mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org>
Cc: rva333@protonmail.com, "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] iio: light: stk3310: add stk3337 support
Date: Sat, 7 Nov 2026 22:39:43 +0000	[thread overview]
Message-ID: <20261107223943.40c5c38f@jic23-hlaptop> (raw)
In-Reply-To: <20261108-6768-stk3337-v1-4-0340c99b0e33@protonmail.com>

On Sun, 08 Nov 2026 00:15:06 +0200
Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org> wrote:

> From: Roman Vivchar <rva333@protonmail.com>
> 
> Add support for the stk3337 sensor, found in the Xiaomi Redmi Note 9
> phone.
> 
> In addition to the standard stk3310 ambient light and proximity
> channels, the stk3337 provides a clear intensity channel, matching the
> layout already used by the stk36c61.

I think you should probably make it clear that this is a subset of
the stk36c61 channel spec as that also has other colour sensors.

I was briefly confused as to why you didn't just use the chan spec
from that given this description.

Other than that, looks good to me.

Thanks

Jonathan


> 
> Datasheet: https://www.bestmodulescorp.com/en/amfile/file/download/file/1699/product/1048/
> Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> ---
>  drivers/iio/light/stk3310.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
> index 2f4747c06f43..6d629ce726fc 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -60,6 +60,7 @@
>  #define STK3311S34_CHIP_ID_VAL			0x1E
>  #define STK3311X_CHIP_ID_VAL			0x12
>  #define STK3335_CHIP_ID_VAL			0x51
> +#define STK3337_CHIP_ID_VAL			0x5F
>  #define STK36C61_CHIP_ID_VAL			0x95
>  #define STK3310_PSINT_EN			0x01
>  #define STK3310_PS_MAX_VAL			0xFFFF
> @@ -111,6 +112,7 @@ static const u8 stk3310_chip_ids[] = {
>  	STK3311X_CHIP_ID_VAL,
>  	STK3311_CHIP_ID_VAL,
>  	STK3335_CHIP_ID_VAL,
> +	STK3337_CHIP_ID_VAL,
>  	STK36C61_CHIP_ID_VAL,
>  };
>  
> @@ -233,6 +235,12 @@ static const struct iio_chan_spec stk3310_channels[] = {
>  	STK3310_PROXIMITY_CHANNEL,
>  };
>  
> +static const struct iio_chan_spec stk3337_channels[] = {
> +	STK3310_LIGHT_CHANNEL,
> +	STK3310_PROXIMITY_CHANNEL,
> +	STK36C61_INTENSITY_CHANNEL(CLEAR, STK36C61_REG_CLEAR_DATA_MSB),
> +};
> +
>  static const struct iio_chan_spec stk36c61_channels[] = {
>  	STK3310_LIGHT_CHANNEL,
>  	STK3310_PROXIMITY_CHANNEL,
> @@ -260,6 +268,12 @@ static const struct stk3310_chip_info stk3310_chip_info = {
>  	.num_channels = ARRAY_SIZE(stk3310_channels),
>  };
>  
> +static const struct stk3310_chip_info stk3337_chip_info = {
> +	.name = "stk3337",
> +	.channels = stk3337_channels,
> +	.num_channels = ARRAY_SIZE(stk3337_channels),
> +};
> +
>  static const struct stk3310_chip_info stk36c61_chip_info = {
>  	.name = "stk36c61",
>  	.channels = stk36c61_channels,
> @@ -870,6 +884,7 @@ static const struct i2c_device_id stk3310_i2c_id[] = {
>  	{ .name = "stk3310", .driver_data = (kernel_ulong_t)&stk3310_chip_info },
>  	{ .name = "stk3311", .driver_data = (kernel_ulong_t)&stk3310_chip_info },
>  	{ .name = "stk3335", .driver_data = (kernel_ulong_t)&stk3310_chip_info },
> +	{ .name = "stk3337", .driver_data = (kernel_ulong_t)&stk3337_chip_info },
>  	{ .name = "stk36c61", .driver_data = (kernel_ulong_t)&stk36c61_chip_info },
>  	{ }
>  };
> @@ -888,6 +903,7 @@ static const struct of_device_id stk3310_of_match[] = {
>  	{ .compatible = "sensortek,stk3310", .data = &stk3310_chip_info },
>  	{ .compatible = "sensortek,stk3311", .data = &stk3310_chip_info },
>  	{ .compatible = "sensortek,stk3335", .data = &stk3310_chip_info },
> +	{ .compatible = "sensortek,stk3337", .data = &stk3337_chip_info },
>  	{ .compatible = "sensortek,stk36c61", .data = &stk36c61_chip_info },
>  	{ }
>  };
> 


      reply	other threads:[~2026-11-07 22:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 22:15 [PATCH 0/4] iio: light: stk3310: stk3337 support + vdd supply Roman Vivchar via B4 Relay
2026-11-07 22:15 ` [PATCH 1/4] dt-bindings: iio: light: stk33xx: add power supply support Roman Vivchar via B4 Relay
2026-11-07 22:36   ` Jonathan Cameron
2026-11-07 22:45     ` Roman Vivchar
2026-11-07 23:53       ` Jonathan Cameron
2026-11-08  0:06         ` Roman Vivchar
2026-11-07 22:15 ` [PATCH 2/4] dt-bindings: iio: light: stk33xx: add stk3337 Roman Vivchar via B4 Relay
2026-11-07 22:15 ` [PATCH 3/4] iio: light: stk3310: add vdd regulator support Roman Vivchar via B4 Relay
2026-11-07 22:15 ` [PATCH 4/4] iio: light: stk3310: add stk3337 support Roman Vivchar via B4 Relay
2026-11-07 22:39   ` Jonathan Cameron [this message]

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=20261107223943.40c5c38f@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+rva333.protonmail.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=rva333@protonmail.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

all inboxes | Powered by JetHome®