From nobody Wed Dec 17 03:48:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AAA186337; Sat, 19 Apr 2025 19:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745091988; cv=none; b=U4qM5lxPYEMi7xro0Yy0ZWF5egm9uqQIK5DqJJPPr5lJ34mfCFaGJihx1P1RI9rbr1/ojBU3npYahoZlF+Q9EMv3VDBeDULjpLFvbhY8vz+Up/IMTVyIHsnL/ezVqUFdGrpm32GXS5Dv2vRmhNm50/OWMQ1lPhQPH2I13gIkPD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745091988; c=relaxed/simple; bh=GBsLmBLPqNfr3xsTFXsl4ap5IQP9wLywcQpn3tzVvyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VqLT2qS1OHUFcxGcBuRhp1Wl/4BM7mw6S2q17tXSfRzR0Cd6BAqRB1ecL6g+IIAx7jJAls5u4QzXzpT5AmHjYpg0Nax7T/+I7T16JnPibP7NGGSaTmIN24uiMfHskPpHQG0m7LnjJ8N4mJ97y/EBHEyYriHevdOsGDomuia0miQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LkSAEXlZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LkSAEXlZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id BE2FFC4CEEC; Sat, 19 Apr 2025 19:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745091987; bh=GBsLmBLPqNfr3xsTFXsl4ap5IQP9wLywcQpn3tzVvyE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LkSAEXlZys7wSVrzq4063YvsQ4Zm/gD5oeJUEL1UdeVqmGofYajnhcgkRTUALB1vK TEgoEUZ9Yzh1amFyJOmokiAfwULpqk0fqMgkvHShuhaqgk75T2nnlqr61H81JjmxsO B/M8ep5ywOZ8ZdYFoTOjyuhLOFq+0o8s78qWKNqiJntmUq8iQP23+Mgc6jLDAm7O3o r0+DwC3PHSf0wWllT9JsN+U3EPe7v3zBl7y9APjMYB+T9cTSpMuVhEZlTSs3CVY1Em 21k9LYD7/HxmtuYRFf+9Xej3I5hjQpD8C44r1pbaYKTcA6TWl8UMgwhY61K+ThLtTC bnuR+FPmrkQSA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABF5AC369D2; Sat, 19 Apr 2025 19:46:27 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 19 Apr 2025 21:46:24 +0200 Subject: [PATCH v5 1/2] Input: add ABS_SND_PROFILE Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250419-op6-tri-state-v5-1-443127078517@ixit.cz> References: <20250419-op6-tri-state-v5-0-443127078517@ixit.cz> In-Reply-To: <20250419-op6-tri-state-v5-0-443127078517@ixit.cz> To: Dmitry Torokhov , Jonathan Corbet , Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Gergo Koteles , David Heidelberg X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2583; i=david@ixit.cz; h=from:subject:message-id; bh=i5QacdZ/EVh5SDiiH8BXaqoyY6PRnf1bq8efvVTS4uk=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBoA/2SLFWFP6SwaDTbbhtXi/nY8CtVGPNDNxepf +rx00VGsByJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCaAP9kgAKCRBgAj/E00kg cvU0EACxLXN1Bs8kSN4lpWS/FMjVCiqiOc0elNecLFBakDSaHbUMSAw4z7UFJSg+MfNzbXhnr7S AzEsYRhcUfvCmhvMUSOfhi0DGYpG1zdFztM6FmGRTqFNBMo5PunougTmXSZJG5satKEYipfXG1O g1pJK4pibcnZN3ijF9X+QUb6rBjeHHOGvOdnIx/WvjruBPJ6iSVF/SVIDP0Bmud49lpGa1GR2aE NSObUWdPWVxib0DgR4I8q9Z1D8AK3oSjl63J9OX6pESXO2fCjtOfokp2yU8jrKG/qLB4mdo5hio mFJxevAyafkFfWKCDJhrbFyJAzNinOG0u3D9T1XGVpdf9rZKR5/E49hgRe7age9xOVBYDzCDcuo Kpo3pe2yv/s4JTwXylRte1F6xfD7OSnuEqNitAYlhCSa0XwqTpZF85sHE/qBRSrhio3zCYyGBG+ KccPiPxhhrKll8DZgnbvS3/JVF3doqaKDC9zYA2fIcRoLLjc2jQell+nB4tt/ZjnK5csDCRyRP6 +YD25FOGcLutxzGEpssIVLY5Tex52S8ks4L+3lNt33TfBZkXvSHQALJd+OmCGimtz67/ufuiocI aBNgqKHzwNn1nTP/oQY219HhGiLIm1gyjSxvCXXay8l0y2VhljF1U7k4PKQMmM5Hzz5ELmAz9B8 zELlvHrQ3LoulIg== X-Developer-Key: i=david@ixit.cz; a=openpgp; fpr=D77A09CFEEDC2BBD53A7047460023FC4D3492072 X-Endpoint-Received: by B4 Relay for david@ixit.cz/default with auth_id=355 X-Original-From: David Heidelberg Reply-To: david@ixit.cz From: Gergo Koteles ABS_SND_PROFILE used to describe the state of a multi-value sound profile switch. This will be used for the alert-slider on OnePlus phones or other phones. Profile values added as SND_PROFLE_(SILENT|VIBRATE|RING) identifiers to input-event-codes.h so they can be used from DTS. Signed-off-by: Gergo Koteles Signed-off-by: David Heidelberg --- Documentation/input/event-codes.rst | 6 ++++++ drivers/hid/hid-debug.c | 1 + include/uapi/linux/input-event-codes.h | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/Documentation/input/event-codes.rst b/Documentation/input/even= t-codes.rst index b4557462edd7b3fef9e9cd6c2c3cb2d05bb531ab..d43336e64d6aa4fe8a41b7e9947= f4f214df6e1ab 100644 --- a/Documentation/input/event-codes.rst +++ b/Documentation/input/event-codes.rst @@ -241,6 +241,12 @@ A few EV_ABS codes have special meanings: emitted only when the selected profile changes, indicating the newly selected profile value. =20 +* ABS_SND_PROFILE: + + - Used to describe the state of a multi-value sound profile switch. + An event is emitted only when the selected profile changes, + indicating the newly selected profile value. + * ABS_MT_: =20 - Used to describe multitouch input events. Please see diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 8433306148d57887f855578b8386bd0473cad612..2ccbae40c47cbca73df90b69e23= 6830ff0fe4f3e 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -3511,6 +3511,7 @@ static const char *absolutes[ABS_CNT] =3D { [ABS_DISTANCE] =3D "Distance", [ABS_TILT_X] =3D "XTilt", [ABS_TILT_Y] =3D "YTilt", [ABS_TOOL_WIDTH] =3D "ToolWidth", [ABS_VOLUME] =3D "Volume", [ABS_PROFILE] =3D "Profile", + [ABS_SND_PROFILE] =3D "SoundProfile", [ABS_MISC] =3D "Misc", [ABS_MT_SLOT] =3D "MTSlot", [ABS_MT_TOUCH_MAJOR] =3D "MTMajor", diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/in= put-event-codes.h index 3b2524e4b667d1e7cc02ff5cb674e7c2ac069a66..7b10c97d13fb8d346a836f6c90c= 5964895856776 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -870,6 +870,7 @@ =20 #define ABS_VOLUME 0x20 #define ABS_PROFILE 0x21 +#define ABS_SND_PROFILE 0x22 =20 #define ABS_MISC 0x28 =20 @@ -979,4 +980,12 @@ #define SND_MAX 0x07 #define SND_CNT (SND_MAX+1) =20 +/* + * ABS_SND_PROFILE values + */ + +#define SND_PROFILE_SILENT 0x00 +#define SND_PROFILE_VIBRATE 0x01 +#define SND_PROFILE_RING 0x02 + #endif --=20 2.49.0 From nobody Wed Dec 17 03:48:33 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AD254A3C; Sat, 19 Apr 2025 19:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745091988; cv=none; b=Tsh3Dndx8dbWvgj0SZB2jvpw6o9LYb62slVJKdrO5fJMgYWusY84/8boAInE6FA3d2oOhN5zG731U+ivphX64GdbdIPen/7Qj21mCX2wbEdOLyOGxdiEqAnN4v+eZ3L7hKtNcoBB8fm0D1okB6TjJwt2ymE8UGDFha0w6BSr6To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745091988; c=relaxed/simple; bh=oJfRg4zIMZ3tXriZj/afkIrse+w7HayBW5i6gEbnvu0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tOfnfB7XpOBh0pT+vvnhwsZ4Sd0C+STGIF/NrtLOOx4Sg9NJY3nHp5tej75DfOcpEi2f+oNtLUG1V9w6L47cWyndNkgjskmkCVsqnTrikUi4dWwjP5KoFk+2fKAukC9I9ejB5o6mWw8ElqzdUqWtnYMVeGfnm6yRvde2iypiSz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SwX29j3h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SwX29j3h" Received: by smtp.kernel.org (Postfix) with ESMTPS id D1D78C4CEED; Sat, 19 Apr 2025 19:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745091987; bh=oJfRg4zIMZ3tXriZj/afkIrse+w7HayBW5i6gEbnvu0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=SwX29j3hTiqKf4CGUwjD6f9FhEQoJyzKfmS2evYs4QIxoenmYCHkz5UgvL6boIzqI mC1ZczduyJEapXUJFt6qZEilotmAoUIwrw8Qb6Tdf4Wt1odDuqOg0Jjt/elcVyW0aI aX8EGi3AC7ora8WnE838of+XsknPvmsdgMjYS/MgyMY6Cjt3in/zyVsxkXrxAUqmqM dZDJjgSvTzODWiHJw7arxMO+YQ7cY4JE2eNmCiIi5OIVimvUrV80FrLfyg/b7LjUgi UUHzWL0hm+uYQjB1zeNpPHLuu4VNh/rCgjzk2isBNBSmY0GTklVE3iII/vwYmYSY/3 JCGmiT53BK4OA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBD0CC369D3; Sat, 19 Apr 2025 19:46:27 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 19 Apr 2025 21:46:25 +0200 Subject: [PATCH v5 2/2] arm64: dts: qcom: sdm845-oneplus: Add alert-slider Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250419-op6-tri-state-v5-2-443127078517@ixit.cz> References: <20250419-op6-tri-state-v5-0-443127078517@ixit.cz> In-Reply-To: <20250419-op6-tri-state-v5-0-443127078517@ixit.cz> To: Dmitry Torokhov , Jonathan Corbet , Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Gergo Koteles , Casey Connolly , David Heidelberg , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2333; i=david@ixit.cz; h=from:subject:message-id; bh=QhCUbDmUHcz4RzxVc6XbeZUejFzQoncYw+4pfYDvJbY=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBoA/2SXNUW9FmCVx/sofCVR1893e6A0Pgi0fk2t /vlzsdqOCOJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCaAP9kgAKCRBgAj/E00kg clf8D/9u8uPCDLrbj2Z6HGbMlLcVBRPLnOb//zm6tNBBYYlkWtuSbIA4+ziaEy7T7v9mYMzPyVy L0lRRx62HtcjCdCaOvfebpZUh8tJ0xOJ/5wzORGEsHbsBVseMdjZi7cddRm0FXw//3e3tPdlqfX J+MmSRz2RDYsavYWjVdcnmSXmIni9aLGBWTg+hAY2WK+8Cn003wZ5E5wi02KMhprT36HNVVQsWK 994To8W4xb/LMsUmYf0LD3ImbBYVyEAixDeIW2Ondy7TtuQN80KH9Dzzw2KDBj0j35mWjJWUuzs 96htMIWpmGPuUsQoaR05EmetYyynt6eHdnEs0LeWLxtpGbacZwJSIZRXqnsGDEDpqCIv3M3atqH +Fbsa2vgJSeH4AJgGsUM62WIdXWCs9bgez5JuwsZsV3f5nYiNgTrR6Wa+6btvPNTKaVG0zJK3Qc nGMILNV0iaeCpbjby8Z+6rQOagCNa31ELCp4UUun7wPmFX6N6fIWrKlvos+mccgOluIcl1n3/+A +6BqBxepc/MC6tYCiGGg+wqvokSUY9i5YLHsCk3NVLtUH8qmIbbPXs1raRaS0K+LGTdggQu4Kc4 XFUsiABTxGtUw0vWH8NLYUJajZIqiBv2Hbf/4LU0MITDguUfmwjiBTFEXDnVld1N/oooKnZqIEz TO1xwGF/KlLHmTA== X-Developer-Key: i=david@ixit.cz; a=openpgp; fpr=D77A09CFEEDC2BBD53A7047460023FC4D3492072 X-Endpoint-Received: by B4 Relay for david@ixit.cz/default with auth_id=355 X-Original-From: David Heidelberg Reply-To: david@ixit.cz From: Gergo Koteles 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 Signed-off-by: Casey Connolly Signed-off-by: Gergo Koteles Reviewed-by: Konrad Dybcio Signed-off-by: David Heidelberg --- .../arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 39 ++++++++++++++++++= ++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm= 64/boot/dts/qcom/sdm845-oneplus-common.dtsi index 8a0f154bffc3d55ae2134ef28cb7653dde702552..9a508b3149bef50c0ed897dec3c= 01a3f08712e85 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -21,6 +21,41 @@ /delete-node/ &rmtfs_mem; =20 / { + alert-slider { + compatible =3D "gpio-keys"; + label =3D "Alert slider"; + + pinctrl-0 =3D <&alert_slider_default>; + pinctrl-names =3D "default"; + + switch-top { + label =3D "Silent"; + linux,input-type =3D ; + linux,code =3D ; + linux,input-value =3D ; + gpios =3D <&tlmm 126 GPIO_ACTIVE_LOW>; + linux,can-disable; + }; + + switch-middle { + label =3D "Vibrate"; + linux,input-type =3D ; + linux,code =3D ; + linux,input-value =3D ; + gpios =3D <&tlmm 52 GPIO_ACTIVE_LOW>; + linux,can-disable; + }; + + switch-bottom { + label =3D "Ring"; + linux,input-type =3D ; + linux,code =3D ; + linux,input-value =3D ; + gpios =3D <&tlmm 24 GPIO_ACTIVE_LOW>; + linux,can-disable; + }; + }; + aliases { serial0 =3D &uart9; serial1 =3D &uart6; @@ -799,8 +834,8 @@ hall_sensor_default: hall-sensor-default-state { bias-disable; }; =20 - tri_state_key_default: tri-state-key-default-state { - pins =3D "gpio40", "gpio42", "gpio26"; + alert_slider_default: alert-slider-default-state { + pins =3D "gpio126", "gpio52", "gpio24"; function =3D "gpio"; drive-strength =3D <2>; bias-disable; --=20 2.49.0