All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: dts: ux500: configure the accelerometers open drain
@ 2016-04-14  8:48 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-04-14  8:48 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Linus Walleij, linux-iio, Jonathan Cameron

Configure the two accelerometers sharing GPIO line 82 as:

- Open drain so that they can share the same interrupt line.

Configure the corresponding interrupt pin:

- Trigger on the falling edge since open drain implies that we
  do not actively drive the line high, but we will actively drive
  it low to generate interrupts and then it moves from high to low
  i.e. a falling edge.

- Pulled up so the line will be biased to high unless an IRQ
  is active on any device on the line, and thus it goes high
  again after the interrupt is deasserted.

Cc: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Switch to using the drive-mode-open-drain; setting
---
 arch/arm/boot/dts/ste-href-tvk1281618.dtsi | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
index 55f9d0cc90f3..aec816c8ecb6 100644
--- a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
+++ b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
@@ -93,14 +93,15 @@
 				/* Accelerometer */
 				compatible = "st,lsm303dlh-accel";
 				st,drdy-int-pin = <1>;
+				drive-open-drain;
 				reg = <0x18>;
 				vdd-supply = <&ab8500_ldo_aux1_reg>;
 				vddio-supply = <&db8500_vsmps2_reg>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&accel_tvk_mode>;
 				interrupt-parent = <&gpio2>;
-				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
-					     <19 IRQ_TYPE_EDGE_RISING>;
+				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
+					     <19 IRQ_TYPE_EDGE_FALLING>;
 			};
 			lsm303dlh@1e {
 				/*
@@ -118,14 +119,15 @@
 				/* Accelerometer */
 				compatible = "st,lis331dl-accel";
 				st,drdy-int-pin = <1>;
+				drive-open-drain;
 				reg = <0x1c>;
 				vdd-supply = <&ab8500_ldo_aux1_reg>;
 				vddio-supply = <&db8500_vsmps2_reg>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&accel_tvk_mode>;
 				interrupt-parent = <&gpio2>;
-				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
-					     <19 IRQ_TYPE_EDGE_RISING>;
+				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
+					     <19 IRQ_TYPE_EDGE_FALLING>;
 			};
 			ak8974@0f {
 				/* Magnetometer */
@@ -216,7 +218,7 @@
 					/* Accelerometer interrupt lines 1 & 2 */
 					tvk_cfg {
 						pins = "GPIO82_C1", "GPIO83_D3";
-						ste,config = <&gpio_in_pd>;
+						ste,config = <&gpio_in_pu>;
 					};
 				};
 			};
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] ARM: dts: ux500: configure the accelerometers open drain
@ 2016-04-14  8:48 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-04-14  8:48 UTC (permalink / raw)
  To: linux-arm-kernel

Configure the two accelerometers sharing GPIO line 82 as:

- Open drain so that they can share the same interrupt line.

Configure the corresponding interrupt pin:

- Trigger on the falling edge since open drain implies that we
  do not actively drive the line high, but we will actively drive
  it low to generate interrupts and then it moves from high to low
  i.e. a falling edge.

- Pulled up so the line will be biased to high unless an IRQ
  is active on any device on the line, and thus it goes high
  again after the interrupt is deasserted.

Cc: linux-iio at vger.kernel.org
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Switch to using the drive-mode-open-drain; setting
---
 arch/arm/boot/dts/ste-href-tvk1281618.dtsi | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
index 55f9d0cc90f3..aec816c8ecb6 100644
--- a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
+++ b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
@@ -93,14 +93,15 @@
 				/* Accelerometer */
 				compatible = "st,lsm303dlh-accel";
 				st,drdy-int-pin = <1>;
+				drive-open-drain;
 				reg = <0x18>;
 				vdd-supply = <&ab8500_ldo_aux1_reg>;
 				vddio-supply = <&db8500_vsmps2_reg>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&accel_tvk_mode>;
 				interrupt-parent = <&gpio2>;
