mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Chang Yu <marcus.yu.56@gmail.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Shi Hao" <i.shihao.999@gmail.com>,
	"Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
	"Joshua Crofts" <joshua.crofts1@gmail.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: light: add AS7343 multi-spectral sensor driver
Date: Thu, 17 Sep 2026 04:01:02 +0100	[thread overview]
Message-ID: <20260917040102.59be257c@jic23-hlaptop> (raw)
In-Reply-To: <aqiyQOMGGIzu-91z@gmail.com>

On Mon, 14 Sep 2026 19:49:36 -0700
Chang Yu <marcus.yu.56@gmail.com> wrote:

> On Mon, Sep 14, 2026 at 11:00:18AM +0300, Andy Shevchenko wrote:
> > On Fri, Sep 11, 2026 at 06:39:12PM -0700, Chang Yu wrote:
> > 
> > ...
> >   
> > > +static int as7343_setup_device(struct device *dev, struct as7343_data *data)
> > > +{
> > > +	struct regmap *map = data->regmap;
> > > +	unsigned int val;
> > > +	__le16 step;
> > > +	int ret;
> > > +
> > > +	/* Power on */
> > > +	ret = regmap_set_bits(map, AS7343_ENABLE, AS7343_ENABLE_PON);
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	/* Need to set REG_BANK to 1 before we can access ID */
> > > +	ret = regmap_set_bits(map, AS7343_CFG0, AS7343_CFG0_REG_BANK);
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	ret = regmap_read(map, AS7343_ID, &val);
> > > +	if (ret)
> > > +		return ret;  
> >   
> > > +	if (val != 0x81)
> > > +		dev_info(dev, "Unknown device ID: %x\n", val);  
> > 
> > Wouldn't be better to define 0x81 with meaningful name?
> >   
> 
> If I remeber correctly Jonathan prefers just putting 0x81 inline. I'm
> OK with either style so I'll defer to the judgement to Jonathan here.

I briefly wondered why I said that and went to look.
I've been reading too many multipart drivers that do

#define THING1_ID 42
#define THING2_ID 43

struct something_chip_info thing1_chip_info = {
	.id = THING1_ID,
};

struct something_chip_info thing2_chip_info = {
	.id = THING2_ID,
};

And in those cases it doesn't make any sense to have defines.
So I was thinking don't do it here either so we'd be in a nicer
position when another device (maybe) shows up.

Jonathan

  parent reply	other threads:[~2026-09-17  3:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12  1:39 [PATCH v4 0/2] Add support for AS7343 multi-spectral sensor Chang Yu
2026-09-12  1:39 ` [PATCH v4 1/2] dt-bindings: iio: light: add as7343 Chang Yu
2026-09-13  0:56   ` Jonathan Cameron
2026-09-13  1:35     ` Chang Yu
2026-09-13  2:51       ` Jonathan Cameron
2026-09-13  3:20         ` Chang Yu
2026-09-13 17:14           ` Jonathan Cameron
2026-09-15  3:19             ` Chang Yu
2026-09-12  1:39 ` [PATCH v4 2/2] iio: light: add AS7343 multi-spectral sensor driver Chang Yu
2026-09-13  2:47   ` Jonathan Cameron
2026-09-13  4:11     ` Chang Yu
2026-09-13 17:17       ` Jonathan Cameron
2026-09-14  8:00   ` Andy Shevchenko
2026-09-15  2:49     ` Chang Yu
2026-09-15  7:34       ` Andy Shevchenko
2026-09-16  4:04         ` Chang Yu
2026-09-17  3:01       ` Jonathan Cameron [this message]
2026-09-13  0:30 ` [PATCH v4 0/2] Add support for AS7343 multi-spectral sensor Jonathan Cameron
2026-09-13  0:44   ` Chang Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260917040102.59be257c@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=azpijr@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=i.shihao.999@gmail.com \
    --cc=joshua.crofts1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcus.yu.56@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®