Skip to contentSkip to conversation

imx: add max7310 and usb support for imx6qdl sabreauto

PATCH Superseded Peter Chen 2 participants 7 messages Mar 9, 2015 – Mar 13, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

cover imx: add max7310 and usb support for imx6qdl sabreauto

Hi Shawn,

In this series, two functions are added for imx6qdl sabreauto board.

- In the 1st patch, the i2c interface gpio expendor max7310 is added
- In the 2nd patch, the USB support is added
- In the 3rd patch, the driver for max7310 is added

Peter Chen (3):
ARM: imx6qdl-sabreauto.dtsi: add max7310 support
ARM: imx6qdl-sabreauto.dtsi: enable USB support
ARM: imx_v6_v7_defconfig: Add CONFIG_GPIO_PCA953X

 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 87 ++++++++++++++++++++++++++++++++
 arch/arm/configs/imx_v6_v7_defconfig     |  1 +
 2 files changed, 88 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/3 ARM: imx6qdl-sabreauto.dtsi: add max7310 support

max7310 is an i2c interface gpio expander

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 43 ++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +43 -0
index 009abd6..51acfec 100644
@@ -28,6 +28,13 @@
 		};
 	};
 
+	max7310_reset: max7310-reset {
+		compatible = "gpio-reset";
+		reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+		reset-delay-us = <1>;
+		#reset-cells = <0>;
+	};
+
 	sound-spdif {
 		compatible = "fsl,imx-audio-spdif",
 			   "fsl,imx-sabreauto-spdif";
@@ -182,6 +189,35 @@
 	};
 };
 
+&i2c3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3>;
+	pinctrl-assert-gpios = <&gpio5 4 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+
+	max7310_a: gpio at 30 {
+		compatible = "maxim,max7310";
+		reg = <0x30>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		resets = <&max7310_reset>;
+	};
+
+	max7310_b: gpio at 32 {
+		compatible = "maxim,max7310";
+		reg = <0x32>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+
+	max7310_c: gpio at 34 {
+		compatible = "maxim,max7310";
+		reg = <0x34>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
+
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
@@ -265,6 +301,13 @@
 			>;
 		};
 
+		pinctrl_i2c3: i2c3grp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_3__I2C3_SCL  0x4001b8b1
+				MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+			>;
+		};
+
 		pinctrl_pwm3: pwm1grp {
 			fsl,pins = <
 				MX6QDL_PAD_SD4_DAT1__PWM3_OUT		0x1b0b1
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/3 ARM: imx6qdl-sabreauto.dtsi: add max7310 support

Quoted 12 lines · Peter Chen

max7310 is an i2c interface gpio expander

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 43 ++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +0 -0
index 009abd6..51acfec 100644

arch/arm/boot/dts/imx6qdl-sabreauto.dtsi line 32

Quoted 5 lines
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +2 -0
@@ -28,6 +28,13 @@
 		};
 	};
 
+	max7310_reset: max7310-reset {
+		compatible = "gpio-reset";

The mainline kernel doesn't seem to have a gpio-reset driver/binding yet.

Shawn

Quoted 61 lines
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +41 -0
+		reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+		reset-delay-us = <1>;
+		#reset-cells = <0>;
+	};
+
 	sound-spdif {
 		compatible = "fsl,imx-audio-spdif",
 			   "fsl,imx-sabreauto-spdif";
@@ -182,6 +189,35 @@
 	};
 };
 
+&i2c3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3>;
+	pinctrl-assert-gpios = <&gpio5 4 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+
+	max7310_a: gpio at 30 {
+		compatible = "maxim,max7310";
+		reg = <0x30>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		resets = <&max7310_reset>;
+	};
+
+	max7310_b: gpio at 32 {
+		compatible = "maxim,max7310";
+		reg = <0x32>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+
+	max7310_c: gpio at 34 {
+		compatible = "maxim,max7310";
+		reg = <0x34>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
+
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
@@ -265,6 +301,13 @@
 			>;
 		};
 
+		pinctrl_i2c3: i2c3grp {
+			fsl,pins = <
+				MX6QDL_PAD_GPIO_3__I2C3_SCL  0x4001b8b1
+				MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+			>;
+		};
+
 		pinctrl_pwm3: pwm1grp {
 			fsl,pins = <
 				MX6QDL_PAD_SD4_DAT1__PWM3_OUT		0x1b0b1
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 1/3 ARM: imx6qdl-sabreauto.dtsi: add max7310 support

Quoted 16 lines · Shawn Guo
Quoted 15 lines · Peter Chen

max7310 is an i2c interface gpio expander

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 43 ++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +0 -0
index 009abd6..51acfec 100644
@@ -28,6 +28,13 @@
 		};
 	};
 
