History log of /linux-master/drivers/input/keyboard/sh_keysc.c
Revision Date Author Comments
# e340089d 20-Sep-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Input: sh_keysc - convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230920125829.1478827-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# aebc2380 04-Dec-2022 Jonathan Cameron <Jonathan.Cameron@huawei.com>

Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
thus suppressing the warning, but still allowing the unused code to be
removed. Thus also drop the ifdef guards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20221204180841.2211588-23-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 4bdc0d67 06-Jan-2020 Christoph Hellwig <hch@lst.de>

remove ioremap_nocache and devm_ioremap_nocache

ioremap has provided non-cached semantics by default since the Linux 2.6
days, so remove the additional ioremap_nocache interface.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>


# 0bec8b7e 14-Aug-2019 Stephen Boyd <swboyd@chromium.org>

Input: remove dev_err() usage after platform_get_irq()

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>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 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 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bf9a9f8e 06-Jan-2014 Paul Gortmaker <paul.gortmaker@windriver.com>

Input: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# c838cb3d 05-Dec-2013 Jingoo Han <jg1.han@samsung.com>

Input: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead
of accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 86066e68 06-May-2013 Sachin Kamat <sachin.kamat@linaro.org>

Input: sh_keysc - remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# e2619cf7 23-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

Input: remove use of __devexit

CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5298cc4c 23-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

Input: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 1cb0aa88 23-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

Input: remove use of __devexit_p

CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5146c84f 29-Nov-2011 JJ Ding <dgdunix@gmail.com>

Input: keyboard - use macro module_platform_driver()

Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to
save some platform_driver boilerplate code. Use it.

Signed-off-by: JJ Ding <dgdunix@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# cca8edfd 04-Jul-2011 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: sh_keysc - fix compile warning

The "#if" above should really be an "#ifdef" to avoid this warning:

CC drivers/input/keyboard/sh_keysc.o
drivers/input/keyboard/sh_keysc.c:294:5: warning: "CONFIG_PM_SLEEP" is
not defined

Reported-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# cca23d0b 18-Jun-2011 Magnus Damm <damm@opensource.se>

Input: sh_keysc - 8x8 MODE_6 fix

According to the data sheet for G4, AP4 and AG5 KEYSC MODE_6 is 8x8 keys.
Bump up MAXKEYS to 64 too.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 9cc7c80b 04-May-2011 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: sh_keysc - only compile PM code if PM is enabled

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 12d0cef7 03-May-2011 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: sh_keysc - make sh_keysc_device_driver static

This variable is not used outside of the module so we should mark it
as static.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 2dfb9a85 28-Apr-2011 Magnus Damm <damm@opensource.se>

Input: sh_keysc - switch to threaded IRQ handler

Update the KEYSC driver to make use of threaded IRQs with IRQF_ONESHOT
to improve interrupt latency. The driver is using udelay() in the ISR
to make sure the hardware has stabilized. Without using interrupt threads
this delay may affect the latency of the rest of the system.

Also pass dev_name() as string for /proc/interrupts.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# b6d2a3e6 28-Apr-2011 Magnus Damm <damm@opensource.se>

Input: sh_keysc - implement runtime PM support

Convert the KEYSC driver from MSTP bit control through a magic clock
string to making use of Runtime PM.

Also, update the system suspend/resume callbacks to drop the Runtime
PM reference in the case of wakeup disabled.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 8f8be243 11-Feb-2010 Magnus Damm <damm@opensource.se>

Input: sh_keysc - update the driver with mode 6

Add mode 6 support to the sh_keysc driver. Also update the KYOUTDR mask
value to include all 16 register bits.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 324e5ade 10-Feb-2010 Magnus Damm <damm@opensource.se>

Input: sh_keysc - switch to using bitmaps

Use bitmaps instead of using 32-bit integers to keep track of the key
states. With this change in place the driver supports key pads with
more than 32 keys.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 2b14a808 10-Feb-2010 Magnus Damm <damm@opensource.se>

Input: sh_keysc - factor out hw access functions

Update the sh_keysc driver to factor out the register access functions
sh_keysc_read(), sh_keysc_write() together with sh_keysc_level_mode().
This makes the code a bit easier to follow.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 3bf12763 21-Jan-2010 Magnus Damm <damm@opensource.se>

Input: sh_keysc - add mode 4 and mode 5 support

Add Mode 4 and Mode 5 support to the SH_KEYSC driver. These modes allow
slightly larger key pad matrixes.

While at it, make use of resource_size().

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 47145210 14-Dec-2009 Alexey Dobriyan <adobriyan@gmail.com>

const: constify remaining dev_pm_ops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# fc1d003d 27-Nov-2009 Magnus Damm <damm@opensource.se>

sh: Move KEYSC header file

This patch moves the KEYSC header file from the
SuperH specific asm directory to a place where
it can be shared by multiple architectures.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 1f85d381 14-Sep-2009 Kuninori Morimoto <morimoto.kuninori@renesas.com>

sh: add kycr2_delay for sh_keysc

After KYCR2 is set, udelay might become necessary if there are only a
small number of keys attached. This patch introduces an optional delay
through the platform data to address this problem.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 24d01c06 21-Jul-2009 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: sh_keysc - allow modifying keymap from userspace

Adjust the driver so EVIOCGKEYCODE/EVIOCSKEYCODE work.

Acked-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 4ba50df6 01-Apr-2009 Magnus Damm <damm@igel.co.jp>

input: sh_keysc: use enable/disable_irq_wake()

Modify the sh_keysc driver to use enable/disable_irq_wake()
during suspend and resume. These functions are used to enable
the sh_keysc interrupt in the interrupt controller so the
keypad can be used to wakeup the system from suspend.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 49976927 11-Mar-2009 Magnus Damm <damm@igel.co.jp>

input: sh_keysc suspend can use to_platform_device()

This patch changes sh_keysc to use to_platform_device()
for suspend. Thanks to Trilok Soni for this suggestion.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Reviewed-by: Trilok Soni <soni.trilok@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# a29b99ec 10-Mar-2009 Magnus Damm <damm@igel.co.jp>

input: add suspend wakeup support to sh_keysc

This patch adds wakeup support to the sh_keysc driver.
With this feature the ".../power/wakeup" file can be
used to enable and disable if the device takes the
system out of suspend. Default is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 090d951b 31-Oct-2008 Magnus Damm <damm@igel.co.jp>

sh: sh_mobile keysc clock framework support

Add clock framework support to the sh_mobile keysc driver and
adjust the board specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# d3aa43a9 18-Jul-2008 Tetsuya Mukawa <mukawa@igel.co.jp>

sh_keysc: remove request_mem_region() and release_mem_region()

Remove request_mem_region() and release_mem_region() from sh_keysc driver.
Those functions can find resource conflict, but it is already checked in
platform_device_add().

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 6dea7814 21-Mar-2008 Magnus Damm <magnus.damm@gmail.com>

Fix sh_keysc double free

Avoid double free situation from happening by removing input_free_device()
after input_unregister_device(). Suggested by Dmitry Torokhov.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 795e6bf3 04-Mar-2008 Magnus Damm <magnus.damm@gmail.com>

sh: SuperH KEYSC platform driver

Add a platform driver for the SuperH KEYSC block. The driver expects to get
mode, timing information and keypad layout from the board code as platform
data. The board code is resonsible for pin configuration.

Both sh7343 and sh7722 should be supported, but only the sh7722 processor has
been tested so far. SH_KEYSC_MODE_3 is yet to be tested.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>