Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: chemical: bme680: add regulators

Add support for the regulators described in the dt-binding.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20241202192341.33187-3-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Vasileios Amoiridis and committed by
Jonathan Cameron
601f7269 139a45c3

+11
+11
drivers/iio/chemical/bme680_core.c
··· 15 15 #include <linux/log2.h> 16 16 #include <linux/module.h> 17 17 #include <linux/regmap.h> 18 + #include <linux/regulator/consumer.h> 18 19 19 20 #include <linux/iio/buffer.h> 20 21 #include <linux/iio/iio.h> ··· 111 110 BME680_HUMID, 112 111 BME680_GAS, 113 112 }; 113 + 114 + static const char *const bme680_supply_names[] = { "vdd", "vddio" }; 114 115 115 116 struct bme680_data { 116 117 struct regmap *regmap; ··· 1116 1113 data->heater_temp = 320; /* degree Celsius */ 1117 1114 data->heater_dur = 150; /* milliseconds */ 1118 1115 data->preheat_curr_mA = 0; 1116 + 1117 + ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(bme680_supply_names), 1118 + bme680_supply_names); 1119 + if (ret) 1120 + return dev_err_probe(dev, ret, 1121 + "failed to get and enable supplies.\n"); 1122 + 1123 + fsleep(BME680_STARTUP_TIME_US); 1119 1124 1120 1125 ret = regmap_write(regmap, BME680_REG_SOFT_RESET, BME680_CMD_SOFTRESET); 1121 1126 if (ret < 0)