summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>2024-09-29 22:38:49 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-10-05 12:09:15 +0100
commit4ad62021c2e3cabfb2bee8d1e36ce79dca9baf72 (patch)
tree6f34261cf877585d2d5295aa81f0d16c0a9940cd
parentd92fcd7e923200953813a5fc4f11298ee5fe6543 (diff)
iio: light: veml6070: add support for a regulator
Add support for a device-managed regulator with the reference name provided in the datasheet (vdd). Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-4-a9350341a646@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/light/veml6070.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
index d15caebdc959..faba04e1da98 100644
--- a/drivers/iio/light/veml6070.c
+++ b/drivers/iio/light/veml6070.c
@@ -163,6 +163,10 @@ static int veml6070_probe(struct i2c_client *client)
indio_dev->name = VEML6070_DRV_NAME;
indio_dev->modes = INDIO_DIRECT_MODE;
+ ret = devm_regulator_get_enable(&client->dev, "vdd");
+ if (ret < 0)
+ return ret;
+
data->client2 = i2c_new_dummy_device(client->adapter, VEML6070_ADDR_DATA_LSB);
if (IS_ERR(data->client2)) {
dev_err(&client->dev, "i2c device for second chip address failed\n");