summaryrefslogtreecommitdiff
path: root/drivers/button/button-qcom-pmic.c
AgeCommit message (Collapse)Author
2025-06-02button: qcom-pmic: allow to specify code in devicetreeAlexey Minnekhanov
Most device vendors put "Volume Down" button onto PMIC RESIN. But Sony is special: see dts/upstream/src/arm64/qcom/sdm630-sony-xperia-nile.dtsi or [1]. They put "Volume Down" on PMIC GPIO 7 where others usually put "Volume Up", and KEY_VOLUMEUP is inside &pon_resin. Currently if you boot U-Boot on such Sony device, you end up with 2 "Volume Down" buttons, and no "Volume Up", which makes navigating menu problematic. Support reading devicetree "linux,code" property and override statically defined button code & label based on that. [1] https://elixir.bootlin.com/linux/v6.15-rc3/source/arch/ arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi#L263 Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org> Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Link: https://lore.kernel.org/r/20250424014811.3809818-1-alexeymin@minlexx.ru Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-04-11button: qcom-pmic: prettify and standardise button labelsCaleb Connolly
Boards using gpio-keys for volume buttons label them "Volume Down", let's match that here, and make the power button nicer too. This simplifies configuring button_cmds in a board-agnostic way. Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-5-f52e57d3b8c6@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-01-22button: qcom-pmic: add software debounceCaleb Connolly
This helps with reliability on some platforms. We should probably also configure the hardware debounce timer eventually. Link: https://lore.kernel.org/r/20241113045109.1838241-1-caleb.connolly@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-23button: qcom-pmic: add support for pmk8350 button configsNeil Armstrong
Finally add the entries for the qcom,pmk8350-pwrkey and qcom,pmk8350-resin found on PMICs used with SM8350 and later SoCs. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-23button: qcom-pmic: move node name checks to btn_data structNeil Armstrong
Move node name checks to a proper data struct with all information for the supported subnodes. Replace the key offset defines with the Linux driver ones. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-02-14button: qcom-pmic: demote "unknown button" message to debugCaleb Connolly
This message isn't an error (there can be a watchdog subnode for example) but it shouldn't be printed unless this driver is being debugged. Demote it to a debug print. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-02-14button: qcom-pmic: fix some error checkingDan Carpenter
The pmic_reg_read() function can return errors. Add a check for that. Fixes: 4e8aa0065d4b ("button: qcom-pmic: introduce Qualcomm PMIC button driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
2024-01-16button: qcom-pmic: introduce Qualcomm PMIC button driverCaleb Connolly
Qualcomm PMICs include a "pon" function which handles two buttons, the power button and "resin" button (usually volume down). Introduce a new driver following upstream Linux DT to enable these and map them to Enter and Down respectively to enable use in boot menus. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>