Skip to contentSkip to conversation

Device tree changes to add more droid 4 devices

PATCH In review Tony Lindgren 4 participants 20 messages Mar 5, 2017 – Mar 23, 2017 9 messages not in the archive Device tree bindings

lore
Share & tools
lore
#0 lore raw

cover Device tree changes to add more droid 4 devices

Hi all,

Here are few more devices we can configure for droid 4.

Note that Sebastian Reichel also just posted the LCD panel changes in thread "[PATCHv2 00/10] Nokia N950 basic display support". The last patch in this thread contains the related LCD panel configuration.

Regards,

Tony

Tony Lindgren (6):
ARM: dts: omap4-droid4: Add touchscreen
ARM: dts: omap4-droid4: Add LCD backlight
ARM: dts: omap4-droid4: Add GPIO poweroff
ARM: dts: omap4-droid4: Add tmp105 sensor for droid 4
ARM: dts: omap4-droid4: Add HDMI support
ARM: dts: omap4-droid4: Add LCD

 arch/arm/boot/dts/omap4-droid4-xt894.dts | 217 +++++++++++++++++++++++++++++++
 1 file changed, 217 insertions(+)
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

PATCH 1/6 ARM: dts: omap4-droid4: Add touchscreen

In reply to a message not in the archive

Droid4's touchscreen can be used with mainline's maxtouch driver. The touchscreen's lower area is used for four soft buttons (KEY_MENU, KEY_HOME, KEY_BACK, KEY_SEARCH), but that does not seem to be currently supported by the mainline kernel.

The mxt224 configuration can be saved with "mxt-app" for the kernel to load. It can be saved after the first boot with:

# mxt-app -d i2c-dev:1-004a --save /lib/firmware/maxtouch.cfg

Where the mxt-app can be found at:

https://github.com/atmel-maxtouch/mxt-app

The firmware for the droid 4 mxt224 comes with GPLv2 license in the Motorola Linux kernel sources. This firmware can be dumped out with "droid4-touchscreen-firmware" program at:

https://github.com/tmlind/droid4-touchscreen-firmware

The related LCD patches are still pending, but when merged, the touchscreen can be rotated in X with something like:

# xrandr --output DSI-1 --rotate right
# xinput set-prop 6 'Coordinate Transformation Matrix' \
	0 1 0 -1 0 1 0 0 1

For now, we rely on a gpio-hog but later on we can add the reset gpio handling to the driver and have it load the maxtouch.cfg and maxtouch.fw on boot.

This patch is based on combined similar patches done by me and Sebastian.

---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 36 ++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +36 -0
@@ -59,6 +59,15 @@
 	};
 };
 
+&gpio6 {
+	touchscreen_reset {
+		gpio-hog;
+		gpios = <13 0>;
+		output-high;
+		line-name = "touchscreen-reset";
+	};
+};
+
 /* L3_2 interconnect is unused, SRAM, GPMC and L3_ICLK2 disabled */
 &gpmc {
 	status = "disabled";
@@ -171,6 +180,27 @@
 	};
 };
 
+/*
+ * REVISIT: Add gpio173 reset pin handling to the driver, see gpio-hog above.
+ * If the GPIO reset is used, we probably need to have /lib/firmware/maxtouch.fw
+ * available. See "mxt-app" and "droid4-touchscreen-firmware" tools for more
+ * information.
+ */
+&i2c2 {
+	tsp@4a {
+		compatible = "atmel,maxtouch";
+		reg = <0x4a>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&touchscreen_pins>;
+
+		/* gpio_183 with sys_nirq2 pad as wakeup */
+		interrupts-extended = <&gpio6 23 IRQ_TYPE_EDGE_FALLING
+				       &omap4_pmx_core 0x160>;
+		interrupt-names = "irq", "wakeup";
+		wakeup-source;
+	};
+};
+
 /* L3_2 interconnect is unused, SRAM, GPMC and L3_ICLK2 disabled */
 &ocmcram {
 	status = "disabled";
@@ -184,6 +214,12 @@
 		>;
 	};
 
