public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ti-ads1015: Use correct pga upper bound
@ 2024-01-06 17:48 Mohammed Billoo
  2024-01-07 16:15 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Mohammed Billoo @ 2024-01-06 17:48 UTC (permalink / raw)
  To: mab.kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen, Marek Vasut,
	Uwe Kleine-König, Biju Das, linux-iio, linux-kernel

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>
---
 drivers/iio/adc/ti-ads1015.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index 6799ea49dbc7..6ae967e4d8fa 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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-08 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-06 17:48 [PATCH] iio: adc: ti-ads1015: Use correct pga upper bound Mohammed Billoo
2024-01-07 16:15 ` Jonathan Cameron
2024-01-08 13:37   ` Mohammed Billoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox