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

Input: ams_delta_serio - 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-31-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# a9f08ad7 18-Aug-2022 Wolfram Sang <wsa+renesas@sang-engineering.com>

Input: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 7d3370e5 20-Jul-2021 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Revert "Input: serio - make write method mandatory"

This reverts commit 81c7c0a350bfe9306ad9fb10356534ede8f4ab31. The idea
to make write method mandatory was flawed as several client drivers
(such as atkbd) check for presence of write() method to adjust behavior
of the driver.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 81c7c0a3 19-Jul-2021 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: serio - make write method mandatory

Given that all serio drivers except one implement write() method
let's make it mandatory to avoid testing for its presence whenever
we attempt to use it.

Link: https://lore.kernel.org/r/YFgUxG/TljMuVeQ3@google.com
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>


# 5f73861f 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

Input: ams_delta_serio: Get FIQ buffer from platform_data

Instead of exporting the FIQ buffer symbol to be used in
ams-delta-serio driver, pass it to the driver as platform_data.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# a617b36b 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

Input: ams_delta_serio: use IRQ resource

The driver still obtains IRQ number from a hardcoded GPIO. Use IRQ
resource instead.

For this to work on Amstrad Delta, add the IRQ resource to
ams-delta-serio platform device structure. Obtain the IRQ number
assigned to "keybrd_clk" GPIO pin from FIQ initialization routine.

As a benefit, the driver no longer needs to include
<mach/board-ams-delta.h>.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# dc8fbeb0 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

ARM: OMAP1: Get rid of <mach/ams-delta-fiq.h>

Split the header file into two parts and move them to directories where
they belong.

Information on internal structure of FIQ buffer is moved to
<linux/platform_data/ams-delta-fiq.h> for ams-delta-serio driver use.

Other information used by ams-delta board init file and FIQ code is
made local to mach-omap1 root directory.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# a32d5ce1 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

ARM: OMAP1: ams-delta FIQ: Keep serio input GPIOs requested

From the very beginning, input GPIO pins of ams-delta serio port have
been used by FIQ handler, not serio driver.

Don't request those pins from the ams-delta-serio driver any longer,
instead keep them requested and initialized by the FIQ initialization
routine which already requests them and releases while identifying GPIO
IRQs.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 41f8fee3 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin

"keybrd_dataout" GPIO pin used to be initialized by ams-delta-serio
driver to a state safe for ams-delta-serio device function and not
changed thereafter. As such, it may be assumed not under the driver
control and responsibility for its initialization handed over to board
init file.

Introduce a GPIO hog table and take over control of the
"keybrd_dataout" GPIO pin from the ams-delta-serio driver.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 2bcb1be0 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

Input: ams_delta_serio: Replace power GPIO with regulator

Modify the driver so it no longer requests and manipulates the
"keybrd_pwr" GPIO pin but a "vcc" regulator supply instead.

For this to work with Amstrad Delta, define a regulator over the
"keybrd_pwr" GPIO pin with the "vcc" supply for ams-delta-serio device
and register it from the board file. Both assign an absulute GPIO
number to the soon depreciated .gpio member of the regulator config
structure, and also build and register a GPIO lookup table so it is
ready for use by the regulator driver as soon as its upcoming update
is applied.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 56de7570 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

Input: ams_delta_serio: use private structure

Introduce a driver private structure and allocate it on device probe.
For now, use it instead of a static variable for storing a pointer to
serio structure. Subsequent patches will populate it with more members
as needed.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# df88c576 21-Jun-2018 Janusz Krzysztofik <jmkrzyszt@gmail.com>

Input: ams_delta_serio: convert to platform driver

Convert the driver to an "ams-delta-serio" platform driver. For it to
be used with Amstrad Delta, register an "ams-delta-serio" platform
device from the board init file.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 3c45b026 23-Jun-2016 Colin Ian King <colin.king@canonical.com>

Input: ams_delta_serio - fix spelling mistake: "paritiy" -> "parity"

trivial fix to spelling mistake in dev_warn message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# e27e35ec 19-Sep-2012 Tony Lindgren <tony@atomide.com>

ARM: OMAP1: Move board-ams-delta.h from plat to mach

This is only used by omap1.

And to fix things properly, this should not be included
from the drivers at all.

Acked-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Cc: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Cc: linux-mtd@lists.infradead.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Liam Girdwood <lrg@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Tony Lindgren <tony@atomide.com>


# e6801afb 29-Mar-2012 Tarun Kanti DebBarma <tarun.kanti@ti.com>

drivers: input: Fix OMAP_GPIO_IRQ with gpio_to_irq() in ams_delta_serio_exit()

