aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorMohammed Billoo <mab.kernel@gmail.com>2024-01-06 12:48:35 -0500
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-01-22 18:58:45 +0000
commit0ba6014a2317b8dae9e31cd293f6666c5172efe9 (patch)
treeaf005b70a564f4d5a300200fa231335699a408ff /drivers/iio
parenta9058f287016f24c1d88acd062933424e623fa32 (diff)
downloadlinux-0ba6014a2317b8dae9e31cd293f6666c5172efe9.tar.gz
iio: adc: ti-ads1015: Use correct pga upper bound
The devicetree binding and datasheets (for both the ADS1015 and ADS1115) show that the PGA index should have a maximum value of 5, and not 6. Signed-off-by: Mohammed Billoo <mab.kernel@gmail.com> Link: https://lore.kernel.org/r/20240106174836.1086714-1-mab.kernel@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/ti-ads1015.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index 6799ea49dbc73..6ae967e4d8fa7 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -925,7 +925,7 @@ static int ads1015_client_get_channels_config(struct i2c_client *client)
if (!fwnode_property_read_u32(node, "ti,gain", &pval)) {
pga = pval;
- if (pga > 6) {
+ if (pga > 5) {
dev_err(dev, "invalid gain on %pfw\n", node);
fwnode_handle_put(node);
return -EINVAL;