aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/pressure
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2013-07-02 06:13:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-08-03 14:00:27 -0400
commit1003eb67baf00cca8aa51f5833090c61938aa82e (patch)
treed17adcbb2be2788b323e01ba26867bbfc7e85280 /drivers/iio/pressure
parentbace48f44adb954ad71e62779d1be52dae3f0caf (diff)
iio: lps331ap: Modify in_temp_scale calculation way
This patch modifies the way how the in_temp_scale output value is calculated. With this implementation it is more clear how the value is obtained. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/pressure')
-rw-r--r--drivers/iio/pressure/st_pressure_core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 81e2d5b030a6..43b3a55e1130 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -31,6 +31,9 @@
31#define ST_PRESS_LSB_PER_MBAR 4096UL 31#define ST_PRESS_LSB_PER_MBAR 4096UL
32#define ST_PRESS_KPASCAL_NANO_SCALE (100000000UL / \ 32#define ST_PRESS_KPASCAL_NANO_SCALE (100000000UL / \
33 ST_PRESS_LSB_PER_MBAR) 33 ST_PRESS_LSB_PER_MBAR)
34#define ST_PRESS_LSB_PER_CELSIUS 480UL
35#define ST_PRESS_CELSIUS_NANO_SCALE (1000000000UL / \
36 ST_PRESS_LSB_PER_CELSIUS)
34#define ST_PRESS_NUMBER_DATA_CHANNELS 1 37#define ST_PRESS_NUMBER_DATA_CHANNELS 1
35 38
36/* DEFAULT VALUE FOR SENSORS */ 39/* DEFAULT VALUE FOR SENSORS */
@@ -53,8 +56,8 @@
53#define ST_PRESS_1_FS_ADDR 0x23 56#define ST_PRESS_1_FS_ADDR 0x23
54#define ST_PRESS_1_FS_MASK 0x30 57#define ST_PRESS_1_FS_MASK 0x30
55#define ST_PRESS_1_FS_AVL_1260_VAL 0x00 58#define ST_PRESS_1_FS_AVL_1260_VAL 0x00
56#define ST_PRESS_1_FS_AVL_TEMP_GAIN 2083000
57#define ST_PRESS_1_FS_AVL_1260_GAIN ST_PRESS_KPASCAL_NANO_SCALE 59#define ST_PRESS_1_FS_AVL_1260_GAIN ST_PRESS_KPASCAL_NANO_SCALE
60#define ST_PRESS_1_FS_AVL_TEMP_GAIN ST_PRESS_CELSIUS_NANO_SCALE
58#define ST_PRESS_1_BDU_ADDR 0x20 61#define ST_PRESS_1_BDU_ADDR 0x20
59#define ST_PRESS_1_BDU_MASK 0x04 62#define ST_PRESS_1_BDU_MASK 0x04
60#define ST_PRESS_1_DRDY_IRQ_ADDR 0x22 63#define ST_PRESS_1_DRDY_IRQ_ADDR 0x22