+	touchscreen_pins: pinmux_touchscreen_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x1a0, PIN_INPUT_PULLUP | MUX_MODE3)
+		>;
+	};
+
 	usb_ulpi_pins: pinmux_usb_ulpi_pins {
 		pinctrl-single,pins = <
 		OMAP4_IOPAD(0x196, MUX_MODE7)
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 2/6 ARM: dts: omap4-droid4: Add LCD backlight

In reply to a message not in the archive

The TI LMU driver has not yet been merged, but the device
tree binding for TI LMU drivers has been acked already
earlier by Rob Herring <[email protected]>. So it should be safe to apply to cut down the number of pending patches.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Milo Kim <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +19 -0
@@ -180,6 +180,25 @@
 	};
 };
 
+&i2c1 {
+	lm3532@38 {
+		compatible = "ti,lm3532";
+		reg = <0x38>;
+
+		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
+
+		backlight {
+			compatible = "ti,lm3532-backlight";
+
+			lcd {
+				led-sources = <0 1 2>;
+				ramp-up-msec = <1>;
+				ramp-down-msec = <0>;
+			};
+		};
+	};
+};
+
 /*
  * REVISIT: Add gpio173 reset pin handling to the driver, see gpio-hog above.
  * If the GPIO reset is used, we probably need to have /lib/firmware/maxtouch.fw
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

PATCH 3/6 ARM: dts: omap4-droid4: Add GPIO poweroff

In reply to a message not in the archive

Droid 4 has a GPIO line that we can use with CONFIG_POWER_RESET_GPIO. It is probably connected to the CPCAP PMIC, and seems to power down the whole device taking power consumption to zero based on what I measured.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +16 -0
@@ -27,6 +27,14 @@
 		reg = <0x80000000 0x3fd00000>;	/* 1021 MB */
 	};
 
+	/* Poweroff GPIO probably connected to CPCAP */
+	gpio-poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff_gpio>;
+		pinctrl-names = "default";
+		gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;	/* gpio50 */
+	};
+
 	/* This is probably coming straight from the battery.. */
 	wl12xx_vmmc: regulator-wl12xx {
 		compatible = "regulator-fixed";
@@ -226,6 +234,14 @@
 };
 
 &omap4_pmx_core {
+
+	/* gpmc_ncs0.gpio_50 */
+	poweroff_gpio: pinmux_poweroff_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x074, PIN_OUTPUT_PULLUP | MUX_MODE3)
+		>;
+	};
+
 	usb_gpio_mux_sel1: pinmux_usb_gpio_mux_sel1_pins {
 		/* gpio_60 */
 		pinctrl-single,pins = <
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

PATCH 4/6 ARM: dts: omap4-droid4: Add tmp105 sensor for droid 4

In reply to a message not in the archive

Add tmp105 sensor for droid 4. This can be used with modprobe lm75.ko and running sensors from lm-sensors package. Note that the lm75.c driver does not yet support alert interrupt but droid 4 seems to be wired for it.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +21 -0
@@ -81,6 +81,20 @@
 	status = "disabled";
 };
 
+&i2c1 {
+	tmp105@48 {
+		compatible = "ti,tmp105";
+		reg = <0x48>;
+		pinctrl-0 = <&tmp105_irq>;
+		pinctrl-names = "default";
+		/* kpd_row0.gpio_178 */
+		interrupts-extended = <&gpio6 18 IRQ_TYPE_EDGE_FALLING
+				       &omap4_pmx_core 0x14e>;
+		interrupt-names = "irq", "wakeup";
+		wakeup-source;
+	};
+};
+
 &keypad {
 	keypad,num-rows = <8>;
 	keypad,num-columns = <8>;
@@ -242,6 +256,13 @@
 		>;
 	};
 
+	/* kpd_row0.gpio_178 */
+	tmp105_irq: pinmux_tmp105_irq {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x18e, PIN_INPUT_PULLUP | MUX_MODE3)
+		>;
+	};
+
 	usb_gpio_mux_sel1: pinmux_usb_gpio_mux_sel1_pins {
 		/* gpio_60 */
 		pinctrl-single,pins = <
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#14 lore raw

PATCH 5/6 ARM: dts: omap4-droid4: Add HDMI support

In reply to a message not in the archive

We can get HDMI working as long as the 5V regulator is on. There is probably an encoder chip there too, but so far no idea what it might be. Let's keep the 5V HDMI regulator always enabled for now as otherwise we cannot detect the monitor properly.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 65 ++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +65 -0
@@ -35,6 +35,37 @@
 		gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;	/* gpio50 */
 	};
 
