All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	linux-iio@vger.kernel.org,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, "Kees Cook" <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Luca Weiss" <luca.weiss@fairphone.com>
Subject: Re: [PATCH v2 5/5] iio: light: stk3310: support the Sensortek STK36C61
Date: Sun, 30 Aug 2026 12:03:29 -0300	[thread overview]
Message-ID: <apRGQVfPKWHvE2Ct@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20260828154705.11962-1-jorijnvdgraaf@catcrafts.net>

On 08/28, Jorijn van der Graaf wrote:
> On Fri, Aug 28, 2026 at 01:18:18AM -0300, Marcelo Schmitt wrote:
> > > @@ -417,10 +459,10 @@ static int stk3310_read_raw(struct iio_dev *indio_dev,
> > >  		mutex_unlock(&data->lock);
> > >  		return IIO_VAL_INT;
> > >  	case IIO_CHAN_INFO_INT_TIME:
> > > -		if (chan->type == IIO_LIGHT)
> > > -			ret = regmap_field_read(data->reg_als_it, &index);
> > > -		else
> > > +		if (chan->type == IIO_PROXIMITY)
> > >  			ret = regmap_field_read(data->reg_ps_it, &index);
> > > +		else
> > > +			ret = regmap_field_read(data->reg_als_it, &index);
> > The above seems unnecessary. Why changing the comparison from IIO_LIGHT to IIO_PROXIMITY?
> > After the proposed update we would have the integration time for both light and
> > intensity channels being read from the same register field?
> 
> These arms now see three channel types instead of two, so the two-way
> branch has to put the intensity channels on one side or the other:
> keyed on IIO_LIGHT they would fall into the else and read or write the
> proximity fields. Proximity is the odd one out - its engine has its
> own integration-time and gain fields - so the comparison keys on it
> (the write_raw arms route identically, hence the same change there).
> 
> And yes, light and intensity read the same field: the chip measures
> the colour channels in the same engine run as the ALS data, over the
> ALS integration time. Stepping that field through the driver doubles
> the ALS count and all four colour counts together (measured on the
> device: ALS 30/59/120 across three settings, C 83/167/334, R/G/B
> likewise).

Ah, so both STK3310 and STK36C61 have register 0x02 for integration time and
gain configurations that applies for all light/color channels. I think changing
to compare with IIO_PROXIMITY makes sense then.

Having a closer look at the data sheet I found for STK36C61, I noticed registers
0x13 and 0x14 are not listed. Does the newer part has ambient light sensing
besides the clear channel?


With best regards,
Marcelo

  reply	other threads:[~2026-08-30 15:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 17:54 [PATCH v2 0/5] iio: light: stk3310: per-chip match data and STK36C61 support Jorijn van der Graaf
2026-08-26 17:54 ` [PATCH v2 1/5] iio: light: stk3310: lower-case the i2c device ID names Jorijn van der Graaf
2026-08-26 18:03   ` sashiko-bot
2026-08-27  6:45   ` Andy Shevchenko
2026-08-26 17:54 ` [PATCH v2 2/5] dt-bindings: iio: light: stk33xx: document the Sensortek STK36C61 Jorijn van der Graaf
2026-08-26 17:54 ` [PATCH v2 3/5] iio: light: stk3310: move the data registers into the channel address Jorijn van der Graaf
2026-08-26 18:07   ` sashiko-bot
2026-08-27  6:47   ` Andy Shevchenko
2026-08-26 17:54 ` [PATCH v2 4/5] iio: light: stk3310: add per-chip match data Jorijn van der Graaf
2026-08-26 18:03   ` sashiko-bot
2026-08-27  7:47   ` Andy Shevchenko
2026-08-26 17:54 ` [PATCH v2 5/5] iio: light: stk3310: support the Sensortek STK36C61 Jorijn van der Graaf
2026-08-27  7:53   ` Andy Shevchenko
2026-08-28  4:18   ` Marcelo Schmitt
2026-08-28 15:47     ` Jorijn van der Graaf
2026-08-30 15:03       ` Marcelo Schmitt [this message]
2026-08-30 20:19         ` Jorijn van der Graaf
2026-08-31  7:53           ` Luca Weiss
2026-09-01  0:54             ` Marcelo Schmitt
2026-09-01  1:28               ` Marcelo Schmitt
2026-09-01  2:55                 ` Jorijn van der Graaf
2026-09-01  6:57                   ` Luca Weiss
2026-08-30 23:48 ` [PATCH v2 0/5] iio: light: stk3310: per-chip match data and STK36C61 support Jonathan Cameron

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=apRGQVfPKWHvE2Ct@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gustavoars@kernel.org \
    --cc=jic23@kernel.org \
    --cc=jorijnvdgraaf@catcrafts.net \
    --cc=kees@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.weiss@fairphone.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.