Quoted 6 lines

arch/arm/boot/dts/imx6qdl-sabreauto.dtsi line 32

Quoted 2 lines
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +2 -0
+	max7310_reset: max7310-reset {
+		compatible = "gpio-reset";

The mainline kernel doesn't seem to have a gpio-reset driver/binding yet.

Yeah, the driver still handles reset by itself instead of DT. Even without reset operation, my max7310 chip works ok. Would you accept that I delete this reset operation and send v2?

Signature · 2 lines
Best Regards,
Peter Chen
#4 lore raw

PATCH 1/3 ARM: imx6qdl-sabreauto.dtsi: add max7310 support

Quoted 24 lines · Peter Chen
Quoted 16 lines · Shawn Guo
Quoted 15 lines · Peter Chen

max7310 is an i2c interface gpio expander

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 43 ++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +0 -0
index 009abd6..51acfec 100644
@@ -28,6 +28,13 @@
 		};
 	};
 
Quoted 6 lines

arch/arm/boot/dts/imx6qdl-sabreauto.dtsi line 32

Quoted 2 lines
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +2 -0
+	max7310_reset: max7310-reset {
+		compatible = "gpio-reset";

The mainline kernel doesn't seem to have a gpio-reset driver/binding yet.

Quoted 4 lines

Yeah, the driver still handles reset by itself instead of DT. Even without reset operation, my max7310 chip works ok. Would you accept that I delete this reset operation and send v2?

Yes.

Shawn

author
#5 lore raw

PATCH 2/3 ARM: imx6qdl-sabreauto.dtsi: enable USB support

In reply to Peter Chen

Add USBOTG and USB host 1 support

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 44 ++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +44 -0
index 51acfec..33f228c 100644
@@ -35,6 +35,32 @@
 		#reset-cells = <0>;
 	};
 
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reg_usb_h1_vbus: regulator at 0 {
+			compatible = "regulator-fixed";
+			reg = <0>;
+			regulator-name = "usb_h1_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&max7310_b 7 GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+		};
+
+		reg_usb_otg_vbus: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&max7310_c 1 GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+		};
+	};
+
 	sound-spdif {
 		compatible = "fsl,imx-audio-spdif",
 			   "fsl,imx-sabreauto-spdif";
@@ -327,6 +353,12 @@
 			>;
 		};
 
+		pinctrl_usbotg: usbotggrp {
+			fsl,pins = <
+				MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
+			>;
+		};
+
 		pinctrl_usdhc3: usdhc3grp {
 			fsl,pins = <
 				MX6QDL_PAD_SD3_CMD__SD3_CMD		0x17059
@@ -471,6 +503,18 @@
 	status = "okay";
 };
 
+&usbh1 {
+	vbus-supply = <&reg_usb_h1_vbus>;
+	status = "okay";
+};
+
+&usbotg {
+	vbus-supply = <&reg_usb_otg_vbus>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbotg>;
+	status = "okay";
+};
+
 &usdhc3 {
 	pinctrl-names = "default", "state_100mhz", "state_200mhz";
 	pinctrl-0 = <&pinctrl_usdhc3>;
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH 3/3 ARM: imx_v6_v7_defconfig: Add CONFIG_GPIO_PCA953X

In reply to Peter Chen

It is used for max7310 gpio expandor which is used at imx6qdl sabreauto board.

---
 arch/arm/configs/imx_v6_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/imx_v6_v7_defconfig +1 -0
index cf1e71e..75e7a95 100644
@@ -168,6 +168,7 @@ CONFIG_SPI=y
 CONFIG_SPI_IMX=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_MC9S08DZ60=y
+CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_STMPE=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_RESET=y
Signature · 1 line
1.9.1