2023-12-06 22:16:34

by Paul Cercueil

[permalink] [raw]
Subject: [PATCH 0/3] ARM: dts: samsung: exynos4210-i9100 updates

Hi Krzysztof / Rob,

Here a small patchset with a fix and some improvements to the DTS for
the Galaxy S2 (aka. i9100) phone.

The first patch unconditionally enables a regulator, which seems to be
needed for the phone to boot properly. I do not know what it is
connected to.

The last two patches add nodes for the touch keys and the accelerometer.

This patchset is based on linux-next-20231206.

Cheers,
-Paul.

Paul Cercueil (3):
ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12
ARM: dts: samsung: exynos4210-i9100: Add node for touch keys
ARM: dts: samsung: exynos4210-i9100: Add accelerometer node

.../arm/boot/dts/samsung/exynos4210-i9100.dts | 48 ++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)

--
2.42.0


2023-12-06 22:16:42

by Paul Cercueil

[permalink] [raw]
Subject: [PATCH 1/3] ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12

The kernel hangs for a good 12 seconds without any info being printed to
dmesg, very early in the boot process, if this regulator is not enabled.

Force-enable it to work around this issue, until we know more about the
underlying problem.

Signed-off-by: Paul Cercueil <[email protected]>
Fixes: 8620cc2f99b7 ("ARM: dts: exynos: Add devicetree file for the Galaxy S2")
Cc: <[email protected]> # v5.8+
---
arch/arm/boot/dts/samsung/exynos4210-i9100.dts | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
index a9ec1f6c1dea..a076a1dfe41f 100644
--- a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
+++ b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
@@ -527,6 +527,14 @@ vtcam_reg: LDO12 {
regulator-name = "VT_CAM_1.8V";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
+
+ /*
+ * Force-enable this regulator; otherwise the
+ * kernel hangs very early in the boot process
+ * for about 12 seconds, without apparent
+ * reason.
+ */
+ regulator-always-on;
};

vcclcd_reg: LDO13 {
--
2.42.0

2023-12-06 22:16:51

by Paul Cercueil

[permalink] [raw]
Subject: [PATCH 3/3] ARM: dts: samsung: exynos4210-i9100: Add accelerometer node

Add a Device Tree node for the ST Microelectronics "K3D" accelerometer
chip found in the Galaxy S2.

Signed-off-by: Paul Cercueil <[email protected]>
---
arch/arm/boot/dts/samsung/exynos4210-i9100.dts | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
index f03b03dbe9f2..7e57fe033e2b 100644
--- a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
+++ b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
@@ -421,6 +421,23 @@ touchscreen@4a {
};
};

+&i2c_1 {
+ status = "okay";
+
+ samsung,i2c-sda-delay = <100>;
+ samsung,i2c-slave-addr = <0x10>;
+ samsung,i2c-max-bus-freq = <100000>;
+
+ lis3dh: accelerometer@19 {
+ compatible = "st,lis3dh-accel";
+ reg = <0x19>;
+
+ mount-matrix = "0", "-1", "0",
+ "1", "0", "0",
+ "0", "0", "1";
+ };
+};
+
&i2c_5 {
status = "okay";

--
2.42.0

2023-12-06 22:16:52

by Paul Cercueil

[permalink] [raw]
Subject: [PATCH 2/3] ARM: dts: samsung: exynos4210-i9100: Add node for touch keys

Add a Device Tree node to support the LED-backed "menu" and "back" keys.

Signed-off-by: Paul Cercueil <[email protected]>
---
.../arm/boot/dts/samsung/exynos4210-i9100.dts | 23 ++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
index a076a1dfe41f..f03b03dbe9f2 100644
--- a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
+++ b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
@@ -184,6 +184,28 @@ s5k5bafx_ep: endpoint {
};
};

+ i2c-gpio-2 {
+ compatible = "i2c-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sda-gpios = <&gpk1 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&gpk1 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ i2c-gpio,delay-us = <2>;
+
+ touchscreen@20 {
+ compatible = "cypress,aries-touchkey";
+ reg = <0x20>;
+
+ interrupt-parent = <&gpl0>;
+ interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+
+ vdd-supply = <&vtouchled_reg>;
+ vcc-supply = <&vtouch_reg>;
+ linux,keycodes = <KEY_MENU>, <KEY_BACK>;
+ };
+ };
+
spi-3 {
compatible = "spi-gpio";
#address-cells = <1>;
@@ -513,7 +535,6 @@ vtouch_reg: LDO11 {
regulator-name = "TOUCH_2.8V";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
- regulator-always-on;
};

vpll_reg: LDO10 {
--
2.42.0

2023-12-08 19:43:38

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 0/3] ARM: dts: samsung: exynos4210-i9100 updates


On Wed, 06 Dec 2023 23:15:53 +0100, Paul Cercueil wrote:
> Here a small patchset with a fix and some improvements to the DTS for
> the Galaxy S2 (aka. i9100) phone.
>
> The first patch unconditionally enables a regulator, which seems to be
> needed for the phone to boot properly. I do not know what it is
> connected to.
>
> [...]

Applied, thanks!

[1/3] ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12
https://git.kernel.org/krzk/linux/c/84228d5e29dbc7a6be51e221000e1d122125826c
[2/3] ARM: dts: samsung: exynos4210-i9100: Add node for touch keys
https://git.kernel.org/krzk/linux/c/6e73b11062b2e3e873666ba35577437502cf1dd2
[3/3] ARM: dts: samsung: exynos4210-i9100: Add accelerometer node
https://git.kernel.org/krzk/linux/c/50c7cdc9a4d2d21373c1ab52c131109ab30c53f5

Best regards,
--
Krzysztof Kozlowski <[email protected]>

2023-12-08 19:44:36

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] ARM: dts: samsung: exynos4210-i9100: Add accelerometer node

On 06/12/2023 23:15, Paul Cercueil wrote:
> Add a Device Tree node for the ST Microelectronics "K3D" accelerometer
> chip found in the Galaxy S2.
>
> Signed-off-by: Paul Cercueil <[email protected]>
> ---
> arch/arm/boot/dts/samsung/exynos4210-i9100.dts | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
> index f03b03dbe9f2..7e57fe033e2b 100644
> --- a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
> +++ b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts
> @@ -421,6 +421,23 @@ touchscreen@4a {
> };
> };
>
> +&i2c_1 {

Fixed placement, so nodes are ordered. If it was not the case in your
DTS, it means you worked on some old tree, which should be avoided.
Please work on mainline.

Best regards,
Krzysztof