-				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
-					     <19 IRQ_TYPE_EDGE_RISING>;
+				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
+					     <19 IRQ_TYPE_EDGE_FALLING>;
 			};
 			lsm303dlh at 1e {
 				/*
@@ -118,14 +119,15 @@
 				/* Accelerometer */
 				compatible = "st,lis331dl-accel";
 				st,drdy-int-pin = <1>;
+				drive-open-drain;
 				reg = <0x1c>;
 				vdd-supply = <&ab8500_ldo_aux1_reg>;
 				vddio-supply = <&db8500_vsmps2_reg>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&accel_tvk_mode>;
 				interrupt-parent = <&gpio2>;
-				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
-					     <19 IRQ_TYPE_EDGE_RISING>;
+				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
+					     <19 IRQ_TYPE_EDGE_FALLING>;
 			};
 			ak8974 at 0f {
 				/* Magnetometer */
@@ -216,7 +218,7 @@
 					/* Accelerometer interrupt lines 1 & 2 */
 					tvk_cfg {
 						pins = "GPIO82_C1", "GPIO83_D3";
-						ste,config = <&gpio_in_pd>;
+						ste,config = <&gpio_in_pu>;
 					};
 				};
 			};
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ARM: dts: ux500: configure the accelerometers open drain
  2016-04-14  8:48 ` Linus Walleij
@ 2016-04-17 11:28   ` Jonathan Cameron
  -1 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2016-04-17 11:28 UTC (permalink / raw)
  To: Linus Walleij, linux-arm-kernel; +Cc: linux-iio, Jonathan Cameron

On 14/04/16 09:48, Linus Walleij wrote:
> Configure the two accelerometers sharing GPIO line 82 as:
> 
> - Open drain so that they can share the same interrupt line.
> 
> Configure the corresponding interrupt pin:
> 
> - Trigger on the falling edge since open drain implies that we
>   do not actively drive the line high, but we will actively drive
>   it low to generate interrupts and then it moves from high to low
>   i.e. a falling edge.
> 
> - Pulled up so the line will be biased to high unless an IRQ
>   is active on any device on the line, and thus it goes high
>   again after the interrupt is deasserted.
> 
> Cc: linux-iio@vger.kernel.org
> Cc: Jonathan Cameron <jic23@cam.ac.uk>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
I have just applied the patch supporting this to the iio tree
for the next merge window.

Jonathan
> ---
> ChangeLog v1->v2:
> - Switch to using the drive-mode-open-drain; setting
> ---
>  arch/arm/boot/dts/ste-href-tvk1281618.dtsi | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
> index 55f9d0cc90f3..aec816c8ecb6 100644
> --- a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
> +++ b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
> @@ -93,14 +93,15 @@
>  				/* Accelerometer */
>  				compatible = "st,lsm303dlh-accel";
>  				st,drdy-int-pin = <1>;
> +				drive-open-drain;
>  				reg = <0x18>;
>  				vdd-supply = <&ab8500_ldo_aux1_reg>;
>  				vddio-supply = <&db8500_vsmps2_reg>;
>  				pinctrl-names = "default";
>  				pinctrl-0 = <&accel_tvk_mode>;
>  				interrupt-parent = <&gpio2>;
> -				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
> -					     <19 IRQ_TYPE_EDGE_RISING>;
> +				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
> +					     <19 IRQ_TYPE_EDGE_FALLING>;
>  			};
>  			lsm303dlh@1e {
>  				/*
> @@ -118,14 +119,15 @@
>  				/* Accelerometer */
>  				compatible = "st,lis331dl-accel";
>  				st,drdy-int-pin = <1>;
> +				drive-open-drain;
>  				reg = <0x1c>;
>  				vdd-supply = <&ab8500_ldo_aux1_reg>;
>  				vddio-supply = <&db8500_vsmps2_reg>;
>  				pinctrl-names = "default";
>  				pinctrl-0 = <&accel_tvk_mode>;
>  				interrupt-parent = <&gpio2>;
> -				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
> -					     <19 IRQ_TYPE_EDGE_RISING>;
> +				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
> +					     <19 IRQ_TYPE_EDGE_FALLING>;
>  			};
>  			ak8974@0f {
>  				/* Magnetometer */
> @@ -216,7 +218,7 @@
>  					/* Accelerometer interrupt lines 1 & 2 */
>  					tvk_cfg {
>  						pins = "GPIO82_C1", "GPIO83_D3";
> -						ste,config = <&gpio_in_pd>;
> +						ste,config = <&gpio_in_pu>;
>  					};
>  				};
>  			};
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] ARM: dts: ux500: configure the accelerometers open drain
@ 2016-04-17 11:28   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2016-04-17 11:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 14/04/16 09:48, Linus Walleij wrote:
> Configure the two accelerometers sharing GPIO line 82 as:
> 
> - Open drain so that they can share the same interrupt line.
> 
> Configure the corresponding interrupt pin:
> 
> - Trigger on the falling edge since open drain implies that we
>   do not actively drive the line high, but we will actively drive
>   it low to generate interrupts and then it moves from high to low
>   i.e. a falling edge.
> 
> - Pulled up so the line will be biased to high unless an IRQ
>   is active on any device on the line, and thus it goes high
>   again after the interrupt is deasserted.
> 
> Cc: linux-iio at vger.kernel.org
> Cc: Jonathan Cameron <jic23@cam.ac.uk>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
I have just applied the patch supporting this to the iio tree
for the next merge window.