+	hdmi0: connector {
+		compatible = "hdmi-connector";
+		pinctrl-0 = <&hdmi_hpd_gpio>;
+		pinctrl-names = "default";
+		label = "hdmi";
+		type = "d";
+
+		hpd-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;	/* gpio63 */
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&hdmi_out>;
+			};
+		};
+	};
+
+	/*
+	 * HDMI 5V regulator probably sourced from battery. Let's keep
+	 * keep this as always enabled for HDMI to work until we've
+	 * figured what the encoder chip is.
+	 */
+	hdmi_regulator: regulator-hdmi {
+		compatible = "regulator-fixed";
+		regulator-name = "hdmi";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio2 27 GPIO_ACTIVE_HIGH>;	/* gpio59 */
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	/* This is probably coming straight from the battery.. */
 	wl12xx_vmmc: regulator-wl12xx {
 		compatible = "regulator-fixed";
@@ -67,6 +98,10 @@
 	};
 };
 
+&dss {
+	status = "okay";
+};
+
 &gpio6 {
 	touchscreen_reset {
 		gpio-hog;
@@ -81,6 +116,20 @@
 	status = "disabled";
 };
 
+&hdmi {
+	status = "okay";
+	pinctrl-0 = <&dss_hdmi_pins>;
+	pinctrl-names = "default";
+	vdda-supply = <&vdac>;
+
+	port {
+		hdmi_out: endpoint {
+			remote-endpoint = <&hdmi_connector_in>;
+			lanes = <1 0 3 2 5 4 7 6>;
+		};
+	};
+};
+
 &i2c1 {
 	tmp105@48 {
 		compatible = "ti,tmp105";
@@ -249,6 +298,22 @@
 
 &omap4_pmx_core {
 
+	/* hdmi_hpd.gpio_63 */
+	hdmi_hpd_gpio: pinmux_hdmi_hpd_pins {
+		pinctrl-single,pins = <
+                OMAP4_IOPAD(0x098, PIN_INPUT | MUX_MODE3)
+		>;
+	};
+
+	/* hdmi_cec.hdmi_cec, hdmi_scl.hdmi_scl, hdmi_sda.hdmi_sda */
+	dss_hdmi_pins: pinmux_dss_hdmi_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0)
+		OMAP4_IOPAD(0x09c, PIN_INPUT | MUX_MODE0)
+		OMAP4_IOPAD(0x09e, PIN_INPUT | MUX_MODE0)
+		>;
+	};
+
 	/* gpmc_ncs0.gpio_50 */
 	poweroff_gpio: pinmux_poweroff_pins {
 		pinctrl-single,pins = <
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#17 lore raw

PATCH 6/6 ARM: dts: omap4-droid4: Add LCD

In reply to a message not in the archive

The LCD panel on droid 4 is a command mode LCD. The binding follows the standard omapdrm binding and the changes needed for omapdrm command mode panels are posted separately.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 60 ++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +60 -0
@@ -17,6 +17,11 @@
 		stdout-path = &uart3;
 	};
 
+	aliases {
+		display0 = &lcd0;
+		display1 = &hdmi0;
+	};
+
 	/*
 	 * We seem to have only 1021 MB accessible, 1021 - 1022 is locked,
 	 * then 1023 - 1024 seems to contain mbm. For SRAM, see the notes
@@ -66,6 +71,17 @@
 		regulator-always-on;
 	};
 
+	/* LCD regulator from sw5 source */
+	lcd_regulator: regulator-lcd {
+		compatible = "regulator-fixed";
+		regulator-name = "lcd";
+		regulator-min-microvolt = <5050000>;
+		regulator-max-microvolt = <5050000>;
+		gpio = <&gpio4 0 GPIO_ACTIVE_HIGH>;	/* gpio96 */
+		enable-active-high;
+		vin-supply = <&sw5>;
+	};
+
 	/* This is probably coming straight from the battery.. */
 	wl12xx_vmmc: regulator-wl12xx {
 		compatible = "regulator-fixed";
@@ -111,6 +127,50 @@
 	};
 };
 
+&dsi1 {
+	status = "okay";
+	vdd-supply = <&vcsi>;
+
+	port {
+		dsi1_out_ep: endpoint {
+			remote-endpoint = <&lcd0_in>;
+			lanes = <0 1 2 3 4 5>;
+		};
+	};
+
+	lcd0: display {
+		compatible = "panel-dsi-cm";
+		label = "lcd0";
+		vddi-supply = <&lcd_regulator>;
+		reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;	/* gpio101 */
+
+		panel-timing {
+			clock-frequency = <0>;		/* Calculated by dsi */
+
+			hback-porch = <2>;
+			hactive = <540>;
+			hfront-porch = <0>;
+			hsync-len = <2>;
+
+			vback-porch = <1>;
+			vactive = <960>;
+			vfront-porch = <0>;
+			vsync-len = <1>;
+
+			hsync-active = <0>;
+			vsync-active = <0>;
+			de-active = <1>;
+			pixelclk-active = <1>;
+		};
+
+		port {
+			lcd0_in: endpoint {
+				remote-endpoint = <&dsi1_out_ep>;
+			};
+		};
+	};
+};
+
 /* L3_2 interconnect is unused, SRAM, GPMC and L3_ICLK2 disabled */
 &gpmc {
 	status = "disabled";
Signature · 5 lines
2.11.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by
#5 lore raw

Re: [PATCH 2/6] ARM: dts: omap4-droid4: Add LCD backlight

In reply to a message not in the archive
Quoted 4 lines · Tony Lindgren

The TI LMU driver has not yet been merged, but the device
tree binding for TI LMU drivers has been acked already
earlier by Rob Herring <[email protected]>. So it should be safe to apply to cut down the number of pending patches.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#16 lore raw

Re: [PATCH 5/6] ARM: dts: omap4-droid4: Add HDMI support

In reply to a message not in the archive

Hi,

Quoted 4 lines · Tony Lindgren

We can get HDMI working as long as the 5V regulator is on. There is probably an encoder chip there too, but so far no idea what it might be. Let's keep the 5V HDMI regulator always enabled for now as otherwise we cannot detect the monitor properly.

-- Sebastian

Quoted 101 lines
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 65 ++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +65 -0
@@ -35,6 +35,37 @@
 		gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;	/* gpio50 */
 	};
 
+	hdmi0: connector {
+		compatible = "hdmi-connector";
+		pinctrl-0 = <&hdmi_hpd_gpio>;
+		pinctrl-names = "default";
+		label = "hdmi";
+		type = "d";
+
+		hpd-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;	/* gpio63 */
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&hdmi_out>;
+			};
+		};
+	};
+
+	/*
+	 * HDMI 5V regulator probably sourced from battery. Let's keep
+	 * keep this as always enabled for HDMI to work until we've
+	 * figured what the encoder chip is.
+	 */
+	hdmi_regulator: regulator-hdmi {
+		compatible = "regulator-fixed";
+		regulator-name = "hdmi";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio2 27 GPIO_ACTIVE_HIGH>;	/* gpio59 */
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	/* This is probably coming straight from the battery.. */
 	wl12xx_vmmc: regulator-wl12xx {
 		compatible = "regulator-fixed";
@@ -67,6 +98,10 @@
 	};
 };
 
