summaryrefslogtreecommitdiff
path: root/drivers/button/button-qcom-pmic.c
AgeCommit message (Collapse)Author
2025-08-13button: qcom-pmic: Fix dereference of uninitialised pointerAndrew Goodbody
The pointer 'label' is declared and later dereferenced without ever having a value assigned to it. Add an assignment to this pointer so it will be valid later when dereferenced. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
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 <[email protected]> Signed-off-by: Alexey Minnekhanov <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
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 <[email protected]> # google-sunfish Tested-by: Jens Reidel <[email protected]> # xiaomi-davinci Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Caleb Connolly <[email protected]>
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/[email protected] Signed-off-by: Caleb Connolly <[email protected]>
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 <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
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 <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
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 <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
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 <[email protected]> Reviewed-by: Caleb Connolly <[email protected]> Reviewed-by: Sumit Garg <[email protected]>
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 <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Tested-by: Sumit Garg <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>