Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751776AbdFAPoX (ORCPT ); Thu, 1 Jun 2017 11:44:23 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33023 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbdFAPoV (ORCPT ); Thu, 1 Jun 2017 11:44:21 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Linus Walleij" , "Jonathan Cameron" , "Marcin Niestroj" Date: Thu, 01 Jun 2017 16:43:15 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 004/212] iio: st_pressure: Fix data sign In-Reply-To: X-SA-Exim-Connect-IP: 82.70.136.246 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2263 Lines: 63 3.16.44-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Marcin Niestroj 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 Reviewed-by: Linus Walleij Signed-off-by: Jonathan Cameron [bwh: Backported to 3.16: drop change in st_press_lps22hb_channels] Signed-off-by: Ben Hutchings --- --- 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,