Skip to content

Commit e8245c6

Browse files
mitajic23
authored andcommitted
iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set
The ADS1015 device have two operating modes, continuous conversion mode and single-shot mode. This driver assumes that the continuous conversion mode is selected by runtime resume callback when the ADC result is requested. If CONFIG_PM is disabled, the device is always in the default single-shot mode and no one begins a single conversion. So the conversion register doesn't contain valid ADC result. Fix it by changing the continuous mode in probe function. Cc: Daniel Baluta <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 8d0e8e7 commit e8245c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/iio/adc/ti-ads1015.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,13 @@ static int ads1015_probe(struct i2c_client *client,
623623
dev_err(&client->dev, "iio triggered buffer setup failed\n");
624624
return ret;
625625
}
626+
627+
ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG,
628+
ADS1015_CFG_MOD_MASK,
629+
ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT);
630+
if (ret)
631+
return ret;
632+
626633
ret = pm_runtime_set_active(&client->dev);
627634
if (ret)
628635
goto err_buffer_cleanup;

0 commit comments

Comments
 (0)