]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: dts: qcom: sdm845-oneplus: Add alert-slider
authorGergo Koteles <soyer@irl.hu>
Thu, 13 Nov 2025 16:02:59 +0000 (17:02 +0100)
committerBjorn Andersson <andersson@kernel.org>
Thu, 26 Mar 2026 14:40:48 +0000 (09:40 -0500)
The alert-slider is a tri-state sound profile switch found on the
OnePlus 6, Android maps the states to "silent", "vibrate" and "ring".
Expose them as ABS_SND_PROFILE events.
The previous GPIO numbers were wrong. Update them to the correct ones.

Co-developed-by: Casey Connolly <casey@connolly.tech>
Signed-off-by: Casey Connolly <casey@connolly.tech>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Tested-by: Guido Günther <agx@sigxcpu.org> # oneplus,fajita & oneplus,enchilada
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Link: https://lore.kernel.org/r/20251113-op6-tri-state-v8-2-54073f3874bc@ixit.cz
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi

index 5b121ea5520f5f80c06c5c4558310c1518563fab..ea187244c92a9699954e988afb7ea1ec1f85256c 100644 (file)
        chassis-type = "handset";
        qcom,msm-id = <QCOM_ID_SDM845 0x20001>;
 
+       alert-slider {
+               compatible = "gpio-keys";
+               label = "Alert slider";
+
+               pinctrl-0 = <&alert_slider_default>;
+               pinctrl-names = "default";
+
+               switch-top {
+                       label = "Silent";
+                       linux,input-type = <EV_ABS>;
+                       linux,code = <ABS_SND_PROFILE>;
+                       linux,input-value = <SND_PROFILE_SILENT>;
+                       gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
+                       linux,can-disable;
+               };
+
+               switch-middle {
+                       label = "Vibrate";
+                       linux,input-type = <EV_ABS>;
+                       linux,code = <ABS_SND_PROFILE>;
+                       linux,input-value = <SND_PROFILE_VIBRATE>;
+                       gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
+                       linux,can-disable;
+               };
+
+               switch-bottom {
+                       label = "Ring";
+                       linux,input-type = <EV_ABS>;
+                       linux,code = <ABS_SND_PROFILE>;
+                       linux,input-value = <SND_PROFILE_RING>;
+                       gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
+                       linux,can-disable;
+               };
+       };
+
        aliases {
                serial0 = &uart9;
                serial1 = &uart6;