* [PATCH v2 1/4] ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators
2024-10-10 12:29 [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Andreas Kemnade
@ 2024-10-10 12:29 ` Andreas Kemnade
2024-10-10 20:07 ` Roger Quadros
2024-10-10 12:29 ` [PATCH v2 2/4] ARM: dts: omap: omap4-epson-embt2ws: wire up regulators Andreas Kemnade
` (4 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Andreas Kemnade @ 2024-10-10 12:29 UTC (permalink / raw)
To: linux-kernel, Rob Herring, rogerq, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
Cc: Andreas Kemnade
To properly have things running after cold boot, define
GPIO regulators. Naming is based on board file.
In the vendor kernel they are enabled in a function
called bt2ws_dcdc_init() if the system is not booted just
to charge the battery.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
.../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 73 +++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
index 339e52ba3614..4462747b5cf5 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
+++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
@@ -46,6 +46,55 @@ key-lock {
};
};
+ cb_v18: regulator-cb-v18 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&cb_v18_pins>;
+ compatible = "regulator-fixed";
+ regulator-name = "cb_v18";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ cb_v33: regulator-cb-v33 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&cb_v33_pins>;
+ compatible = "regulator-fixed";
+ regulator-name = "cb_v33";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ gpio = <&gpio6 30 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ regulator-cb-v50 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&cb_v50_pins>;
+ compatible = "regulator-fixed";
+ regulator-name = "cb_v50";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ lb_v50: regulator-lb-v50 {
+ /* required for many things at the head (probably indirectly) */
+ pinctrl-names = "default";
+ pinctrl-0 = <&lb_v50_pins>;
+ compatible = "regulator-fixed";
+ regulator-name = "lb_v50";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
unknown_supply: unknown-supply {
compatible = "regulator-fixed";
regulator-name = "unknown";
@@ -336,6 +385,24 @@ OMAP4_IOPAD(0x1ca, PIN_OUTPUT | MUX_MODE3) /* gpio25 */
>;
};
+ cb_v18_pins: pinmux-cb-v18-pins {
+ pinctrl-single,pins = <
+ OMAP4_IOPAD(0x1d0, PIN_OUTPUT | MUX_MODE3) /* gpio28 */
+ >;
+ };
+
+ cb_v33_pins: pinmux-cb-v33-pins {
+ pinctrl-single,pins = <
+ OMAP4_IOPAD(0x1d2, PIN_OUTPUT | MUX_MODE3) /* gpio190 */
+ >;
+ };
+
+ cb_v50_pins: pinmux-cb-v50-pins {
+ pinctrl-single,pins = <
+ OMAP4_IOPAD(0x1d4, PIN_OUTPUT | MUX_MODE3) /* gpio191 */
+ >;
+ };
+
gpio_keys_pins: pinmux-gpio-key-pins {
pinctrl-single,pins = <
OMAP4_IOPAD(0x56, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio35 */
@@ -387,6 +454,12 @@ OMAP4_IOPAD(0x005c, PIN_OUTPUT | MUX_MODE1)
>;
};
+ lb_v50_pins: pinmux-lb-v50-pins {
+ pinctrl-single,pins = <
+ OMAP4_IOPAD(0x1ce, PIN_OUTPUT | MUX_MODE3) /* gpio27 */
+ >;
+ };
+
mcbsp2_pins: pinmux-mcbsp2-pins {
pinctrl-single,pins = <
OMAP4_IOPAD(0x0f6, PIN_INPUT | MUX_MODE0) /* abe_mcbsp2_clkx */
--
2.39.5
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 1/4] ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators
2024-10-10 12:29 ` [PATCH v2 1/4] ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators Andreas Kemnade
@ 2024-10-10 20:07 ` Roger Quadros
0 siblings, 0 replies; 16+ messages in thread
From: Roger Quadros @ 2024-10-10 20:07 UTC (permalink / raw)
To: Andreas Kemnade, linux-kernel, Rob Herring, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
On 10/10/2024 15:29, Andreas Kemnade wrote:
> To properly have things running after cold boot, define
> GPIO regulators. Naming is based on board file.
>
> In the vendor kernel they are enabled in a function
> called bt2ws_dcdc_init() if the system is not booted just
> to charge the battery.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 2/4] ARM: dts: omap: omap4-epson-embt2ws: wire up regulators
2024-10-10 12:29 [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Andreas Kemnade
2024-10-10 12:29 ` [PATCH v2 1/4] ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators Andreas Kemnade
@ 2024-10-10 12:29 ` Andreas Kemnade
2024-10-10 20:08 ` Roger Quadros
2024-10-10 12:29 ` [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs Andreas Kemnade
` (3 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Andreas Kemnade @ 2024-10-10 12:29 UTC (permalink / raw)
To: linux-kernel, Rob Herring, rogerq, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
Cc: Andreas Kemnade
Wire up the regulators where usage is plausible. Do not
wire them if purpose/usage is unclear like 5V for
many things requiring lower voltages.
Tested on vendor kernel that backlight definitively does not react
on blc_[rl] GPIOs.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
index 4462747b5cf5..7684868a2eed 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
+++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
@@ -20,13 +20,13 @@ memory@80000000 {
backlight-left {
compatible = "pwm-backlight";
pwms = <&twl_pwm 1 7812500>;
- power-supply = <&unknown_supply>;
+ power-supply = <&lb_v50>;
};
backlight-right {
compatible = "pwm-backlight";
pwms = <&twl_pwm 0 7812500>;
- power-supply = <&unknown_supply>;
+ power-supply = <&lb_v50>;
};
chosen {
@@ -95,11 +95,6 @@ lb_v50: regulator-lb-v50 {
enable-active-high;
};
- unknown_supply: unknown-supply {
- compatible = "regulator-fixed";
- regulator-name = "unknown";
- };
-
wl12xx_pwrseq: wl12xx-pwrseq {
compatible = "mmc-pwrseq-simple";
clocks = <&twl 1>;
@@ -308,6 +303,8 @@ mpu9150: imu@68 {
pinctrl-0 = <&mpu9150_pins>;
interrupt-parent = <&gpio2>;
interrupt = <7 IRQ_TYPE_LEVEL_HIGH>;
+ vddio-supply = <&cb_v18>;
+ vdd-supply = <&cb_v33>;
invensense,level-shifter;
};
};
--
2.39.5
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 2/4] ARM: dts: omap: omap4-epson-embt2ws: wire up regulators
2024-10-10 12:29 ` [PATCH v2 2/4] ARM: dts: omap: omap4-epson-embt2ws: wire up regulators Andreas Kemnade
@ 2024-10-10 20:08 ` Roger Quadros
0 siblings, 0 replies; 16+ messages in thread
From: Roger Quadros @ 2024-10-10 20:08 UTC (permalink / raw)
To: Andreas Kemnade, linux-kernel, Rob Herring, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
On 10/10/2024 15:29, Andreas Kemnade wrote:
> Wire up the regulators where usage is plausible. Do not
> wire them if purpose/usage is unclear like 5V for
> many things requiring lower voltages.
>
> Tested on vendor kernel that backlight definitively does not react
> on blc_[rl] GPIOs.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
2024-10-10 12:29 [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Andreas Kemnade
2024-10-10 12:29 ` [PATCH v2 1/4] ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators Andreas Kemnade
2024-10-10 12:29 ` [PATCH v2 2/4] ARM: dts: omap: omap4-epson-embt2ws: wire up regulators Andreas Kemnade
@ 2024-10-10 12:29 ` Andreas Kemnade
2024-10-10 20:15 ` Roger Quadros
2024-10-11 10:37 ` Roger Quadros
2024-10-10 12:29 ` [PATCH v2 4/4] ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander Andreas Kemnade
` (2 subsequent siblings)
5 siblings, 2 replies; 16+ messages in thread
From: Andreas Kemnade @ 2024-10-10 12:29 UTC (permalink / raw)
To: linux-kernel, Rob Herring, rogerq, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
Cc: Andreas Kemnade
Set them to the state seen in a running system, initialized
by vendor u-boot or kernel. Add line names where they are defined in the
vendor kernel.
gpio15 resets something in the display, otherwise meaning of the
gpios is not known.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
.../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 92 +++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
index 7684868a2eed..983a21d95db3 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
+++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
@@ -115,6 +115,73 @@ wl12xx_vmmc: wl12xx-vmmc {
};
};
+&gpio1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
+
+ lb-reset-hog {
+ gpio-hog;
+ gpios = <9 GPIO_ACTIVE_HIGH>;
+ output-low;
+ line-name = "lb_reset";
+ };
+
+ power-en-hog {
+ gpio-hog;
+ gpios = <10 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "power_en";
+ };
+
+ /*
+ * Name taken from vendor kernel but no evidence of actual usage found
+ * nor what it really controls.
+ */
+ panel-power-en-hog {
+ gpio-hog;
+ gpios = <14 GPIO_ACTIVE_HIGH>;
+ output-low;
+ line-name = "panel_power_en";
+ };
+
+ /*
+ * These two are exported to sysfs in vendor kernel, usage unknown,
+ * backlight state seems unrelated to these.
+ */
+ blc-r-hog {
+ gpio-hog;
+ gpios = <17 GPIO_ACTIVE_HIGH>;
+ output-low;
+ line-name = "blc_r";
+ };
+
+ blc-l-hog {
+ gpio-hog;
+ gpios = <16 GPIO_ACTIVE_HIGH>;
+ output-low;
+ line-name = "blc_l";
+ };
+
+ high-hog {
+ gpio-hog;
+ gpios = <15 GPIO_ACTIVE_HIGH /* maybe dsi to dpi chip reset? */
+ 21 GPIO_ACTIVE_HIGH
+ 26 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "unknown-high";
+ };
+
+ low-hog {
+ gpio-hog;
+ gpios = <18 GPIO_ACTIVE_HIGH
+ 19 GPIO_ACTIVE_HIGH
+ 20 GPIO_ACTIVE_HIGH
+ 22 GPIO_ACTIVE_HIGH>;
+ output-low;
+ line-name = "unknown-low";
+ };
+};
+
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
@@ -406,6 +473,22 @@ OMAP4_IOPAD(0x56, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio35 */
>;
};
+ gpio1_hog_pins: pinmux-gpio1-hog-pins {
+ pinctrl-single,pins = <
+ OMAP4_IOPAD(0x1b4, PIN_OUTPUT | MUX_MODE3) /* gpio14 */
+ OMAP4_IOPAD(0x1b8, PIN_OUTPUT | MUX_MODE3) /* gpio16 */
+ OMAP4_IOPAD(0x1ba, PIN_OUTPUT | MUX_MODE3) /* gpio17 */
+
+ OMAP4_IOPAD(0x1b6, PIN_OUTPUT | MUX_MODE3) /* gpio15 */
+ OMAP4_IOPAD(0x1bc, PIN_OUTPUT | MUX_MODE3) /* gpio18 */
+ OMAP4_IOPAD(0x1be, PIN_OUTPUT | MUX_MODE3) /* gpio19 */
+ OMAP4_IOPAD(0x1c0, PIN_OUTPUT | MUX_MODE3) /* gpio20 */
+ OMAP4_IOPAD(0x1c2, PIN_OUTPUT | MUX_MODE3) /* gpio21 */
+ OMAP4_IOPAD(0x1c4, PIN_OUTPUT | MUX_MODE3) /* gpio22 */
+ OMAP4_IOPAD(0x1cc, PIN_OUTPUT | MUX_MODE3) /* gpio26 */
+ >;
+ };
+
i2c1_pins: pinmux-i2c1-pins {
pinctrl-single,pins = <
OMAP4_IOPAD(0x122, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl */
@@ -527,6 +610,15 @@ OMAP4_IOPAD(0x1c8, PIN_OUTPUT | MUX_MODE3) /* gpio_24 / WLAN_EN */
};
};
+&omap4_pmx_wkup {
+ gpio1wk_hog_pins: pinmux-gpio1wk-hog-pins {
+ pinctrl-single,pins = <
+ OMAP4_IOPAD(0x68, PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpio9 */
+ OMAP4_IOPAD(0x6a, PIN_INPUT | MUX_MODE3) /* gpio10 */
+ >;
+ };
+};
+
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pins &bt_pins>;
--
2.39.5
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
2024-10-10 12:29 ` [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs Andreas Kemnade
@ 2024-10-10 20:15 ` Roger Quadros
2024-10-11 9:12 ` Andreas Kemnade
2024-10-11 10:37 ` Roger Quadros
1 sibling, 1 reply; 16+ messages in thread
From: Roger Quadros @ 2024-10-10 20:15 UTC (permalink / raw)
To: Andreas Kemnade, linux-kernel, Rob Herring, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
On 10/10/2024 15:29, Andreas Kemnade wrote:
> Set them to the state seen in a running system, initialized
> by vendor u-boot or kernel. Add line names where they are defined in the
> vendor kernel.
> gpio15 resets something in the display, otherwise meaning of the
> gpios is not known.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
> .../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 92 +++++++++++++++++++
> 1 file changed, 92 insertions(+)
>
> diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> index 7684868a2eed..983a21d95db3 100644
> --- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> +++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> @@ -115,6 +115,73 @@ wl12xx_vmmc: wl12xx-vmmc {
> };
> };
>
> +&gpio1 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
> +
> + lb-reset-hog {
> + gpio-hog;
> + gpios = <9 GPIO_ACTIVE_HIGH>;
> + output-low;
> + line-name = "lb_reset";
> + };
> +
> + power-en-hog {
> + gpio-hog;
> + gpios = <10 GPIO_ACTIVE_HIGH>;
> + output-high;
> + line-name = "power_en";
> + };
As GPIO 9 and 10 come form the Wake-up domain, my guess is
they are used as wake-up input source. Reset button / Power off/wake button?
From pinmux they seem to be Input. So why do we need to force them to a
certain output state?
Can you please confirm if everything works as usual without this hog?
We could still give the GPIO a name without the hog right?
maybe user-space is interested in the state.
> +
> + /*
> + * Name taken from vendor kernel but no evidence of actual usage found
> + * nor what it really controls.
> + */
> + panel-power-en-hog {
> + gpio-hog;
> + gpios = <14 GPIO_ACTIVE_HIGH>;
> + output-low;
> + line-name = "panel_power_en";
> + };
> +
> + /*
> + * These two are exported to sysfs in vendor kernel, usage unknown,
> + * backlight state seems unrelated to these.
> + */
> + blc-r-hog {
> + gpio-hog;
> + gpios = <17 GPIO_ACTIVE_HIGH>;
> + output-low;
> + line-name = "blc_r";
> + };
> +
> + blc-l-hog {
> + gpio-hog;
> + gpios = <16 GPIO_ACTIVE_HIGH>;
> + output-low;
> + line-name = "blc_l";
> + };
> +
> + high-hog {
> + gpio-hog;
> + gpios = <15 GPIO_ACTIVE_HIGH /* maybe dsi to dpi chip reset? */
> + 21 GPIO_ACTIVE_HIGH
> + 26 GPIO_ACTIVE_HIGH>;
> + output-high;
> + line-name = "unknown-high";
> + };
> +
> + low-hog {
> + gpio-hog;
> + gpios = <18 GPIO_ACTIVE_HIGH
> + 19 GPIO_ACTIVE_HIGH
> + 20 GPIO_ACTIVE_HIGH
> + 22 GPIO_ACTIVE_HIGH>;
> + output-low;
> + line-name = "unknown-low";
> + };
> +};
> +
> &i2c1 {
> pinctrl-names = "default";
> pinctrl-0 = <&i2c1_pins>;
> @@ -406,6 +473,22 @@ OMAP4_IOPAD(0x56, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio35 */
> >;
> };
>
> + gpio1_hog_pins: pinmux-gpio1-hog-pins {
> + pinctrl-single,pins = <
> + OMAP4_IOPAD(0x1b4, PIN_OUTPUT | MUX_MODE3) /* gpio14 */
> + OMAP4_IOPAD(0x1b8, PIN_OUTPUT | MUX_MODE3) /* gpio16 */
> + OMAP4_IOPAD(0x1ba, PIN_OUTPUT | MUX_MODE3) /* gpio17 */
> +
> + OMAP4_IOPAD(0x1b6, PIN_OUTPUT | MUX_MODE3) /* gpio15 */
> + OMAP4_IOPAD(0x1bc, PIN_OUTPUT | MUX_MODE3) /* gpio18 */
> + OMAP4_IOPAD(0x1be, PIN_OUTPUT | MUX_MODE3) /* gpio19 */
> + OMAP4_IOPAD(0x1c0, PIN_OUTPUT | MUX_MODE3) /* gpio20 */
> + OMAP4_IOPAD(0x1c2, PIN_OUTPUT | MUX_MODE3) /* gpio21 */
> + OMAP4_IOPAD(0x1c4, PIN_OUTPUT | MUX_MODE3) /* gpio22 */
> + OMAP4_IOPAD(0x1cc, PIN_OUTPUT | MUX_MODE3) /* gpio26 */
> + >;
> + };
> +
> i2c1_pins: pinmux-i2c1-pins {
> pinctrl-single,pins = <
> OMAP4_IOPAD(0x122, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl */
> @@ -527,6 +610,15 @@ OMAP4_IOPAD(0x1c8, PIN_OUTPUT | MUX_MODE3) /* gpio_24 / WLAN_EN */
> };
> };
>
> +&omap4_pmx_wkup {
> + gpio1wk_hog_pins: pinmux-gpio1wk-hog-pins {
> + pinctrl-single,pins = <
> + OMAP4_IOPAD(0x68, PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpio9 */
> + OMAP4_IOPAD(0x6a, PIN_INPUT | MUX_MODE3) /* gpio10 */
> + >;
> + };
> +};
> +
> &uart2 {
> pinctrl-names = "default";
> pinctrl-0 = <&uart2_pins &bt_pins>;
--
cheers,
-roger
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
2024-10-10 20:15 ` Roger Quadros
@ 2024-10-11 9:12 ` Andreas Kemnade
2024-10-11 10:37 ` Roger Quadros
0 siblings, 1 reply; 16+ messages in thread
From: Andreas Kemnade @ 2024-10-11 9:12 UTC (permalink / raw)
To: Roger Quadros
Cc: linux-kernel, Rob Herring, linux-omap, Krzysztof Kozlowski, tony,
devicetree, khilman, Conor Dooley, aaro.koskinen
Am Thu, 10 Oct 2024 23:15:51 +0300
schrieb Roger Quadros <rogerq@kernel.org>:
> On 10/10/2024 15:29, Andreas Kemnade wrote:
> > Set them to the state seen in a running system, initialized
> > by vendor u-boot or kernel. Add line names where they are defined
> > in the vendor kernel.
> > gpio15 resets something in the display, otherwise meaning of the
> > gpios is not known.
> >
> > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> > ---
> > .../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 92
> > +++++++++++++++++++ 1 file changed, 92 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> > b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts index
> > 7684868a2eed..983a21d95db3 100644 ---
> > a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts +++
> > b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts @@ -115,6
> > +115,73 @@ wl12xx_vmmc: wl12xx-vmmc { };
> > };
> >
> > +&gpio1 {
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
> > +
> > + lb-reset-hog {
> > + gpio-hog;
> > + gpios = <9 GPIO_ACTIVE_HIGH>;
> > + output-low;
> > + line-name = "lb_reset";
> > + };
> > +
> > + power-en-hog {
> > + gpio-hog;
> > + gpios = <10 GPIO_ACTIVE_HIGH>;
> > + output-high;
> > + line-name = "power_en";
> > + };
>
> As GPIO 9 and 10 come form the Wake-up domain, my guess is
> they are used as wake-up input source. Reset button / Power off/wake
> button? From pinmux they seem to be Input. So why do we need to force
> them to a certain output state?
Interesting reasoning and good to bring up those thoughts.
Vendor v3.0 kernel:
shell@android:/sys/kernel/debug # cat gpio
GPIOs 0-31, gpio:
[...]
gpio-9 (gpio_lb_reset ) out lo
gpio-10 (gpio_power_en ) out hi
So they are configured as output.
There is one power button. It can be handled via the TWL6032 (driver
not upstreamed yet). There is also one reset button resetting the SoC.
I do not see a reason why to deviate from vendor kernel.
> Can you please confirm if everything works as usual without this hog?
>
Well, if everything is working well, I would agree to optimize
these things. But not now. There are races in the boot process
and I would like to rule out that any random or strange behavior has
anything to do with some gpio setting.
Regards,
Andreas
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
2024-10-11 9:12 ` Andreas Kemnade
@ 2024-10-11 10:37 ` Roger Quadros
0 siblings, 0 replies; 16+ messages in thread
From: Roger Quadros @ 2024-10-11 10:37 UTC (permalink / raw)
To: Andreas Kemnade
Cc: linux-kernel, Rob Herring, linux-omap, Krzysztof Kozlowski, tony,
devicetree, khilman, Conor Dooley, aaro.koskinen
On 11/10/2024 12:12, Andreas Kemnade wrote:
> Am Thu, 10 Oct 2024 23:15:51 +0300
> schrieb Roger Quadros <rogerq@kernel.org>:
>
>> On 10/10/2024 15:29, Andreas Kemnade wrote:
>>> Set them to the state seen in a running system, initialized
>>> by vendor u-boot or kernel. Add line names where they are defined
>>> in the vendor kernel.
>>> gpio15 resets something in the display, otherwise meaning of the
>>> gpios is not known.
>>>
>>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>>> ---
>>> .../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 92
>>> +++++++++++++++++++ 1 file changed, 92 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
>>> b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts index
>>> 7684868a2eed..983a21d95db3 100644 ---
>>> a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts +++
>>> b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts @@ -115,6
>>> +115,73 @@ wl12xx_vmmc: wl12xx-vmmc { };
>>> };
>>>
>>> +&gpio1 {
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
>>> +
>>> + lb-reset-hog {
>>> + gpio-hog;
>>> + gpios = <9 GPIO_ACTIVE_HIGH>;
>>> + output-low;
>>> + line-name = "lb_reset";
>>> + };
>>> +
>>> + power-en-hog {
>>> + gpio-hog;
>>> + gpios = <10 GPIO_ACTIVE_HIGH>;
>>> + output-high;
>>> + line-name = "power_en";
>>> + };
>>
>> As GPIO 9 and 10 come form the Wake-up domain, my guess is
>> they are used as wake-up input source. Reset button / Power off/wake
>> button? From pinmux they seem to be Input. So why do we need to force
>> them to a certain output state?
>
> Interesting reasoning and good to bring up those thoughts.
>
> Vendor v3.0 kernel:
> shell@android:/sys/kernel/debug # cat gpio
> GPIOs 0-31, gpio:
> [...]
> gpio-9 (gpio_lb_reset ) out lo
> gpio-10 (gpio_power_en ) out hi
>
> So they are configured as output.
> There is one power button. It can be handled via the TWL6032 (driver
> not upstreamed yet). There is also one reset button resetting the SoC.
>
> I do not see a reason why to deviate from vendor kernel.
OK.
>
>> Can you please confirm if everything works as usual without this hog?
>>
> Well, if everything is working well, I would agree to optimize
> these things. But not now. There are races in the boot process
> and I would like to rule out that any random or strange behavior has
> anything to do with some gpio setting.
>
> Regards,
> Andreas
--
cheers,
-roger
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
2024-10-10 12:29 ` [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs Andreas Kemnade
2024-10-10 20:15 ` Roger Quadros
@ 2024-10-11 10:37 ` Roger Quadros
1 sibling, 0 replies; 16+ messages in thread
From: Roger Quadros @ 2024-10-11 10:37 UTC (permalink / raw)
To: Andreas Kemnade, linux-kernel, Rob Herring, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
On 10/10/2024 15:29, Andreas Kemnade wrote:
> Set them to the state seen in a running system, initialized
> by vendor u-boot or kernel. Add line names where they are defined in the
> vendor kernel.
> gpio15 resets something in the display, otherwise meaning of the
> gpios is not known.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 4/4] ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander
2024-10-10 12:29 [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Andreas Kemnade
` (2 preceding siblings ...)
2024-10-10 12:29 ` [PATCH v2 3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs Andreas Kemnade
@ 2024-10-10 12:29 ` Andreas Kemnade
2024-10-10 20:17 ` Roger Quadros
2024-10-10 14:30 ` [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Rob Herring (Arm)
2024-10-29 23:35 ` Kevin Hilman
5 siblings, 1 reply; 16+ messages in thread
From: Andreas Kemnade @ 2024-10-10 12:29 UTC (permalink / raw)
To: linux-kernel, Rob Herring, rogerq, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
Cc: Andreas Kemnade
Define the GPIO expander which controls at least some camera gpios.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
index 983a21d95db3..6bc8c0397c29 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
+++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
@@ -299,6 +299,19 @@ &i2c2 {
clock-frequency = <200000>;
+ /* is sometimes not available, research needed */
+ gpio_head: gpio@20 {
+ compatible = "ti,tca6408";
+ reg = <0x20>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ /*
+ * camera chip at 0x3c, available if <&gpio_head 1> high
+ * and <&gpio_head 5> low
+ */
+
/* at head/glasses */
mpu9150h: imu@68 {
compatible = "invensense,mpu9150";
--
2.39.5
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 4/4] ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander
2024-10-10 12:29 ` [PATCH v2 4/4] ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander Andreas Kemnade
@ 2024-10-10 20:17 ` Roger Quadros
0 siblings, 0 replies; 16+ messages in thread
From: Roger Quadros @ 2024-10-10 20:17 UTC (permalink / raw)
To: Andreas Kemnade, linux-kernel, Rob Herring, linux-omap,
Krzysztof Kozlowski, tony, devicetree, khilman, Conor Dooley,
aaro.koskinen
On 10/10/2024 15:29, Andreas Kemnade wrote:
> Define the GPIO expander which controls at least some camera gpios.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions
2024-10-10 12:29 [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Andreas Kemnade
` (3 preceding siblings ...)
2024-10-10 12:29 ` [PATCH v2 4/4] ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander Andreas Kemnade
@ 2024-10-10 14:30 ` Rob Herring (Arm)
2024-10-17 9:49 ` Andreas Kemnade
2024-10-29 23:23 ` Kevin Hilman
2024-10-29 23:35 ` Kevin Hilman
5 siblings, 2 replies; 16+ messages in thread
From: Rob Herring (Arm) @ 2024-10-10 14:30 UTC (permalink / raw)
To: Andreas Kemnade
Cc: aaro.koskinen, khilman, rogerq, linux-omap, Krzysztof Kozlowski,
devicetree, Conor Dooley, linux-kernel, tony
On Thu, 10 Oct 2024 14:29:53 +0200, Andreas Kemnade wrote:
> Bring the system into a more defined state and do not rely
> on things being initialized by bootloader.
>
> Changes in V2:
> - better comment strange GPIOs
> - proper names for regulator nodes
>
> Andreas Kemnade (4):
> ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators
> ARM: dts: omap: omap4-epson-embt2ws: wire up regulators
> ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
> ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander
>
> .../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 183 +++++++++++++++++-
> 1 file changed, 179 insertions(+), 4 deletions(-)
>
> --
> 2.39.5
>
>
>
My bot found new DTB warnings on the .dts files added or changed in this
series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:
pip3 install dtschema --upgrade
New warnings running 'make CHECK_DTBS=y ti/omap/omap4-epson-embt2ws.dtb' for 20241010122957.85164-1-andreas@kemnade.info:
arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dtb: serial@0: {'compatible': ['ti,omap4-uart'], 'reg': [[0, 256]], 'interrupts': [[0, 74, 4]], 'clock-frequency': 48000000, 'pinctrl-names': ['default'], 'pinctrl-0': [[115]], 'interrupts-extended': [[1, 0, 74, 4], [116, 260]], '$nodename': ['serial@0']} is valid under each of {'required': ['interrupts-extended']}, {'required': ['interrupts']}
from schema $id: http://devicetree.org/schemas/serial/8250_omap.yaml#
arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dtb: serial@0: {'compatible': ['ti,omap4-uart'], 'reg': [[0, 256]], 'interrupts': [[0, 73, 4]], 'clock-frequency': 48000000, 'pinctrl-names': ['default'], 'pinctrl-0': [[118, 119]], 'interrupts-extended': [[1, 0, 73, 4], [116, 220]], 'bluetooth-gnss': {'compatible': ['ti,wl1283-st'], 'enable-gpios': [[120, 25, 0]], 'clocks': [[121, 1]], 'clock-names': ['ext_clock']}, '$nodename': ['serial@0']} is valid under each of {'required': ['interrupts-extended']}, {'required': ['interrupts']}
from schema $id: http://devicetree.org/schemas/serial/8250_omap.yaml#
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions
2024-10-10 14:30 ` [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Rob Herring (Arm)
@ 2024-10-17 9:49 ` Andreas Kemnade
2024-10-29 23:23 ` Kevin Hilman
1 sibling, 0 replies; 16+ messages in thread
From: Andreas Kemnade @ 2024-10-17 9:49 UTC (permalink / raw)
To: Rob Herring (Arm)
Cc: aaro.koskinen, khilman, rogerq, linux-omap, Krzysztof Kozlowski,
devicetree, Conor Dooley, linux-kernel, tony
Am Thu, 10 Oct 2024 09:30:09 -0500
schrieb "Rob Herring (Arm)" <robh@kernel.org>:
> On Thu, 10 Oct 2024 14:29:53 +0200, Andreas Kemnade wrote:
> > Bring the system into a more defined state and do not rely
> > on things being initialized by bootloader.
> >
> > Changes in V2:
> > - better comment strange GPIOs
> > - proper names for regulator nodes
> >
> > Andreas Kemnade (4):
> > ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators
> > ARM: dts: omap: omap4-epson-embt2ws: wire up regulators
> > ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
> > ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander
> >
> > .../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 183
> > +++++++++++++++++- 1 file changed, 179 insertions(+), 4 deletions(-)
> >
> > --
> > 2.39.5
> >
> >
> >
>
>
> My bot found new DTB warnings on the .dts files added or changed in
> this series.
>
> Some warnings may be from an existing SoC .dtsi. Or perhaps the
> warnings are fixed by another series. Ultimately, it is up to the
> platform maintainer whether these warnings are acceptable or not. No
> need to reply unless the platform maintainer has comments.
>
> If you already ran DT checks and didn't see these error(s), then
> make sure dt-schema is up to date:
>
> pip3 install dtschema --upgrade
>
>
> New warnings running 'make CHECK_DTBS=y
> ti/omap/omap4-epson-embt2ws.dtb' for
> 20241010122957.85164-1-andreas@kemnade.info:
>
> arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dtb: serial@0:
> {'compatible': ['ti,omap4-uart'], 'reg': [[0, 256]], 'interrupts':
> [[0, 74, 4]], 'clock-frequency': 48000000, 'pinctrl-names':
> ['default'], 'pinctrl-0': [[115]], 'interrupts-extended': [[1, 0, 74,
> 4], [116, 260]], '$nodename': ['serial@0']} is valid under each of
> {'required': ['interrupts-extended']}, {'required': ['interrupts']}
> from schema $id: http://devicetree.org/schemas/serial/8250_omap.yaml#
> arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dtb: serial@0:
> {'compatible': ['ti,omap4-uart'], 'reg': [[0, 256]], 'interrupts':
> [[0, 73, 4]], 'clock-frequency': 48000000, 'pinctrl-names':
> ['default'], 'pinctrl-0': [[118, 119]], 'interrupts-extended': [[1,
> 0, 73, 4], [116, 220]], 'bluetooth-gnss': {'compatible':
> ['ti,wl1283-st'], 'enable-gpios': [[120, 25, 0]], 'clocks': [[121,
> 1]], 'clock-names': ['ext_clock']}, '$nodename': ['serial@0']} is
> valid under each of {'required': ['interrupts-extended']},
> {'required': ['interrupts']} from schema $id:
> http://devicetree.org/schemas/serial/8250_omap.yaml#
>
To make sure I am getting this right: According to wdiff, the
difference is:
'pinctrl-0': [-[[116, 117]],-] {+[[118, 119]],+}
'interrupts-extended': [[1, 0, 73, 4], [-[114,-] {+[116,+} 220]]
So my understanding is that phandle numbers are reordered and one
of the reordered numbers pops up in a warning message and cannot
easily be filtered away. Are there any tools or procedures in general to
filter out phandle reenumeration noise? Also when reordering things
expecting no functional change and diffing dtbs that would be helpful.
Regards,
Andreas
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions
2024-10-10 14:30 ` [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Rob Herring (Arm)
2024-10-17 9:49 ` Andreas Kemnade
@ 2024-10-29 23:23 ` Kevin Hilman
1 sibling, 0 replies; 16+ messages in thread
From: Kevin Hilman @ 2024-10-29 23:23 UTC (permalink / raw)
To: Rob Herring (Arm), Andreas Kemnade
Cc: aaro.koskinen, rogerq, linux-omap, Krzysztof Kozlowski,
devicetree, Conor Dooley, linux-kernel, tony
"Rob Herring (Arm)" <robh@kernel.org> writes:
> On Thu, 10 Oct 2024 14:29:53 +0200, Andreas Kemnade wrote:
>> Bring the system into a more defined state and do not rely
>> on things being initialized by bootloader.
>>
>> Changes in V2:
>> - better comment strange GPIOs
>> - proper names for regulator nodes
>>
>> Andreas Kemnade (4):
>> ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators
>> ARM: dts: omap: omap4-epson-embt2ws: wire up regulators
>> ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
>> ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander
>>
>> .../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 183 +++++++++++++++++-
>> 1 file changed, 179 insertions(+), 4 deletions(-)
>>
>> --
>> 2.39.5
>>
>>
>>
>
>
> My bot found new DTB warnings on the .dts files added or changed in this
> series.
>
> Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
> are fixed by another series. Ultimately, it is up to the platform
> maintainer whether these warnings are acceptable or not. No need to reply
> unless the platform maintainer has comments.
This seems like not a new warning, but instead a reoccurance of an
existing warning due to a phandle rename, so I'm planning to pull this
as is.
Kevin
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions
2024-10-10 12:29 [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Andreas Kemnade
` (4 preceding siblings ...)
2024-10-10 14:30 ` [PATCH v2 0/4] ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions Rob Herring (Arm)
@ 2024-10-29 23:35 ` Kevin Hilman
5 siblings, 0 replies; 16+ messages in thread
From: Kevin Hilman @ 2024-10-29 23:35 UTC (permalink / raw)
To: linux-kernel, Rob Herring, rogerq, linux-omap,
Krzysztof Kozlowski, tony, devicetree, Conor Dooley,
aaro.koskinen, Andreas Kemnade
On Thu, 10 Oct 2024 14:29:53 +0200, Andreas Kemnade wrote:
> Bring the system into a more defined state and do not rely
> on things being initialized by bootloader.
>
> Changes in V2:
> - better comment strange GPIOs
> - proper names for regulator nodes
>
> [...]
Applied, thanks!
[1/4] ARM: dts: omap: omap4-epson-embt2ws: define GPIO regulators
commit: c14655b6dffd9ca93276f630d2c9a5973711d33b
[2/4] ARM: dts: omap: omap4-epson-embt2ws: wire up regulators
commit: e84bc0f34f708f3c58e5268cb53f451af97fe1d3
[3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs
commit: b5a041ea0bfb2eb8ab5e19f61e2772faa8110a2d
[4/4] ARM: dts: omap: omap4-epson-embt2ws: add GPIO expander
commit: 0b96b3f1d01486e836d01d18c2f8e3f01b046cb5
Best regards,
--
Kevin Hilman <khilman@baylibre.com>
^ permalink raw reply [flat|nested] 16+ messages in thread