summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/snvs_pwrkey.c
AgeCommit message (Collapse)Author
2019-12-04Input: snvs_pwrkey - remove gratuitous NULL initializersDmitry Torokhov
Gratuitous NULL initializers rarely help and often prevent compiler from warning about using uninitialized variable. Let's remove them. Reviewed-by: Anson Huang <Anson.Huang@nxp.com> Link: https://lore.kernel.org/r/20191125211407.GA97812@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-25Input: snvs_pwrkey - send key events for i.MX6 S, DL and QRobin van der Gracht
The first generation i.MX6 processors does not send an interrupt when the power key is pressed. It sends a power down request interrupt if the key is released before a hard shutdown (5 second press). This should allow software to bring down the SoC safely. For this driver to work as a regular power key with the older SoCs, we need to send a keypress AND release when we get the power down request irq. Signed-off-by: Robin van der Gracht <robin@protonic.nl> Link: https://lore.kernel.org/r/20191125161210.8275-1-robin@protonic.nl Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-14Input: remove dev_err() usage after platform_get_irq()Stephen Boyd
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-05-10Merge tag 'v5.1' into nextDmitry Torokhov
Sync up with mainline to bring in the latest APIs.
2019-04-04Input: snvs_pwrkey - use dev_pm_set_wake_irq() to simplify codeAnson Huang
With calling dev_pm_set_wake_irq() to set SNVS ON/OFF button as wakeup source for suspend, generic wake irq mechanism will automatically enable it as wakeup source when suspend, then the enable_irq_wake()/disable_irq_wake() can be removed in suspend/resume callback, it simplifies the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-04-03Input: snvs_pwrkey - initialize necessary driver data before enabling IRQAnson Huang
SNVS IRQ is requested before necessary driver data initialized, if there is a pending IRQ during driver probe phase, kernel NULL pointer panic will occur in IRQ handler. To avoid such scenario, just initialize necessary driver data before enabling IRQ. This patch is inspired by NXP's internal kernel tree. Fixes: d3dc6e232215 ("input: keyboard: imx: add snvs power key driver") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-21Input: snvs_pwrkey - switch to SPDX identifierFabio Estevam
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-24Input: keyboard - convert timers to use timer_setup()Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-09-26Input: snvs_pwrkey - drop input_free_device call if input_register_device failsAxel Lin
Current code uses devm_input_allocate_device() so don't explicitly call input_free_device if input_register_device fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-03-11Input: snvs_pwrkey - fix returned value check of ↵Vladimir Zapolskiy
syscon_regmap_lookup_by_phandle() On error syscon_regmap_lookup_by_phandle() returns ERR_PTR() value, which makes a check for NULL invalid and may lead to oops on error path. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-03-02Input: snvs_pwrkey - use __maybe_unused to hide pm functionsArnd Bergmann
The SNVS power key driver has suspend/resume functions that are accessed using SIMPLE_DEV_PM_OPS, which hide the reference when CONFIG_PM_SLEEP is not set, resulting in a warning about unused functions: drivers/input/keyboard/snvs_pwrkey.c:183:12: error: 'imx_snvs_pwrkey_suspend' defined but not used [-Werror=unused-function] drivers/input/keyboard/snvs_pwrkey.c:194:12: error: 'imx_snvs_pwrkey_resume' defined but not used [-Werror=unused-function] This adds __maybe_unused annotations to let the compiler know it can silently drop the function definition. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-10-26Input: snvs_pwrkey - remove duplicated semicolonJavier Martinez Canillas
Remove the unneded semicolon since it is clearly a typo error. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-18input: snvs_pwrkey: use "wakeup-source" as deivce tree property nameShawn Guo
Instead of inventing a new property name, let's use "wakeup-source" to be consistent with other driver and subsystem bindings. Signed-off-by: Shawn Guo <shawnguo@kernel.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-15input: keyboard: imx: add snvs power key driverRobin Gong
add snvs power key driver. It work in imx chips after i.mx6sx ON/OFF key used power on/off whole system. This driver make it wakeup from suspend state when short press ON/OFF key. Long time press will trig SNVS power off chip without software intervention. Signed-off-by: Robin Gong <b38343@freescale.com> Signed-off-by: Frank Li <Frank.Li@freescale.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>