[PATCH v2 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-04-23 Thread Aren Moynihan
If the chip isn't powered, this call is likely to return an error. Without a log here the driver will silently fail to probe. Common errors are ENXIO (when the chip isn't powered) and ETIMEDOUT (when the i2c bus isn't powered). Signed-off-by: Aren Moynihan --- Notes: Changes in v2

[PATCH v2 6/6] arm64: dts: allwinner: pinephone: Add power supplies to stk3311

2024-04-23 Thread Aren Moynihan
From: Ondrej Jirman This makes the driver disable the supply during sleep. Signed-off-by: Ondrej Jirman Signed-off-by: Aren Moynihan --- Notes: Changes in v2: - add leda-supply arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH v2 3/6] iio: light: stk3310: Manage LED power supply

2024-04-23 Thread Aren Moynihan
The stk3310 and stk3310 chips have an input for power to the infrared LED. Add support for managing it's state. Signed-off-by: Aren Moynihan --- drivers/iio/light/stk3310.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/stk3310.c b

[PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-23 Thread Aren Moynihan
From: Ondrej Jirman VDD power input can be used to completely power off the chip during system suspend. Do so if available. Signed-off-by: Ondrej Jirman Signed-off-by: Aren Moynihan --- Notes: Changes in v2: - always enable / disable regulators and rely on a dummy regulator

[PATCH v2 0/6] iio: light: stk3310: support powering off during suspend

2024-04-23 Thread Aren Moynihan
is more likely to cause issues than including it. - Convert stk3310 to use dev_err_probe for errors. - Always enable / disable regulators and rely on dummy devices if they're not specified. - more listed in individual patches Aren Moynihan (4): dt-bindings: iio: light: stk33xx: add vdd

[PATCH v2 1/6] dt-bindings: iio: light: stk33xx: add vdd and leda regulators

2024-04-23 Thread Aren Moynihan
stk3310 and stk3311 are typically connected to power supplies for the chip (vdd) and the infrared LED (leda). Add properties so we can power these up / down appropriately. Signed-off-by: Aren Moynihan --- Notes: Changes in v2: - add leda-supply - add supplies to examples

[PATCH v2 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-04-23 Thread Aren Moynihan
Using dev_err_probe instead of dev_err and return makes the errors easier to understand by including the error name, and saves a little code. Signed-off-by: Aren Moynihan --- Notes: Added in v2 drivers/iio/light/stk3310.c | 44 + 1 file changed, 20

[PATCH 1/4] dt-bindings: iio: light: stk33xx: add regulator for vdd supply

2024-04-14 Thread Aren Moynihan
Signed-off-by: Aren Moynihan --- 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 f6e22dc9814a..db35e239d4a8

[PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails

2024-04-14 Thread Aren Moynihan
If the chip isn't powered, this call is likely to return an error. Without a log here the driver will silently fail to probe. Common errors are ENXIO (when the chip isn't powered) and ETIMEDOUT (when the i2c bus isn't powered). Signed-off-by: Aren Moynihan --- drivers/iio/light/stk3310.c | 4

[PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-14 Thread Aren Moynihan
From: Ondrej Jirman VDD power input can be used to completely power off the chip during system suspend. Do so if available. Signed-off-by: Ondrej Jirman Signed-off-by: Aren Moynihan --- drivers/iio/light/stk3310.c | 56 +++-- 1 file changed, 53 insertions

[PATCH 4/4] arm64: dts: allwinner: pinephone: Add power supply to stk3311

2024-04-14 Thread Aren Moynihan
From: Ondrej Jirman This makes the driver disable the supply during sleep. Signed-off-by: Ondrej Jirman Signed-off-by: Aren Moynihan --- arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64

[PATCH 0/4] iio: light: stk3310: support powering off during suspend

2024-04-14 Thread Aren Moynihan
need to make sure that it gets reinitialized with the same parameters after resume. Aren Moynihan (2): dt-bindings: iio: light: stk33xx: add regulator for vdd supply iio: light: stk3310: log error if reading the chip id fails Ondrej Jirman (2): iio: light: stk3310: Implement vdd supply