+&dss {
+	status = "okay";
+};
+
 &gpio6 {
 	touchscreen_reset {
 		gpio-hog;
@@ -81,6 +116,20 @@
 	status = "disabled";
 };
 
+&hdmi {
+	status = "okay";
+	pinctrl-0 = <&dss_hdmi_pins>;
+	pinctrl-names = "default";
+	vdda-supply = <&vdac>;
+
+	port {
+		hdmi_out: endpoint {
+			remote-endpoint = <&hdmi_connector_in>;
+			lanes = <1 0 3 2 5 4 7 6>;
+		};
+	};
+};
+
 &i2c1 {
 	tmp105@48 {
 		compatible = "ti,tmp105";
@@ -249,6 +298,22 @@
 
 &omap4_pmx_core {
 
+	/* hdmi_hpd.gpio_63 */
+	hdmi_hpd_gpio: pinmux_hdmi_hpd_pins {
+		pinctrl-single,pins = <
+                OMAP4_IOPAD(0x098, PIN_INPUT | MUX_MODE3)
+		>;
+	};
+
+	/* hdmi_cec.hdmi_cec, hdmi_scl.hdmi_scl, hdmi_sda.hdmi_sda */
+	dss_hdmi_pins: pinmux_dss_hdmi_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0)
+		OMAP4_IOPAD(0x09c, PIN_INPUT | MUX_MODE0)
+		OMAP4_IOPAD(0x09e, PIN_INPUT | MUX_MODE0)
+		>;
+	};
+
 	/* gpmc_ncs0.gpio_50 */
 	poweroff_gpio: pinmux_poweroff_pins {
 		pinctrl-single,pins = <
Signature · 1 line
2.11.1
#6 lore raw

Re: [PATCH 2/6] ARM: dts: omap4-droid4: Add LCD backlight

In reply to a message not in the archive

Hi,

Quoted 5 lines · Tony Lindgren

The TI LMU driver has not yet been merged, but the device
tree binding for TI LMU drivers has been acked already
earlier by Rob Herring <[email protected]>. So it should be safe to apply to cut down the number of pending patches.

Quoted 7 lines
Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Milo Kim <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sebastian Reichel <[email protected]>

I had to add https://patchwork.kernel.org/patch/7704601/ in addition to the patches recently queued into MFD. It would be nice to get that into 4.12 - @Milo Kim: What's your plan on that patch?

-- Sebastian

Quoted 35 lines
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +19 -0
@@ -180,6 +180,25 @@
 	};
 };
 
+&i2c1 {
+	lm3532@38 {
+		compatible = "ti,lm3532";
+		reg = <0x38>;
+
+		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
+
+		backlight {
+			compatible = "ti,lm3532-backlight";
+
+			lcd {
+				led-sources = <0 1 2>;
+				ramp-up-msec = <1>;
+				ramp-down-msec = <0>;
+			};
+		};
+	};
+};
+
 /*
  * REVISIT: Add gpio173 reset pin handling to the driver, see gpio-hog above.
  * If the GPIO reset is used, we probably need to have /lib/firmware/maxtouch.fw
Signature · 1 line
2.11.1
#10 lore raw

Re: [PATCH 3/6] ARM: dts: omap4-droid4: Add GPIO poweroff

In reply to a message not in the archive

Hi,

Quoted 10 lines · Tony Lindgren

Droid 4 has a GPIO line that we can use with CONFIG_POWER_RESET_GPIO. It is probably connected to the CPCAP PMIC, and seems to power down the whole device taking power consumption to zero based on what I measured.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>

-- Sebastian

Quoted 38 lines
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +16 -0
@@ -27,6 +27,14 @@
 		reg = <0x80000000 0x3fd00000>;	/* 1021 MB */
 	};
 
