* [PATCH v2 0/4] iio: light: stk3310: stk3337 support + vdd supply
@ 2026-11-17 18:08 Roman Vivchar via B4 Relay
2026-11-17 18:08 ` [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support Roman Vivchar via B4 Relay
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Roman Vivchar via B4 Relay @ 2026-11-17 18:08 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-iio, devicetree, linux-kernel, Roman Vivchar
This patch series adds support for stk3337 light sensor, found in the
Xiaomi Redmi Note 9 phone. The sensor is compatible with stk3310
registers, while having Clear channel, similar to the stk36c61.
The series also adds vdd-supply property, since on this board the sensor
is wired to the shared power supply.
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
Changes in v2:
- Clarify that stk3337 is a subset of the stk36c61 in patch 4 commit message (Jonathan)
- Link to v1: https://patch.msgid.link/20261108-6768-stk3337-v1-0-0340c99b0e33@protonmail.com
---
Roman Vivchar (4):
dt-bindings: iio: light: stk33xx: add power supply support
dt-bindings: iio: light: stk33xx: add stk3337
iio: light: stk3310: add vdd regulator support
iio: light: stk3310: add stk3337 support
.../devicetree/bindings/iio/light/stk33xx.yaml | 3 +++
drivers/iio/light/stk3310.c | 21 +++++++++++++++++++++
2 files changed, 24 insertions(+)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
change-id: 20261107-6768-stk3337-34f7a2db3a24
Best regards,
--
rva3 <rva333@protonmail.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support
2026-11-17 18:08 [PATCH v2 0/4] iio: light: stk3310: stk3337 support + vdd supply Roman Vivchar via B4 Relay
@ 2026-11-17 18:08 ` Roman Vivchar via B4 Relay
2026-11-18 18:12 ` Conor Dooley
2026-11-17 18:08 ` [PATCH v2 2/4] dt-bindings: iio: light: stk33xx: add stk3337 Roman Vivchar via B4 Relay
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Roman Vivchar via B4 Relay @ 2026-11-17 18:08 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-iio, devicetree, linux-kernel, Roman Vivchar
From: Roman Vivchar <rva333@protonmail.com>
On some boards, the chip shares a power rail with other components. If
that rail is turned off, the chip can't function.
Add vdd-supply property to document the chip power supply.
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
index f655a570aac7..114cf87eb54d 100644
--- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
+++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
@@ -37,6 +37,8 @@ properties:
proximity-near-level: true
+ vdd-supply: true
+
required:
- compatible
- reg
--
2.56.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 2/4] dt-bindings: iio: light: stk33xx: add stk3337
2026-11-17 18:08 [PATCH v2 0/4] iio: light: stk3310: stk3337 support + vdd supply Roman Vivchar via B4 Relay
2026-11-17 18:08 ` [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support Roman Vivchar via B4 Relay
@ 2026-11-17 18:08 ` Roman Vivchar via B4 Relay
2026-11-18 18:11 ` Conor Dooley
2026-11-17 18:08 ` [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support Roman Vivchar via B4 Relay
2026-11-17 18:08 ` [PATCH v2 4/4] iio: light: stk3310: add stk3337 support Roman Vivchar via B4 Relay
3 siblings, 1 reply; 15+ messages in thread
From: Roman Vivchar via B4 Relay @ 2026-11-17 18:08 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-iio, devicetree, linux-kernel, Roman Vivchar
From: Roman Vivchar <rva333@protonmail.com>
Add compatible string for the stk3337 ALSPS sensor. Its core registers
are backwards compatible with the stk3310, while also providing a clear
light channel like the stk36c61, so document it with sensortek,stk3310
as a fallback.
Datasheet: https://www.bestmodulescorp.com/en/amfile/file/download/file/1699/product/1048/
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
index 114cf87eb54d..d5d7059fbc0f 100644
--- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
+++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
@@ -26,6 +26,7 @@ properties:
- items:
- enum:
- sensortek,stk3013
+ - sensortek,stk3337
- sensortek,stk36c61
- const: sensortek,stk3310
--
2.56.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support
2026-11-17 18:08 [PATCH v2 0/4] iio: light: stk3310: stk3337 support + vdd supply Roman Vivchar via B4 Relay
2026-11-17 18:08 ` [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support Roman Vivchar via B4 Relay
2026-11-17 18:08 ` [PATCH v2 2/4] dt-bindings: iio: light: stk33xx: add stk3337 Roman Vivchar via B4 Relay
@ 2026-11-17 18:08 ` Roman Vivchar via B4 Relay
2026-11-18 10:01 ` Joshua Crofts
2026-11-17 18:08 ` [PATCH v2 4/4] iio: light: stk3310: add stk3337 support Roman Vivchar via B4 Relay
3 siblings, 1 reply; 15+ messages in thread
From: Roman Vivchar via B4 Relay @ 2026-11-17 18:08 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-iio, devicetree, linux-kernel, Roman Vivchar
From: Roman Vivchar <rva333@protonmail.com>
On some boards, the sensor is powered by shared power rail. If the rail
is powered down, the chip can't function.
Add vdd regulator support to ensure the power supply is enabled for the
chip.
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
drivers/iio/light/stk3310.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index e751e7c97bc1..2f4747c06f43 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -18,6 +18,7 @@
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#include <linux/sysfs.h>
#include <linux/types.h>
@@ -745,6 +746,10 @@ static int stk3310_probe(struct i2c_client *client)
device_property_read_u32(&client->dev, "proximity-near-level",
&data->ps_near_level);
+ ret = devm_regulator_get_enable(dev, "vdd");
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get vdd supply\n");
+
mutex_init(&data->lock);
ret = stk3310_regmap_init(data);
--
2.56.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 4/4] iio: light: stk3310: add stk3337 support
2026-11-17 18:08 [PATCH v2 0/4] iio: light: stk3310: stk3337 support + vdd supply Roman Vivchar via B4 Relay
` (2 preceding siblings ...)
2026-11-17 18:08 ` [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support Roman Vivchar via B4 Relay
@ 2026-11-17 18:08 ` Roman Vivchar via B4 Relay
2026-11-18 10:03 ` Joshua Crofts
3 siblings, 1 reply; 15+ messages in thread
From: Roman Vivchar via B4 Relay @ 2026-11-17 18:08 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-iio, devicetree, linux-kernel, Roman Vivchar
From: Roman Vivchar <rva333@protonmail.com>
Add support for the stk3337 sensor, found in the Xiaomi Redmi Note 9
phone.
The stk3337 is a subset of the stk36c61. It provides the stk3310 ambient
light and proximity channels along with the clear intensity channel from
the stk36c61, but lacks the red, green, and blue intensity channels.
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 },
{ }
};
--
2.56.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support
2026-11-17 18:08 ` [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support Roman Vivchar via B4 Relay
@ 2026-11-18 10:01 ` Joshua Crofts
2026-11-19 3:32 ` Jonathan Cameron
0 siblings, 1 reply; 15+ messages in thread
From: Joshua Crofts @ 2026-11-18 10:01 UTC (permalink / raw)
To: Roman Vivchar via B4 Relay
Cc: rva333, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
On Tue, 17 Nov 2026 20:08:37 +0200
Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org> wrote:
> @@ -745,6 +746,10 @@ static int stk3310_probe(struct i2c_client *client)
> device_property_read_u32(&client->dev, "proximity-near-level",
> &data->ps_near_level);
>
> + ret = devm_regulator_get_enable(dev, "vdd");
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to get vdd supply\n");
> +
IMO this should work, but I don't like the mixing of devm_* and non-devm_*
functions, this may cause issues down the road. Consider moving the driver
to all devm_* functions?
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 4/4] iio: light: stk3310: add stk3337 support
2026-11-17 18:08 ` [PATCH v2 4/4] iio: light: stk3310: add stk3337 support Roman Vivchar via B4 Relay
@ 2026-11-18 10:03 ` Joshua Crofts
0 siblings, 0 replies; 15+ messages in thread
From: Joshua Crofts @ 2026-11-18 10:03 UTC (permalink / raw)
To: Roman Vivchar via B4 Relay
Cc: rva333, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
On Tue, 17 Nov 2026 20:08:38 +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.
>
> The stk3337 is a subset of the stk36c61. It provides the stk3310 ambient
> light and proximity channels along with the clear intensity channel from
> the stk36c61, but lacks the red, green, and blue intensity channels.
>
> Datasheet: https://www.bestmodulescorp.com/en/amfile/file/download/file/1699/product/1048/
> Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> ---
Reviewed-by: Joshua Crofts <crofts@kernel.org>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: iio: light: stk33xx: add stk3337
2026-11-17 18:08 ` [PATCH v2 2/4] dt-bindings: iio: light: stk33xx: add stk3337 Roman Vivchar via B4 Relay
@ 2026-11-18 18:11 ` Conor Dooley
0 siblings, 0 replies; 15+ messages in thread
From: Conor Dooley @ 2026-11-18 18:11 UTC (permalink / raw)
To: rva333
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support
2026-11-17 18:08 ` [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support Roman Vivchar via B4 Relay
@ 2026-11-18 18:12 ` Conor Dooley
2026-11-19 3:29 ` Jonathan Cameron
0 siblings, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2026-11-18 18:12 UTC (permalink / raw)
To: rva333
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]
On Tue, Nov 17, 2026 at 08:08:35PM +0200, Roman Vivchar via B4 Relay wrote:
> From: Roman Vivchar <rva333@protonmail.com>
>
> On some boards, the chip shares a power rail with other components. If
> that rail is turned off, the chip can't function.
With these issues in mind, probably it should be made required, even
though new required properties are an ABI break.
>
> Add vdd-supply property to document the chip power supply.
>
> Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> ---
> Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> index f655a570aac7..114cf87eb54d 100644
> --- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> +++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> @@ -37,6 +37,8 @@ properties:
>
> proximity-near-level: true
>
> + vdd-supply: true
> +
> required:
> - compatible
> - reg
>
> --
> 2.56.1
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support
2026-11-18 18:12 ` Conor Dooley
@ 2026-11-19 3:29 ` Jonathan Cameron
2026-11-19 16:37 ` Conor Dooley
0 siblings, 1 reply; 15+ messages in thread
From: Jonathan Cameron @ 2026-11-19 3:29 UTC (permalink / raw)
To: Conor Dooley
Cc: rva333, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
On Wed, 18 Nov 2026 18:12:30 +0000
Conor Dooley <conor@kernel.org> wrote:
> On Tue, Nov 17, 2026 at 08:08:35PM +0200, Roman Vivchar via B4 Relay wrote:
> > From: Roman Vivchar <rva333@protonmail.com>
> >
> > On some boards, the chip shares a power rail with other components. If
> > that rail is turned off, the chip can't function.
>
> With these issues in mind, probably it should be made required, even
> though new required properties are an ABI break.
I raised the same on v1. Seems it is used by various boards
in tree where we don't know which supply it is. So whilst nice
to fix we might just be creating some painful build warnings.
Can go ahead and 'guess' I suppose or put a fixed supply on it
in the upstream dts.
Jonathan
>
> >
> > Add vdd-supply property to document the chip power supply.
> >
> > Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> > ---
> > Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > index f655a570aac7..114cf87eb54d 100644
> > --- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > +++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > @@ -37,6 +37,8 @@ properties:
> >
> > proximity-near-level: true
> >
> > + vdd-supply: true
> > +
> > required:
> > - compatible
> > - reg
> >
> > --
> > 2.56.1
> >
> >
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support
2026-11-18 10:01 ` Joshua Crofts
@ 2026-11-19 3:32 ` Jonathan Cameron
2026-11-19 16:33 ` Roman Vivchar
0 siblings, 1 reply; 15+ messages in thread
From: Jonathan Cameron @ 2026-11-19 3:32 UTC (permalink / raw)
To: Joshua Crofts
Cc: Roman Vivchar via B4 Relay, rva333, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
On Wed, 18 Nov 2026 11:01:38 +0100
Joshua Crofts <crofts@kernel.org> wrote:
> On Tue, 17 Nov 2026 20:08:37 +0200
> Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org> wrote:
>
> > @@ -745,6 +746,10 @@ static int stk3310_probe(struct i2c_client *client)
> > device_property_read_u32(&client->dev, "proximity-near-level",
> > &data->ps_near_level);
> >
> > + ret = devm_regulator_get_enable(dev, "vdd");
> > + if (ret)
> > + return dev_err_probe(dev, ret, "failed to get vdd supply\n");
> > +
>
> IMO this should work, but I don't like the mixing of devm_* and non-devm_*
> functions, this may cause issues down the road. Consider moving the driver
> to all devm_* functions?
In this particular case I agree with you because the conversion is very
simple. Generally the rule of thumb is that devm from start of probe
until you decide to stop, then no more devm. In that case the unwind
order should be correct. This change doesn't break that, but the
driver already breaks this wrt to the interrupt, so if Roman
doesn't mind would be great to fix it whilst touching the driver.
Jonathan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support
2026-11-19 3:32 ` Jonathan Cameron
@ 2026-11-19 16:33 ` Roman Vivchar
0 siblings, 0 replies; 15+ messages in thread
From: Roman Vivchar @ 2026-11-19 16:33 UTC (permalink / raw)
To: Jonathan Cameron, Joshua Crofts
Cc: Roman Vivchar via B4 Relay, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
Hi Jonathan, Joshua,
On Thursday, November 19th, 2026 at 5:32 AM, Jonathan Cameron <jic23@kernel.org> wrote:
> On Wed, 18 Nov 2026 11:01:38 +0100
> Joshua Crofts <crofts@kernel.org> wrote:
>
> > On Tue, 17 Nov 2026 20:08:37 +0200
> > Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org> wrote:
> >
> > > @@ -745,6 +746,10 @@ static int stk3310_probe(struct i2c_client *client)
> > > device_property_read_u32(&client->dev, "proximity-near-level",
> > > &data->ps_near_level);
> > >
> > > + ret = devm_regulator_get_enable(dev, "vdd");
> > > + if (ret)
> > > + return dev_err_probe(dev, ret, "failed to get vdd supply\n");
> > > +
> >
> > IMO this should work, but I don't like the mixing of devm_* and non-devm_*
> > functions, this may cause issues down the road. Consider moving the driver
> > to all devm_* functions?
>
> In this particular case I agree with you because the conversion is very
> simple. Generally the rule of thumb is that devm from start of probe
> until you decide to stop, then no more devm. In that case the unwind
> order should be correct. This change doesn't break that, but the
> driver already breaks this wrt to the interrupt, so if Roman
> doesn't mind would be great to fix it whilst touching the driver.
>
Sure, I will include one more patch for devm_* API migration before
adding regulator and new chip support.
I recently found another STK3337 variant on yet another development device,
called STK3331. It seems to be exactly the same, except for the chip ID.
Should I include it in the next revision, or send it as a separate series
later?
Best regards,
Roman
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support
2026-11-19 3:29 ` Jonathan Cameron
@ 2026-11-19 16:37 ` Conor Dooley
2026-11-19 17:20 ` Roman Vivchar
0 siblings, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2026-11-19 16:37 UTC (permalink / raw)
To: Jonathan Cameron
Cc: rva333, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]
On Thu, Nov 19, 2026 at 03:29:03AM +0000, Jonathan Cameron wrote:
> On Wed, 18 Nov 2026 18:12:30 +0000
> Conor Dooley <conor@kernel.org> wrote:
>
> > On Tue, Nov 17, 2026 at 08:08:35PM +0200, Roman Vivchar via B4 Relay wrote:
> > > From: Roman Vivchar <rva333@protonmail.com>
> > >
> > > On some boards, the chip shares a power rail with other components. If
> > > that rail is turned off, the chip can't function.
> >
> > With these issues in mind, probably it should be made required, even
> > though new required properties are an ABI break.
>
> I raised the same on v1. Seems it is used by various boards
> in tree where we don't know which supply it is. So whilst nice
> to fix we might just be creating some painful build warnings.
Yeah I don't really want to cause more warnings, but if it is actually
the source of issues, warning may get them resolved.
Up to Roman really I guess.
> Can go ahead and 'guess' I suppose or put a fixed supply on it
> in the upstream dts.
>
> Jonathan
>
> >
> > >
> > > Add vdd-supply property to document the chip power supply.
> > >
> > > Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> > > ---
> > > Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > > index f655a570aac7..114cf87eb54d 100644
> > > --- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > > @@ -37,6 +37,8 @@ properties:
> > >
> > > proximity-near-level: true
> > >
> > > + vdd-supply: true
> > > +
> > > required:
> > > - compatible
> > > - reg
> > >
> > > --
> > > 2.56.1
> > >
> > >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support
2026-11-19 16:37 ` Conor Dooley
@ 2026-11-19 17:20 ` Roman Vivchar
2026-11-19 17:44 ` Conor Dooley
0 siblings, 1 reply; 15+ messages in thread
From: Roman Vivchar @ 2026-11-19 17:20 UTC (permalink / raw)
To: Conor Dooley
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
Hi Conor,
On Thursday, November 19th, 2026 at 6:37 PM, Conor Dooley <conor@kernel.org> wrote:
> On Thu, Nov 19, 2026 at 03:29:03AM +0000, Jonathan Cameron wrote:
> > On Wed, 18 Nov 2026 18:12:30 +0000
> > Conor Dooley <conor@kernel.org> wrote:
> >
> > > On Tue, Nov 17, 2026 at 08:08:35PM +0200, Roman Vivchar via B4 Relay wrote:
> > > > From: Roman Vivchar <rva333@protonmail.com>
> > > >
> > > > On some boards, the chip shares a power rail with other components. If
> > > > that rail is turned off, the chip can't function.
> > >
> > > With these issues in mind, probably it should be made required, even
> > > though new required properties are an ABI break.
> >
> > I raised the same on v1. Seems it is used by various boards
> > in tree where we don't know which supply it is. So whilst nice
> > to fix we might just be creating some painful build warnings.
>
> Yeah I don't really want to cause more warnings, but if it is actually
> the source of issues, warning may get them resolved.
>
> Up to Roman really I guess.
Sadly I don't have schematic for these boards in upstream, so I guess
the safest approach is leaving it as optional, since most devices have
power rail shared with almost always-on components (like eMMC or other
sensors).
Best regards,
Roman
>
> > Can go ahead and 'guess' I suppose or put a fixed supply on it
> > in the upstream dts.
> >
> > Jonathan
> >
> > >
> > > >
> > > > Add vdd-supply property to document the chip power supply.
> > > >
> > > > Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> > > > ---
> > > > Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 2 ++
> > > > 1 file changed, 2 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > > > index f655a570aac7..114cf87eb54d 100644
> > > > --- a/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > > > +++ b/Documentation/devicetree/bindings/iio/light/stk33xx.yaml
> > > > @@ -37,6 +37,8 @@ properties:
> > > >
> > > > proximity-near-level: true
> > > >
> > > > + vdd-supply: true
> > > > +
> > > > required:
> > > > - compatible
> > > > - reg
> > > >
> > > > --
> > > > 2.56.1
> > > >
> > > >
> >
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support
2026-11-19 17:20 ` Roman Vivchar
@ 2026-11-19 17:44 ` Conor Dooley
0 siblings, 0 replies; 15+ messages in thread
From: Conor Dooley @ 2026-11-19 17:44 UTC (permalink / raw)
To: Roman Vivchar
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-11-19 17:44 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 18:08 [PATCH v2 0/4] iio: light: stk3310: stk3337 support + vdd supply Roman Vivchar via B4 Relay
2026-11-17 18:08 ` [PATCH v2 1/4] dt-bindings: iio: light: stk33xx: add power supply support Roman Vivchar via B4 Relay
2026-11-18 18:12 ` Conor Dooley
2026-11-19 3:29 ` Jonathan Cameron
2026-11-19 16:37 ` Conor Dooley
2026-11-19 17:20 ` Roman Vivchar
2026-11-19 17:44 ` Conor Dooley
2026-11-17 18:08 ` [PATCH v2 2/4] dt-bindings: iio: light: stk33xx: add stk3337 Roman Vivchar via B4 Relay
2026-11-18 18:11 ` Conor Dooley
2026-11-17 18:08 ` [PATCH v2 3/4] iio: light: stk3310: add vdd regulator support Roman Vivchar via B4 Relay
2026-11-18 10:01 ` Joshua Crofts
2026-11-19 3:32 ` Jonathan Cameron
2026-11-19 16:33 ` Roman Vivchar
2026-11-17 18:08 ` [PATCH v2 4/4] iio: light: stk3310: add stk3337 support Roman Vivchar via B4 Relay
2026-11-18 10:03 ` Joshua Crofts
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®