Even though ams-delta-serio input driver uses gpio_to_irq() in all
relevent places to get irq number, the ams_delta_serio_exit() still
uses OMAP_GPIO_IRQ macro. Fix this.

Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# da564a05 10-Feb-2012 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

ARM: OMAP1: ams-delta: clean up init data section assignments

The main purpose of this patch is to fix several section mismatch
warnings from the board file and a few board specific drivers,
introduced with recent Amstrad Delta patch series, some of them rising
up only when building with CONFIG_MODULES not set.

While being at it, section tagging of all init data found in the board
file have been revised and hopefully corrected and/or optimized.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 8d09a1bb 20-Dec-2011 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

input: serio: ams-delta: toggle keyboard power over GPIO

Don't use Amstrad Delta custom I/O functions once GPIO interface is
available for the underlying hardware.

While requesting and initializing GPIO pins used, also take care of one
extra pin KEYBRD_DATAOUT which, even if not used by the driver, belongs
to the device and affects its functioning.

Once done, move the driver initialization back to the device_initcall
level, reverting the temporary chane introduced with patch 1/7 "ARM:
OMAP1: ams-delta: register latch dependent devices later". That change
is no longer required once the driver takes care of registering used
GPIO pins, and it's better to initialize the device before others using
the latch2 based GPIO pins, otherwise a garbage is reported on boot,
perhaps due to random data already captured by the FIQ handler while the
keyboard related latch bits are written with random values during
initialization of those other latch2 dependent devices.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
[tony@atomide.com: renamed _gpios to ams_delta_gpios]
Signed-off-by: Tony Lindgren <tony@atomide.com>


# f7519d8c 20-Dec-2011 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

ARM: OMAP1: ams-delta: register latch dependent devices later

In preparation to converting Amstrad Delta on-board latches to
basic_mmio_gpio devices, registration of platform devices which depend
on latches and will require initialization of their GPIO pins first,
should be moved out of .machine_init down to late_initcall level, as the
gpio-generic driver is not available until device_initcall time. The
latch reset operation, which will be replaced with GPIO initialization,
must also be moved to late_initcall for the same reason.

Since there was already another, separate arch_initcall function for
setting up one of those latch dependent devices, the on-board modem
device, reuse that function, i.e., rename it to a name that matches the
new purpose, extend with other device setup relocated from
.machine_init, and move down to the late_initcall level.

While being at it, add missing gpio_free() in case the modem platform
device registration fails.

Thanks to Tony Lindgren <tony@atomide.com> who suggested this approach
instead of shifting up the gpio-generic driver initialization.

In addition, defer registration of the Amstrad Delta ASoC and serio
devices, done from their device driver files, until late_initcall time,
as those drivers will depend on their GPIO pins already requested from
the board late_init() function until updated to register their GPIO pins
themselves.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>


# 77f6ca5a 09-Nov-2011 Aaro Koskinen <aaro.koskinen@iki.fi>

Input: ams_delta_serio - include linux/module.h

Fix the following compilation failure with v3.2-rc1 by including module.h:

CC drivers/input/serio/ams_delta_serio.o
drivers/input/serio/ams_delta_serio.c:33:15: error: expected declaration specifiers or '...' before string constant
drivers/input/serio/ams_delta_serio.c:34:20: error: expected declaration specifiers or '...' before string constant
drivers/input/serio/ams_delta_serio.c:35:16: error: expected declaration specifiers or '...' before string constant
drivers/input/serio/ams_delta_serio.c: In function 'ams_delta_serio_init':
drivers/input/serio/ams_delta_serio.c:155:2: error: 'THIS_MODULE' undeclared (first use in this function)
drivers/input/serio/ams_delta_serio.c:155:2: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# dced35ae 28-Mar-2011 Thomas Gleixner <tglx@linutronix.de>

drivers: Final irq namespace conversion

Scripted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>


# ebcc0199 21-Nov-2010 Axel Lin <axel.lin@gmail.com>

Input: ams_delta_serio - fix wrong kfree in ams_delta_serio_exit

serio_unregister_port() will call put_device() to free the memory.
Thus remove kfree(ams_delta_serio) after
serio_unregister_port(ams_delta_serio).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 29453932 27-Apr-2010 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>

input: serio: add support for Amstrad Delta serial keyboardport

The patch introduces a serio driver that supports a keyboard serial port found
on the Amstrad Delta videophone board.

After initializing the hardware, the driver reads its input data from a buffer
filled in by the board FIQ (Fast Interrupt Request) handler.

Standard AT keyboard driver (atkbd) will be used on top of the serio layer for
handling the E3 keyboard (called mailboard) connected to the port. Since the
device generated scancodes differ from what the atkbd expects, a custom key
code to scan code table must be loaded from userspace for the keyboard to be
useable.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Tony Lindgren <tony@atomide.com>