+	/* Poweroff GPIO probably connected to CPCAP */
+	gpio-poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff_gpio>;
+		pinctrl-names = "default";
+		gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;	/* gpio50 */
+	};
+
 	/* This is probably coming straight from the battery.. */
 	wl12xx_vmmc: regulator-wl12xx {
 		compatible = "regulator-fixed";
@@ -226,6 +234,14 @@
 };
 
 &omap4_pmx_core {
+
+	/* gpmc_ncs0.gpio_50 */
+	poweroff_gpio: pinmux_poweroff_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x074, PIN_OUTPUT_PULLUP | MUX_MODE3)
+		>;
+	};
+
 	usb_gpio_mux_sel1: pinmux_usb_gpio_mux_sel1_pins {
 		/* gpio_60 */
 		pinctrl-single,pins = <
Signature · 1 line
2.11.1
#13 lore raw

Re: [PATCH 4/6] ARM: dts: omap4-droid4: Add tmp105 sensor for droid 4

In reply to a message not in the archive

Hi,

Quoted 4 lines · Tony Lindgren

Add tmp105 sensor for droid 4. This can be used with modprobe lm75.ko and running sensors from lm-sensors package. Note that the lm75.c driver does not yet support alert interrupt but droid 4 seems to be wired for it.

lazy testing: cat /sys/class/hwmon/hwmon0/temp1_input 31437

Quoted 5 lines
Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>

-- Sebastian

Quoted 44 lines
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +21 -0
@@ -81,6 +81,20 @@
 	status = "disabled";
 };
 
