Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1655520

[PATCH 3.16 004/212] iio: st_pressure: Fix data sign

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject [PATCH 3.16 004/212] iio: st_pressure: Fix data sign
Date 2017-06-01 18:50 +0200
Message-ID <tNBso-53m-89@gated-at.bofh.it> (permalink)
References <tNAwh-4oP-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.16.44-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Marcin Niestroj <m.niestroj@grinn-global.com>

commit 1b211d48abaa0e12e6e6177c0316ff55d11fdfce upstream.

Datasheet of each device (lps331ap, lps25h, lps001wp, lps22hb) says that
the pressure and temperature data is a 2's complement.

I'm sending this the slow way, as negative pressures on these are pretty
unusual and the nature of the fixing of multiple device introduction patches
will make it hard to apply to older kernels - Jonathan.

Fixes: 217494e5b780 ("iio:pressure: Add STMicroelectronics pressures driver")
Fixes: 2f5effcbd097 ("iio: pressure-core: st: Expand and rename LPS331AP's channel descriptor")
Fixes: 7885a8ce6800 ("iio: pressure: st: Add support for new LPS001WP pressure sensor")
Fixes: e039e2f5b4da ("iio:st_pressure:initial lps22hb sensor support")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
[bwh: Backported to 3.16: drop change in st_press_lps22hb_channels]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -116,7 +116,7 @@ static const struct iio_chan_spec st_pre
 		.address = ST_PRESS_1_OUT_XL_ADDR,
 		.scan_index = ST_SENSORS_SCAN_X,
 		.scan_type = {
-			.sign = 'u',
+			.sign = 's',
 			.realbits = 24,
 			.storagebits = 24,
 			.endianness = IIO_LE,
@@ -131,7 +131,7 @@ static const struct iio_chan_spec st_pre
 		.address = ST_TEMP_1_OUT_L_ADDR,
 		.scan_index = -1,
 		.scan_type = {
-			.sign = 'u',
+			.sign = 's',
 			.realbits = 16,
 			.storagebits = 16,
 			.endianness = IIO_LE,
@@ -152,7 +152,7 @@ static const struct iio_chan_spec st_pre
 		.address = ST_PRESS_LPS001WP_OUT_L_ADDR,
 		.scan_index = ST_SENSORS_SCAN_X,
 		.scan_type = {
-			.sign = 'u',
+			.sign = 's',
 			.realbits = 16,
 			.storagebits = 16,
 			.endianness = IIO_LE,
@@ -168,7 +168,7 @@ static const struct iio_chan_spec st_pre
 		.address = ST_TEMP_LPS001WP_OUT_L_ADDR,
 		.scan_index = -1,
 		.scan_type = {
-			.sign = 'u',
+			.sign = 's',
 			.realbits = 16,
 			.storagebits = 16,
 			.endianness = IIO_LE,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.16 000/212] 3.16.44-rc1 review Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 003/212] adm80211: return an error if adm8211_alloc_rings()  fails Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 006/212] MIPS: Clear ISA bit correctly in  get_frame_info() Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 023/212] Drivers: hv: vmbus: Raise retry/wait limits  in vmbus_post_msg() Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 008/212] MIPS: Fix get_frame_info() handling of  microMIPS function size Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 011/212] MIPS: Handle microMIPS jumps in the same way  as MIPS32/MIPS64 jumps Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 031/212] ASoC: rt5640: use msleep() for long delays Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 027/212] ext4: avoid deadlock when expanding inode size Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 004/212] iio: st_pressure: Fix data sign Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  [PATCH 3.16 001/212] mm/huge_memory.c: fix up "mm/huge_memory.c:  respect FOLL_FORCE/FOLL_COW for thp" backport Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 18:50 +0200
  Re: [PATCH 3.16 000/212] 3.16.44-rc1 review Guenter Roeck <linux@roeck-us.net> - 2017-06-01 23:20 +0200

csiph-web