* [PATCH] iio: accel: fix ADXL355 temperature signature value @ 2026-03-13 9:24 Andrej Valek 2026-03-14 20:22 ` David Lechner 0 siblings, 1 reply; 5+ messages in thread From: Andrej Valek @ 2026-03-13 9:24 UTC (permalink / raw) To: linux-iio Cc: Valek Andrej, lars, Michael.Hennerich, puranjay, jonathan.cameron, dlechner From: "Valek Andrej <andrej.v@skyrain.eu>" Temperature was wrongly represented as 12-bit signature, confirmed by DS. Even if the temperature is negative, the value in the register stays unsigned. Signed-off-by: Valek Andrej <andrej.v@skyrain.eu> --- drivers/iio/accel/adxl355_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c index 1c1d64d5cbcb2..8f90c58f41008 100644 --- a/drivers/iio/accel/adxl355_core.c +++ b/drivers/iio/accel/adxl355_core.c @@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = { BIT(IIO_CHAN_INFO_OFFSET), .scan_index = 3, .scan_type = { - .sign = 's', + .sign = 'u', .realbits = 12, .storagebits = 16, .endianness = IIO_BE, -- 2.34.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: fix ADXL355 temperature signature value 2026-03-13 9:24 [PATCH] iio: accel: fix ADXL355 temperature signature value Andrej Valek @ 2026-03-14 20:22 ` David Lechner 2026-03-15 15:35 ` Andrej Valek 0 siblings, 1 reply; 5+ messages in thread From: David Lechner @ 2026-03-14 20:22 UTC (permalink / raw) To: Andrej Valek, linux-iio Cc: Valek Andrej, lars, Michael.Hennerich, puranjay, jonathan.cameron On 3/13/26 4:24 AM, Andrej Valek wrote: > From: "Valek Andrej <andrej.v@skyrain.eu>" > > Temperature was wrongly represented as 12-bit signature, confirmed by DS. signature == signed integer? DS == datasheet? > Even if the temperature is negative, the value in the register stays > unsigned. And IIO_CHAN_INFO_OFFSET will be negative. > > Signed-off-by: Valek Andrej <andrej.v@skyrain.eu> > --- > drivers/iio/accel/adxl355_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c > index 1c1d64d5cbcb2..8f90c58f41008 100644 > --- a/drivers/iio/accel/adxl355_core.c > +++ b/drivers/iio/accel/adxl355_core.c > @@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = { > BIT(IIO_CHAN_INFO_OFFSET), > .scan_index = 3, > .scan_type = { > - .sign = 's', > + .sign = 'u', > .realbits = 12, > .storagebits = 16, > .endianness = IIO_BE, ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: fix ADXL355 temperature signature value 2026-03-14 20:22 ` David Lechner @ 2026-03-15 15:35 ` Andrej Valek 2026-03-15 16:18 ` David Lechner 0 siblings, 1 reply; 5+ messages in thread From: Andrej Valek @ 2026-03-15 15:35 UTC (permalink / raw) To: David Lechner, linux-iio Cc: lars, Michael.Hennerich, puranjay, jonathan.cameron Ah, I see, I described it wrongly. On 14.03.2026 21:22, David Lechner wrote: > On 3/13/26 4:24 AM, Andrej Valek wrote: >> From: "Valek Andrej <andrej.v@skyrain.eu>" >> >> Temperature was wrongly represented as 12-bit signature, confirmed by DS. > signature == signed integer? Correct, temperature is wrongly represented as signed 12-bit number, while it has to be unsigned. > > DS == datasheet? Yes > >> Even if the temperature is negative, the value in the register stays >> unsigned. > And IIO_CHAN_INFO_OFFSET will be negative. Not sure what do you mean by this. I can only say, that output type was "be:s12/16>>0" and should be "be:u12/16>>0". So when some upper layer wanted to represent the number it "overflowed", while the bits have been masked. > >> Signed-off-by: Valek Andrej <andrej.v@skyrain.eu> >> --- >> drivers/iio/accel/adxl355_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c >> index 1c1d64d5cbcb2..8f90c58f41008 100644 >> --- a/drivers/iio/accel/adxl355_core.c >> +++ b/drivers/iio/accel/adxl355_core.c >> @@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = { >> BIT(IIO_CHAN_INFO_OFFSET), >> .scan_index = 3, >> .scan_type = { >> - .sign = 's', >> + .sign = 'u', >> .realbits = 12, >> .storagebits = 16, >> .endianness = IIO_BE, > > Conclusion = Should I send a new version with "fixed" description? BR, Andy ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: fix ADXL355 temperature signature value 2026-03-15 15:35 ` Andrej Valek @ 2026-03-15 16:18 ` David Lechner 2026-03-22 11:44 ` Jonathan Cameron 0 siblings, 1 reply; 5+ messages in thread From: David Lechner @ 2026-03-15 16:18 UTC (permalink / raw) To: Andrej Valek, linux-iio Cc: lars, Michael.Hennerich, puranjay, jonathan.cameron On 3/15/26 10:35 AM, Andrej Valek wrote: > Ah, I see, I described it wrongly. > > On 14.03.2026 21:22, David Lechner wrote: >> On 3/13/26 4:24 AM, Andrej Valek wrote: >>> From: "Valek Andrej <andrej.v@skyrain.eu>" >>> >>> Temperature was wrongly represented as 12-bit signature, confirmed by DS. >> signature == signed integer? > Correct, temperature is wrongly represented as signed 12-bit number, while it has to be unsigned. >> >> DS == datasheet? > Yes >> >>> Even if the temperature is negative, the value in the register stays >>> unsigned. >> And IIO_CHAN_INFO_OFFSET will be negative. > Not sure what do you mean by this. I can only say, that output type was "be:s12/16>>0" and should be "be:u12/16>>0". So when some upper layer wanted to represent the number it "overflowed", while the bits have been masked. Mostly I was talking to myself on this point. No action is needed here. >> >>> Signed-off-by: Valek Andrej <andrej.v@skyrain.eu> >>> --- >>> drivers/iio/accel/adxl355_core.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c >>> index 1c1d64d5cbcb2..8f90c58f41008 100644 >>> --- a/drivers/iio/accel/adxl355_core.c >>> +++ b/drivers/iio/accel/adxl355_core.c >>> @@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = { >>> BIT(IIO_CHAN_INFO_OFFSET), >>> .scan_index = 3, >>> .scan_type = { >>> - .sign = 's', >>> + .sign = 'u', >>> .realbits = 12, >>> .storagebits = 16, >>> .endianness = IIO_BE, >> >> > Conclusion = Should I send a new version with "fixed" description? Sometimes, for small tweaks, Jonathan will just fix it while applying the patch. So wait for for his feedback. You can also see the status of the patch in patchwork at [1]. If the State changes to "Changes requested", then you know a new version is expected. Right now, it says "New" which means he hasn't looked at it or made a decision yet. [1]: https://patchwork.kernel.org/project/linux-iio/patch/20260313092413.35912-1-andy@skyrain.eu/ > > BR, > Andy ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: accel: fix ADXL355 temperature signature value 2026-03-15 16:18 ` David Lechner @ 2026-03-22 11:44 ` Jonathan Cameron 0 siblings, 0 replies; 5+ messages in thread From: Jonathan Cameron @ 2026-03-22 11:44 UTC (permalink / raw) To: David Lechner Cc: Andrej Valek, linux-iio, lars, Michael.Hennerich, puranjay, jonathan.cameron On Sun, 15 Mar 2026 11:18:18 -0500 David Lechner <dlechner@baylibre.com> wrote: > On 3/15/26 10:35 AM, Andrej Valek wrote: > > Ah, I see, I described it wrongly. > > > > On 14.03.2026 21:22, David Lechner wrote: > >> On 3/13/26 4:24 AM, Andrej Valek wrote: > >>> From: "Valek Andrej <andrej.v@skyrain.eu>" > >>> > >>> Temperature was wrongly represented as 12-bit signature, confirmed by DS. > >> signature == signed integer? > > Correct, temperature is wrongly represented as signed 12-bit number, while it has to be unsigned. > >> > >> DS == datasheet? > > Yes > >> > >>> Even if the temperature is negative, the value in the register stays > >>> unsigned. > >> And IIO_CHAN_INFO_OFFSET will be negative. > > Not sure what do you mean by this. I can only say, that output type was "be:s12/16>>0" and should be "be:u12/16>>0". So when some upper layer wanted to represent the number it "overflowed", while the bits have been masked. > > Mostly I was talking to myself on this point. No action is needed here. > > >> > >>> Signed-off-by: Valek Andrej <andrej.v@skyrain.eu> > >>> --- > >>> drivers/iio/accel/adxl355_core.c | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>> diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c > >>> index 1c1d64d5cbcb2..8f90c58f41008 100644 > >>> --- a/drivers/iio/accel/adxl355_core.c > >>> +++ b/drivers/iio/accel/adxl355_core.c > >>> @@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = { > >>> BIT(IIO_CHAN_INFO_OFFSET), > >>> .scan_index = 3, > >>> .scan_type = { > >>> - .sign = 's', > >>> + .sign = 'u', > >>> .realbits = 12, > >>> .storagebits = 16, > >>> .endianness = IIO_BE, > >> > >> > > Conclusion = Should I send a new version with "fixed" description? > > Sometimes, for small tweaks, Jonathan will just fix it while applying the > patch. So wait for for his feedback. > > You can also see the status of the patch in patchwork at [1]. If the State > changes to "Changes requested", then you know a new version is expected. > Right now, it says "New" which means he hasn't looked at it or made a > decision yet. > > > [1]: https://patchwork.kernel.org/project/linux-iio/patch/20260313092413.35912-1-andy@skyrain.eu/ Busy few weeks. Catching up now. This also needs a fixes tag to indicate how far back we should be looking to backport it. Looks like it was all the way so I've added one. Fixes: 12ed27863ea3 ("iio: accel: Add driver support for ADXL355") Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > > > > > BR, > > Andy > > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-22 11:45 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-13 9:24 [PATCH] iio: accel: fix ADXL355 temperature signature value Andrej Valek 2026-03-14 20:22 ` David Lechner 2026-03-15 15:35 ` Andrej Valek 2026-03-15 16:18 ` David Lechner 2026-03-22 11:44 ` Jonathan Cameron
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox