public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Shreeya Patel <shreeya.patel@collabora.com>,
	Zhigang Shi <Zhigang.Shi@liteon.com>,
	Paul Gazzillo <paul@pgazz.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andi Shyti <andi.shyti@kernel.org>
Subject: Re: [PATCH v3 4/5] iio: light: ROHM BU27008 color sensor
Date: Sun, 7 May 2023 15:24:43 +0100	[thread overview]
Message-ID: <20230507152443.754f2fab@jic23-huawei> (raw)
In-Reply-To: <307cc8ce-6178-7a86-2c90-eaf0ac8c122d@fi.rohmeurope.com>

On Wed, 3 May 2023 05:11:53 +0000
"Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com> wrote:

> Hi Andy
> 
> Thanks for the review.
> 
> On 5/2/23 23:40, Andy Shevchenko wrote:
> > On Wed, Apr 26, 2023 at 11:08:17AM +0300, Matti Vaittinen wrote:  
> >> The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear
> >> and IR) with four configurable channels. Red and green being always
> >> available and two out of the rest three (blue, clear, IR) can be
> >> selected to be simultaneously measured. Typical application is adjusting
> >> LCD backlight of TVs, mobile phones and tablet PCs.
> >>
> >> Add initial support for the ROHM BU27008 color sensor.
> >>   - raw_read() of RGB and clear channels
> >>   - triggered buffer w/ DRDY interrtupt  
> > 
> > ...
> >   
> >> +enum {
> >> +	BU27008_RED,	/* Always data0 */
> >> +	BU27008_GREEN,	/* Always data1 */
> >> +	BU27008_BLUE,	/* data2, configurable (blue / clear) */
> >> +	BU27008_CLEAR,	/* data2 or data3 */
> >> +	BU27008_IR,	/* data3 */
> >> +	BU27008_NUM_CHANS  
> > 
> > Why not converting comments to a kernel-doc?
> >   
> >> +};
> >> +
> >> +enum {
> >> +	BU27008_DATA0, /* Always RED */
> >> +	BU27008_DATA1, /* Always GREEN */
> >> +	BU27008_DATA2, /* Blue or Clear */
> >> +	BU27008_DATA3, /* IR or Clear */
> >> +	BU27008_NUM_HW_CHANS
> >> +};  
> > 
> > Ditto.  
> 
> I see no value having entities which are not intended to be used outside 
> this file documented in any "global" documentation. One who is ever 
> going to use these or wonder what these are - will most likely be 
> watching this file. My personal view is that the generated docs should 
> be kept lean. In my opinion the problem of the day is the time we spend 
> looking for a needle hidden in a haystack. In my opinion adding this to 
> kernel-doc just adds hay :)

> 
> I still can do this if no-one else objects. I almost never look at the 
> generated docs myself. Usually I just look the docs from code files - 
> and kernel-doc format is not any worse for me to read. Still, I can 
> imagine including this type of stuff to generic doc just bloats them and 
> my not serve well those who use them.


Unless someone specifically adds this doc to the main docs build, the
kernel-doc won't end up in the docs anyway. It just provides a nice
bit of consistent formatting. Even if they do add this for some reason,
there are controls on internal vs external (exported stuff) being added
to the docs.

> 
> > 
> > ...
> >   
> >> +	if (int_time < 0)
> >> +		int_time = 400000;  
> > 
> > Adding 3 0:s to drop them below with a heavy division operation? Well done!
> > Or did I miss anything?  
> 
> No. You did not miss anything. This can be improved.
> 
> >   
> >> +	msleep(int_time / 1000);  
> > 
> > USEC_PER_MSEC ?  
> 
> Ok.
> 
> > ...
> >   
> >> +	ret = devm_iio_device_register(dev, idev);
> >> +	if (ret)
> >> +		return dev_err_probe(dev, ret,
> >> +				     "Unable to register iio device\n");
> >> +
> >> +	return ret;  
> > 
> > return 0 will suffice.  
> 
> Ok.
> 
> Thanks,
> 	-- Matti
> 


  reply	other threads:[~2023-05-07 14:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26  8:06 [PATCH v3 0/5] Support ROHM BU27008 RGB sensor Matti Vaittinen
2023-04-26  8:07 ` [PATCH v3 1/5] dt-bindings: iio: light: ROHM BU27008 Matti Vaittinen
2023-04-26  8:07 ` [PATCH v3 2/5] iio: trigger: Add simple trigger_validation helper Matti Vaittinen
2023-04-26  8:08 ` [PATCH v3 3/5] iio: kx022a: Use new iio_validate_own_trigger() Matti Vaittinen
2023-04-26  8:08 ` [PATCH v3 4/5] iio: light: ROHM BU27008 color sensor Matti Vaittinen
2023-05-01 14:20   ` Jonathan Cameron
2023-05-02  8:07     ` Vaittinen, Matti
2023-05-07 14:22       ` Jonathan Cameron
2023-05-07 16:13         ` Matti Vaittinen
2023-05-13 17:26           ` Jonathan Cameron
2023-05-02 20:40   ` Andy Shevchenko
2023-05-03  5:11     ` Vaittinen, Matti
2023-05-07 14:24       ` Jonathan Cameron [this message]
2023-05-07 15:49         ` Matti Vaittinen
2023-05-08 12:41         ` Andy Shevchenko
2023-05-08 12:48           ` Matti Vaittinen
2023-04-26  8:08 ` [PATCH v3 5/5] MAINTAINERS: Add ROHM BU27008 Matti Vaittinen

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=20230507152443.754f2fab@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Matti.Vaittinen@fi.rohmeurope.com \
    --cc=Zhigang.Shi@liteon.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=paul@pgazz.com \
    --cc=robh+dt@kernel.org \
    --cc=shreeya.patel@collabora.com \
    /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