[PATCH v3 3/7] iio: light: stk3310: add vdd regulator support

From: Roman Vivchar via B4 Relay

Date: Sun Nov 22 2026 - 12:17:01 EST


From: Roman Vivchar <rva333@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
---
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 708ac0503be0..828c3404215e 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -19,6 +19,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>

@@ -759,6 +760,10 @@ static int stk3310_probe(struct i2c_client *client)
if (ret)
return ret;

+ ret = devm_regulator_get_enable(dev, "vdd");
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get vdd supply\n");
+
ret = stk3310_regmap_init(data);
if (ret < 0)
return ret;

--
2.56.1