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 and
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
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
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/ligh
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
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
t out 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: stk33x
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
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:
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
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 if
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/stk331
-off-by: Aren Moynihan
---
Notes:
Changes in v4:
- fix variable declaration order in stk3310_resume to match the rest of
the driver
Changes in v3:
- use bulk regulators instead of two individual ones
- handle cleanup using devm callbacks instead of the remove
probe, and this condition
should return an error, which fits what dev_err_probe is designed for.
Signed-off-by: Aren Moynihan
---
Notes:
Changes in v4:
- get a struct device ahead of time so it can be passed as "dev"
instead of "&client->dev"
Changes
o 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 (5):
dt-bindings: iio: light: stk33xx: add vdd and leda regulators
iio: light: stk3310: handle all remove logic with devm
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:
Changes in v4:
- Get a struct device ahead of time so it can be passed as "dev"
Using devm callbacks helps to make the ordering of probe / remove
operations easier to reason about and removes some duplicate code
between the probe error path and driver remove.
---
Notes:
Changes in v4:
- also replace mutex_init with devm_mutex_init
Added in v3
drivers/iio/l
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
Reviewed-by: Krzysztof Kozlowski
---
Notes:
Changes in v2:
- add leda-supply
From: Ondrej Jirman
This allows the driver to properly handle powering this device, and
disable power during suspend.
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
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 | 47 -
1 file changed, 20
On Mon, Oct 28, 2024 at 04:38:37PM +0200, Andy Shevchenko wrote:
> On Mon, Oct 28, 2024 at 10:19:57AM -0400, Aren Moynihan wrote:
> > The vdd and leda supplies must be powered on for the chip to function
> > and can be powered off during system suspend.
> >
> > Co-
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
Reviewed-by: Krzysztof Kozlowski
---
Notes:
Changes in v2:
- add leda-supply
The vdd and leda supplies must be powered on for the chip to function
and can be powered off during system suspend.
Co-developed-by: Ondrej Jirman
Signed-off-by: Aren Moynihan
---
Notes:
I'm not sure what the proper way to handle attribution for this patch
is. It was origionally
From: Ondrej Jirman
This allows the driver to properly handle powering this device, and
disable power during suspend.
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
ssues 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 (5):
dt-bindings: iio: light: stk33xx: add vdd and leda regulators
ii
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:
Using devm callbacks helps to make the ordering of probe / remove
operations easier to reason about and removes some duplicate code
between the probe error path and driver remove.
---
Notes:
Added in v3
drivers/iio/light/stk3310.c | 35 +++
1 file changed, 19
-off-by: Aren Moynihan
---
Notes:
Changes in v5:
- explicitely include array_size.h
Changes in v4:
- fix variable declaration order in stk3310_resume to match the rest of
the driver
Changes in v3:
- use bulk regulators instead of two individual ones
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:
Changes in v4:
- Get a struct device ahead of time so it can be passed as "dev"
This reduces syntactic noise where the dev variable is used, which
should help improve readability.
Signed-off-by: Aren Moynihan
---
Notes:
Added in v5
drivers/iio/light/stk3310.c | 40 ++---
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a
This macro has a conditional return statement, which obfuscates control
flow. Inlining makes the control flow more clear.
This also switches to using dev_err_probe for error reporting, which is
a shorter way of expressing the same logic as before.
Signed-off-by: Aren Moynihan
---
Notes
From: Ondrej Jirman
This allows the driver to properly handle powering this device, and
disable power during suspend.
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
rors.
- Always enable / disable regulators and rely on dummy devices if
they're not specified.
- more listed in individual patches
Aren Moynihan (7):
dt-bindings: iio: light: stk33xx: add vdd and leda regulators
iio: light: stk3310: handle all remove logic with devm callbacks
iio: li
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
Reviewed-by: Krzysztof Kozlowski
---
Notes:
Changes in v2:
- add leda-supply
Using devm callbacks helps to make the ordering of probe / remove
operations easier to reason about and removes some duplicate code
between the probe error path and driver remove.
Signed-off-by: Aren Moynihan
---
Notes:
Changes in v4:
- also replace mutex_init with devm_mutex_init
probe, and this condition
should return an error, which fits what dev_err_probe is designed for.
Signed-off-by: Aren Moynihan
---
Notes:
Changes in v4:
- get a struct device ahead of time so it can be passed as "dev"
instead of "&client->dev"
Changes
36 matches
Mail list logo