+&i2c1 {
+	tmp105@48 {
+		compatible = "ti,tmp105";
+		reg = <0x48>;
+		pinctrl-0 = <&tmp105_irq>;
+		pinctrl-names = "default";
+		/* kpd_row0.gpio_178 */
+		interrupts-extended = <&gpio6 18 IRQ_TYPE_EDGE_FALLING
+				       &omap4_pmx_core 0x14e>;
+		interrupt-names = "irq", "wakeup";
+		wakeup-source;
+	};
+};
+
 &keypad {
 	keypad,num-rows = <8>;
 	keypad,num-columns = <8>;
@@ -242,6 +256,13 @@
 		>;
 	};
 
+	/* kpd_row0.gpio_178 */
+	tmp105_irq: pinmux_tmp105_irq {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x18e, PIN_INPUT_PULLUP | MUX_MODE3)
+		>;
+	};
+
 	usb_gpio_mux_sel1: pinmux_usb_gpio_mux_sel1_pins {
 		/* gpio_60 */
 		pinctrl-single,pins = <
Signature · 1 line
2.11.1
#19 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

In reply to a message not in the archive

Hi,

Quoted 10 lines · Tony Lindgren

The LCD panel on droid 4 is a command mode LCD. The binding follows the standard omapdrm binding and the changes needed for omapdrm command mode panels are posted separately.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>

With a non-modular kernel lcd is not working with omapdrm if HDMI is enabled. After dropping HDMI in droid4's dts file everything worked as expected. I assume both work properly with a modular kernel?

-- Sebastian

Quoted 90 lines
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 60 ++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
arch/arm/boot/dts/omap4-droid4-xt894.dts +60 -0
@@ -17,6 +17,11 @@
 		stdout-path = &uart3;
 	};
 
+	aliases {
+		display0 = &lcd0;
+		display1 = &hdmi0;
+	};
+
 	/*
 	 * We seem to have only 1021 MB accessible, 1021 - 1022 is locked,
 	 * then 1023 - 1024 seems to contain mbm. For SRAM, see the notes
@@ -66,6 +71,17 @@
 		regulator-always-on;
 	};
 
+	/* LCD regulator from sw5 source */
+	lcd_regulator: regulator-lcd {
+		compatible = "regulator-fixed";
+		regulator-name = "lcd";
+		regulator-min-microvolt = <5050000>;
+		regulator-max-microvolt = <5050000>;
+		gpio = <&gpio4 0 GPIO_ACTIVE_HIGH>;	/* gpio96 */
+		enable-active-high;
+		vin-supply = <&sw5>;
+	};
+
 	/* This is probably coming straight from the battery.. */
 	wl12xx_vmmc: regulator-wl12xx {
 		compatible = "regulator-fixed";
@@ -111,6 +127,50 @@
 	};
 };
 
