devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors
@ 2018-07-13 17:11 Peter Robinson
  2018-07-13 18:08 ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Robinson @ 2018-07-13 17:11 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel, devicetree
  Cc: Peter Robinson

The i2c2 bus has a external plug which enables the easy connection of external
"bricks" with sensors of various kinds, while i2c4 on the Extended/Full boards
has a pair of on board motion sensors, accelerometer and magnetometer on one chip
and gyroscope on another so it makes sense to enable these i2c buses for use.
Tested on UDOO Neo Full.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 .../arm/boot/dts/imx6sx-udoo-neo-extended.dts |  7 +++++++
 arch/arm/boot/dts/imx6sx-udoo-neo-full.dts    |  7 +++++++
 arch/arm/boot/dts/imx6sx-udoo-neo.dtsi        | 19 +++++++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts b/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts
index 42bfc8f8f7f6b..9ef424f48c523 100644
--- a/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts
+++ b/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts
@@ -52,3 +52,10 @@
 		reg = <0x80000000 0x40000000>;
 	};
 };
+
+&i2c4 { /* Onboard Motion sensors */
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c4>;
+	clock-frequency = <100000>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts b/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts
index c84c877f09d49..a3d3b731ac9ed 100644
--- a/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts
+++ b/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts
@@ -67,3 +67,10 @@
 		};
 	};
 };
+
+&i2c4 { /* Onboard Motion sensors */
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c4>;
+	clock-frequency = <100000>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx6sx-udoo-neo.dtsi b/arch/arm/boot/dts/imx6sx-udoo-neo.dtsi
index 53b3eac94f0de..dad8611cc2851 100644
--- a/arch/arm/boot/dts/imx6sx-udoo-neo.dtsi
+++ b/arch/arm/boot/dts/imx6sx-udoo-neo.dtsi
@@ -225,6 +225,13 @@
 	};
 };
 
+&i2c2 { /* Brick snap in sensors connector */
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2>;
+	clock-frequency = <100000>;
+	status = "okay";
+};
+
 &iomuxc {
 	pinctrl_bt_reg: btreggrp {
 		fsl,pins =
@@ -256,6 +263,18 @@
 			<MX6SX_PAD_GPIO1_IO01__I2C1_SDA		0x4001b8b1>;
 	};
 
+	pinctrl_i2c2: i2c2grp {
+		fsl,pins =
+			<MX6SX_PAD_GPIO1_IO03__I2C2_SDA          0x4001b8b1>,
+			<MX6SX_PAD_GPIO1_IO02__I2C2_SCL          0x4001b8b1>;
+	};
+
+	pinctrl_i2c4: i2c4grp {
+		fsl,pins =
+			<MX6SX_PAD_USB_H_DATA__I2C4_SDA		0x4001b8b1>,
+			<MX6SX_PAD_USB_H_STROBE__I2C4_SCL	0x4001b8b1>;
+	};
+
 	pinctrl_uart1: uart1grp {
 		fsl,pins =
 			<MX6SX_PAD_GPIO1_IO04__UART1_TX		0x1b0b1>,
-- 
2.17.1

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

* Re: [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors
  2018-07-13 17:11 [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors Peter Robinson
@ 2018-07-13 18:08 ` Fabio Estevam
  2018-07-16 14:43   ` Peter Robinson
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2018-07-13 18:08 UTC (permalink / raw)
  To: Peter Robinson
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Sascha Hauer, NXP Linux Team, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Peter,

On Fri, Jul 13, 2018 at 2:11 PM, Peter Robinson <pbrobinson@gmail.com> wrote:

> +&i2c4 { /* Onboard Motion sensors */
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pinctrl_i2c4>;
> +       clock-frequency = <100000>;
> +       status = "okay";
> +};

Would it be possible to add i2c4 to the common dtsi file instead?

I haven't checked the schematics, but if it is only the
imx6sx-udoo-neo-basic.dts that does not have the i2c4 node, then
maybe you could add i2c4 to the dtsi and disable it inside
imx6sx-udoo-neo-basic.dts?

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

* Re: [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors
  2018-07-13 18:08 ` Fabio Estevam
@ 2018-07-16 14:43   ` Peter Robinson
  2018-07-17 14:20     ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Robinson @ 2018-07-16 14:43 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Sascha Hauer, NXP Linux Team, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Fabio,

On Fri, Jul 13, 2018 at 7:08 PM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Peter,
>
> On Fri, Jul 13, 2018 at 2:11 PM, Peter Robinson <pbrobinson@gmail.com> wrote:
>
>> +&i2c4 { /* Onboard Motion sensors */
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <&pinctrl_i2c4>;
>> +       clock-frequency = <100000>;
>> +       status = "okay";
>> +};
>
> Would it be possible to add i2c4 to the common dtsi file instead?
>
> I haven't checked the schematics, but if it is only the
> imx6sx-udoo-neo-basic.dts that does not have the i2c4 node, then
> maybe you could add i2c4 to the dtsi and disable it inside
> imx6sx-udoo-neo-basic.dts?

Enabling it to turn around and then disable it again seemed counter
intuitive to me hence the way I did, the WiFi in done that way even
though it's not on all boards and I would imagine it would cause
errors on the devices where there isn't wifi although I don't have
those model(s) to verify.

Peter

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

* Re: [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors
  2018-07-16 14:43   ` Peter Robinson
@ 2018-07-17 14:20     ` Fabio Estevam
  2019-05-27 17:05       ` Peter Robinson
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2018-07-17 14:20 UTC (permalink / raw)
  To: Peter Robinson
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Sascha Hauer, NXP Linux Team, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Peter,

On Mon, Jul 16, 2018 at 11:43 AM, Peter Robinson <pbrobinson@gmail.com> wrote:

> Enabling it to turn around and then disable it again seemed counter

Other option would be to put i2c4 with status = "disabled" in the common file
and enable i2c4 on the two dts files that suport it.

> intuitive to me hence the way I did, the WiFi in done that way even
> though it's not on all boards and I would imagine it would cause
> errors on the devices where there isn't wifi although I don't have
> those model(s) to verify.

If the Wifi is not present, then it will not be probed, so it would
not cause problems.

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

* Re: [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors
  2018-07-17 14:20     ` Fabio Estevam
@ 2019-05-27 17:05       ` Peter Robinson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Robinson @ 2019-05-27 17:05 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Sascha Hauer, NXP Linux Team, Pengutronix Kernel Team,
	Fabio Estevam, Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Fabio,

> > Enabling it to turn around and then disable it again seemed counter
>
> Other option would be to put i2c4 with status = "disabled" in the common file
> and enable i2c4 on the two dts files that suport it.

I've (finally) revisited this again and also got bluetooth working,
will send a new series out shortly.

Peter

> > intuitive to me hence the way I did, the WiFi in done that way even
> > though it's not on all boards and I would imagine it would cause
> > errors on the devices where there isn't wifi although I don't have
> > those model(s) to verify.
>
> If the Wifi is not present, then it will not be probed, so it would
> not cause problems.

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

end of thread, other threads:[~2019-05-27 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13 17:11 [PATCH] ARM: dts: imx6sx-udoo-neo: enable i2c-2 and i2c-4 for onboard sensors Peter Robinson
2018-07-13 18:08 ` Fabio Estevam
2018-07-16 14:43   ` Peter Robinson
2018-07-17 14:20     ` Fabio Estevam
2019-05-27 17:05       ` Peter Robinson

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).