summaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/pm8941-pwrkey.c
AgeCommit message (Collapse)AuthorFilesLines
2022-04-24Input: pm8941-pwrkey - simulate missed key press eventsDavid Collins1-0/+11
The status of the keys connected to the KPDPWR_N and RESIN_N pins is identified by reading corresponding bits in the interrupt real time status register. If the status has changed by the time that the interrupt is handled then a press event will be missed. Maintain a last known status variable to find unbalanced release events and simulate press events for each accordingly. Signed-off-by: David Collins <collinsd@codeaurora.org> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> Link: https://lore.kernel.org/r/20220422191239.6271-6-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-04-24Input: pm8941-pwrkey - add software key press debouncing supportDavid Collins1-6/+77
On certain PMICs, an unexpected assertion of KPDPWR_DEB (the positive logic hardware debounced power key signal) may be seen during the falling edge of KPDPWR_N (i.e. a power key press) when it occurs close to the rising edge of SLEEP_CLK. This then triggers a spurious KPDPWR interrupt. Handle this issue by adding software debouncing support to ignore key events that occur within the hardware debounce delay after the most recent key release event. Signed-off-by: David Collins <collinsd@codeaurora.org> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> Link: https://lore.kernel.org/r/20220422191239.6271-5-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-04-24Input: pm8941-pwrkey - add support for PON GEN3 base addressesAnjelique Melendez1-7/+24
Currently, PON address is read from the "reg" property. For PON GEN3, which starts with PMK8350, the "reg" property will have both the PON HLOS and PON PBS addesses defined. Add support so that all PON generations can be configured. Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> Link: https://lore.kernel.org/r/20220422191239.6271-4-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-04-24Input: pm8941-pwrkey - fix error messageAnjelique Melendez1-1/+1
Currently, error message reads "failed to set debounce". However, code is attempting to read revision not set debounce. Fix this. Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> Link: https://lore.kernel.org/r/20220422191239.6271-3-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-16Input: pm8941-pwrkey - respect reboot_mode for warm resetShawn Guo1-1/+5
On some devices, e.g. Sony Xperia M4 Aqua, warm reset is used to reboot device into bootloader and recovery mode. Instead of always doing hard reset, add a check on reboot_mode for possible warm reset. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Luca Weiss <luca@z3ntu.xyz> Link: https://lore.kernel.org/r/20210714095850.27185-3-shawn.guo@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-07-23Input: pm8941-pwrkey - fix comma vs semicolon issueDmitry Torokhov1-1/+1
There is absolutely no reason to use comma operator in this code, 2 separate statements make much more sense. Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/YPsa1qCBn/SAmE5x@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-01Input: pm8941-pwrkey - add support for PMK8350 PON_HLOS PMIC peripheralDavid Collins1-31/+72
On Qualcomm Technologies, Inc. PMIC PMK8350, the PON peripheral is split into two peripherals: PON_HLOS and PON_PBS. The application processor only has write access to PON_HLOS which limits it to only receiving PON interrupts. Add support for the PMK8350 PON_HLOS peripheral so that its KPDPWR_N and RESIN_N interrupts can be used to detect key presses. Signed-off-by: David Collins <collinsd@codeaurora.org> Signed-off-by: satya priya <skakit@codeaurora.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/1620630064-16354-2-git-send-email-skakit@codeaurora.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-14Input: remove dev_err() usage after platform_get_irq()Stephen Boyd1-3/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 and only version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 294 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141900.825281744@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30Input: pm8941-pwrkey - add resin entryVinod Koul1-0/+8
Since handling is abstracted in this driver, we need to add resin entry in id table along with pwrkey_data. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-30Input: pm8941-pwrkey - abstract register offsets and event codeVinod Koul1-13/+49
In order to support resin thru the pwrkey driver (they are very similar in nature) we need to abstract the handling in this driver. First we abstract pull_up_bit and status_bit along in driver data. The event code sent for key events is quiried from DT. Since the device can be child of pon lookup regmap and reg from parent if lookup fails (we are child). Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21Input: misc - drop unnecessary calls to device_init_wakeupGuenter Roeck1-1/+0
Calling device_init_wakeup in the remove function is unnecessary since the device is going away, and thus won't be able to cause any wakeups under any circumstances. Besides, the driver cleanup code already handles the necessary cleanup. Similarly, disabling wakeup in the probe error path is unnecessary, as is disabling wakeup in the probe function in the first place. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-19Input: pm8941-pwrkey - remove unneded semicolonJavier Martinez Canillas1-1/+1
It's not needed and is just creating a null statement so remove it. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-20Input: add Qualcomm PM8941 power key driverCourtney Cavin1-0/+293
Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Tested-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>