summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViral Patel <viral8854@gmail.com>2026-10-14 23:07:36 +0530
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-11-02 00:38:37 +0000
commitef5c183a863bb69bf019a2d2ae0e1bfdaebe6222 (patch)
tree50fbf1a926bfe33c800e66b665a3d5575c1b2a16
parentc794a0a82fb189d98c635c5791c67c672ad80eb8 (diff)
iio: magnetometer: tlv493d: fix magnetic field scale
The TLV493D-A1B6 datasheet specifies a magnetic resolution of 98 uT/LSB (0.098 mT/LSB). IIO reports magnetic field in Gauss (1 mT = 10 G), so the scale should be 0.98 G/LSB. The driver currently reports 98/1000 = 0.098 G/LSB, which under-reports the magnetic field by a factor of 10. The comment also gives the resolution as 0.0098 mT (9.8 uT), mixing up units. Correct the scale value and the comment. Fixes: 106511d280c7 ("iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor") Signed-off-by: Viral Patel <viral8854@gmail.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
-rw-r--r--drivers/iio/magnetometer/tlv493d.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/magnetometer/tlv493d.c b/drivers/iio/magnetometer/tlv493d.c
index 03415cc2c9b3..234e3ce63ff7 100644
--- a/drivers/iio/magnetometer/tlv493d.c
+++ b/drivers/iio/magnetometer/tlv493d.c
@@ -299,11 +299,11 @@ static int tlv493d_read_raw(struct iio_dev *indio_dev,
switch (chan->type) {
case IIO_MAGN:
/*
- * Magnetic field scale: 0.0098 mTesla (i.e. 9.8 µT)
- * Magnetic field in Gauss: mT * 10 = 0.098.
+ * Magnetic field scale: 0.098 mTesla (i.e. 98 µT) per LSB.
+ * In Gauss (1 mT = 10 G): 0.98 G per LSB.
*/
*val = 98;
- *val2 = 1000;
+ *val2 = 100;
return IIO_VAL_FRACTIONAL;
case IIO_TEMP:
/*