* [PATCH 0/4] ARM: dts: qcom: msm8960: expressatt: Add more peripherals
@ 2025-11-20 7:14 Rudraksha Gupta via B4 Relay
2025-11-20 7:14 ` [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor Rudraksha Gupta via B4 Relay
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-11-20 7:14 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel, Rudraksha Gupta
Intro:
=================
The following is now working on the Samsung Galaxy Express SGH-I437, an
old 2012 Android phone:
- Light Sensor
- Proximity is currently giving bogus values
- NFC
- Magnetometer
- Maybe need to update the mount matrix?
- Accelerometer
- Maybe need to update the mount matrix?
Tests:
=================
Light Sensor
=================
/sys/bus/iio/devices/iio:device2 # cat in_intensity0_raw && cat in_intensity1_raw
0
0
/sys/bus/iio/devices/iio:device2 # cat in_intensity0_raw && cat in_intensity1_raw
163
28
=================
NFC
=================
nfc0:
Tags: [ ]
Devices: [ ]
Protocols: [ Felica MIFARE Jewel ISO-DEP NFC-DEP ]
Powered: Yes
RF Mode: None
lto: 150
rw: 15
miux: 2047
Start polling on nfc0 as initiator
Targets found for nfc0
Tags: [ tag4 ]
Devices: [ ]
=================
Magnetometer
=================
/sys/bus/iio/devices/iio:device1 # cat in_magn_x_raw && cat in_magn_y_raw && cat in_magn_z_raw
-441672
1223706
3275580
/sys/bus/iio/devices/iio:device1 # cat in_magn_x_raw && cat in_magn_y_raw && cat in_magn_z_raw
-364650
1206172
3248674
/sys/bus/iio/devices/iio:device1 # cat in_magn_x_raw && cat in_magn_y_raw && cat in_magn_z_raw
-439362
1214092
3180892
=================
Accelerometer
=================
/sys/bus/iio/devices/iio:device0 # cat in_accel_x_raw && cat in_accel_y_raw && cat in_accel_z_raw
16
484
-48
/sys/bus/iio/devices/iio:device0 # cat in_accel_x_raw && cat in_accel_y_raw && cat in_accel_z_raw
13
489
469
/sys/bus/iio/devices/iio:device0 # cat in_accel_x_raw && cat in_accel_y_raw && cat in_accel_z_raw
433
106
48
More Information:
=================
- Device page:
https://wiki.postmarketos.org/wiki/Samsung_Galaxy_Express_SGH-I437_(samsung-expressatt)
- Downstream kernel (uses board files):
https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm-12.0-YNG4N/arch/arm/mach-msm/board-express.c
Note: These patches were assisted with AI (specifically Claude) as it
was easily able to translate the old board file into a DTS format that
mainline understands.
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
Rudraksha Gupta (4):
ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor
ARM: dts: qcom: msm8960: expressatt: Add NFC
ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
ARM: dts: qcom: msm8960: expressatt: Add Accelerometer
.../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 109 +++++++++++++++++++++
1 file changed, 109 insertions(+)
---
base-commit: a771210bab42017434c91411e16694ac4fd7afc2
change-id: 20251119-expressatt_nfc_accel_magn_light-f78e02897186
prerequisite-message-id: <176210698639.937813.643585209118839199.b4-ty@kernel.org>
prerequisite-patch-id: befdfe1948c2fbfb867597a6de917c8067fd57be
prerequisite-patch-id: 70a2b0837b9846d8a775f464295da73ca8ff26b4
prerequisite-patch-id: 20e005aa4312c3525e1b90f33a398189b9e2b3b7
prerequisite-patch-id: 970e0eb8af1736e4565fc37830576a67bf7b3227
prerequisite-patch-id: babd3b55d9ff28f19dbc3f7978742c58ef436aee
Best regards,
--
Rudraksha Gupta <guptarud@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor
2025-11-20 7:14 [PATCH 0/4] ARM: dts: qcom: msm8960: expressatt: Add more peripherals Rudraksha Gupta via B4 Relay
@ 2025-11-20 7:14 ` Rudraksha Gupta via B4 Relay
2025-11-20 9:10 ` Konrad Dybcio
2025-11-20 7:14 ` [PATCH 2/4] ARM: dts: qcom: msm8960: expressatt: Add NFC Rudraksha Gupta via B4 Relay
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-11-20 7:14 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel, Rudraksha Gupta
From: Rudraksha Gupta <guptarud@gmail.com>
Currently the Proximity Sensor doesn't work, but light sensor does.
Left the proximity sensor as a TODO for later.
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
.../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
index 5ee919dce75b..1e331a046e7b 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
@@ -52,6 +52,31 @@ key-volume-down {
linux,code = <KEY_VOLUMEDOWN>;
};
};
+
+ i2c-gpio-sensors {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ i2c-gpio,delay-us = <5>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ light-sensor@39 {
+ compatible = "amstaos,tmd2772";
+ reg = <0x39>;
+ interrupt-parent = <&pm8921_gpio>;
+ interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
+ vdd-supply = <&pm8921_l9>;
+ vddio-supply = <&pm8921_lvs4>;
+
+ // TODO: Proximity doesn't work
+ amstaos,proximity-diodes = <0>;
+ led-max-microamp = <100000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&prox_sensor_int>;
+ };
+ };
};
&gsbi5 {
@@ -163,6 +188,15 @@ &pm8921 {
interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
};
+&pm8921_gpio {
+ prox_sensor_int: prox-sensor-int-state {
+ pins = "gpio6";
+ function = "normal";
+ input-enable;
+ bias-disable;
+ };
+};
+
&rpm {
regulators {
compatible = "qcom,rpm-pm8921-regulators";
@@ -280,6 +314,7 @@ pm8921_l9: l9 {
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
bias-pull-down;
+ regulator-always-on;
};
pm8921_l10: l10 {
@@ -377,6 +412,7 @@ pm8921_lvs3: lvs3 {
pm8921_lvs4: lvs4 {
bias-pull-down;
+ regulator-always-on;
};
pm8921_lvs5: lvs5 {
--
2.51.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/4] ARM: dts: qcom: msm8960: expressatt: Add NFC
2025-11-20 7:14 [PATCH 0/4] ARM: dts: qcom: msm8960: expressatt: Add more peripherals Rudraksha Gupta via B4 Relay
2025-11-20 7:14 ` [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor Rudraksha Gupta via B4 Relay
@ 2025-11-20 7:14 ` Rudraksha Gupta via B4 Relay
2025-11-20 9:14 ` Konrad Dybcio
2025-11-20 7:14 ` [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer Rudraksha Gupta via B4 Relay
2025-11-20 7:14 ` [PATCH 4/4] ARM: dts: qcom: msm8960: expressatt: Add Accelerometer Rudraksha Gupta via B4 Relay
3 siblings, 1 reply; 12+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-11-20 7:14 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel, Rudraksha Gupta
From: Rudraksha Gupta <guptarud@gmail.com>
Add pn544 NFC chip
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
.../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 46 ++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
index 1e331a046e7b..81806d7ca001 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
@@ -77,6 +77,27 @@ light-sensor@39 {
pinctrl-0 = <&prox_sensor_int>;
};
};
+
+ i2c-gpio-nfc {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 32 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 33 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ i2c-gpio,delay-us = <5>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ nfc@2b {
+ compatible = "nxp,pn544-i2c";
+ reg = <0x2b>;
+ interrupt-parent = <&tlmm>;
+ interrupts = <106 IRQ_TYPE_EDGE_RISING>;
+ enable-gpios = <&pm8921_gpio 21 GPIO_ACTIVE_HIGH>;
+ firmware-gpios = <&tlmm 92 GPIO_ACTIVE_HIGH>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&nfc_default &nfc_enable>;
+ };
+ };
};
&gsbi5 {
@@ -182,6 +203,22 @@ touchscreen: touchscreen-int-state {
bias-disable;
drive-strength = <2>;
};
+
+ nfc_default: nfc-default-state {
+ irq-pins {
+ pins = "gpio106";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+
+ firmware-pins {
+ pins = "gpio92";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+ };
};
&pm8921 {
@@ -195,6 +232,15 @@ prox_sensor_int: prox-sensor-int-state {
input-enable;
bias-disable;
};
+
+ nfc_enable: nfc-enable-state {
+ pins = "gpio21";
+ function = "normal";
+ output-low;
+ bias-disable;
+ qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+ power-source = <PM8921_GPIO_S4>;
+ };
};
&rpm {
--
2.51.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
2025-11-20 7:14 [PATCH 0/4] ARM: dts: qcom: msm8960: expressatt: Add more peripherals Rudraksha Gupta via B4 Relay
2025-11-20 7:14 ` [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor Rudraksha Gupta via B4 Relay
2025-11-20 7:14 ` [PATCH 2/4] ARM: dts: qcom: msm8960: expressatt: Add NFC Rudraksha Gupta via B4 Relay
@ 2025-11-20 7:14 ` Rudraksha Gupta via B4 Relay
2025-11-20 9:14 ` Konrad Dybcio
2025-11-20 7:14 ` [PATCH 4/4] ARM: dts: qcom: msm8960: expressatt: Add Accelerometer Rudraksha Gupta via B4 Relay
3 siblings, 1 reply; 12+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-11-20 7:14 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel, Rudraksha Gupta
From: Rudraksha Gupta <guptarud@gmail.com>
Add the Yamaha magnetometer. Mount Matrix is left as a TODO.
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
.../boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
index 81806d7ca001..403bef67a148 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
@@ -490,3 +490,21 @@ &usb1 {
dr_mode = "otg";
status = "okay";
};
+
+&gsbi12 {
+ qcom,mode = <GSBI_PROT_I2C>;
+ status = "okay";
+};
+
+&gsbi12_i2c {
+ status = "okay";
+
+ magnetometer@2e {
+ compatible = "yamaha,yas532";
+ reg = <0x2e>;
+ vdd-supply = <&pm8921_l9>;
+ iovdd-supply = <&pm8921_lvs4>;
+
+ // TODO: Figure out Mount Matrix
+ };
+};
--
2.51.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/4] ARM: dts: qcom: msm8960: expressatt: Add Accelerometer
2025-11-20 7:14 [PATCH 0/4] ARM: dts: qcom: msm8960: expressatt: Add more peripherals Rudraksha Gupta via B4 Relay
` (2 preceding siblings ...)
2025-11-20 7:14 ` [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer Rudraksha Gupta via B4 Relay
@ 2025-11-20 7:14 ` Rudraksha Gupta via B4 Relay
3 siblings, 0 replies; 12+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2025-11-20 7:14 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel, Rudraksha Gupta
From: Rudraksha Gupta <guptarud@gmail.com>
Add the Bosch Accelerometer. Mount Matrix is left as a TODO.
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
index 403bef67a148..5ae702693826 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
@@ -499,6 +499,15 @@ &gsbi12 {
&gsbi12_i2c {
status = "okay";
+ accelerometer@18 {
+ compatible = "bosch,bma254";
+ reg = <0x18>;
+ vdd-supply = <&pm8921_l9>;
+ vddio-supply = <&pm8921_lvs4>;
+
+ // TODO: Figure out Mount Matrix
+ };
+
magnetometer@2e {
compatible = "yamaha,yas532";
reg = <0x2e>;
--
2.51.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor
2025-11-20 7:14 ` [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor Rudraksha Gupta via B4 Relay
@ 2025-11-20 9:10 ` Konrad Dybcio
2025-11-21 11:27 ` Rudraksha Gupta
0 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-20 9:10 UTC (permalink / raw)
To: guptarud, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel
On 11/20/25 8:14 AM, Rudraksha Gupta via B4 Relay wrote:
> From: Rudraksha Gupta <guptarud@gmail.com>
>
> Currently the Proximity Sensor doesn't work, but light sensor does.
> Left the proximity sensor as a TODO for later.
>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
> ---
> .../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 36 ++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> index 5ee919dce75b..1e331a046e7b 100644
> --- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> @@ -52,6 +52,31 @@ key-volume-down {
> linux,code = <KEY_VOLUMEDOWN>;
> };
> };
> +
> + i2c-gpio-sensors {
> + compatible = "i2c-gpio";
Are you using gpio-i2c for any specific reason? Would GSBI2 not be
connected to this pair? (I am not sure FWIW)
> + sda-gpios = <&tlmm 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> + scl-gpios = <&tlmm 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> + i2c-gpio,delay-us = <5>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + light-sensor@39 {
> + compatible = "amstaos,tmd2772";
> + reg = <0x39>;
> + interrupt-parent = <&pm8921_gpio>;
> + interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
> + vdd-supply = <&pm8921_l9>;
> + vddio-supply = <&pm8921_lvs4>;
> +
> + // TODO: Proximity doesn't work
C-style comments ( /* foo */ ) are preferred
> + amstaos,proximity-diodes = <0>;
Try comparing the values the upstream and downstream drivers write
to the device, maybe you're missing something
> + led-max-microamp = <100000>;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&prox_sensor_int>;
property-n
property-names
is the preferred order
> + };
> + };
> };
>
> &gsbi5 {
> @@ -163,6 +188,15 @@ &pm8921 {
> interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
> };
>
> +&pm8921_gpio {
> + prox_sensor_int: prox-sensor-int-state {
> + pins = "gpio6";
> + function = "normal";
> + input-enable;
> + bias-disable;
> + };
> +};
> +
> &rpm {
> regulators {
> compatible = "qcom,rpm-pm8921-regulators";
> @@ -280,6 +314,7 @@ pm8921_l9: l9 {
> regulator-min-microvolt = <2850000>;
> regulator-max-microvolt = <2850000>;
> bias-pull-down;
> + regulator-always-on;
> };
>
> pm8921_l10: l10 {
> @@ -377,6 +412,7 @@ pm8921_lvs3: lvs3 {
>
> pm8921_lvs4: lvs4 {
> bias-pull-down;
> + regulator-always-on;
Does it stop working if you remove these regulator-always-on additions?
Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
2025-11-20 7:14 ` [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer Rudraksha Gupta via B4 Relay
@ 2025-11-20 9:14 ` Konrad Dybcio
2025-11-21 11:35 ` Rudraksha Gupta
0 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-20 9:14 UTC (permalink / raw)
To: guptarud, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel
On 11/20/25 8:14 AM, Rudraksha Gupta via B4 Relay wrote:
> From: Rudraksha Gupta <guptarud@gmail.com>
>
> Add the Yamaha magnetometer. Mount Matrix is left as a TODO.
>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
> ---
> .../boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> index 81806d7ca001..403bef67a148 100644
> --- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> @@ -490,3 +490,21 @@ &usb1 {
> dr_mode = "otg";
> status = "okay";
> };
> +
> +&gsbi12 {
> + qcom,mode = <GSBI_PROT_I2C>;
> + status = "okay";
Please add a \n before status
> +};
> +
> +&gsbi12_i2c {
> + status = "okay";
> +
> + magnetometer@2e {
> + compatible = "yamaha,yas532";
> + reg = <0x2e>;
> + vdd-supply = <&pm8921_l9>;
Odd double space
> + iovdd-supply = <&pm8921_lvs4>;
> +
> + // TODO: Figure out Mount Matrix
pmOS wiki has this:
https://github.com/SiddharthManthan/accelerometer-mount-matrix-generator/blob/master/rotation_matrix.py
but for accelerometers.. shouldn't be too different, I would assume
Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4] ARM: dts: qcom: msm8960: expressatt: Add NFC
2025-11-20 7:14 ` [PATCH 2/4] ARM: dts: qcom: msm8960: expressatt: Add NFC Rudraksha Gupta via B4 Relay
@ 2025-11-20 9:14 ` Konrad Dybcio
0 siblings, 0 replies; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-20 9:14 UTC (permalink / raw)
To: guptarud, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel
On 11/20/25 8:14 AM, Rudraksha Gupta via B4 Relay wrote:
> From: Rudraksha Gupta <guptarud@gmail.com>
>
> Add pn544 NFC chip
>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
> ---
> .../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 46 ++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> index 1e331a046e7b..81806d7ca001 100644
> --- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
> @@ -77,6 +77,27 @@ light-sensor@39 {
> pinctrl-0 = <&prox_sensor_int>;
> };
> };
> +
> + i2c-gpio-nfc {
> + compatible = "i2c-gpio";
> + sda-gpios = <&tlmm 32 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> + scl-gpios = <&tlmm 33 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> + i2c-gpio,delay-us = <5>;
Same question, any chance this is GSBI7?
Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor
2025-11-20 9:10 ` Konrad Dybcio
@ 2025-11-21 11:27 ` Rudraksha Gupta
0 siblings, 0 replies; 12+ messages in thread
From: Rudraksha Gupta @ 2025-11-21 11:27 UTC (permalink / raw)
To: Konrad Dybcio, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel
>> +
>> + i2c-gpio-sensors {
>> + compatible = "i2c-gpio";
>
> Are you using gpio-i2c for any specific reason? Would GSBI2 not be
> connected to this pair? (I am not sure FWIW)
This is interesting! Downstream uses i2c-gpio and I (well, Claude) used
that. Seems like downstream doesn't define a GSBI2, so I guessed it's
structure in the dts and it seems to work! Thanks for the suggestion.
No GSBI2:
https://codeberg.org/LogicalErzor/Android_Kernel_Samsung_D2/src/branch/cm-14.1/arch/arm/mach-msm/board-express-gpiomux.c#L411
>> + amstaos,proximity-diodes = <0>;
> Try comparing the values the upstream and downstream drivers write
> to the device, maybe you're missing something
Yeah, I'll continue to try and do that. In the meantime I'll send a v2
so I can get further comments.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
2025-11-20 9:14 ` Konrad Dybcio
@ 2025-11-21 11:35 ` Rudraksha Gupta
2025-11-21 12:54 ` Konrad Dybcio
0 siblings, 1 reply; 12+ messages in thread
From: Rudraksha Gupta @ 2025-11-21 11:35 UTC (permalink / raw)
To: Konrad Dybcio, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, devicetree, linux-kernel
>> + iovdd-supply = <&pm8921_lvs4>;
>> +
>> + // TODO: Figure out Mount Matrix
> pmOS wiki has this:
>
> https://github.com/SiddharthManthan/accelerometer-mount-matrix-generator/blob/master/rotation_matrix.py
>
> but for accelerometers.. shouldn't be too different, I would assume
Unfortunately this seems to generate a broken matrix for me for the
accelerometer. Downstream is also useless here as I believe Android does
something slightly different.
I have been trying to upstream the pinephone pro's accelerometer and
magnetometer as well (
https://lore.kernel.org/all/20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com/
), but I'm just not sure if what I'm doing is right. I think the easiest
solution for me right now is to get the screen working and use GUI
programs to figure out if the mount matrix is right. If you have other
suggestions, please let me know. I'm all ears.
But since I have your attention for now, I had a couple questions on
trying to get the screen to work:
- The pipeline is MDP4 <-> DSI <-> Panel, right? Any information you can
give me so that I can try to get this working faster?
- Is IOMMU broken? It seems like I can use APQ8064's implementation, but
that's broken since at least 5.10. Should this be reported, and if so where?
- I see Adreno 2xx, but seems like there is not Adreno 225 DTS
compatible? Any insight here?
Thanks,
Rudraksha
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
2025-11-21 11:35 ` Rudraksha Gupta
@ 2025-11-21 12:54 ` Konrad Dybcio
2025-11-21 13:11 ` Dmitry Baryshkov
0 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-21 12:54 UTC (permalink / raw)
To: Rudraksha Gupta, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dmitry Baryshkov
Cc: linux-arm-msm, devicetree, linux-kernel
On 11/21/25 12:35 PM, Rudraksha Gupta wrote:
>>> + iovdd-supply = <&pm8921_lvs4>;
>>> +
>>> + // TODO: Figure out Mount Matrix
>> pmOS wiki has this:
>>
>> https://github.com/SiddharthManthan/accelerometer-mount-matrix-generator/blob/master/rotation_matrix.py
>>
>> but for accelerometers.. shouldn't be too different, I would assume
>
> Unfortunately this seems to generate a broken matrix for me for the accelerometer. Downstream is also useless here as I believe Android does something slightly different.
>
> I have been trying to upstream the pinephone pro's accelerometer and magnetometer as well ( https://lore.kernel.org/all/20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com/ ), but I'm just not sure if what I'm doing is right. I think the easiest solution for me right now is to get the screen working and use GUI programs to figure out if the mount matrix is right. If you have other suggestions, please let me know. I'm all ears.
>
> But since I have your attention for now, I had a couple questions on trying to get the screen to work:
>
> - The pipeline is MDP4 <-> DSI <-> Panel, right? Any information you can give me so that I can try to get this working faster?
Yes that's the pipeline
Unless the MDP4 driver is missing something (which it may as well, all
hw since ~2013 has moved on to MDP5/DPU), you should just be required to
come up with a panel driver (DSI init sequences, poking at regulators,
reset GPIO(s) etc.)
> - Is IOMMU broken? It seems like I can use APQ8064's implementation, but that's broken since at least 5.10. Should this be reported, and if so where?
I don't know, this platform uses its own arcane driver.. +Dmitry?
If you have a bug report, please send it to linux-arm-msm
> - I see Adreno 2xx, but seems like there is not Adreno 225 DTS compatible? Any insight here?
Adreno is a separate HW block, you can/should get software rendering to
work first
Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
2025-11-21 12:54 ` Konrad Dybcio
@ 2025-11-21 13:11 ` Dmitry Baryshkov
0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2025-11-21 13:11 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Rudraksha Gupta, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, devicetree,
linux-kernel
On Fri, Nov 21, 2025 at 01:54:22PM +0100, Konrad Dybcio wrote:
> On 11/21/25 12:35 PM, Rudraksha Gupta wrote:
> >>> + iovdd-supply = <&pm8921_lvs4>;
> >>> +
> >>> + // TODO: Figure out Mount Matrix
> >> pmOS wiki has this:
> >>
> >> https://github.com/SiddharthManthan/accelerometer-mount-matrix-generator/blob/master/rotation_matrix.py
> >>
> >> but for accelerometers.. shouldn't be too different, I would assume
> >
> > Unfortunately this seems to generate a broken matrix for me for the accelerometer. Downstream is also useless here as I believe Android does something slightly different.
> >
> > I have been trying to upstream the pinephone pro's accelerometer and magnetometer as well ( https://lore.kernel.org/all/20250929-ppp_light_accel_mag_vol-down-v4-0-6598f22d3451@gmail.com/ ), but I'm just not sure if what I'm doing is right. I think the easiest solution for me right now is to get the screen working and use GUI programs to figure out if the mount matrix is right. If you have other suggestions, please let me know. I'm all ears.
> >
> > But since I have your attention for now, I had a couple questions on trying to get the screen to work:
> >
> > - The pipeline is MDP4 <-> DSI <-> Panel, right? Any information you can give me so that I can try to get this working faster?
>
> Yes that's the pipeline
>
> Unless the MDP4 driver is missing something (which it may as well, all
> hw since ~2013 has moved on to MDP5/DPU), you should just be required to
> come up with a panel driver (DSI init sequences, poking at regulators,
> reset GPIO(s) etc.)
For MDP4 I mostly test LVDS and HDMI output, my DSI4 devices, Nexus7 is
not that usable for testing. Last time I checked it, it was working.
>
> > - Is IOMMU broken? It seems like I can use APQ8064's implementation, but that's broken since at least 5.10. Should this be reported, and if so where?
>
> I don't know, this platform uses its own arcane driver.. +Dmitry?
> If you have a bug report, please send it to linux-arm-msm
It seemed to work for the minimal test cases (mainly around display).
Please send bug reports to this ML, cc iommu@lists.linux.dev
>
> > - I see Adreno 2xx, but seems like there is not Adreno 225 DTS compatible? Any insight here?
>
> Adreno is a separate HW block, you can/should get software rendering to
> work first
Jonathan Marek had, if I'm not mistaken, A225 implemented, but likely
not contributed upstream. You can try asking him.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-11-21 13:11 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 7:14 [PATCH 0/4] ARM: dts: qcom: msm8960: expressatt: Add more peripherals Rudraksha Gupta via B4 Relay
2025-11-20 7:14 ` [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor Rudraksha Gupta via B4 Relay
2025-11-20 9:10 ` Konrad Dybcio
2025-11-21 11:27 ` Rudraksha Gupta
2025-11-20 7:14 ` [PATCH 2/4] ARM: dts: qcom: msm8960: expressatt: Add NFC Rudraksha Gupta via B4 Relay
2025-11-20 9:14 ` Konrad Dybcio
2025-11-20 7:14 ` [PATCH 3/4] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer Rudraksha Gupta via B4 Relay
2025-11-20 9:14 ` Konrad Dybcio
2025-11-21 11:35 ` Rudraksha Gupta
2025-11-21 12:54 ` Konrad Dybcio
2025-11-21 13:11 ` Dmitry Baryshkov
2025-11-20 7:14 ` [PATCH 4/4] ARM: dts: qcom: msm8960: expressatt: Add Accelerometer Rudraksha Gupta via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox