Re: [PATCH 1/4] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor

From: Konrad Dybcio

Date: Thu Nov 20 2025 - 04:10:52 EST


On 11/20/25 8:14 AM, Rudraksha Gupta via B4 Relay wrote:
> From: Rudraksha Gupta <guptarud@xxxxxxxxx>
>
> 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@xxxxxxxxx>
> ---
> .../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