diff for duplicates of <522793A9.8040300@st.com> diff --git a/a/1.txt b/N1/1.txt index f073d25..5b13b25 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,34 +1,32 @@ Hi Lee, > They're currently named *_1_*, for 'Sensor 1', but the code will be much > more readable if we use the naming convention *_LPS331AP_* instead. -You are right, but the reason is to maintain the same structure of the=20 -other sensors drivers (like accel, gyro and magn). Often some sensors=20 +You are right, but the reason is to maintain the same structure of the +other sensors drivers (like accel, gyro and magn). Often some sensors can use the same data and using 1,2,... I think it's more general. Denis > Signed-off-by: Lee Jones <lee.jones@linaro.org> > --- -> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++----------= -------- +> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++----------------- > 1 file changed, 44 insertions(+), 46 deletions(-) > -> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressu= -re/st_pressure_core.c +> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c > index 9c343b4..becfb25 100644 > --- a/drivers/iio/pressure/st_pressure_core.c > +++ b/drivers/iio/pressure/st_pressure_core.c > @@ -31,92 +31,90 @@ > #define ST_PRESS_MBAR_TO_KPASCAL(x) (x * 10) > #define ST_PRESS_NUMBER_DATA_CHANNELS 1 -> =20 +> > -/* DEFAULT VALUE FOR SENSORS */ > -#define ST_PRESS_DEFAULT_OUT_XL_ADDR 0x28 > -#define ST_TEMP_DEFAULT_OUT_L_ADDR 0x2b > - > /* FULLSCALE */ > #define ST_PRESS_FS_AVL_1260MB 1260 -> =20 +> > -/* CUSTOM VALUES FOR SENSOR 1 */ > -#define ST_PRESS_1_WAI_EXP 0xbb > -#define ST_PRESS_1_ODR_ADDR 0x20 @@ -63,8 +61,7 @@ re/st_pressure_core.c > +#define ST_PRESS_LPS331AP_FS_ADDR 0x23 > +#define ST_PRESS_LPS331AP_FS_MASK 0x30 > +#define ST_PRESS_LPS331AP_FS_AVL_1260_VAL 0x00 -> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN ST_PRESS_MBAR_TO_KPASCAL(2441= -41) +> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN ST_PRESS_MBAR_TO_KPASCAL(244141) > +#define ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN 2083000 > +#define ST_PRESS_LPS331AP_BDU_ADDR 0x20 > +#define ST_PRESS_LPS331AP_BDU_MASK 0x04 @@ -74,8 +71,8 @@ re/st_pressure_core.c > +#define ST_PRESS_LPS331AP_TEMP_OFFSET 42500 > +#define ST_PRESS_LPS331AP_OUT_XL_ADDR 0x28 > +#define ST_TEMP_LPS331AP_OUT_L_ADDR 0x2b -> =20 -> static const struct iio_chan_spec st_press_channels[] =3D { +> +> static const struct iio_chan_spec st_press_channels[] = { > ST_SENSORS_LSM_CHANNELS(IIO_PRESSURE, > BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), > ST_SENSORS_SCAN_X, 0, IIO_NO_MOD, 'u', IIO_LE, 24, 24, @@ -89,21 +86,21 @@ re/st_pressure_core.c > + ST_TEMP_LPS331AP_OUT_L_ADDR), > IIO_CHAN_SOFT_TIMESTAMP(1) > }; -> =20 -> static const struct st_sensors st_press_sensors[] =3D { +> +> static const struct st_sensors st_press_sensors[] = { > { -> - .wai =3D ST_PRESS_1_WAI_EXP, -> + .wai =3D ST_PRESS_LPS331AP_WAI_EXP, -> .sensors_supported =3D { -> [0] =3D LPS331AP_PRESS_DEV_NAME, +> - .wai = ST_PRESS_1_WAI_EXP, +> + .wai = ST_PRESS_LPS331AP_WAI_EXP, +> .sensors_supported = { +> [0] = LPS331AP_PRESS_DEV_NAME, > }, -> .ch =3D (struct iio_chan_spec *)st_press_channels, -> .odr =3D { -> - .addr =3D ST_PRESS_1_ODR_ADDR, -> - .mask =3D ST_PRESS_1_ODR_MASK, -> + .addr =3D ST_PRESS_LPS331AP_ODR_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_ODR_MASK, -> .odr_avl =3D { +> .ch = (struct iio_chan_spec *)st_press_channels, +> .odr = { +> - .addr = ST_PRESS_1_ODR_ADDR, +> - .mask = ST_PRESS_1_ODR_MASK, +> + .addr = ST_PRESS_LPS331AP_ODR_ADDR, +> + .mask = ST_PRESS_LPS331AP_ODR_MASK, +> .odr_avl = { > - { 1, ST_PRESS_1_ODR_AVL_1HZ_VAL, }, > - { 7, ST_PRESS_1_ODR_AVL_7HZ_VAL, }, > - { 13, ST_PRESS_1_ODR_AVL_13HZ_VAL, }, @@ -114,45 +111,45 @@ re/st_pressure_core.c > + { 25, ST_PRESS_LPS331AP_ODR_AVL_25HZ_VAL, }, > }, > }, -> .pw =3D { -> - .addr =3D ST_PRESS_1_PW_ADDR, -> - .mask =3D ST_PRESS_1_PW_MASK, -> + .addr =3D ST_PRESS_LPS331AP_PW_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_PW_MASK, -> .value_on =3D ST_SENSORS_DEFAULT_POWER_ON_VALUE, -> .value_off =3D ST_SENSORS_DEFAULT_POWER_OFF_VALUE, +> .pw = { +> - .addr = ST_PRESS_1_PW_ADDR, +> - .mask = ST_PRESS_1_PW_MASK, +> + .addr = ST_PRESS_LPS331AP_PW_ADDR, +> + .mask = ST_PRESS_LPS331AP_PW_MASK, +> .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE, +> .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, > }, -> .fs =3D { -> - .addr =3D ST_PRESS_1_FS_ADDR, -> - .mask =3D ST_PRESS_1_FS_MASK, -> + .addr =3D ST_PRESS_LPS331AP_FS_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_FS_MASK, -> .fs_avl =3D { -> [0] =3D { -> .num =3D ST_PRESS_FS_AVL_1260MB, -> - .value =3D ST_PRESS_1_FS_AVL_1260_VAL, -> - .gain =3D ST_PRESS_1_FS_AVL_1260_GAIN, -> - .gain2 =3D ST_PRESS_1_FS_AVL_TEMP_GAIN, -> + .value =3D ST_PRESS_LPS331AP_FS_AVL_1260_VAL, -> + .gain =3D ST_PRESS_LPS331AP_FS_AVL_1260_GAIN, -> + .gain2 =3D ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN, +> .fs = { +> - .addr = ST_PRESS_1_FS_ADDR, +> - .mask = ST_PRESS_1_FS_MASK, +> + .addr = ST_PRESS_LPS331AP_FS_ADDR, +> + .mask = ST_PRESS_LPS331AP_FS_MASK, +> .fs_avl = { +> [0] = { +> .num = ST_PRESS_FS_AVL_1260MB, +> - .value = ST_PRESS_1_FS_AVL_1260_VAL, +> - .gain = ST_PRESS_1_FS_AVL_1260_GAIN, +> - .gain2 = ST_PRESS_1_FS_AVL_TEMP_GAIN, +> + .value = ST_PRESS_LPS331AP_FS_AVL_1260_VAL, +> + .gain = ST_PRESS_LPS331AP_FS_AVL_1260_GAIN, +> + .gain2 = ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN, > }, > }, > }, -> .bdu =3D { -> - .addr =3D ST_PRESS_1_BDU_ADDR, -> - .mask =3D ST_PRESS_1_BDU_MASK, -> + .addr =3D ST_PRESS_LPS331AP_BDU_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_BDU_MASK, +> .bdu = { +> - .addr = ST_PRESS_1_BDU_ADDR, +> - .mask = ST_PRESS_1_BDU_MASK, +> + .addr = ST_PRESS_LPS331AP_BDU_ADDR, +> + .mask = ST_PRESS_LPS331AP_BDU_MASK, > }, -> .drdy_irq =3D { -> - .addr =3D ST_PRESS_1_DRDY_IRQ_ADDR, -> - .mask =3D ST_PRESS_1_DRDY_IRQ_MASK, -> + .addr =3D ST_PRESS_LPS331AP_DRDY_IRQ_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_DRDY_IRQ_MASK, +> .drdy_irq = { +> - .addr = ST_PRESS_1_DRDY_IRQ_ADDR, +> - .mask = ST_PRESS_1_DRDY_IRQ_MASK, +> + .addr = ST_PRESS_LPS331AP_DRDY_IRQ_ADDR, +> + .mask = ST_PRESS_LPS331AP_DRDY_IRQ_MASK, > }, -> - .multi_read_bit =3D ST_PRESS_1_MULTIREAD_BIT, -> + .multi_read_bit =3D ST_PRESS_LPS331AP_MULTIREAD_BIT, -> .bootime =3D 2, +> - .multi_read_bit = ST_PRESS_1_MULTIREAD_BIT, +> + .multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT, +> .bootime = 2, > }, > }; diff --git a/a/content_digest b/N1/content_digest index 405b73e..e73ea41 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,48 +1,40 @@ "ref\01378287103-21765-1-git-send-email-lee.jones@linaro.org\0" "ref\01378287103-21765-6-git-send-email-lee.jones@linaro.org\0" - "From\0Denis CIOCCA <denis.ciocca@st.com>\0" - "Subject\0Re: [PATCH 05/11] iio: pressure-core: st: Describe LPS331AP defines by name\0" + "From\0denis.ciocca@st.com (Denis CIOCCA)\0" + "Subject\0[PATCH 05/11] iio: pressure-core: st: Describe LPS331AP defines by name\0" "Date\0Wed, 4 Sep 2013 22:10:17 +0200\0" - "To\0Lee Jones <lee.jones@linaro.org>\0" - "Cc\0linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>" - linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> - jic23@cam.ac.uk <jic23@cam.ac.uk> - arnd@arndb.de <arnd@arndb.de> - linus.walleij@linaro.org <linus.walleij@linaro.org> - " linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "Hi Lee,\n" "> They're currently named *_1_*, for 'Sensor 1', but the code will be much\n" "> more readable if we use the naming convention *_LPS331AP_* instead.\n" - "You are right, but the reason is to maintain the same structure of the=20\n" - "other sensors drivers (like accel, gyro and magn). Often some sensors=20\n" + "You are right, but the reason is to maintain the same structure of the \n" + "other sensors drivers (like accel, gyro and magn). Often some sensors \n" "can use the same data and using 1,2,... I think it's more general.\n" "\n" "Denis\n" "\n" "> Signed-off-by: Lee Jones <lee.jones@linaro.org>\n" "> ---\n" - "> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++----------=\n" - "-------\n" + "> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++-----------------\n" "> 1 file changed, 44 insertions(+), 46 deletions(-)\n" ">\n" - "> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressu=\n" - "re/st_pressure_core.c\n" + "> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c\n" "> index 9c343b4..becfb25 100644\n" "> --- a/drivers/iio/pressure/st_pressure_core.c\n" "> +++ b/drivers/iio/pressure/st_pressure_core.c\n" "> @@ -31,92 +31,90 @@\n" "> #define ST_PRESS_MBAR_TO_KPASCAL(x)\t\t(x * 10)\n" "> #define ST_PRESS_NUMBER_DATA_CHANNELS\t\t1\n" - "> =20\n" + "> \n" "> -/* DEFAULT VALUE FOR SENSORS */\n" "> -#define ST_PRESS_DEFAULT_OUT_XL_ADDR\t\t0x28\n" "> -#define ST_TEMP_DEFAULT_OUT_L_ADDR\t\t0x2b\n" "> -\n" "> /* FULLSCALE */\n" "> #define ST_PRESS_FS_AVL_1260MB\t\t\t1260\n" - "> =20\n" + "> \n" "> -/* CUSTOM VALUES FOR SENSOR 1 */\n" "> -#define ST_PRESS_1_WAI_EXP\t\t\t0xbb\n" "> -#define ST_PRESS_1_ODR_ADDR\t\t\t0x20\n" @@ -77,8 +69,7 @@ "> +#define ST_PRESS_LPS331AP_FS_ADDR\t\t0x23\n" "> +#define ST_PRESS_LPS331AP_FS_MASK\t\t0x30\n" "> +#define ST_PRESS_LPS331AP_FS_AVL_1260_VAL\t0x00\n" - "> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN\tST_PRESS_MBAR_TO_KPASCAL(2441=\n" - "41)\n" + "> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN\tST_PRESS_MBAR_TO_KPASCAL(244141)\n" "> +#define ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN\t2083000\n" "> +#define ST_PRESS_LPS331AP_BDU_ADDR\t\t0x20\n" "> +#define ST_PRESS_LPS331AP_BDU_MASK\t\t0x04\n" @@ -88,8 +79,8 @@ "> +#define ST_PRESS_LPS331AP_TEMP_OFFSET\t\t42500\n" "> +#define ST_PRESS_LPS331AP_OUT_XL_ADDR\t\t0x28\n" "> +#define ST_TEMP_LPS331AP_OUT_L_ADDR\t\t0x2b\n" - "> =20\n" - "> static const struct iio_chan_spec st_press_channels[] =3D {\n" + "> \n" + "> static const struct iio_chan_spec st_press_channels[] = {\n" "> \tST_SENSORS_LSM_CHANNELS(IIO_PRESSURE,\n" "> \t\t\tBIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),\n" "> \t\t\tST_SENSORS_SCAN_X, 0, IIO_NO_MOD, 'u', IIO_LE, 24, 24,\n" @@ -103,21 +94,21 @@ "> +\t\t\tST_TEMP_LPS331AP_OUT_L_ADDR),\n" "> \tIIO_CHAN_SOFT_TIMESTAMP(1)\n" "> };\n" - "> =20\n" - "> static const struct st_sensors st_press_sensors[] =3D {\n" + "> \n" + "> static const struct st_sensors st_press_sensors[] = {\n" "> \t{\n" - "> -\t\t.wai =3D ST_PRESS_1_WAI_EXP,\n" - "> +\t\t.wai =3D ST_PRESS_LPS331AP_WAI_EXP,\n" - "> \t\t.sensors_supported =3D {\n" - "> \t\t\t[0] =3D LPS331AP_PRESS_DEV_NAME,\n" + "> -\t\t.wai = ST_PRESS_1_WAI_EXP,\n" + "> +\t\t.wai = ST_PRESS_LPS331AP_WAI_EXP,\n" + "> \t\t.sensors_supported = {\n" + "> \t\t\t[0] = LPS331AP_PRESS_DEV_NAME,\n" "> \t\t},\n" - "> \t\t.ch =3D (struct iio_chan_spec *)st_press_channels,\n" - "> \t\t.odr =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_ODR_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_ODR_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_ODR_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_ODR_MASK,\n" - "> \t\t\t.odr_avl =3D {\n" + "> \t\t.ch = (struct iio_chan_spec *)st_press_channels,\n" + "> \t\t.odr = {\n" + "> -\t\t\t.addr = ST_PRESS_1_ODR_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_ODR_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_ODR_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_ODR_MASK,\n" + "> \t\t\t.odr_avl = {\n" "> -\t\t\t\t{ 1, ST_PRESS_1_ODR_AVL_1HZ_VAL, },\n" "> -\t\t\t\t{ 7, ST_PRESS_1_ODR_AVL_7HZ_VAL, },\n" "> -\t\t\t\t{ 13, ST_PRESS_1_ODR_AVL_13HZ_VAL, },\n" @@ -128,47 +119,47 @@ "> +\t\t\t\t{ 25, ST_PRESS_LPS331AP_ODR_AVL_25HZ_VAL, },\n" "> \t\t\t},\n" "> \t\t},\n" - "> \t\t.pw =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_PW_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_PW_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_PW_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_PW_MASK,\n" - "> \t\t\t.value_on =3D ST_SENSORS_DEFAULT_POWER_ON_VALUE,\n" - "> \t\t\t.value_off =3D ST_SENSORS_DEFAULT_POWER_OFF_VALUE,\n" + "> \t\t.pw = {\n" + "> -\t\t\t.addr = ST_PRESS_1_PW_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_PW_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_PW_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_PW_MASK,\n" + "> \t\t\t.value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,\n" + "> \t\t\t.value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,\n" "> \t\t},\n" - "> \t\t.fs =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_FS_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_FS_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_FS_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_FS_MASK,\n" - "> \t\t\t.fs_avl =3D {\n" - "> \t\t\t\t[0] =3D {\n" - "> \t\t\t\t\t.num =3D ST_PRESS_FS_AVL_1260MB,\n" - "> -\t\t\t\t\t.value =3D ST_PRESS_1_FS_AVL_1260_VAL,\n" - "> -\t\t\t\t\t.gain =3D ST_PRESS_1_FS_AVL_1260_GAIN,\n" - "> -\t\t\t\t\t.gain2 =3D ST_PRESS_1_FS_AVL_TEMP_GAIN,\n" - "> +\t\t\t\t\t.value =3D ST_PRESS_LPS331AP_FS_AVL_1260_VAL,\n" - "> +\t\t\t\t\t.gain =3D ST_PRESS_LPS331AP_FS_AVL_1260_GAIN,\n" - "> +\t\t\t\t\t.gain2 =3D ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN,\n" + "> \t\t.fs = {\n" + "> -\t\t\t.addr = ST_PRESS_1_FS_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_FS_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_FS_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_FS_MASK,\n" + "> \t\t\t.fs_avl = {\n" + "> \t\t\t\t[0] = {\n" + "> \t\t\t\t\t.num = ST_PRESS_FS_AVL_1260MB,\n" + "> -\t\t\t\t\t.value = ST_PRESS_1_FS_AVL_1260_VAL,\n" + "> -\t\t\t\t\t.gain = ST_PRESS_1_FS_AVL_1260_GAIN,\n" + "> -\t\t\t\t\t.gain2 = ST_PRESS_1_FS_AVL_TEMP_GAIN,\n" + "> +\t\t\t\t\t.value = ST_PRESS_LPS331AP_FS_AVL_1260_VAL,\n" + "> +\t\t\t\t\t.gain = ST_PRESS_LPS331AP_FS_AVL_1260_GAIN,\n" + "> +\t\t\t\t\t.gain2 = ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN,\n" "> \t\t\t\t},\n" "> \t\t\t},\n" "> \t\t},\n" - "> \t\t.bdu =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_BDU_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_BDU_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_BDU_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_BDU_MASK,\n" + "> \t\t.bdu = {\n" + "> -\t\t\t.addr = ST_PRESS_1_BDU_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_BDU_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_BDU_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_BDU_MASK,\n" "> \t\t},\n" - "> \t\t.drdy_irq =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_DRDY_IRQ_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_DRDY_IRQ_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_DRDY_IRQ_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_DRDY_IRQ_MASK,\n" + "> \t\t.drdy_irq = {\n" + "> -\t\t\t.addr = ST_PRESS_1_DRDY_IRQ_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_DRDY_IRQ_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_DRDY_IRQ_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_DRDY_IRQ_MASK,\n" "> \t\t},\n" - "> -\t\t.multi_read_bit =3D ST_PRESS_1_MULTIREAD_BIT,\n" - "> +\t\t.multi_read_bit =3D ST_PRESS_LPS331AP_MULTIREAD_BIT,\n" - "> \t\t.bootime =3D 2,\n" + "> -\t\t.multi_read_bit = ST_PRESS_1_MULTIREAD_BIT,\n" + "> +\t\t.multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT,\n" + "> \t\t.bootime = 2,\n" "> \t},\n" > }; -a4f22a3f3cebf670917d8a2d4e10754950083aa3c0936674bb1c87d3eb772380 +0184674ca91a2fe0a20d4d92cf52054fbe3678f0e6014edd620fa93ab241dda0
diff --git a/a/1.txt b/N2/1.txt index f073d25..5b13b25 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -1,34 +1,32 @@ Hi Lee, > They're currently named *_1_*, for 'Sensor 1', but the code will be much > more readable if we use the naming convention *_LPS331AP_* instead. -You are right, but the reason is to maintain the same structure of the=20 -other sensors drivers (like accel, gyro and magn). Often some sensors=20 +You are right, but the reason is to maintain the same structure of the +other sensors drivers (like accel, gyro and magn). Often some sensors can use the same data and using 1,2,... I think it's more general. Denis > Signed-off-by: Lee Jones <lee.jones@linaro.org> > --- -> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++----------= -------- +> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++----------------- > 1 file changed, 44 insertions(+), 46 deletions(-) > -> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressu= -re/st_pressure_core.c +> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c > index 9c343b4..becfb25 100644 > --- a/drivers/iio/pressure/st_pressure_core.c > +++ b/drivers/iio/pressure/st_pressure_core.c > @@ -31,92 +31,90 @@ > #define ST_PRESS_MBAR_TO_KPASCAL(x) (x * 10) > #define ST_PRESS_NUMBER_DATA_CHANNELS 1 -> =20 +> > -/* DEFAULT VALUE FOR SENSORS */ > -#define ST_PRESS_DEFAULT_OUT_XL_ADDR 0x28 > -#define ST_TEMP_DEFAULT_OUT_L_ADDR 0x2b > - > /* FULLSCALE */ > #define ST_PRESS_FS_AVL_1260MB 1260 -> =20 +> > -/* CUSTOM VALUES FOR SENSOR 1 */ > -#define ST_PRESS_1_WAI_EXP 0xbb > -#define ST_PRESS_1_ODR_ADDR 0x20 @@ -63,8 +61,7 @@ re/st_pressure_core.c > +#define ST_PRESS_LPS331AP_FS_ADDR 0x23 > +#define ST_PRESS_LPS331AP_FS_MASK 0x30 > +#define ST_PRESS_LPS331AP_FS_AVL_1260_VAL 0x00 -> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN ST_PRESS_MBAR_TO_KPASCAL(2441= -41) +> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN ST_PRESS_MBAR_TO_KPASCAL(244141) > +#define ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN 2083000 > +#define ST_PRESS_LPS331AP_BDU_ADDR 0x20 > +#define ST_PRESS_LPS331AP_BDU_MASK 0x04 @@ -74,8 +71,8 @@ re/st_pressure_core.c > +#define ST_PRESS_LPS331AP_TEMP_OFFSET 42500 > +#define ST_PRESS_LPS331AP_OUT_XL_ADDR 0x28 > +#define ST_TEMP_LPS331AP_OUT_L_ADDR 0x2b -> =20 -> static const struct iio_chan_spec st_press_channels[] =3D { +> +> static const struct iio_chan_spec st_press_channels[] = { > ST_SENSORS_LSM_CHANNELS(IIO_PRESSURE, > BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), > ST_SENSORS_SCAN_X, 0, IIO_NO_MOD, 'u', IIO_LE, 24, 24, @@ -89,21 +86,21 @@ re/st_pressure_core.c > + ST_TEMP_LPS331AP_OUT_L_ADDR), > IIO_CHAN_SOFT_TIMESTAMP(1) > }; -> =20 -> static const struct st_sensors st_press_sensors[] =3D { +> +> static const struct st_sensors st_press_sensors[] = { > { -> - .wai =3D ST_PRESS_1_WAI_EXP, -> + .wai =3D ST_PRESS_LPS331AP_WAI_EXP, -> .sensors_supported =3D { -> [0] =3D LPS331AP_PRESS_DEV_NAME, +> - .wai = ST_PRESS_1_WAI_EXP, +> + .wai = ST_PRESS_LPS331AP_WAI_EXP, +> .sensors_supported = { +> [0] = LPS331AP_PRESS_DEV_NAME, > }, -> .ch =3D (struct iio_chan_spec *)st_press_channels, -> .odr =3D { -> - .addr =3D ST_PRESS_1_ODR_ADDR, -> - .mask =3D ST_PRESS_1_ODR_MASK, -> + .addr =3D ST_PRESS_LPS331AP_ODR_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_ODR_MASK, -> .odr_avl =3D { +> .ch = (struct iio_chan_spec *)st_press_channels, +> .odr = { +> - .addr = ST_PRESS_1_ODR_ADDR, +> - .mask = ST_PRESS_1_ODR_MASK, +> + .addr = ST_PRESS_LPS331AP_ODR_ADDR, +> + .mask = ST_PRESS_LPS331AP_ODR_MASK, +> .odr_avl = { > - { 1, ST_PRESS_1_ODR_AVL_1HZ_VAL, }, > - { 7, ST_PRESS_1_ODR_AVL_7HZ_VAL, }, > - { 13, ST_PRESS_1_ODR_AVL_13HZ_VAL, }, @@ -114,45 +111,45 @@ re/st_pressure_core.c > + { 25, ST_PRESS_LPS331AP_ODR_AVL_25HZ_VAL, }, > }, > }, -> .pw =3D { -> - .addr =3D ST_PRESS_1_PW_ADDR, -> - .mask =3D ST_PRESS_1_PW_MASK, -> + .addr =3D ST_PRESS_LPS331AP_PW_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_PW_MASK, -> .value_on =3D ST_SENSORS_DEFAULT_POWER_ON_VALUE, -> .value_off =3D ST_SENSORS_DEFAULT_POWER_OFF_VALUE, +> .pw = { +> - .addr = ST_PRESS_1_PW_ADDR, +> - .mask = ST_PRESS_1_PW_MASK, +> + .addr = ST_PRESS_LPS331AP_PW_ADDR, +> + .mask = ST_PRESS_LPS331AP_PW_MASK, +> .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE, +> .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, > }, -> .fs =3D { -> - .addr =3D ST_PRESS_1_FS_ADDR, -> - .mask =3D ST_PRESS_1_FS_MASK, -> + .addr =3D ST_PRESS_LPS331AP_FS_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_FS_MASK, -> .fs_avl =3D { -> [0] =3D { -> .num =3D ST_PRESS_FS_AVL_1260MB, -> - .value =3D ST_PRESS_1_FS_AVL_1260_VAL, -> - .gain =3D ST_PRESS_1_FS_AVL_1260_GAIN, -> - .gain2 =3D ST_PRESS_1_FS_AVL_TEMP_GAIN, -> + .value =3D ST_PRESS_LPS331AP_FS_AVL_1260_VAL, -> + .gain =3D ST_PRESS_LPS331AP_FS_AVL_1260_GAIN, -> + .gain2 =3D ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN, +> .fs = { +> - .addr = ST_PRESS_1_FS_ADDR, +> - .mask = ST_PRESS_1_FS_MASK, +> + .addr = ST_PRESS_LPS331AP_FS_ADDR, +> + .mask = ST_PRESS_LPS331AP_FS_MASK, +> .fs_avl = { +> [0] = { +> .num = ST_PRESS_FS_AVL_1260MB, +> - .value = ST_PRESS_1_FS_AVL_1260_VAL, +> - .gain = ST_PRESS_1_FS_AVL_1260_GAIN, +> - .gain2 = ST_PRESS_1_FS_AVL_TEMP_GAIN, +> + .value = ST_PRESS_LPS331AP_FS_AVL_1260_VAL, +> + .gain = ST_PRESS_LPS331AP_FS_AVL_1260_GAIN, +> + .gain2 = ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN, > }, > }, > }, -> .bdu =3D { -> - .addr =3D ST_PRESS_1_BDU_ADDR, -> - .mask =3D ST_PRESS_1_BDU_MASK, -> + .addr =3D ST_PRESS_LPS331AP_BDU_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_BDU_MASK, +> .bdu = { +> - .addr = ST_PRESS_1_BDU_ADDR, +> - .mask = ST_PRESS_1_BDU_MASK, +> + .addr = ST_PRESS_LPS331AP_BDU_ADDR, +> + .mask = ST_PRESS_LPS331AP_BDU_MASK, > }, -> .drdy_irq =3D { -> - .addr =3D ST_PRESS_1_DRDY_IRQ_ADDR, -> - .mask =3D ST_PRESS_1_DRDY_IRQ_MASK, -> + .addr =3D ST_PRESS_LPS331AP_DRDY_IRQ_ADDR, -> + .mask =3D ST_PRESS_LPS331AP_DRDY_IRQ_MASK, +> .drdy_irq = { +> - .addr = ST_PRESS_1_DRDY_IRQ_ADDR, +> - .mask = ST_PRESS_1_DRDY_IRQ_MASK, +> + .addr = ST_PRESS_LPS331AP_DRDY_IRQ_ADDR, +> + .mask = ST_PRESS_LPS331AP_DRDY_IRQ_MASK, > }, -> - .multi_read_bit =3D ST_PRESS_1_MULTIREAD_BIT, -> + .multi_read_bit =3D ST_PRESS_LPS331AP_MULTIREAD_BIT, -> .bootime =3D 2, +> - .multi_read_bit = ST_PRESS_1_MULTIREAD_BIT, +> + .multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT, +> .bootime = 2, > }, > }; diff --git a/a/content_digest b/N2/content_digest index 405b73e..9b2705f 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -15,34 +15,32 @@ "Hi Lee,\n" "> They're currently named *_1_*, for 'Sensor 1', but the code will be much\n" "> more readable if we use the naming convention *_LPS331AP_* instead.\n" - "You are right, but the reason is to maintain the same structure of the=20\n" - "other sensors drivers (like accel, gyro and magn). Often some sensors=20\n" + "You are right, but the reason is to maintain the same structure of the \n" + "other sensors drivers (like accel, gyro and magn). Often some sensors \n" "can use the same data and using 1,2,... I think it's more general.\n" "\n" "Denis\n" "\n" "> Signed-off-by: Lee Jones <lee.jones@linaro.org>\n" "> ---\n" - "> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++----------=\n" - "-------\n" + "> drivers/iio/pressure/st_pressure_core.c | 90 ++++++++++++++++-----------------\n" "> 1 file changed, 44 insertions(+), 46 deletions(-)\n" ">\n" - "> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressu=\n" - "re/st_pressure_core.c\n" + "> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c\n" "> index 9c343b4..becfb25 100644\n" "> --- a/drivers/iio/pressure/st_pressure_core.c\n" "> +++ b/drivers/iio/pressure/st_pressure_core.c\n" "> @@ -31,92 +31,90 @@\n" "> #define ST_PRESS_MBAR_TO_KPASCAL(x)\t\t(x * 10)\n" "> #define ST_PRESS_NUMBER_DATA_CHANNELS\t\t1\n" - "> =20\n" + "> \n" "> -/* DEFAULT VALUE FOR SENSORS */\n" "> -#define ST_PRESS_DEFAULT_OUT_XL_ADDR\t\t0x28\n" "> -#define ST_TEMP_DEFAULT_OUT_L_ADDR\t\t0x2b\n" "> -\n" "> /* FULLSCALE */\n" "> #define ST_PRESS_FS_AVL_1260MB\t\t\t1260\n" - "> =20\n" + "> \n" "> -/* CUSTOM VALUES FOR SENSOR 1 */\n" "> -#define ST_PRESS_1_WAI_EXP\t\t\t0xbb\n" "> -#define ST_PRESS_1_ODR_ADDR\t\t\t0x20\n" @@ -77,8 +75,7 @@ "> +#define ST_PRESS_LPS331AP_FS_ADDR\t\t0x23\n" "> +#define ST_PRESS_LPS331AP_FS_MASK\t\t0x30\n" "> +#define ST_PRESS_LPS331AP_FS_AVL_1260_VAL\t0x00\n" - "> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN\tST_PRESS_MBAR_TO_KPASCAL(2441=\n" - "41)\n" + "> +#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN\tST_PRESS_MBAR_TO_KPASCAL(244141)\n" "> +#define ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN\t2083000\n" "> +#define ST_PRESS_LPS331AP_BDU_ADDR\t\t0x20\n" "> +#define ST_PRESS_LPS331AP_BDU_MASK\t\t0x04\n" @@ -88,8 +85,8 @@ "> +#define ST_PRESS_LPS331AP_TEMP_OFFSET\t\t42500\n" "> +#define ST_PRESS_LPS331AP_OUT_XL_ADDR\t\t0x28\n" "> +#define ST_TEMP_LPS331AP_OUT_L_ADDR\t\t0x2b\n" - "> =20\n" - "> static const struct iio_chan_spec st_press_channels[] =3D {\n" + "> \n" + "> static const struct iio_chan_spec st_press_channels[] = {\n" "> \tST_SENSORS_LSM_CHANNELS(IIO_PRESSURE,\n" "> \t\t\tBIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),\n" "> \t\t\tST_SENSORS_SCAN_X, 0, IIO_NO_MOD, 'u', IIO_LE, 24, 24,\n" @@ -103,21 +100,21 @@ "> +\t\t\tST_TEMP_LPS331AP_OUT_L_ADDR),\n" "> \tIIO_CHAN_SOFT_TIMESTAMP(1)\n" "> };\n" - "> =20\n" - "> static const struct st_sensors st_press_sensors[] =3D {\n" + "> \n" + "> static const struct st_sensors st_press_sensors[] = {\n" "> \t{\n" - "> -\t\t.wai =3D ST_PRESS_1_WAI_EXP,\n" - "> +\t\t.wai =3D ST_PRESS_LPS331AP_WAI_EXP,\n" - "> \t\t.sensors_supported =3D {\n" - "> \t\t\t[0] =3D LPS331AP_PRESS_DEV_NAME,\n" + "> -\t\t.wai = ST_PRESS_1_WAI_EXP,\n" + "> +\t\t.wai = ST_PRESS_LPS331AP_WAI_EXP,\n" + "> \t\t.sensors_supported = {\n" + "> \t\t\t[0] = LPS331AP_PRESS_DEV_NAME,\n" "> \t\t},\n" - "> \t\t.ch =3D (struct iio_chan_spec *)st_press_channels,\n" - "> \t\t.odr =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_ODR_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_ODR_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_ODR_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_ODR_MASK,\n" - "> \t\t\t.odr_avl =3D {\n" + "> \t\t.ch = (struct iio_chan_spec *)st_press_channels,\n" + "> \t\t.odr = {\n" + "> -\t\t\t.addr = ST_PRESS_1_ODR_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_ODR_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_ODR_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_ODR_MASK,\n" + "> \t\t\t.odr_avl = {\n" "> -\t\t\t\t{ 1, ST_PRESS_1_ODR_AVL_1HZ_VAL, },\n" "> -\t\t\t\t{ 7, ST_PRESS_1_ODR_AVL_7HZ_VAL, },\n" "> -\t\t\t\t{ 13, ST_PRESS_1_ODR_AVL_13HZ_VAL, },\n" @@ -128,47 +125,47 @@ "> +\t\t\t\t{ 25, ST_PRESS_LPS331AP_ODR_AVL_25HZ_VAL, },\n" "> \t\t\t},\n" "> \t\t},\n" - "> \t\t.pw =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_PW_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_PW_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_PW_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_PW_MASK,\n" - "> \t\t\t.value_on =3D ST_SENSORS_DEFAULT_POWER_ON_VALUE,\n" - "> \t\t\t.value_off =3D ST_SENSORS_DEFAULT_POWER_OFF_VALUE,\n" + "> \t\t.pw = {\n" + "> -\t\t\t.addr = ST_PRESS_1_PW_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_PW_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_PW_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_PW_MASK,\n" + "> \t\t\t.value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,\n" + "> \t\t\t.value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,\n" "> \t\t},\n" - "> \t\t.fs =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_FS_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_FS_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_FS_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_FS_MASK,\n" - "> \t\t\t.fs_avl =3D {\n" - "> \t\t\t\t[0] =3D {\n" - "> \t\t\t\t\t.num =3D ST_PRESS_FS_AVL_1260MB,\n" - "> -\t\t\t\t\t.value =3D ST_PRESS_1_FS_AVL_1260_VAL,\n" - "> -\t\t\t\t\t.gain =3D ST_PRESS_1_FS_AVL_1260_GAIN,\n" - "> -\t\t\t\t\t.gain2 =3D ST_PRESS_1_FS_AVL_TEMP_GAIN,\n" - "> +\t\t\t\t\t.value =3D ST_PRESS_LPS331AP_FS_AVL_1260_VAL,\n" - "> +\t\t\t\t\t.gain =3D ST_PRESS_LPS331AP_FS_AVL_1260_GAIN,\n" - "> +\t\t\t\t\t.gain2 =3D ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN,\n" + "> \t\t.fs = {\n" + "> -\t\t\t.addr = ST_PRESS_1_FS_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_FS_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_FS_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_FS_MASK,\n" + "> \t\t\t.fs_avl = {\n" + "> \t\t\t\t[0] = {\n" + "> \t\t\t\t\t.num = ST_PRESS_FS_AVL_1260MB,\n" + "> -\t\t\t\t\t.value = ST_PRESS_1_FS_AVL_1260_VAL,\n" + "> -\t\t\t\t\t.gain = ST_PRESS_1_FS_AVL_1260_GAIN,\n" + "> -\t\t\t\t\t.gain2 = ST_PRESS_1_FS_AVL_TEMP_GAIN,\n" + "> +\t\t\t\t\t.value = ST_PRESS_LPS331AP_FS_AVL_1260_VAL,\n" + "> +\t\t\t\t\t.gain = ST_PRESS_LPS331AP_FS_AVL_1260_GAIN,\n" + "> +\t\t\t\t\t.gain2 = ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN,\n" "> \t\t\t\t},\n" "> \t\t\t},\n" "> \t\t},\n" - "> \t\t.bdu =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_BDU_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_BDU_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_BDU_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_BDU_MASK,\n" + "> \t\t.bdu = {\n" + "> -\t\t\t.addr = ST_PRESS_1_BDU_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_BDU_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_BDU_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_BDU_MASK,\n" "> \t\t},\n" - "> \t\t.drdy_irq =3D {\n" - "> -\t\t\t.addr =3D ST_PRESS_1_DRDY_IRQ_ADDR,\n" - "> -\t\t\t.mask =3D ST_PRESS_1_DRDY_IRQ_MASK,\n" - "> +\t\t\t.addr =3D ST_PRESS_LPS331AP_DRDY_IRQ_ADDR,\n" - "> +\t\t\t.mask =3D ST_PRESS_LPS331AP_DRDY_IRQ_MASK,\n" + "> \t\t.drdy_irq = {\n" + "> -\t\t\t.addr = ST_PRESS_1_DRDY_IRQ_ADDR,\n" + "> -\t\t\t.mask = ST_PRESS_1_DRDY_IRQ_MASK,\n" + "> +\t\t\t.addr = ST_PRESS_LPS331AP_DRDY_IRQ_ADDR,\n" + "> +\t\t\t.mask = ST_PRESS_LPS331AP_DRDY_IRQ_MASK,\n" "> \t\t},\n" - "> -\t\t.multi_read_bit =3D ST_PRESS_1_MULTIREAD_BIT,\n" - "> +\t\t.multi_read_bit =3D ST_PRESS_LPS331AP_MULTIREAD_BIT,\n" - "> \t\t.bootime =3D 2,\n" + "> -\t\t.multi_read_bit = ST_PRESS_1_MULTIREAD_BIT,\n" + "> +\t\t.multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT,\n" + "> \t\t.bootime = 2,\n" "> \t},\n" > }; -a4f22a3f3cebf670917d8a2d4e10754950083aa3c0936674bb1c87d3eb772380 +4cd3c082ec000cd8499d5f3616143ac672b77f8c33333ff65228965aad357274
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.