+&dsi1 {
+	status = "okay";
+	vdd-supply = <&vcsi>;
+
+	port {
+		dsi1_out_ep: endpoint {
+			remote-endpoint = <&lcd0_in>;
+			lanes = <0 1 2 3 4 5>;
+		};
+	};
+
+	lcd0: display {
+		compatible = "panel-dsi-cm";
+		label = "lcd0";
+		vddi-supply = <&lcd_regulator>;
+		reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;	/* gpio101 */
+
+		panel-timing {
+			clock-frequency = <0>;		/* Calculated by dsi */
+
+			hback-porch = <2>;
+			hactive = <540>;
+			hfront-porch = <0>;
+			hsync-len = <2>;
+
+			vback-porch = <1>;
+			vactive = <960>;
+			vfront-porch = <0>;
+			vsync-len = <1>;
+
+			hsync-active = <0>;
+			vsync-active = <0>;
+			de-active = <1>;
+			pixelclk-active = <1>;
+		};
+
+		port {
+			lcd0_in: endpoint {
+				remote-endpoint = <&dsi1_out_ep>;
+			};
+		};
+	};
+};
+
 /* L3_2 interconnect is unused, SRAM, GPMC and L3_ICLK2 disabled */
 &gpmc {
 	status = "disabled";
Signature · 1 line
2.11.1
#20 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

Quoted 14 lines · Sebastian Reichel

Hi,

Quoted 10 lines · Tony Lindgren

The LCD panel on droid 4 is a command mode LCD. The binding follows the standard omapdrm binding and the changes needed for omapdrm command mode panels are posted separately.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Quoted 6 lines

With a non-modular kernel lcd is not working with omapdrm if HDMI is enabled. After dropping HDMI in droid4's dts file everything worked as expected. I assume both work properly with a modular kernel?

Yes with loadable modules both work just fine. If things do not work properly as built-in, chances are there's some unhandled dependency that needs -EPROBE_DEFER somewhere for a regulator or a clock.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#22 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

In reply to a message not in the archive

Hi,

Quoted 22 lines · Tony Lindgren
Quoted 14 lines · Sebastian Reichel

Hi,

Quoted 10 lines · Tony Lindgren

The LCD panel on droid 4 is a command mode LCD. The binding follows the standard omapdrm binding and the changes needed for omapdrm command mode panels are posted separately.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Quoted 6 lines

With a non-modular kernel lcd is not working with omapdrm if HDMI is enabled. After dropping HDMI in droid4's dts file everything worked as expected. I assume both work properly with a modular kernel?

Quoted 4 lines

Yes with loadable modules both work just fine. If things do not work properly as built-in, chances are there's some unhandled dependency that needs -EPROBE_DEFER somewhere for a regulator or a clock.

I think that would also result in problems with disabled HDMI. I guess the problem is, that omapdrm is initialized too early. AFAIK omapdrm is not hotplug-capable.

-- Sebastian

#7 lore raw

Re: [PATCH 2/6] ARM: dts: omap4-droid4: Add LCD backlight

In reply to Sebastian Reichel

Hi Sebastian,

Quoted 3 lines · Sebastian Reichel

I had to add https://patchwork.kernel.org/patch/7704601/ in addition to the patches recently queued into MFD. It would be nice to get that into 4.12 - @Milo Kim: What's your plan on that patch?

Thanks for checking this.

I just sent the patch to backlight subsystem maintainers. Nothing new except adding a pwm helper, pwm_apply_args().

Best regards,
Milo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#23 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

In reply to Sebastian Reichel
Quoted 25 lines · Sebastian Reichel

Hi,

Quoted 22 lines · Tony Lindgren
Quoted 20 lines · Sebastian Reichel

Hi,

Quoted 10 lines · Tony Lindgren

The LCD panel on droid 4 is a command mode LCD. The binding follows the standard omapdrm binding and the changes needed for omapdrm command mode panels are posted separately.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>

With a non-modular kernel lcd is not working with omapdrm if HDMI is enabled. After dropping HDMI in droid4's dts file everything worked as expected. I assume both work properly with a modular kernel?

Quoted 8 lines
Quoted 4 lines

Yes with loadable modules both work just fine. If things do not work properly as built-in, chances are there's some unhandled dependency that needs -EPROBE_DEFER somewhere for a regulator or a clock.

I think that would also result in problems with disabled HDMI. I guess the problem is, that omapdrm is initialized too early. AFAIK omapdrm is not hotplug-capable.

It shouldn't matter when omapdrm is initialized. omapdrm should wait until it has all the displays.

Tomi

#25 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

In reply to a message not in the archive

Hi,

Quoted 27 lines · Tomi Valkeinen
Quoted 26 lines · Sebastian Reichel
Quoted 24 lines · Tony Lindgren
Quoted 12 lines · Sebastian Reichel
Quoted 10 lines · Tony Lindgren

The LCD panel on droid 4 is a command mode LCD. The binding follows the standard omapdrm binding and the changes needed for omapdrm command mode panels are posted separately.

Cc Marcel Partap <[email protected]>
Cc Michael Scott <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Quoted 6 lines

With a non-modular kernel lcd is not working with omapdrm if HDMI is enabled. After dropping HDMI in droid4's dts file everything worked as expected. I assume both work properly with a modular kernel?

Yes with loadable modules both work just fine. If things do not work properly as built-in, chances are there's some unhandled dependency that needs -EPROBE_DEFER somewhere for a regulator or a clock.

Quoted 6 lines
Quoted 3 lines

I think that would also result in problems with disabled HDMI. I guess the problem is, that omapdrm is initialized too early. AFAIK omapdrm is not hotplug-capable.

It shouldn't matter when omapdrm is initialized. omapdrm should wait until it has all the displays.

I tried to trace this. I assume, that your "should wait until it has all the displays" refers to the code in "omap_connect_dssdevs()". Unfortunately that code does not work correctly:

droid4# dmesg | grep-interesting

[    1.222137] omapdss_dss 58000000.dss: 58000000.dss supply vdda_video not found, using dummy regulator
[    1.236663] omapdss_dispc 58001000.dispc: OMAP DISPC rev 4.0
[    1.236877] omapdss_dss 58000000.dss: bound 58001000.dispc (ops dispc_component_ops)
[    1.245208] omapdss_dsi 58004000.encoder: OMAP DSI rev 3.0
[    1.246246] omapdss_dss 58000000.dss: bound 58004000.encoder (ops dsi_component_ops)
[    1.255462] omapdss_dss 58000000.dss: bound 58006000.encoder (ops hdmi4_component_ops)
[    1.264923] panel-dsi-cm 58004000.encoder:display: probe

This probe failed with -EPROBE_DEFER due to regulator not yet available.

[    3.294586] connector-hdmi connector: connected display: hdmi

I added this to omap_connect_dssdevs(). DSI is not even in the for loop, otherwise there would have been another print.

[    3.299560] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    3.299560] [drm] No driver support for vblank timestamp query.
[    3.313507] [drm] Cannot find any crtc or sizes - going 1024x768
[    3.342376] [drm] Enabling DMM ywrap scrolling
[    3.386871] omapdrm omapdrm.0: fb0: omapdrm frame buffer device
[    3.397460] [drm] Initialized omapdrm 1.0.0 20110917 for omapdrm.0 on minor 0
[    3.406219] panel-dsi-cm 58004000.encoder:display: probe

