mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
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>
This commit is contained in:
parent
a9058f2870
commit
0ba6014a23
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user