* [PATCH v4 00/20] iio: ST clean-ups and new sensor support
@ 2013-09-16 16:02 Lee Jones
2013-09-16 16:02 ` [PATCH 01/20] ARM: ux500: Remove PrimeCell IDs from Nomadik I2C DT nodes Lee Jones
` (19 more replies)
0 siblings, 20 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi Jonathan,
Hopefully I've covered all of your points in this new set.
This patch-set includes a few clean-ups surrounding error handling and
non-mandatory functionality along with regulator support and the addition
of a new pressure/temperature sensor (LPS001WP).
Everything has been tested with Device Tree.
v2:
- Rebased onto Linux -next as requested by Jonathan
- Reworked clean-up patch to address Jonathan's concerns
- Added binding document (inc regulators)
- Extended regulator support in the driver
- Re-worked Data Ready pin handling
v3:
- Standardise sensor names: <model>_<sensor-type>
- Added error handling clean-ups
- More binding documents; for magn, accel and gyro
- Message on successful sensor bring-up; for press, magn, accel and gyro
- More device enablement for ux500 by way of CONFIGs
- New neat reorder/grouping of patches
v4:
- Remove "registered" prints
- Remove *_<dev_name> appends
- Fix patch mangle
- CC DT ML on bindings
- Realisation that we're using a different Accel & Magn chip
- Move (irq > 0) back into the error path
- Squash CONFIG enablement into one patch
Documentation/devicetree/bindings/iio/accel/lsm303dlhc.txt | 21 +++++++++++++
Documentation/devicetree/bindings/iio/gyro/l3g4200d.txt | 21 +++++++++++++
Documentation/devicetree/bindings/iio/magnetometer/lsm303dlhc.txt | 21 +++++++++++++
Documentation/devicetree/bindings/iio/pressure/lps001wp.txt | 21 +++++++++++++
arch/arm/boot/dts/ste-dbx5x0.dtsi | 5 ----
arch/arm/boot/dts/ste-snowball.dts | 34 +++++++++++++++++++++
arch/arm/configs/u8500_defconfig | 5 ++++
drivers/iio/accel/st_accel_core.c | 19 ++++++------
drivers/iio/common/st_sensors/st_sensors_core.c | 50 ++++++++++++++++++-------------
drivers/iio/gyro/st_gyro_core.c | 19 ++++++------
drivers/iio/magnetometer/st_magn_core.c | 19 ++++++------
drivers/iio/pressure/st_pressure.h | 1 +
drivers/iio/pressure/st_pressure_core.c | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
drivers/iio/pressure/st_pressure_i2c.c | 1 +
include/linux/iio/common/st_sensors.h | 5 ++++
15 files changed, 329 insertions(+), 67 deletions(-)
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 01/20] ARM: ux500: Remove PrimeCell IDs from Nomadik I2C DT nodes
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 02/20] ARM: ux500: Enable the LPS001WP Pressure & Temperature sensor from DT Lee Jones
` (18 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Turns out that they're actually not required and the driver probes just
fine without them. The ID is incorrect at the moment anyway. They actually
currently specify the stn8815.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/ste-dbx5x0.dtsi | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index a152945..9c01d66 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -531,7 +531,6 @@
compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
reg = <0x80004000 0x1000>;
interrupts = <0 21 IRQ_TYPE_LEVEL_HIGH>;
- arm,primecell-periphid = <0x180024>;
#address-cells = <1>;
#size-cells = <0>;
@@ -544,7 +543,6 @@
compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
reg = <0x80122000 0x1000>;
interrupts = <0 22 IRQ_TYPE_LEVEL_HIGH>;
- arm,primecell-periphid = <0x180024>;
#address-cells = <1>;
#size-cells = <0>;
@@ -557,7 +555,6 @@
compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
reg = <0x80128000 0x1000>;
interrupts = <0 55 IRQ_TYPE_LEVEL_HIGH>;
- arm,primecell-periphid = <0x180024>;
#address-cells = <1>;
#size-cells = <0>;
@@ -570,7 +567,6 @@
compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
reg = <0x80110000 0x1000>;
interrupts = <0 12 IRQ_TYPE_LEVEL_HIGH>;
- arm,primecell-periphid = <0x180024>;
#address-cells = <1>;
#size-cells = <0>;
@@ -583,7 +579,6 @@
compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
reg = <0x8012a000 0x1000>;
interrupts = <0 51 IRQ_TYPE_LEVEL_HIGH>;
- arm,primecell-periphid = <0x180024>;
#address-cells = <1>;
#size-cells = <0>;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 02/20] ARM: ux500: Enable the LPS001WP Pressure & Temperature sensor from DT
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
2013-09-16 16:02 ` [PATCH 01/20] ARM: ux500: Remove PrimeCell IDs from Nomadik I2C DT nodes Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 03/20] ARM: ux500: Enable the LSM303DLH Accelerator " Lee Jones
` (17 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
After applying this node the LPS001WP sensor chip should probe
successfully once the driver support has also been applied.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/ste-snowball.dts | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index 49824be..ab173eb 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -153,6 +153,16 @@
status = "okay";
};
+ i2c at 80128000 {
+ lps001wp at 5c {
+ compatible = "st,lps001wp";
+ reg = <0x5c>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
+ };
+
uart at 80120000 {
status = "okay";
};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 03/20] ARM: ux500: Enable the LSM303DLH Accelerator sensor from DT
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
2013-09-16 16:02 ` [PATCH 01/20] ARM: ux500: Remove PrimeCell IDs from Nomadik I2C DT nodes Lee Jones
2013-09-16 16:02 ` [PATCH 02/20] ARM: ux500: Enable the LPS001WP Pressure & Temperature sensor from DT Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 04/20] ARM: ux500: Enable the LSM303DLH Magnetometer " Lee Jones
` (16 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
After applying this node the LSM303DLH sensor chip should probe
successfully once the driver support has also been applied.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/ste-snowball.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index ab173eb..61b33a0 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -161,6 +161,14 @@
vdd-supply = <&ab8500_ldo_aux1_reg>;
vddio-supply = <&db8500_vsmps2_reg>;
};
+
+ lsm303dlhc_accel at 19 {
+ compatible = "st,lsm303dlhc_accel";
+ reg = <0x19>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
};
uart at 80120000 {
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 04/20] ARM: ux500: Enable the LSM303DLH Magnetometer sensor from DT
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (2 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 03/20] ARM: ux500: Enable the LSM303DLH Accelerator " Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 05/20] ARM: ux500: Enable the L3G4200D Gyroscope " Lee Jones
` (15 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
After applying this node the LSM303DLH sensor chip should probe
successfully once the driver support has also been applied.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/ste-snowball.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index 61b33a0..b851713 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -169,6 +169,14 @@
vdd-supply = <&ab8500_ldo_aux1_reg>;
vddio-supply = <&db8500_vsmps2_reg>;
};
+
+ lsm303dlhc_magn at 1e {
+ compatible = "st,lsm303dlhc_magn";
+ reg = <0x1e>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
};
uart at 80120000 {
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 05/20] ARM: ux500: Enable the L3G4200D Gyroscope sensor from DT
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (3 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 04/20] ARM: ux500: Enable the LSM303DLH Magnetometer " Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 06/20] ARM: ux500: CONFIG: Enable ST's IIO Sensors by default Lee Jones
` (14 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
After applying this node the L3G4200D sensor chip should probe
successfully once the driver support has also been applied.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/ste-snowball.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index b851713..7bc157f 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -162,6 +162,14 @@
vddio-supply = <&db8500_vsmps2_reg>;
};
+ l3g4200d at 68 {
+ compatible = "st,l3g4200d";
+ reg = <0x68>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
+
lsm303dlhc_accel at 19 {
compatible = "st,lsm303dlhc_accel";
reg = <0x19>;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 06/20] ARM: ux500: CONFIG: Enable ST's IIO Sensors by default
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (4 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 05/20] ARM: ux500: Enable the L3G4200D Gyroscope " Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP Lee Jones
` (13 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
These include; Pressure, Accelerometer, Magnetometer and Gyroscope Sensors
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/configs/u8500_defconfig | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index a0025dc..aaa6c0a 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -37,6 +37,11 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
CONFIG_SENSORS_BH1780=y
+CONFIG_IIO=y
+CONFIG_IIO_ST_PRESS=y
+CONFIG_IIO_ST_ACCEL_3AXIS=y
+CONFIG_IIO_ST_MAGN_3AXIS=y
+CONFIG_IIO_ST_GYRO_3AXIS=y
CONFIG_NETDEVICES=y
CONFIG_SMSC911X=y
CONFIG_SMSC_PHY=y
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (5 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 06/20] ARM: ux500: CONFIG: Enable ST's IIO Sensors by default Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-10-01 21:09 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 08/20] Documentation: dt: iio: Add binding for LSM303DLH - Accel Lee Jones
` (12 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
LPS001WP is a Pressure and Temperature sensor.
Cc: devicetree at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
.../devicetree/bindings/iio/pressure/lps001wp.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
diff --git a/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt b/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
new file mode 100644
index 0000000..45cb45c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
@@ -0,0 +1,21 @@
+* STMicroelectronics Pressure Sensor
+
+Required properties:
+ - compatible: Should be "st,lps001wp"
+ - reg: The I2C address of the sensor
+
+Optional properties:
+ - vdd-supply: Phandle to the Vdd supply regulator
+ - vddio-supply: Phandle to the Vdd-IO supply regulator
+
+Example:
+
+i2c at 80128000 {
+ lps001wp at 5c {
+ compatible = "st,lps001wp";
+ reg = <0x5c>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
+};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 08/20] Documentation: dt: iio: Add binding for LSM303DLH - Accel
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (6 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 09/20] Documentation: dt: iio: Add binding for L3G4200D Lee Jones
` (11 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
LSM303DLH is a Accelerometer Sensor
Cc: devicetree at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
.../devicetree/bindings/iio/accel/lsm303dlhc.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/accel/lsm303dlhc.txt
diff --git a/Documentation/devicetree/bindings/iio/accel/lsm303dlhc.txt b/Documentation/devicetree/bindings/iio/accel/lsm303dlhc.txt
new file mode 100644
index 0000000..5a5101a
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/lsm303dlhc.txt
@@ -0,0 +1,21 @@
+* STMicroelectronics Accelerometer Sensor
+
+Required properties:
+ - compatible: Should be "st,lsm303dlhc_accel"
+ - reg: The I2C address of the sensor
+
+Optional properties:
+ - vdd-supply: Phandle to the Vdd supply regulator
+ - vddio-supply: Phandle to the Vdd-IO supply regulator
+
+Example:
+
+i2c at 80128000 {
+ lsm303dlhc_accel at 19 {
+ compatible = "st,lsm303dlhc_accel";
+ reg = <0x19>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
+};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 09/20] Documentation: dt: iio: Add binding for L3G4200D
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (7 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 08/20] Documentation: dt: iio: Add binding for LSM303DLH - Accel Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 10/20] Documentation: dt: iio: Add binding for LSM303DLH - Magn Lee Jones
` (10 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
L3G4200D is a Gyroscope Sensor
Cc: devicetree at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
.../devicetree/bindings/iio/gyro/l3g4200d.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/gyro/l3g4200d.txt
diff --git a/Documentation/devicetree/bindings/iio/gyro/l3g4200d.txt b/Documentation/devicetree/bindings/iio/gyro/l3g4200d.txt
new file mode 100644
index 0000000..3ca2b9c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/gyro/l3g4200d.txt
@@ -0,0 +1,21 @@
+* STMicroelectronics Gyroscope Sensor
+
+Required properties:
+ - compatible: Should be "st,l3g4200d"
+ - reg: The I2C address of the sensor
+
+Optional properties:
+ - vdd-supply: Phandle to the Vdd supply regulator
+ - vddio-supply: Phandle to the Vdd-IO supply regulator
+
+Example:
+
+i2c at 80128000 {
+ l3g4200d at 68 {
+ compatible = "st,l3g4200d";
+ reg = <0x68>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
+};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 10/20] Documentation: dt: iio: Add binding for LSM303DLH - Magn
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (8 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 09/20] Documentation: dt: iio: Add binding for L3G4200D Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-16 16:02 ` [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin Lee Jones
` (9 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
LSM303DLH is a Magnetometer Sensor
Cc: devicetree at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
.../bindings/iio/magnetometer/lsm303dlhc.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/lsm303dlhc.txt
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/lsm303dlhc.txt b/Documentation/devicetree/bindings/iio/magnetometer/lsm303dlhc.txt
new file mode 100644
index 0000000..2ad49c7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/magnetometer/lsm303dlhc.txt
@@ -0,0 +1,21 @@
+* STMicroelectronics Magnetometer Sensor
+
+Required properties:
+ - compatible: Should be "st,lsm303dlhc_magn"
+ - reg: The I2C address of the sensor
+
+Optional properties:
+ - vdd-supply: Phandle to the Vdd supply regulator
+ - vddio-supply: Phandle to the Vdd-IO supply regulator
+
+Example:
+
+i2c at 80128000 {
+ lsm303dlhc_magn at 1e {
+ compatible = "st,lsm303dlhc_magn";
+ reg = <0x1e>;
+
+ vdd-supply = <&ab8500_ldo_aux1_reg>;
+ vddio-supply = <&db8500_vsmps2_reg>;
+ };
+};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (9 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 10/20] Documentation: dt: iio: Add binding for LSM303DLH - Magn Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:51 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 12/20] iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor() Lee Jones
` (8 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Not all ST's sensors support data ready, so let's make the declaration
of one conditional.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/common/st_sensors/st_sensors_core.c | 33 ++++++++++++++++---------
drivers/iio/pressure/st_pressure_core.c | 3 ++-
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 793136a..2672630 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -198,21 +198,17 @@ int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable)
}
EXPORT_SYMBOL(st_sensors_set_axis_enable);
-int st_sensors_init_sensor(struct iio_dev *indio_dev,
- struct st_sensors_platform_data *pdata)
+int st_sensors_set_drdy_int_pin(struct iio_dev *indio_dev,
+ struct st_sensors_platform_data *pdata)
{
- int err;
struct st_sensor_data *sdata = iio_priv(indio_dev);
- mutex_init(&sdata->tb.buf_lock);
-
switch (pdata->drdy_int_pin) {
case 1:
if (sdata->sensor->drdy_irq.mask_int1 == 0) {
dev_err(&indio_dev->dev,
"DRDY on INT1 not available.\n");
- err = -EINVAL;
- goto init_error;
+ return -EINVAL;
}
sdata->drdy_int_pin = 1;
break;
@@ -220,17 +216,29 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
if (sdata->sensor->drdy_irq.mask_int2 == 0) {
dev_err(&indio_dev->dev,
"DRDY on INT2 not available.\n");
- err = -EINVAL;
- goto init_error;
+ return -EINVAL;
}
sdata->drdy_int_pin = 2;
break;
default:
dev_err(&indio_dev->dev, "DRDY on pdata not valid.\n");
- err = -EINVAL;
- goto init_error;
+ return -EINVAL;
}
+ return 0;
+}
+
+int st_sensors_init_sensor(struct iio_dev *indio_dev,
+ struct st_sensors_platform_data *pdata)
+{
+ struct st_sensor_data *sdata = iio_priv(indio_dev);
+ int err = 0;
+
+ mutex_init(&sdata->tb.buf_lock);
+
+ if (pdata)
+ err = st_sensors_set_drdy_int_pin(indio_dev, pdata);
+
err = st_sensors_set_enable(indio_dev, false);
if (err < 0)
goto init_error;
@@ -266,6 +274,9 @@ int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable)
u8 drdy_mask;
struct st_sensor_data *sdata = iio_priv(indio_dev);
+ if (!sdata->sensor->drdy_irq.addr)
+ return 0;
+
/* Enable/Disable the interrupt generator 1. */
if (sdata->sensor->drdy_irq.ig1.en_addr > 0) {
err = st_sensors_write_data_with_mask(indio_dev,
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 93bff9b..3abada2 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -254,7 +254,8 @@ int st_press_common_probe(struct iio_dev *indio_dev,
pdata->odr = pdata->sensor->odr.odr_avl[0].hz;
- if (!plat_data)
+ /* Some devices don't support a data ready pin. */
+ if (!plat_data && pdata->sensor->drdy_irq.addr)
plat_data =
(struct st_sensors_platform_data *)&default_press_pdata;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 12/20] iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor()
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (10 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:51 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 13/20] iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data() Lee Jones
` (7 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Strip out all those unnecessary gotos and just return the error right away.
Aids to simplicity and reduces code.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/common/st_sensors/st_sensors_core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 2672630..c5fbe58 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -241,29 +241,28 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
err = st_sensors_set_enable(indio_dev, false);
if (err < 0)
- goto init_error;
+ return err;
if (sdata->current_fullscale) {
err = st_sensors_set_fullscale(indio_dev,
sdata->current_fullscale->num);
if (err < 0)
- goto init_error;
+ return err;
} else
dev_info(&indio_dev->dev, "Full-scale not possible\n");
err = st_sensors_set_odr(indio_dev, sdata->odr);
if (err < 0)
- goto init_error;
+ return err;
/* set BDU */
err = st_sensors_write_data_with_mask(indio_dev,
sdata->sensor->bdu.addr, sdata->sensor->bdu.mask, true);
if (err < 0)
- goto init_error;
+ return err;
err = st_sensors_set_axis_enable(indio_dev, ST_SENSORS_ENABLE_ALL_AXIS);
-init_error:
return err;
}
EXPORT_SYMBOL(st_sensors_init_sensor);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 13/20] iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data()
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (11 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 12/20] iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor() Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:52 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 14/20] iio: pressure-core: st: Clean-up probe() function Lee Jones
` (6 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Gets rid of those unnecessary gotos.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/common/st_sensors/st_sensors_core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index c5fbe58..76e573b 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -331,10 +331,8 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
unsigned int byte_for_channel = ch->scan_type.storagebits >> 3;
outdata = kmalloc(byte_for_channel, GFP_KERNEL);
- if (!outdata) {
- err = -EINVAL;
- goto st_sensors_read_axis_data_error;
- }
+ if (!outdata)
+ return -ENOMEM;
err = sdata->tf->read_multiple_byte(&sdata->tb, sdata->dev,
ch->address, byte_for_channel,
@@ -349,7 +347,7 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
st_sensors_free_memory:
kfree(outdata);
-st_sensors_read_axis_data_error:
+
return err;
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 14/20] iio: pressure-core: st: Clean-up probe() function
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (12 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 13/20] iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data() Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:52 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 15/20] iio: pressure: st: Add support for new LPS001WP pressure sensor Lee Jones
` (5 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
This patch contains some pretty basic clean-ups in probe() pertaining to
the simplification of error handling and a couple of readability adaptions.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/pressure/st_pressure_core.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 3abada2..4539953 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -232,21 +232,23 @@ static const struct iio_trigger_ops st_press_trigger_ops = {
int st_press_common_probe(struct iio_dev *indio_dev,
struct st_sensors_platform_data *plat_data)
{
- int err;
struct st_sensor_data *pdata = iio_priv(indio_dev);
+ int irq = pdata->get_irq_data_ready(indio_dev);
+ int err;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &press_info;
err = st_sensors_check_device_support(indio_dev,
- ARRAY_SIZE(st_press_sensors), st_press_sensors);
+ ARRAY_SIZE(st_press_sensors),
+ st_press_sensors);
if (err < 0)
- goto st_press_common_probe_error;
+ return err;
pdata->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS;
- pdata->multiread_bit = pdata->sensor->multi_read_bit;
- indio_dev->channels = pdata->sensor->ch;
- indio_dev->num_channels = pdata->sensor->num_ch;
+ pdata->multiread_bit = pdata->sensor->multi_read_bit;
+ indio_dev->channels = pdata->sensor->ch;
+ indio_dev->num_channels = pdata->sensor->num_ch;
if (pdata->sensor->fs.addr != 0)
pdata->current_fullscale = (struct st_sensor_fullscale_avl *)
@@ -261,15 +263,15 @@ int st_press_common_probe(struct iio_dev *indio_dev,
err = st_sensors_init_sensor(indio_dev, plat_data);
if (err < 0)
- goto st_press_common_probe_error;
+ return err;
- if (pdata->get_irq_data_ready(indio_dev) > 0) {
+ if (irq > 0) {
err = st_press_allocate_ring(indio_dev);
if (err < 0)
- goto st_press_common_probe_error;
+ return err;
err = st_sensors_allocate_trigger(indio_dev,
- ST_PRESS_TRIGGER_OPS);
+ ST_PRESS_TRIGGER_OPS);
if (err < 0)
goto st_press_probe_trigger_error;
}
@@ -281,12 +283,12 @@ int st_press_common_probe(struct iio_dev *indio_dev,
return err;
st_press_device_register_error:
- if (pdata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_sensors_deallocate_trigger(indio_dev);
st_press_probe_trigger_error:
- if (pdata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_press_deallocate_ring(indio_dev);
-st_press_common_probe_error:
+
return err;
}
EXPORT_SYMBOL(st_press_common_probe);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 15/20] iio: pressure: st: Add support for new LPS001WP pressure sensor
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (13 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 14/20] iio: pressure-core: st: Clean-up probe() function Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:53 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply Lee Jones
` (4 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Here we use existing practices to introduce support for another
pressure/temperature sensor, the LPS001WP.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/pressure/st_pressure.h | 1 +
drivers/iio/pressure/st_pressure_core.c | 84 +++++++++++++++++++++++++++++++++
drivers/iio/pressure/st_pressure_i2c.c | 1 +
3 files changed, 86 insertions(+)
diff --git a/drivers/iio/pressure/st_pressure.h b/drivers/iio/pressure/st_pressure.h
index b0b6306..049c21a 100644
--- a/drivers/iio/pressure/st_pressure.h
+++ b/drivers/iio/pressure/st_pressure.h
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/iio/common/st_sensors.h>
+#define LPS001WP_PRESS_DEV_NAME "lps001wp"
#define LPS331AP_PRESS_DEV_NAME "lps331ap"
/**
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 4539953..e879542 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -64,6 +64,21 @@
#define ST_PRESS_LPS331AP_OUT_XL_ADDR 0x28
#define ST_TEMP_LPS331AP_OUT_L_ADDR 0x2b
+/* CUSTOM VALUES FOR LPS001WP SENSOR */
+#define ST_PRESS_LPS001WP_WAI_EXP 0xba
+#define ST_PRESS_LPS001WP_ODR_ADDR 0x20
+#define ST_PRESS_LPS001WP_ODR_MASK 0x30
+#define ST_PRESS_LPS001WP_ODR_AVL_1HZ_VAL 0x01
+#define ST_PRESS_LPS001WP_ODR_AVL_7HZ_VAL 0x02
+#define ST_PRESS_LPS001WP_ODR_AVL_13HZ_VAL 0x03
+#define ST_PRESS_LPS001WP_PW_ADDR 0x20
+#define ST_PRESS_LPS001WP_PW_MASK 0x40
+#define ST_PRESS_LPS001WP_BDU_ADDR 0x20
+#define ST_PRESS_LPS001WP_BDU_MASK 0x04
+#define ST_PRESS_LPS001WP_MULTIREAD_BIT true
+#define ST_PRESS_LPS001WP_OUT_L_ADDR 0x28
+#define ST_TEMP_LPS001WP_OUT_L_ADDR 0x2a
+
static const struct iio_chan_spec st_press_lps331ap_channels[] = {
{
.type = IIO_PRESSURE,
@@ -100,6 +115,40 @@ static const struct iio_chan_spec st_press_lps331ap_channels[] = {
IIO_CHAN_SOFT_TIMESTAMP(1)
};
+static const struct iio_chan_spec st_press_lps001wp_channels[] = {
+ {
+ .type = IIO_PRESSURE,
+ .channel2 = IIO_NO_MOD,
+ .address = ST_PRESS_LPS001WP_OUT_L_ADDR,
+ .scan_index = ST_SENSORS_SCAN_X,
+ .scan_type = {
+ .sign = 'u',
+ .realbits = 16,
+ .storagebits = 16,
+ .endianness = IIO_LE,
+ },
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+ .modified = 0,
+ },
+ {
+ .type = IIO_TEMP,
+ .channel2 = IIO_NO_MOD,
+ .address = ST_TEMP_LPS001WP_OUT_L_ADDR,
+ .scan_index = -1,
+ .scan_type = {
+ .sign = 'u',
+ .realbits = 16,
+ .storagebits = 16,
+ .endianness = IIO_LE,
+ },
+ .info_mask_separate =
+ BIT(IIO_CHAN_INFO_RAW) |
+ BIT(IIO_CHAN_INFO_OFFSET),
+ .modified = 0,
+ },
+ IIO_CHAN_SOFT_TIMESTAMP(1)
+};
+
static const struct st_sensors st_press_sensors[] = {
{
.wai = ST_PRESS_LPS331AP_WAI_EXP,
@@ -148,6 +197,41 @@ static const struct st_sensors st_press_sensors[] = {
.multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT,
.bootime = 2,
},
+ {
+ .wai = ST_PRESS_LPS001WP_WAI_EXP,
+ .sensors_supported = {
+ [0] = LPS001WP_PRESS_DEV_NAME,
+ },
+ .ch = (struct iio_chan_spec *)st_press_lps001wp_channels,
+ .num_ch = ARRAY_SIZE(st_press_lps001wp_channels),
+ .odr = {
+ .addr = ST_PRESS_LPS001WP_ODR_ADDR,
+ .mask = ST_PRESS_LPS001WP_ODR_MASK,
+ .odr_avl = {
+ { 1, ST_PRESS_LPS001WP_ODR_AVL_1HZ_VAL, },
+ { 7, ST_PRESS_LPS001WP_ODR_AVL_7HZ_VAL, },
+ { 13, ST_PRESS_LPS001WP_ODR_AVL_13HZ_VAL, },
+ },
+ },
+ .pw = {
+ .addr = ST_PRESS_LPS001WP_PW_ADDR,
+ .mask = ST_PRESS_LPS001WP_PW_MASK,
+ .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
+ .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
+ },
+ .fs = {
+ .addr = 0,
+ },
+ .bdu = {
+ .addr = ST_PRESS_LPS001WP_BDU_ADDR,
+ .mask = ST_PRESS_LPS001WP_BDU_MASK,
+ },
+ .drdy_irq = {
+ .addr = 0,
+ },
+ .multi_read_bit = ST_PRESS_LPS001WP_MULTIREAD_BIT,
+ .bootime = 2,
+ },
};
static int st_press_read_raw(struct iio_dev *indio_dev,
diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
index 08aac5e..51eab7f 100644
--- a/drivers/iio/pressure/st_pressure_i2c.c
+++ b/drivers/iio/pressure/st_pressure_i2c.c
@@ -49,6 +49,7 @@ static int st_press_i2c_remove(struct i2c_client *client)
}
static const struct i2c_device_id st_press_id_table[] = {
+ { LPS001WP_PRESS_DEV_NAME },
{ LPS331AP_PRESS_DEV_NAME },
{},
};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (14 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 15/20] iio: pressure: st: Add support for new LPS001WP pressure sensor Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 13:03 ` Jonathan Cameron
2013-09-23 19:18 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 17/20] iio: pressure-core: st: Provide support for the Vdd_IO " Lee Jones
` (3 subsequent siblings)
19 siblings, 2 replies; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
The power to some of the sensors are controlled by regulators. In most
cases these are 'always on', but if not they will fail to work until
the regulator is enabled using the relevant APIs. This patch allows for
the Vdd power supply to be specified by either platform data or Device
Tree.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/pressure/st_pressure_core.c | 28 ++++++++++++++++++++++++++++
include/linux/iio/common/st_sensors.h | 3 +++
2 files changed, 31 insertions(+)
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index e879542..c801c80 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -23,6 +23,7 @@
#include <linux/iio/sysfs.h>
#include <linux/iio/trigger.h>
#include <linux/iio/buffer.h>
+#include <linux/regulator/consumer.h>
#include <asm/unaligned.h>
#include <linux/iio/common/st_sensors.h>
@@ -313,6 +314,29 @@ static const struct iio_trigger_ops st_press_trigger_ops = {
#define ST_PRESS_TRIGGER_OPS NULL
#endif
+void st_press_power_enable(struct iio_dev *indio_dev)
+{
+ struct st_sensor_data *pdata = iio_priv(indio_dev);
+ int err;
+
+ /* Regulators not mandatory, but if requested we should enable it. */
+ pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd");
+ if (!IS_ERR(pdata->vdd)) {
+ err = regulator_enable(pdata->vdd);
+ if (err != 0)
+ dev_warn(&indio_dev->dev,
+ "Failed to enable specified Vdd supply\n");
+ }
+}
+
+void st_press_power_disable(struct iio_dev *indio_dev)
+{
+ struct st_sensor_data *pdata = iio_priv(indio_dev);
+
+ if (!IS_ERR(pdata->vdd))
+ regulator_disable(pdata->vdd);
+}
+
int st_press_common_probe(struct iio_dev *indio_dev,
struct st_sensors_platform_data *plat_data)
{
@@ -323,6 +347,8 @@ int st_press_common_probe(struct iio_dev *indio_dev,
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &press_info;
+ st_press_power_enable(indio_dev);
+
err = st_sensors_check_device_support(indio_dev,
ARRAY_SIZE(st_press_sensors),
st_press_sensors);
@@ -381,6 +407,8 @@ void st_press_common_remove(struct iio_dev *indio_dev)
{
struct st_sensor_data *pdata = iio_priv(indio_dev);
+ st_press_power_disable(indio_dev);
+
iio_device_unregister(indio_dev);
if (pdata->get_irq_data_ready(indio_dev) > 0) {
st_sensors_deallocate_trigger(indio_dev);
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index e732fda..968b84e 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -16,6 +16,7 @@
#include <linux/irqreturn.h>
#include <linux/iio/trigger.h>
#include <linux/bitops.h>
+#include <linux/regulator/consumer.h>
#include <linux/platform_data/st_sensors_pdata.h>
@@ -201,6 +202,7 @@ struct st_sensors {
* @trig: The trigger in use by the core driver.
* @sensor: Pointer to the current sensor struct in use.
* @current_fullscale: Maximum range of measure by the sensor.
+ * @vdd: Pointer to sensor's Vdd power supply
* @enabled: Status of the sensor (false->off, true->on).
* @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
* @buffer_data: Data used by buffer part.
@@ -216,6 +218,7 @@ struct st_sensor_data {
struct iio_trigger *trig;
struct st_sensors *sensor;
struct st_sensor_fullscale_avl *current_fullscale;
+ struct regulator *vdd;
bool enabled;
bool multiread_bit;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 17/20] iio: pressure-core: st: Provide support for the Vdd_IO power supply
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (15 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-23 19:19 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 18/20] iio: accel-core: st: Clean up error handling in probe() Lee Jones
` (2 subsequent siblings)
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
The power to some of the sensors are controlled by regulators. In most
cases these are 'always on', but if not they will fail to work until
the regulator is enabled using the relevant APIs. This patch allows for
the Vdd_IO power supply to be specified by either platform data or
Device Tree.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/pressure/st_pressure_core.c | 13 ++++++++++++-
include/linux/iio/common/st_sensors.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index c801c80..e3f3888 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -319,7 +319,7 @@ void st_press_power_enable(struct iio_dev *indio_dev)
struct st_sensor_data *pdata = iio_priv(indio_dev);
int err;
- /* Regulators not mandatory, but if requested we should enable it. */
+ /* Regulators not mandatory, but if requested we should enable them. */
pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd");
if (!IS_ERR(pdata->vdd)) {
err = regulator_enable(pdata->vdd);
@@ -327,6 +327,14 @@ void st_press_power_enable(struct iio_dev *indio_dev)
dev_warn(&indio_dev->dev,
"Failed to enable specified Vdd supply\n");
}
+
+ pdata->vdd_io = devm_regulator_get_optional(&indio_dev->dev, "vddio");
+ if (!IS_ERR(pdata->vdd_io)) {
+ err = regulator_enable(pdata->vdd_io);
+ if (err != 0)
+ dev_warn(&indio_dev->dev,
+ "Failed to enable specified Vdd_IO supply\n");
+ }
}
void st_press_power_disable(struct iio_dev *indio_dev)
@@ -335,6 +343,9 @@ void st_press_power_disable(struct iio_dev *indio_dev)
if (!IS_ERR(pdata->vdd))
regulator_disable(pdata->vdd);
+
+ if (!IS_ERR(pdata->vdd_io))
+ regulator_disable(pdata->vdd_io);
}
int st_press_common_probe(struct iio_dev *indio_dev,
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 968b84e..3c005eb 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -203,6 +203,7 @@ struct st_sensors {
* @sensor: Pointer to the current sensor struct in use.
* @current_fullscale: Maximum range of measure by the sensor.
* @vdd: Pointer to sensor's Vdd power supply
+ * @vdd_io: Pointer to sensor's Vdd-IO power supply
* @enabled: Status of the sensor (false->off, true->on).
* @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
* @buffer_data: Data used by buffer part.
@@ -219,6 +220,7 @@ struct st_sensor_data {
struct st_sensors *sensor;
struct st_sensor_fullscale_avl *current_fullscale;
struct regulator *vdd;
+ struct regulator *vdd_io;
bool enabled;
bool multiread_bit;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 18/20] iio: accel-core: st: Clean up error handling in probe()
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (16 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 17/20] iio: pressure-core: st: Provide support for the Vdd_IO " Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:56 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 19/20] iio: gyro-core: " Lee Jones
2013-09-16 16:02 ` [PATCH 20/20] iio: magn-core: " Lee Jones
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Reduce the amount of those unnecessary goto calls, as in most cases
we can simply return immediately. We also only call for the IRQ number
once and use that value throughout.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/accel/st_accel_core.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index 1458343..97172dd 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -452,8 +452,9 @@ static const struct iio_trigger_ops st_accel_trigger_ops = {
int st_accel_common_probe(struct iio_dev *indio_dev,
struct st_sensors_platform_data *plat_data)
{
- int err;
struct st_sensor_data *adata = iio_priv(indio_dev);
+ int irq = adata->get_irq_data_ready(indio_dev);
+ int err;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &accel_info;
@@ -461,7 +462,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
err = st_sensors_check_device_support(indio_dev,
ARRAY_SIZE(st_accel_sensors), st_accel_sensors);
if (err < 0)
- goto st_accel_common_probe_error;
+ return err;
adata->num_data_channels = ST_ACCEL_NUMBER_DATA_CHANNELS;
adata->multiread_bit = adata->sensor->multi_read_bit;
@@ -478,12 +479,12 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
err = st_sensors_init_sensor(indio_dev, plat_data);
if (err < 0)
- goto st_accel_common_probe_error;
+ return err;
- if (adata->get_irq_data_ready(indio_dev) > 0) {
+ if (irq > 0) {
err = st_accel_allocate_ring(indio_dev);
if (err < 0)
- goto st_accel_common_probe_error;
+ return err;
err = st_sensors_allocate_trigger(indio_dev,
ST_ACCEL_TRIGGER_OPS);
@@ -495,15 +496,15 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
if (err)
goto st_accel_device_register_error;
- return err;
+ return 0;
st_accel_device_register_error:
- if (adata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_sensors_deallocate_trigger(indio_dev);
st_accel_probe_trigger_error:
- if (adata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_accel_deallocate_ring(indio_dev);
-st_accel_common_probe_error:
+
return err;
}
EXPORT_SYMBOL(st_accel_common_probe);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 19/20] iio: gyro-core: st: Clean up error handling in probe()
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (17 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 18/20] iio: accel-core: st: Clean up error handling in probe() Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:57 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 20/20] iio: magn-core: " Lee Jones
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Reduce the amount of those unnecessary goto calls, as in most cases
we can simply return immediately. We also only call for the IRQ number
once and use that value throughout.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/gyro/st_gyro_core.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
index e13c2b0..9f80817 100644
--- a/drivers/iio/gyro/st_gyro_core.c
+++ b/drivers/iio/gyro/st_gyro_core.c
@@ -305,8 +305,9 @@ static const struct iio_trigger_ops st_gyro_trigger_ops = {
int st_gyro_common_probe(struct iio_dev *indio_dev,
struct st_sensors_platform_data *pdata)
{
- int err;
struct st_sensor_data *gdata = iio_priv(indio_dev);
+ int irq = gdata->get_irq_data_ready(indio_dev);
+ int err;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &gyro_info;
@@ -314,7 +315,7 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
err = st_sensors_check_device_support(indio_dev,
ARRAY_SIZE(st_gyro_sensors), st_gyro_sensors);
if (err < 0)
- goto st_gyro_common_probe_error;
+ return err;
gdata->num_data_channels = ST_GYRO_NUMBER_DATA_CHANNELS;
gdata->multiread_bit = gdata->sensor->multi_read_bit;
@@ -327,12 +328,12 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
err = st_sensors_init_sensor(indio_dev, pdata);
if (err < 0)
- goto st_gyro_common_probe_error;
+ return err;
- if (gdata->get_irq_data_ready(indio_dev) > 0) {
+ if (irq > 0) {
err = st_gyro_allocate_ring(indio_dev);
if (err < 0)
- goto st_gyro_common_probe_error;
+ return err;
err = st_sensors_allocate_trigger(indio_dev,
ST_GYRO_TRIGGER_OPS);
@@ -344,15 +345,15 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
if (err)
goto st_gyro_device_register_error;
- return err;
+ return 0;
st_gyro_device_register_error:
- if (gdata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_sensors_deallocate_trigger(indio_dev);
st_gyro_probe_trigger_error:
- if (gdata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_gyro_deallocate_ring(indio_dev);
-st_gyro_common_probe_error:
+
return err;
}
EXPORT_SYMBOL(st_gyro_common_probe);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 20/20] iio: magn-core: st: Clean up error handling in probe()
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
` (18 preceding siblings ...)
2013-09-16 16:02 ` [PATCH 19/20] iio: gyro-core: " Lee Jones
@ 2013-09-16 16:02 ` Lee Jones
2013-09-21 12:57 ` Jonathan Cameron
19 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2013-09-16 16:02 UTC (permalink / raw)
To: linux-arm-kernel
Reduce the amount of those unnecessary goto calls, as in most cases
we can simply return immediately. We also only call for the IRQ number
once and use that value throughout.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/iio/magnetometer/st_magn_core.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index e8d2849..729c71a 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -348,8 +348,9 @@ static const struct iio_info magn_info = {
int st_magn_common_probe(struct iio_dev *indio_dev,
struct st_sensors_platform_data *pdata)
{
- int err;
struct st_sensor_data *mdata = iio_priv(indio_dev);
+ int irq = mdata->get_irq_data_ready(indio_dev);
+ int err;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &magn_info;
@@ -357,7 +358,7 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
err = st_sensors_check_device_support(indio_dev,
ARRAY_SIZE(st_magn_sensors), st_magn_sensors);
if (err < 0)
- goto st_magn_common_probe_error;
+ return err;
mdata->num_data_channels = ST_MAGN_NUMBER_DATA_CHANNELS;
mdata->multiread_bit = mdata->sensor->multi_read_bit;
@@ -370,12 +371,12 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
err = st_sensors_init_sensor(indio_dev, pdata);
if (err < 0)
- goto st_magn_common_probe_error;
+ return err;
- if (mdata->get_irq_data_ready(indio_dev) > 0) {
+ if (irq > 0) {
err = st_magn_allocate_ring(indio_dev);
if (err < 0)
- goto st_magn_common_probe_error;
+ return err;
err = st_sensors_allocate_trigger(indio_dev, NULL);
if (err < 0)
goto st_magn_probe_trigger_error;
@@ -385,15 +386,15 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
if (err)
goto st_magn_device_register_error;
- return err;
+ return 0;
st_magn_device_register_error:
- if (mdata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_sensors_deallocate_trigger(indio_dev);
st_magn_probe_trigger_error:
- if (mdata->get_irq_data_ready(indio_dev) > 0)
+ if (irq > 0)
st_magn_deallocate_ring(indio_dev);
-st_magn_common_probe_error:
+
return err;
}
EXPORT_SYMBOL(st_magn_common_probe);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin
2013-09-16 16:02 ` [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin Lee Jones
@ 2013-09-21 12:51 ` Jonathan Cameron
2013-09-21 13:07 ` Jonathan Cameron
0 siblings, 1 reply; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:51 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Not all ST's sensors support data ready, so let's make the declaration
> of one conditional.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks Lee
> ---
> drivers/iio/common/st_sensors/st_sensors_core.c | 33 ++++++++++++++++---------
> drivers/iio/pressure/st_pressure_core.c | 3 ++-
> 2 files changed, 24 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index 793136a..2672630 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -198,21 +198,17 @@ int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable)
> }
> EXPORT_SYMBOL(st_sensors_set_axis_enable);
>
> -int st_sensors_init_sensor(struct iio_dev *indio_dev,
> - struct st_sensors_platform_data *pdata)
> +int st_sensors_set_drdy_int_pin(struct iio_dev *indio_dev,
> + struct st_sensors_platform_data *pdata)
> {
> - int err;
> struct st_sensor_data *sdata = iio_priv(indio_dev);
>
> - mutex_init(&sdata->tb.buf_lock);
> -
> switch (pdata->drdy_int_pin) {
> case 1:
> if (sdata->sensor->drdy_irq.mask_int1 == 0) {
> dev_err(&indio_dev->dev,
> "DRDY on INT1 not available.\n");
> - err = -EINVAL;
> - goto init_error;
> + return -EINVAL;
> }
> sdata->drdy_int_pin = 1;
> break;
> @@ -220,17 +216,29 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
> if (sdata->sensor->drdy_irq.mask_int2 == 0) {
> dev_err(&indio_dev->dev,
> "DRDY on INT2 not available.\n");
> - err = -EINVAL;
> - goto init_error;
> + return -EINVAL;
> }
> sdata->drdy_int_pin = 2;
> break;
> default:
> dev_err(&indio_dev->dev, "DRDY on pdata not valid.\n");
> - err = -EINVAL;
> - goto init_error;
> + return -EINVAL;
> }
>
> + return 0;
> +}
> +
> +int st_sensors_init_sensor(struct iio_dev *indio_dev,
> + struct st_sensors_platform_data *pdata)
> +{
> + struct st_sensor_data *sdata = iio_priv(indio_dev);
> + int err = 0;
> +
> + mutex_init(&sdata->tb.buf_lock);
> +
> + if (pdata)
> + err = st_sensors_set_drdy_int_pin(indio_dev, pdata);
> +
> err = st_sensors_set_enable(indio_dev, false);
> if (err < 0)
> goto init_error;
> @@ -266,6 +274,9 @@ int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable)
> u8 drdy_mask;
> struct st_sensor_data *sdata = iio_priv(indio_dev);
>
> + if (!sdata->sensor->drdy_irq.addr)
> + return 0;
> +
> /* Enable/Disable the interrupt generator 1. */
> if (sdata->sensor->drdy_irq.ig1.en_addr > 0) {
> err = st_sensors_write_data_with_mask(indio_dev,
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index 93bff9b..3abada2 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -254,7 +254,8 @@ int st_press_common_probe(struct iio_dev *indio_dev,
>
> pdata->odr = pdata->sensor->odr.odr_avl[0].hz;
>
> - if (!plat_data)
> + /* Some devices don't support a data ready pin. */
> + if (!plat_data && pdata->sensor->drdy_irq.addr)
> plat_data =
> (struct st_sensors_platform_data *)&default_press_pdata;
>
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 12/20] iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor()
2013-09-16 16:02 ` [PATCH 12/20] iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor() Lee Jones
@ 2013-09-21 12:51 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:51 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Strip out all those unnecessary gotos and just return the error right away.
>
> Aids to simplicity and reduces code.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks
> ---
> drivers/iio/common/st_sensors/st_sensors_core.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index 2672630..c5fbe58 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -241,29 +241,28 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
>
> err = st_sensors_set_enable(indio_dev, false);
> if (err < 0)
> - goto init_error;
> + return err;
>
> if (sdata->current_fullscale) {
> err = st_sensors_set_fullscale(indio_dev,
> sdata->current_fullscale->num);
> if (err < 0)
> - goto init_error;
> + return err;
> } else
> dev_info(&indio_dev->dev, "Full-scale not possible\n");
>
> err = st_sensors_set_odr(indio_dev, sdata->odr);
> if (err < 0)
> - goto init_error;
> + return err;
>
> /* set BDU */
> err = st_sensors_write_data_with_mask(indio_dev,
> sdata->sensor->bdu.addr, sdata->sensor->bdu.mask, true);
> if (err < 0)
> - goto init_error;
> + return err;
>
> err = st_sensors_set_axis_enable(indio_dev, ST_SENSORS_ENABLE_ALL_AXIS);
>
> -init_error:
> return err;
> }
> EXPORT_SYMBOL(st_sensors_init_sensor);
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 13/20] iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data()
2013-09-16 16:02 ` [PATCH 13/20] iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data() Lee Jones
@ 2013-09-21 12:52 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:52 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Gets rid of those unnecessary gotos.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks Lee.
> ---
> drivers/iio/common/st_sensors/st_sensors_core.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index c5fbe58..76e573b 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -331,10 +331,8 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
> unsigned int byte_for_channel = ch->scan_type.storagebits >> 3;
>
> outdata = kmalloc(byte_for_channel, GFP_KERNEL);
> - if (!outdata) {
> - err = -EINVAL;
> - goto st_sensors_read_axis_data_error;
> - }
> + if (!outdata)
> + return -ENOMEM;
>
> err = sdata->tf->read_multiple_byte(&sdata->tb, sdata->dev,
> ch->address, byte_for_channel,
> @@ -349,7 +347,7 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
>
> st_sensors_free_memory:
> kfree(outdata);
> -st_sensors_read_axis_data_error:
> +
> return err;
> }
>
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 14/20] iio: pressure-core: st: Clean-up probe() function
2013-09-16 16:02 ` [PATCH 14/20] iio: pressure-core: st: Clean-up probe() function Lee Jones
@ 2013-09-21 12:52 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:52 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> This patch contains some pretty basic clean-ups in probe() pertaining to
> the simplification of error handling and a couple of readability adaptions.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks Lee,
> ---
> drivers/iio/pressure/st_pressure_core.c | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index 3abada2..4539953 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -232,21 +232,23 @@ static const struct iio_trigger_ops st_press_trigger_ops = {
> int st_press_common_probe(struct iio_dev *indio_dev,
> struct st_sensors_platform_data *plat_data)
> {
> - int err;
> struct st_sensor_data *pdata = iio_priv(indio_dev);
> + int irq = pdata->get_irq_data_ready(indio_dev);
> + int err;
>
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->info = &press_info;
>
> err = st_sensors_check_device_support(indio_dev,
> - ARRAY_SIZE(st_press_sensors), st_press_sensors);
> + ARRAY_SIZE(st_press_sensors),
> + st_press_sensors);
> if (err < 0)
> - goto st_press_common_probe_error;
> + return err;
>
> pdata->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS;
> - pdata->multiread_bit = pdata->sensor->multi_read_bit;
> - indio_dev->channels = pdata->sensor->ch;
> - indio_dev->num_channels = pdata->sensor->num_ch;
> + pdata->multiread_bit = pdata->sensor->multi_read_bit;
> + indio_dev->channels = pdata->sensor->ch;
> + indio_dev->num_channels = pdata->sensor->num_ch;
>
> if (pdata->sensor->fs.addr != 0)
> pdata->current_fullscale = (struct st_sensor_fullscale_avl *)
> @@ -261,15 +263,15 @@ int st_press_common_probe(struct iio_dev *indio_dev,
>
> err = st_sensors_init_sensor(indio_dev, plat_data);
> if (err < 0)
> - goto st_press_common_probe_error;
> + return err;
>
> - if (pdata->get_irq_data_ready(indio_dev) > 0) {
> + if (irq > 0) {
> err = st_press_allocate_ring(indio_dev);
> if (err < 0)
> - goto st_press_common_probe_error;
> + return err;
>
> err = st_sensors_allocate_trigger(indio_dev,
> - ST_PRESS_TRIGGER_OPS);
> + ST_PRESS_TRIGGER_OPS);
> if (err < 0)
> goto st_press_probe_trigger_error;
> }
> @@ -281,12 +283,12 @@ int st_press_common_probe(struct iio_dev *indio_dev,
> return err;
>
> st_press_device_register_error:
> - if (pdata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_sensors_deallocate_trigger(indio_dev);
> st_press_probe_trigger_error:
> - if (pdata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_press_deallocate_ring(indio_dev);
> -st_press_common_probe_error:
> +
> return err;
> }
> EXPORT_SYMBOL(st_press_common_probe);
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 15/20] iio: pressure: st: Add support for new LPS001WP pressure sensor
2013-09-16 16:02 ` [PATCH 15/20] iio: pressure: st: Add support for new LPS001WP pressure sensor Lee Jones
@ 2013-09-21 12:53 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:53 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Here we use existing practices to introduce support for another
> pressure/temperature sensor, the LPS001WP.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks
> ---
> drivers/iio/pressure/st_pressure.h | 1 +
> drivers/iio/pressure/st_pressure_core.c | 84 +++++++++++++++++++++++++++++++++
> drivers/iio/pressure/st_pressure_i2c.c | 1 +
> 3 files changed, 86 insertions(+)
>
> diff --git a/drivers/iio/pressure/st_pressure.h b/drivers/iio/pressure/st_pressure.h
> index b0b6306..049c21a 100644
> --- a/drivers/iio/pressure/st_pressure.h
> +++ b/drivers/iio/pressure/st_pressure.h
> @@ -14,6 +14,7 @@
> #include <linux/types.h>
> #include <linux/iio/common/st_sensors.h>
>
> +#define LPS001WP_PRESS_DEV_NAME "lps001wp"
> #define LPS331AP_PRESS_DEV_NAME "lps331ap"
>
> /**
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index 4539953..e879542 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -64,6 +64,21 @@
> #define ST_PRESS_LPS331AP_OUT_XL_ADDR 0x28
> #define ST_TEMP_LPS331AP_OUT_L_ADDR 0x2b
>
> +/* CUSTOM VALUES FOR LPS001WP SENSOR */
> +#define ST_PRESS_LPS001WP_WAI_EXP 0xba
> +#define ST_PRESS_LPS001WP_ODR_ADDR 0x20
> +#define ST_PRESS_LPS001WP_ODR_MASK 0x30
> +#define ST_PRESS_LPS001WP_ODR_AVL_1HZ_VAL 0x01
> +#define ST_PRESS_LPS001WP_ODR_AVL_7HZ_VAL 0x02
> +#define ST_PRESS_LPS001WP_ODR_AVL_13HZ_VAL 0x03
> +#define ST_PRESS_LPS001WP_PW_ADDR 0x20
> +#define ST_PRESS_LPS001WP_PW_MASK 0x40
> +#define ST_PRESS_LPS001WP_BDU_ADDR 0x20
> +#define ST_PRESS_LPS001WP_BDU_MASK 0x04
> +#define ST_PRESS_LPS001WP_MULTIREAD_BIT true
> +#define ST_PRESS_LPS001WP_OUT_L_ADDR 0x28
> +#define ST_TEMP_LPS001WP_OUT_L_ADDR 0x2a
> +
> static const struct iio_chan_spec st_press_lps331ap_channels[] = {
> {
> .type = IIO_PRESSURE,
> @@ -100,6 +115,40 @@ static const struct iio_chan_spec st_press_lps331ap_channels[] = {
> IIO_CHAN_SOFT_TIMESTAMP(1)
> };
>
> +static const struct iio_chan_spec st_press_lps001wp_channels[] = {
> + {
> + .type = IIO_PRESSURE,
> + .channel2 = IIO_NO_MOD,
> + .address = ST_PRESS_LPS001WP_OUT_L_ADDR,
> + .scan_index = ST_SENSORS_SCAN_X,
> + .scan_type = {
> + .sign = 'u',
> + .realbits = 16,
> + .storagebits = 16,
> + .endianness = IIO_LE,
> + },
> + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
> + .modified = 0,
> + },
> + {
> + .type = IIO_TEMP,
> + .channel2 = IIO_NO_MOD,
> + .address = ST_TEMP_LPS001WP_OUT_L_ADDR,
> + .scan_index = -1,
> + .scan_type = {
> + .sign = 'u',
> + .realbits = 16,
> + .storagebits = 16,
> + .endianness = IIO_LE,
> + },
> + .info_mask_separate =
> + BIT(IIO_CHAN_INFO_RAW) |
> + BIT(IIO_CHAN_INFO_OFFSET),
> + .modified = 0,
> + },
> + IIO_CHAN_SOFT_TIMESTAMP(1)
> +};
> +
> static const struct st_sensors st_press_sensors[] = {
> {
> .wai = ST_PRESS_LPS331AP_WAI_EXP,
> @@ -148,6 +197,41 @@ static const struct st_sensors st_press_sensors[] = {
> .multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT,
> .bootime = 2,
> },
> + {
> + .wai = ST_PRESS_LPS001WP_WAI_EXP,
> + .sensors_supported = {
> + [0] = LPS001WP_PRESS_DEV_NAME,
> + },
> + .ch = (struct iio_chan_spec *)st_press_lps001wp_channels,
> + .num_ch = ARRAY_SIZE(st_press_lps001wp_channels),
> + .odr = {
> + .addr = ST_PRESS_LPS001WP_ODR_ADDR,
> + .mask = ST_PRESS_LPS001WP_ODR_MASK,
> + .odr_avl = {
> + { 1, ST_PRESS_LPS001WP_ODR_AVL_1HZ_VAL, },
> + { 7, ST_PRESS_LPS001WP_ODR_AVL_7HZ_VAL, },
> + { 13, ST_PRESS_LPS001WP_ODR_AVL_13HZ_VAL, },
> + },
> + },
> + .pw = {
> + .addr = ST_PRESS_LPS001WP_PW_ADDR,
> + .mask = ST_PRESS_LPS001WP_PW_MASK,
> + .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
> + .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
> + },
> + .fs = {
> + .addr = 0,
> + },
> + .bdu = {
> + .addr = ST_PRESS_LPS001WP_BDU_ADDR,
> + .mask = ST_PRESS_LPS001WP_BDU_MASK,
> + },
> + .drdy_irq = {
> + .addr = 0,
> + },
> + .multi_read_bit = ST_PRESS_LPS001WP_MULTIREAD_BIT,
> + .bootime = 2,
> + },
> };
>
> static int st_press_read_raw(struct iio_dev *indio_dev,
> diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
> index 08aac5e..51eab7f 100644
> --- a/drivers/iio/pressure/st_pressure_i2c.c
> +++ b/drivers/iio/pressure/st_pressure_i2c.c
> @@ -49,6 +49,7 @@ static int st_press_i2c_remove(struct i2c_client *client)
> }
>
> static const struct i2c_device_id st_press_id_table[] = {
> + { LPS001WP_PRESS_DEV_NAME },
> { LPS331AP_PRESS_DEV_NAME },
> {},
> };
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 18/20] iio: accel-core: st: Clean up error handling in probe()
2013-09-16 16:02 ` [PATCH 18/20] iio: accel-core: st: Clean up error handling in probe() Lee Jones
@ 2013-09-21 12:56 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:56 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Reduce the amount of those unnecessary goto calls, as in most cases
> we can simply return immediately. We also only call for the IRQ number
> once and use that value throughout.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/iio/accel/st_accel_core.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
> index 1458343..97172dd 100644
> --- a/drivers/iio/accel/st_accel_core.c
> +++ b/drivers/iio/accel/st_accel_core.c
> @@ -452,8 +452,9 @@ static const struct iio_trigger_ops st_accel_trigger_ops = {
> int st_accel_common_probe(struct iio_dev *indio_dev,
> struct st_sensors_platform_data *plat_data)
> {
> - int err;
> struct st_sensor_data *adata = iio_priv(indio_dev);
> + int irq = adata->get_irq_data_ready(indio_dev);
> + int err;
>
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->info = &accel_info;
> @@ -461,7 +462,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
> err = st_sensors_check_device_support(indio_dev,
> ARRAY_SIZE(st_accel_sensors), st_accel_sensors);
> if (err < 0)
> - goto st_accel_common_probe_error;
> + return err;
>
> adata->num_data_channels = ST_ACCEL_NUMBER_DATA_CHANNELS;
> adata->multiread_bit = adata->sensor->multi_read_bit;
> @@ -478,12 +479,12 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
>
> err = st_sensors_init_sensor(indio_dev, plat_data);
> if (err < 0)
> - goto st_accel_common_probe_error;
> + return err;
>
> - if (adata->get_irq_data_ready(indio_dev) > 0) {
> + if (irq > 0) {
> err = st_accel_allocate_ring(indio_dev);
> if (err < 0)
> - goto st_accel_common_probe_error;
> + return err;
>
> err = st_sensors_allocate_trigger(indio_dev,
> ST_ACCEL_TRIGGER_OPS);
> @@ -495,15 +496,15 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
> if (err)
> goto st_accel_device_register_error;
>
> - return err;
> + return 0;
>
> st_accel_device_register_error:
> - if (adata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_sensors_deallocate_trigger(indio_dev);
> st_accel_probe_trigger_error:
> - if (adata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_accel_deallocate_ring(indio_dev);
> -st_accel_common_probe_error:
> +
> return err;
> }
> EXPORT_SYMBOL(st_accel_common_probe);
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 19/20] iio: gyro-core: st: Clean up error handling in probe()
2013-09-16 16:02 ` [PATCH 19/20] iio: gyro-core: " Lee Jones
@ 2013-09-21 12:57 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:57 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Reduce the amount of those unnecessary goto calls, as in most cases
> we can simply return immediately. We also only call for the IRQ number
> once and use that value throughout.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/iio/gyro/st_gyro_core.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
> index e13c2b0..9f80817 100644
> --- a/drivers/iio/gyro/st_gyro_core.c
> +++ b/drivers/iio/gyro/st_gyro_core.c
> @@ -305,8 +305,9 @@ static const struct iio_trigger_ops st_gyro_trigger_ops = {
> int st_gyro_common_probe(struct iio_dev *indio_dev,
> struct st_sensors_platform_data *pdata)
> {
> - int err;
> struct st_sensor_data *gdata = iio_priv(indio_dev);
> + int irq = gdata->get_irq_data_ready(indio_dev);
> + int err;
>
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->info = &gyro_info;
> @@ -314,7 +315,7 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
> err = st_sensors_check_device_support(indio_dev,
> ARRAY_SIZE(st_gyro_sensors), st_gyro_sensors);
> if (err < 0)
> - goto st_gyro_common_probe_error;
> + return err;
>
> gdata->num_data_channels = ST_GYRO_NUMBER_DATA_CHANNELS;
> gdata->multiread_bit = gdata->sensor->multi_read_bit;
> @@ -327,12 +328,12 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
>
> err = st_sensors_init_sensor(indio_dev, pdata);
> if (err < 0)
> - goto st_gyro_common_probe_error;
> + return err;
>
> - if (gdata->get_irq_data_ready(indio_dev) > 0) {
> + if (irq > 0) {
> err = st_gyro_allocate_ring(indio_dev);
> if (err < 0)
> - goto st_gyro_common_probe_error;
> + return err;
>
> err = st_sensors_allocate_trigger(indio_dev,
> ST_GYRO_TRIGGER_OPS);
> @@ -344,15 +345,15 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
> if (err)
> goto st_gyro_device_register_error;
>
> - return err;
> + return 0;
>
> st_gyro_device_register_error:
> - if (gdata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_sensors_deallocate_trigger(indio_dev);
> st_gyro_probe_trigger_error:
> - if (gdata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_gyro_deallocate_ring(indio_dev);
> -st_gyro_common_probe_error:
> +
> return err;
> }
> EXPORT_SYMBOL(st_gyro_common_probe);
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 20/20] iio: magn-core: st: Clean up error handling in probe()
2013-09-16 16:02 ` [PATCH 20/20] iio: magn-core: " Lee Jones
@ 2013-09-21 12:57 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 12:57 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> Reduce the amount of those unnecessary goto calls, as in most cases
> we can simply return immediately. We also only call for the IRQ number
> once and use that value throughout.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/iio/magnetometer/st_magn_core.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index e8d2849..729c71a 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -348,8 +348,9 @@ static const struct iio_info magn_info = {
> int st_magn_common_probe(struct iio_dev *indio_dev,
> struct st_sensors_platform_data *pdata)
> {
> - int err;
> struct st_sensor_data *mdata = iio_priv(indio_dev);
> + int irq = mdata->get_irq_data_ready(indio_dev);
> + int err;
>
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->info = &magn_info;
> @@ -357,7 +358,7 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
> err = st_sensors_check_device_support(indio_dev,
> ARRAY_SIZE(st_magn_sensors), st_magn_sensors);
> if (err < 0)
> - goto st_magn_common_probe_error;
> + return err;
>
> mdata->num_data_channels = ST_MAGN_NUMBER_DATA_CHANNELS;
> mdata->multiread_bit = mdata->sensor->multi_read_bit;
> @@ -370,12 +371,12 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
>
> err = st_sensors_init_sensor(indio_dev, pdata);
> if (err < 0)
> - goto st_magn_common_probe_error;
> + return err;
>
> - if (mdata->get_irq_data_ready(indio_dev) > 0) {
> + if (irq > 0) {
> err = st_magn_allocate_ring(indio_dev);
> if (err < 0)
> - goto st_magn_common_probe_error;
> + return err;
> err = st_sensors_allocate_trigger(indio_dev, NULL);
> if (err < 0)
> goto st_magn_probe_trigger_error;
> @@ -385,15 +386,15 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
> if (err)
> goto st_magn_device_register_error;
>
> - return err;
> + return 0;
>
> st_magn_device_register_error:
> - if (mdata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_sensors_deallocate_trigger(indio_dev);
> st_magn_probe_trigger_error:
> - if (mdata->get_irq_data_ready(indio_dev) > 0)
> + if (irq > 0)
> st_magn_deallocate_ring(indio_dev);
> -st_magn_common_probe_error:
> +
> return err;
> }
> EXPORT_SYMBOL(st_magn_common_probe);
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply
2013-09-16 16:02 ` [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply Lee Jones
@ 2013-09-21 13:03 ` Jonathan Cameron
2013-09-23 19:18 ` Jonathan Cameron
1 sibling, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 13:03 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> The power to some of the sensors are controlled by regulators. In most
> cases these are 'always on', but if not they will fail to work until
> the regulator is enabled using the relevant APIs. This patch allows for
> the Vdd power supply to be specified by either platform data or Device
> Tree.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
I haven't yet pulled 3.12-rc1 into my togreg branch. To keep things
clean I'll do a pull request to Greg soon then apply these afterwards
(when a fast forward merge is possible).
> ---
> drivers/iio/pressure/st_pressure_core.c | 28 ++++++++++++++++++++++++++++
> include/linux/iio/common/st_sensors.h | 3 +++
> 2 files changed, 31 insertions(+)
>
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index e879542..c801c80 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -23,6 +23,7 @@
> #include <linux/iio/sysfs.h>
> #include <linux/iio/trigger.h>
> #include <linux/iio/buffer.h>
> +#include <linux/regulator/consumer.h>
> #include <asm/unaligned.h>
>
> #include <linux/iio/common/st_sensors.h>
> @@ -313,6 +314,29 @@ static const struct iio_trigger_ops st_press_trigger_ops = {
> #define ST_PRESS_TRIGGER_OPS NULL
> #endif
>
> +void st_press_power_enable(struct iio_dev *indio_dev)
> +{
> + struct st_sensor_data *pdata = iio_priv(indio_dev);
> + int err;
> +
> + /* Regulators not mandatory, but if requested we should enable it. */
> + pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd");
> + if (!IS_ERR(pdata->vdd)) {
> + err = regulator_enable(pdata->vdd);
> + if (err != 0)
> + dev_warn(&indio_dev->dev,
> + "Failed to enable specified Vdd supply\n");
> + }
> +}
> +
> +void st_press_power_disable(struct iio_dev *indio_dev)
> +{
> + struct st_sensor_data *pdata = iio_priv(indio_dev);
> +
> + if (!IS_ERR(pdata->vdd))
> + regulator_disable(pdata->vdd);
> +}
> +
> int st_press_common_probe(struct iio_dev *indio_dev,
> struct st_sensors_platform_data *plat_data)
> {
> @@ -323,6 +347,8 @@ int st_press_common_probe(struct iio_dev *indio_dev,
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->info = &press_info;
>
> + st_press_power_enable(indio_dev);
> +
> err = st_sensors_check_device_support(indio_dev,
> ARRAY_SIZE(st_press_sensors),
> st_press_sensors);
> @@ -381,6 +407,8 @@ void st_press_common_remove(struct iio_dev *indio_dev)
> {
> struct st_sensor_data *pdata = iio_priv(indio_dev);
>
> + st_press_power_disable(indio_dev);
> +
> iio_device_unregister(indio_dev);
> if (pdata->get_irq_data_ready(indio_dev) > 0) {
> st_sensors_deallocate_trigger(indio_dev);
> diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
> index e732fda..968b84e 100644
> --- a/include/linux/iio/common/st_sensors.h
> +++ b/include/linux/iio/common/st_sensors.h
> @@ -16,6 +16,7 @@
> #include <linux/irqreturn.h>
> #include <linux/iio/trigger.h>
> #include <linux/bitops.h>
> +#include <linux/regulator/consumer.h>
>
> #include <linux/platform_data/st_sensors_pdata.h>
>
> @@ -201,6 +202,7 @@ struct st_sensors {
> * @trig: The trigger in use by the core driver.
> * @sensor: Pointer to the current sensor struct in use.
> * @current_fullscale: Maximum range of measure by the sensor.
> + * @vdd: Pointer to sensor's Vdd power supply
> * @enabled: Status of the sensor (false->off, true->on).
> * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
> * @buffer_data: Data used by buffer part.
> @@ -216,6 +218,7 @@ struct st_sensor_data {
> struct iio_trigger *trig;
> struct st_sensors *sensor;
> struct st_sensor_fullscale_avl *current_fullscale;
> + struct regulator *vdd;
>
> bool enabled;
> bool multiread_bit;
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin
2013-09-21 12:51 ` Jonathan Cameron
@ 2013-09-21 13:07 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-21 13:07 UTC (permalink / raw)
To: linux-arm-kernel
On 09/21/13 13:51, Jonathan Cameron wrote:
> On 09/16/13 17:02, Lee Jones wrote:
>> Not all ST's sensors support data ready, so let's make the declaration
>> of one conditional.
>>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Applied to the togreg branch of iio.git
>
> Thanks Lee
Having done some extra build tests, noticed that
for st_snesors_set_drdy_int_pin should be static.
Fixed up and push out to the togreg branch of iio.git
>> ---
>> drivers/iio/common/st_sensors/st_sensors_core.c | 33 ++++++++++++++++---------
>> drivers/iio/pressure/st_pressure_core.c | 3 ++-
>> 2 files changed, 24 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
>> index 793136a..2672630 100644
>> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
>> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
>> @@ -198,21 +198,17 @@ int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable)
>> }
>> EXPORT_SYMBOL(st_sensors_set_axis_enable);
>>
>> -int st_sensors_init_sensor(struct iio_dev *indio_dev,
>> - struct st_sensors_platform_data *pdata)
>> +int st_sensors_set_drdy_int_pin(struct iio_dev *indio_dev,
>> + struct st_sensors_platform_data *pdata)
>> {
>> - int err;
>> struct st_sensor_data *sdata = iio_priv(indio_dev);
>>
>> - mutex_init(&sdata->tb.buf_lock);
>> -
>> switch (pdata->drdy_int_pin) {
>> case 1:
>> if (sdata->sensor->drdy_irq.mask_int1 == 0) {
>> dev_err(&indio_dev->dev,
>> "DRDY on INT1 not available.\n");
>> - err = -EINVAL;
>> - goto init_error;
>> + return -EINVAL;
>> }
>> sdata->drdy_int_pin = 1;
>> break;
>> @@ -220,17 +216,29 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
>> if (sdata->sensor->drdy_irq.mask_int2 == 0) {
>> dev_err(&indio_dev->dev,
>> "DRDY on INT2 not available.\n");
>> - err = -EINVAL;
>> - goto init_error;
>> + return -EINVAL;
>> }
>> sdata->drdy_int_pin = 2;
>> break;
>> default:
>> dev_err(&indio_dev->dev, "DRDY on pdata not valid.\n");
>> - err = -EINVAL;
>> - goto init_error;
>> + return -EINVAL;
>> }
>>
>> + return 0;
>> +}
>> +
>> +int st_sensors_init_sensor(struct iio_dev *indio_dev,
>> + struct st_sensors_platform_data *pdata)
>> +{
>> + struct st_sensor_data *sdata = iio_priv(indio_dev);
>> + int err = 0;
>> +
>> + mutex_init(&sdata->tb.buf_lock);
>> +
>> + if (pdata)
>> + err = st_sensors_set_drdy_int_pin(indio_dev, pdata);
>> +
>> err = st_sensors_set_enable(indio_dev, false);
>> if (err < 0)
>> goto init_error;
>> @@ -266,6 +274,9 @@ int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable)
>> u8 drdy_mask;
>> struct st_sensor_data *sdata = iio_priv(indio_dev);
>>
>> + if (!sdata->sensor->drdy_irq.addr)
>> + return 0;
>> +
>> /* Enable/Disable the interrupt generator 1. */
>> if (sdata->sensor->drdy_irq.ig1.en_addr > 0) {
>> err = st_sensors_write_data_with_mask(indio_dev,
>> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
>> index 93bff9b..3abada2 100644
>> --- a/drivers/iio/pressure/st_pressure_core.c
>> +++ b/drivers/iio/pressure/st_pressure_core.c
>> @@ -254,7 +254,8 @@ int st_press_common_probe(struct iio_dev *indio_dev,
>>
>> pdata->odr = pdata->sensor->odr.odr_avl[0].hz;
>>
>> - if (!plat_data)
>> + /* Some devices don't support a data ready pin. */
>> + if (!plat_data && pdata->sensor->drdy_irq.addr)
>> plat_data =
>> (struct st_sensors_platform_data *)&default_press_pdata;
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply
2013-09-16 16:02 ` [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply Lee Jones
2013-09-21 13:03 ` Jonathan Cameron
@ 2013-09-23 19:18 ` Jonathan Cameron
1 sibling, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-23 19:18 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> The power to some of the sensors are controlled by regulators. In most
> cases these are 'always on', but if not they will fail to work until
> the regulator is enabled using the relevant APIs. This patch allows for
> the Vdd power supply to be specified by either platform data or Device
> Tree.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git with a static in front of each of the functions.
> ---
> drivers/iio/pressure/st_pressure_core.c | 28 ++++++++++++++++++++++++++++
> include/linux/iio/common/st_sensors.h | 3 +++
> 2 files changed, 31 insertions(+)
>
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index e879542..c801c80 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -23,6 +23,7 @@
> #include <linux/iio/sysfs.h>
> #include <linux/iio/trigger.h>
> #include <linux/iio/buffer.h>
> +#include <linux/regulator/consumer.h>
> #include <asm/unaligned.h>
>
> #include <linux/iio/common/st_sensors.h>
> @@ -313,6 +314,29 @@ static const struct iio_trigger_ops st_press_trigger_ops = {
> #define ST_PRESS_TRIGGER_OPS NULL
> #endif
>
> +void st_press_power_enable(struct iio_dev *indio_dev)
> +{
> + struct st_sensor_data *pdata = iio_priv(indio_dev);
> + int err;
> +
> + /* Regulators not mandatory, but if requested we should enable it. */
> + pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd");
> + if (!IS_ERR(pdata->vdd)) {
> + err = regulator_enable(pdata->vdd);
> + if (err != 0)
> + dev_warn(&indio_dev->dev,
> + "Failed to enable specified Vdd supply\n");
> + }
> +}
> +
> +void st_press_power_disable(struct iio_dev *indio_dev)
> +{
> + struct st_sensor_data *pdata = iio_priv(indio_dev);
> +
> + if (!IS_ERR(pdata->vdd))
> + regulator_disable(pdata->vdd);
> +}
> +
> int st_press_common_probe(struct iio_dev *indio_dev,
> struct st_sensors_platform_data *plat_data)
> {
> @@ -323,6 +347,8 @@ int st_press_common_probe(struct iio_dev *indio_dev,
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->info = &press_info;
>
> + st_press_power_enable(indio_dev);
> +
> err = st_sensors_check_device_support(indio_dev,
> ARRAY_SIZE(st_press_sensors),
> st_press_sensors);
> @@ -381,6 +407,8 @@ void st_press_common_remove(struct iio_dev *indio_dev)
> {
> struct st_sensor_data *pdata = iio_priv(indio_dev);
>
> + st_press_power_disable(indio_dev);
> +
> iio_device_unregister(indio_dev);
> if (pdata->get_irq_data_ready(indio_dev) > 0) {
> st_sensors_deallocate_trigger(indio_dev);
> diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
> index e732fda..968b84e 100644
> --- a/include/linux/iio/common/st_sensors.h
> +++ b/include/linux/iio/common/st_sensors.h
> @@ -16,6 +16,7 @@
> #include <linux/irqreturn.h>
> #include <linux/iio/trigger.h>
> #include <linux/bitops.h>
> +#include <linux/regulator/consumer.h>
>
> #include <linux/platform_data/st_sensors_pdata.h>
>
> @@ -201,6 +202,7 @@ struct st_sensors {
> * @trig: The trigger in use by the core driver.
> * @sensor: Pointer to the current sensor struct in use.
> * @current_fullscale: Maximum range of measure by the sensor.
> + * @vdd: Pointer to sensor's Vdd power supply
> * @enabled: Status of the sensor (false->off, true->on).
> * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
> * @buffer_data: Data used by buffer part.
> @@ -216,6 +218,7 @@ struct st_sensor_data {
> struct iio_trigger *trig;
> struct st_sensors *sensor;
> struct st_sensor_fullscale_avl *current_fullscale;
> + struct regulator *vdd;
>
> bool enabled;
> bool multiread_bit;
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 17/20] iio: pressure-core: st: Provide support for the Vdd_IO power supply
2013-09-16 16:02 ` [PATCH 17/20] iio: pressure-core: st: Provide support for the Vdd_IO " Lee Jones
@ 2013-09-23 19:19 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-09-23 19:19 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> The power to some of the sensors are controlled by regulators. In most
> cases these are 'always on', but if not they will fail to work until
> the regulator is enabled using the relevant APIs. This patch allows for
> the Vdd_IO power supply to be specified by either platform data or
> Device Tree.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git
Thanks - just the DT patches to go once that discussion is cleanly finished.
> ---
> drivers/iio/pressure/st_pressure_core.c | 13 ++++++++++++-
> include/linux/iio/common/st_sensors.h | 2 ++
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index c801c80..e3f3888 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -319,7 +319,7 @@ void st_press_power_enable(struct iio_dev *indio_dev)
> struct st_sensor_data *pdata = iio_priv(indio_dev);
> int err;
>
> - /* Regulators not mandatory, but if requested we should enable it. */
> + /* Regulators not mandatory, but if requested we should enable them. */
> pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd");
> if (!IS_ERR(pdata->vdd)) {
> err = regulator_enable(pdata->vdd);
> @@ -327,6 +327,14 @@ void st_press_power_enable(struct iio_dev *indio_dev)
> dev_warn(&indio_dev->dev,
> "Failed to enable specified Vdd supply\n");
> }
> +
> + pdata->vdd_io = devm_regulator_get_optional(&indio_dev->dev, "vddio");
> + if (!IS_ERR(pdata->vdd_io)) {
> + err = regulator_enable(pdata->vdd_io);
> + if (err != 0)
> + dev_warn(&indio_dev->dev,
> + "Failed to enable specified Vdd_IO supply\n");
> + }
> }
>
> void st_press_power_disable(struct iio_dev *indio_dev)
> @@ -335,6 +343,9 @@ void st_press_power_disable(struct iio_dev *indio_dev)
>
> if (!IS_ERR(pdata->vdd))
> regulator_disable(pdata->vdd);
> +
> + if (!IS_ERR(pdata->vdd_io))
> + regulator_disable(pdata->vdd_io);
> }
>
> int st_press_common_probe(struct iio_dev *indio_dev,
> diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
> index 968b84e..3c005eb 100644
> --- a/include/linux/iio/common/st_sensors.h
> +++ b/include/linux/iio/common/st_sensors.h
> @@ -203,6 +203,7 @@ struct st_sensors {
> * @sensor: Pointer to the current sensor struct in use.
> * @current_fullscale: Maximum range of measure by the sensor.
> * @vdd: Pointer to sensor's Vdd power supply
> + * @vdd_io: Pointer to sensor's Vdd-IO power supply
> * @enabled: Status of the sensor (false->off, true->on).
> * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
> * @buffer_data: Data used by buffer part.
> @@ -219,6 +220,7 @@ struct st_sensor_data {
> struct st_sensors *sensor;
> struct st_sensor_fullscale_avl *current_fullscale;
> struct regulator *vdd;
> + struct regulator *vdd_io;
>
> bool enabled;
> bool multiread_bit;
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP
2013-09-16 16:02 ` [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP Lee Jones
@ 2013-10-01 21:09 ` Jonathan Cameron
2013-10-01 21:13 ` Jonathan Cameron
0 siblings, 1 reply; 35+ messages in thread
From: Jonathan Cameron @ 2013-10-01 21:09 UTC (permalink / raw)
To: linux-arm-kernel
On 09/16/13 17:02, Lee Jones wrote:
> LPS001WP is a Pressure and Temperature sensor.
>
> Cc: devicetree at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Hi Lee,
I'm planning to drop this set of bindings in favour of the unified ones
proposed by Lukasz Czerwinski.
Could you take a look at those and perhaps propose the additional bits and pieces
needed to ensure everything is covered by the resulting files?
Thanks,
Jonathan
> ---
> .../devicetree/bindings/iio/pressure/lps001wp.txt | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt b/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
> new file mode 100644
> index 0000000..45cb45c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
> @@ -0,0 +1,21 @@
> +* STMicroelectronics Pressure Sensor
> +
> +Required properties:
> + - compatible: Should be "st,lps001wp"
> + - reg: The I2C address of the sensor
> +
> +Optional properties:
> + - vdd-supply: Phandle to the Vdd supply regulator
> + - vddio-supply: Phandle to the Vdd-IO supply regulator
> +
> +Example:
> +
> +i2c at 80128000 {
> + lps001wp at 5c {
> + compatible = "st,lps001wp";
> + reg = <0x5c>;
> +
> + vdd-supply = <&ab8500_ldo_aux1_reg>;
> + vddio-supply = <&db8500_vsmps2_reg>;
> + };
> +};
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP
2013-10-01 21:09 ` Jonathan Cameron
@ 2013-10-01 21:13 ` Jonathan Cameron
0 siblings, 0 replies; 35+ messages in thread
From: Jonathan Cameron @ 2013-10-01 21:13 UTC (permalink / raw)
To: linux-arm-kernel
On 10/01/13 22:09, Jonathan Cameron wrote:
> On 09/16/13 17:02, Lee Jones wrote:
>> LPS001WP is a Pressure and Temperature sensor.
>>
>> Cc: devicetree at vger.kernel.org
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Hi Lee,
>
> I'm planning to drop this set of bindings in favour of the unified ones
> proposed by Lukasz Czerwinski.
Sorry, I just realised this is unclear. I'm proposing to drop the
documentation added in this patch in favour of the other version
in which a file per type of sensor is used rather than one per
individual sensor chip.
>
> Could you take a look at those and perhaps propose the additional bits and pieces
> needed to ensure everything is covered by the resulting files?
>
> Thanks,
>
> Jonathan
>> ---
>> .../devicetree/bindings/iio/pressure/lps001wp.txt | 21 +++++++++++++++++++++
>> 1 file changed, 21 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
>>
>> diff --git a/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt b/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
>> new file mode 100644
>> index 0000000..45cb45c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/pressure/lps001wp.txt
>> @@ -0,0 +1,21 @@
>> +* STMicroelectronics Pressure Sensor
>> +
>> +Required properties:
>> + - compatible: Should be "st,lps001wp"
>> + - reg: The I2C address of the sensor
>> +
>> +Optional properties:
>> + - vdd-supply: Phandle to the Vdd supply regulator
>> + - vddio-supply: Phandle to the Vdd-IO supply regulator
>> +
>> +Example:
>> +
>> +i2c at 80128000 {
>> + lps001wp at 5c {
>> + compatible = "st,lps001wp";
>> + reg = <0x5c>;
>> +
>> + vdd-supply = <&ab8500_ldo_aux1_reg>;
>> + vddio-supply = <&db8500_vsmps2_reg>;
>> + };
>> +};
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2013-10-01 21:13 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16 16:02 [PATCH v4 00/20] iio: ST clean-ups and new sensor support Lee Jones
2013-09-16 16:02 ` [PATCH 01/20] ARM: ux500: Remove PrimeCell IDs from Nomadik I2C DT nodes Lee Jones
2013-09-16 16:02 ` [PATCH 02/20] ARM: ux500: Enable the LPS001WP Pressure & Temperature sensor from DT Lee Jones
2013-09-16 16:02 ` [PATCH 03/20] ARM: ux500: Enable the LSM303DLH Accelerator " Lee Jones
2013-09-16 16:02 ` [PATCH 04/20] ARM: ux500: Enable the LSM303DLH Magnetometer " Lee Jones
2013-09-16 16:02 ` [PATCH 05/20] ARM: ux500: Enable the L3G4200D Gyroscope " Lee Jones
2013-09-16 16:02 ` [PATCH 06/20] ARM: ux500: CONFIG: Enable ST's IIO Sensors by default Lee Jones
2013-09-16 16:02 ` [PATCH 07/20] Documentation: dt: iio: Add binding for LPS001WP Lee Jones
2013-10-01 21:09 ` Jonathan Cameron
2013-10-01 21:13 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 08/20] Documentation: dt: iio: Add binding for LSM303DLH - Accel Lee Jones
2013-09-16 16:02 ` [PATCH 09/20] Documentation: dt: iio: Add binding for L3G4200D Lee Jones
2013-09-16 16:02 ` [PATCH 10/20] Documentation: dt: iio: Add binding for LSM303DLH - Magn Lee Jones
2013-09-16 16:02 ` [PATCH 11/20] iio: sensors-core: st: Support sensors which don't have a Data Ready pin Lee Jones
2013-09-21 12:51 ` Jonathan Cameron
2013-09-21 13:07 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 12/20] iio: sensors-core: st: Clean-up error handling in st_sensors_init_sensor() Lee Jones
2013-09-21 12:51 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 13/20] iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data() Lee Jones
2013-09-21 12:52 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 14/20] iio: pressure-core: st: Clean-up probe() function Lee Jones
2013-09-21 12:52 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 15/20] iio: pressure: st: Add support for new LPS001WP pressure sensor Lee Jones
2013-09-21 12:53 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 16/20] iio: pressure-core: st: Provide support for the Vdd power supply Lee Jones
2013-09-21 13:03 ` Jonathan Cameron
2013-09-23 19:18 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 17/20] iio: pressure-core: st: Provide support for the Vdd_IO " Lee Jones
2013-09-23 19:19 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 18/20] iio: accel-core: st: Clean up error handling in probe() Lee Jones
2013-09-21 12:56 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 19/20] iio: gyro-core: " Lee Jones
2013-09-21 12:57 ` Jonathan Cameron
2013-09-16 16:02 ` [PATCH 20/20] iio: magn-core: " Lee Jones
2013-09-21 12:57 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).