Here the display is probed again (this time successfully, but omapdrm doesn't care anymore).

Note, that the EPROBE_DEFER handling in omap_connect_dssdevs() is correct, since the connect function can also return EPROBE_DEFER. This is because the omapdss SoC modules request their regulators in their connect handler.

So currently all code in omapdrm/displays returning EPROBE_DEFER in their probe function are potentially ignored by omapdrm. It does work however, if that results in no display being initialized at all.

The simple fix would be to move the regulator probing from display's probe function to display's connect function (multiple omapdrm display drivers are affected). IMHO this is ugly and drives us further away from a common driver scheme, so I suggest to fix omap_connect_dssdevs() instead. It should be enough to check, that all devices have been probed either successfully or with a fatal error at the start of the function. Also the "no devices found" could become -ENODEV instead of -EPROBE_DEFER. I think it may have hid this problem for others.

-- Sebastian

#26 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

Quoted 6 lines · Sebastian Reichel
Quoted 2 lines

It shouldn't matter when omapdrm is initialized. omapdrm should wait until it has all the displays.

I tried to trace this. I assume, that your "should wait until it has all the displays" refers to the code in "omap_connect_dssdevs()". Unfortunately that code does not work correctly:

Indeed, sorry about the confusion. Apparently I was talking about TI's kernel, which has fixes for this.

I have actually posted the patches, along with a lot of other stuff, last Nov. See "[PATCH 00/36] drm/omap: miscallaneous improvements" series. The patches 23-25 should fix this particular issue.

Tomi

#28 lore raw

Re: [PATCH 6/6] ARM: dts: omap4-droid4: Add LCD

In reply to a message not in the archive

Hi,

Quoted 9 lines · Tomi Valkeinen
Quoted 6 lines · Sebastian Reichel
Quoted 2 lines

It shouldn't matter when omapdrm is initialized. omapdrm should wait until it has all the displays.

I tried to trace this. I assume, that your "should wait until it has all the displays" refers to the code in "omap_connect_dssdevs()". Unfortunately that code does not work correctly:

Quoted 6 lines

Indeed, sorry about the confusion. Apparently I was talking about TI's kernel, which has fixes for this.

I have actually posted the patches, along with a lot of other stuff, last Nov. See "[PATCH 00/36] drm/omap: miscallaneous improvements" series. The patches 23-25 should fix this particular issue.

Ok, I got both initializing correctly by cherry-picking (and rebasing) the following patches:

drm/omap: Use omapdss_stack_is_ready() to check that the display stack is up drm/omap: dss: Support for detecting display stack readiness drm/omap: move dss_initialized to omapdss-base
drm/omap: add omapdss-base.ko
drm/omap: dss: Functions to check components in the display/output list

What's the plan with regarding patchset?

-- Sebastian