Jonathan
> ---
> ChangeLog v1->v2:
> - Switch to using the drive-mode-open-drain; setting
> ---
>  arch/arm/boot/dts/ste-href-tvk1281618.dtsi | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
> index 55f9d0cc90f3..aec816c8ecb6 100644
> --- a/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
> +++ b/arch/arm/boot/dts/ste-href-tvk1281618.dtsi
> @@ -93,14 +93,15 @@
>  				/* Accelerometer */
>  				compatible = "st,lsm303dlh-accel";
>  				st,drdy-int-pin = <1>;
> +				drive-open-drain;
>  				reg = <0x18>;
>  				vdd-supply = <&ab8500_ldo_aux1_reg>;
>  				vddio-supply = <&db8500_vsmps2_reg>;
>  				pinctrl-names = "default";
>  				pinctrl-0 = <&accel_tvk_mode>;
>  				interrupt-parent = <&gpio2>;
> -				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
> -					     <19 IRQ_TYPE_EDGE_RISING>;
> +				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
> +					     <19 IRQ_TYPE_EDGE_FALLING>;
>  			};
>  			lsm303dlh at 1e {
>  				/*
> @@ -118,14 +119,15 @@
>  				/* Accelerometer */
>  				compatible = "st,lis331dl-accel";
>  				st,drdy-int-pin = <1>;
> +				drive-open-drain;
>  				reg = <0x1c>;
>  				vdd-supply = <&ab8500_ldo_aux1_reg>;
>  				vddio-supply = <&db8500_vsmps2_reg>;
>  				pinctrl-names = "default";
>  				pinctrl-0 = <&accel_tvk_mode>;
>  				interrupt-parent = <&gpio2>;
> -				interrupts = <18 IRQ_TYPE_EDGE_RISING>,
> -					     <19 IRQ_TYPE_EDGE_RISING>;
> +				interrupts = <18 IRQ_TYPE_EDGE_FALLING>,
> +					     <19 IRQ_TYPE_EDGE_FALLING>;
>  			};
>  			ak8974 at 0f {
>  				/* Magnetometer */
> @@ -216,7 +218,7 @@
>  					/* Accelerometer interrupt lines 1 & 2 */
>  					tvk_cfg {
>  						pins = "GPIO82_C1", "GPIO83_D3";
> -						ste,config = <&gpio_in_pd>;
> +						ste,config = <&gpio_in_pu>;
>  					};
>  				};
>  			};
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-17 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14  8:48 [PATCH v2] ARM: dts: ux500: configure the accelerometers open drain Linus Walleij
2016-04-14  8:48 ` Linus Walleij
2016-04-17 11:28 ` Jonathan Cameron
2016-04-17 11:28   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.