mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Nyekjaer <sean@geanix.com>
To: Jonathan Cameron <jic23@kernel.org>,
	 Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
	 Lars-Peter Clausen <lars@metafoo.de>,
	 Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	 linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Sean Nyekjaer <sean@geanix.com>,
	stable@vger.kernel.org
Subject: [PATCH v4 2/2] iio: accel: fxls8962af: Fix temperature scan element sign
Date: Mon, 05 May 2025 21:20:08 +0200	[thread overview]
Message-ID: <20250505-fxls-v4-2-a38652e21738@geanix.com> (raw)
In-Reply-To: <20250505-fxls-v4-0-a38652e21738@geanix.com>

Mark the temperature element signed, data read from the TEMP_OUT register
is in two's complement format.
This will avoid the temperature being mishandled and miss displayed.

Fixes: a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers")
Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 drivers/iio/accel/fxls8962af-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c
index 5f5e917f7aa53912448ba078027183c63bc0cd7d..ae965a8f560d3b9872a7197c3b540fe4f7f655df 100644
--- a/drivers/iio/accel/fxls8962af-core.c
+++ b/drivers/iio/accel/fxls8962af-core.c
@@ -749,6 +749,7 @@ static const struct iio_event_spec fxls8962af_event[] = {
 			      BIT(IIO_CHAN_INFO_OFFSET),\
 	.scan_index = -1, \
 	.scan_type = { \
+		.sign = 's', \
 		.realbits = 8, \
 		.storagebits = 8, \
 	}, \

-- 
2.47.1


  parent reply	other threads:[~2025-05-05 19:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05 19:20 [PATCH v4 0/2] iio: accel: fxls8962af: Fix temperature readings Sean Nyekjaer
2025-05-05 19:20 ` [PATCH v4 1/2] iio: accel: fxls8962af: Fix temperature calculation Sean Nyekjaer
2025-05-05 19:20 ` Sean Nyekjaer [this message]
2025-05-15 16:17 ` [PATCH v4 0/2] iio: accel: fxls8962af: Fix temperature readings Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250505-fxls-v4-2-a38652e21738@geanix.com \
    --to=sean@geanix.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®