struct st_sensor_data *pdata = iio_priv(indio_dev);
int err;
- /* Regulators not mandatory, but if requested we should enable it. */
+ /* Regulators not mandatory, but if requested we should enable them. */
pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd");
if (!IS_ERR(pdata->vdd)) {
err = regulator_enable(pdata->vdd);
dev_warn(&indio_dev->dev,
"Failed to enable specified Vdd supply\n");
}
+
+ pdata->vdd_io = devm_regulator_get_optional(&indio_dev->dev, "vddio");
+ if (!IS_ERR(pdata->vdd_io)) {
+ err = regulator_enable(pdata->vdd_io);
+ if (err != 0)
+ dev_warn(&indio_dev->dev,
+ "Failed to enable specified Vdd_IO supply\n");
+ }
}
static void st_press_power_disable(struct iio_dev *indio_dev)
if (!IS_ERR(pdata->vdd))
regulator_disable(pdata->vdd);
+
+ if (!IS_ERR(pdata->vdd_io))
+ regulator_disable(pdata->vdd_io);
}
int st_press_common_probe(struct iio_dev *indio_dev,
* @sensor: Pointer to the current sensor struct in use.
* @current_fullscale: Maximum range of measure by the sensor.
* @vdd: Pointer to sensor's Vdd power supply
+ * @vdd_io: Pointer to sensor's Vdd-IO power supply
* @enabled: Status of the sensor (false->off, true->on).
* @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
* @buffer_data: Data used by buffer part.
struct st_sensors *sensor;
struct st_sensor_fullscale_avl *current_fullscale;
struct regulator *vdd;
+ struct regulator *vdd_io;
bool enabled;
bool multiread_bit;