History log of /linux-master/drivers/input/touchscreen/mms114.c
Revision Date Author Comments
# bf93349b 19-Jul-2023 Artur Weber <aweber.kernel@gmail.com>

Input: mms114 - add support for touch keys

MELFAS MMS114 and similar touchscreens have support for touch keys.
Enable support of them in the driver. The keycodes to emit can be
controlled by the linux,keycodes DT property.

Sidenote - the MAX_TOUCHKEYS value is set to 15, as that's the
maximum value that the ID field can contain. I don't have access
to any datasheets that could confirm or deny whether this is accurate.

Most downstream drivers I've been able to find only use up to 2 keys
(though I did find a driver that mentioned up to 4, but only 2 were
used). They don't have any checks for a maximum keycode value, it is
just extracted from the ID bits (0xf mask).

The drivers I've been able to find also don't use touch ID 0; I assume
that it is never used, so the keycodes provided in the DT start from
touch ID 1. I suppose this is in-line with the regular behavior
for touch IDs in touchscreen events, as there the provided touch ID
is always lowered by 1, which would cause an overflow if it was 0...
Just in case, we quietly return if the touch ID is set to 0 here.

The implementation of the linux,keycodes property handling code was
adapted from the msg2638 driver.

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Link: https://lore.kernel.org/r/20230714100424.29798-3-aweber.kernel@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# dbce1a7d 17-Jul-2023 Rob Herring <robh@kernel.org>

Input: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174633.4058096-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# d8bde56d 17-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Input: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

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


# 9b61c454 02-Jan-2023 Jonathan Cameron <Jonathan.Cameron@huawei.com>

Input: mms114 - 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 __maybe_unused markings.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-56-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5e857ccf 18-Nov-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Input: mms114 - Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

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


# ab108678 07-Sep-2021 Linus Walleij <linus.walleij@linaro.org>

Input: mms114 - support MMS134S

The MMS134S like the MMS136 has an event size of 6 bytes.

After this patch, the touchscreen on the Samsung SGH-I407
works fine with PostmarketOS.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210706235951.189289-1-linus.walleij@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 53fefdd1 10-Apr-2021 Linus Walleij <linus.walleij@linaro.org>

Input: mms114 - support MMS136

The Melfas MMS136 is similar to the other MMS variants but
has event packages of 6 bytes rather than 8 as the others.

The define is named FINGER_EVENT_SZ in the vendor drivers
so I renamed it from MMS*_PACKET_SZ to MMS*_EVENT_SZ.

After this patch, the touchscreen on the Samsung GT-I8530
works fine with PostmarketOS.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210404232619.3092682-1-linus.walleij@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# bcd9730a 25-Mar-2021 Barry Song <song.bao.hua@hisilicon.com>

Input: move to use request_irq by IRQF_NO_AUTOEN flag

disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable because of requesting.

On the other hand, request_irq() after setting IRQ_NOAUTOEN as
below
irq_set_status_flags(irq, IRQ_NOAUTOEN);
request_irq(dev, irq...);
can also be replaced by request_irq() with IRQF_NO_AUTOEN flag.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Link: https://lore.kernel.org/r/20210302224916.13980-3-song.bao.hua@hisilicon.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# d69f0a43 04-Oct-2020 Andrzej Pietrasiewicz <andrzej.p@collabora.com>

Input: use input_device_enabled()

Use the newly added helper in relevant input drivers.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5fc70e35 11-May-2020 Jiada Wang <jiada_wang@mentor.com>

Input: introduce input_mt_report_slot_inactive()

input_mt_report_slot_state() ignores "tool" argument when the slot is
closed, which has caused a bit of confusion. Let's introduce
input_mt_report_slot_inactive() to report inactive slot state.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Link: https://lore.kernel.org/r/20200508055656.96389-2-jiada_wang@mentor.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 7842087b 25-Apr-2020 Stephan Gerhold <stephan@gerhold.net>

Input: mms114 - add extra compatible for mms345l

MMS345L is another first generation touch screen from Melfas,
which uses mostly the same registers as MMS152.

However, there is some garbage printed during initialization.
Apparently MMS345L does not have the MMS152_COMPAT_GROUP register
that is read+printed during initialization.

TSP FW Rev: bootloader 0x6 / core 0x26 / config 0x26, Compat group: \x06

On earlier kernel versions the compat group was actually printed as
an ASCII control character, seems like it gets escaped now.

But we probably shouldn't print something from a random register.

Add a separate "melfas,mms345l" compatible that avoids reading
from the MMS152_COMPAT_GROUP register. This might also help in case
there is some other device-specific quirk in the future.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Andi Shyti <andi@etezian.org>
Link: https://lore.kernel.org/r/20200423102431.2715-1-stephan@gerhold.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 3f8f7705 09-Apr-2020 Stephan Gerhold <stephan@gerhold.net>

Input: mms114 - fix handling of mms345l

MMS345L is another first generation touch screen from Melfas,
which uses the same registers as MMS152.

However, using I2C_M_NOSTART for it causes errors when reading:

i2c i2c-0: sendbytes: NAK bailout.
mms114 0-0048: __mms114_read_reg: i2c transfer failed (-5)

The driver works fine as soon as I2C_M_NOSTART is removed.

Reviewed-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200405170904.61512-1-stephan@gerhold.net
[dtor: removed separate mms345l handling, made everyone use standard
transfer mode, propagated the 10bit addressing flag to the read part of the
transfer as well.]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 8d13c764 08-Oct-2019 Stephan Gerhold <stephan@gerhold.net>

Input: mms114 - use device_get_match_data

device_get_match_data is available now, so we can replace the call
to of_device_get_match_data and remove the FIXME comment.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Andi Shyti <andi@etezian.org>
Link: https://lore.kernel.org/r/20191007203343.101466-2-stephan@gerhold.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 0004520a 01-Feb-2018 Andi Shyti <andi@etezian.org>

Input: mms114 - add SPDX identifier

Replace the original license statement with the SPDX identifier.
Add also one line of description as recommended by the COPYING
file.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 498e7e7e 01-Feb-2018 Andi Shyti <andi@etezian.org>

Input: mms114 - fix license module information

The driver has been released with GNU Public License v2 as stated
in the header, but the module license information has been tagged
as "GPL" (GNU Public License v2 or later).

Fix the module license information so that it matches the one in
the header as "GPL v2".

Fixes: 07b8481d4aff ("Input: add MELFAS mms114 touchscreen driver")
Reported-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 13e94540 29-Jan-2018 Andi Shyti <andi@etezian.org>

Input: mms114 - fix typo in definition

It's 'MMS114_INFORMATION', not 'MMS114_INFOMATION'

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 7546db02 29-Jan-2018 Andi Shyti <andi@etezian.org>

Input: mms114 - use BIT() macro instead of explicit shifting

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# a22e88fd 29-Jan-2018 Andi Shyti <andi@etezian.org>

Input: mms114 - replace mdelay with msleep

200 milliseconds is a very long time to keep the CPU busy looping.
Use msleep instead.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 72b0c0cf 23-Jan-2018 Simon Shields <simon@lineageos.org>

Input: mms114 - add support for mms152

MMS152 has no configuration registers, but the packet format used in
interrupts is identical to mms114.

Signed-off-by: Simon Shields <simon@lineageos.org>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Tested-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5b0d0033 22-Jan-2018 Simon Shields <simon@lineageos.org>

Input: mms114 - drop platform data and use generic APIs

The MMS114 platform data has no in-tree users, so drop it.

Switch to using the standard touchscreen properties via
touchscreen_parse_properties(), and move the old DT parsing code
to use device_property_*() APIs.

Finally, use touchscreen_report_pos to report x/y coordinates
and drop the custom x/y inversion code.

Signed-off-by: Simon Shields <simon@lineageos.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Tested-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 477baf7e 23-Jan-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: mms114 - mark as direct input device

mms14 is a touchscreen and thus a direct input device; let's mark it
as such. This also allows us to drop some initialization code as
input_init_mt_slots() will do that for us.

Also add error handling for input_mt_init_slots().

Reviewed-by: Simon Shields <simon@lineageos.org>
Tested-by: Simon Shields <simon@lineageos.org>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Tested-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5e703b88 23-Jan-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: mms114 - do not clobber interrupt trigger

Rely on the platform (device tree, ACPI, etc) to properly configure
interrupt trigger/polarity instead of hardcoding the falling edge.

Reviewed-by: Simon Shields <simon@lineageos.org>
Tested-by: Simon Shields <simon@lineageos.org>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Tested-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 0d846a4c 22-May-2017 Wolfram Sang <wsa@kernel.org>

Input: mms114 - move header file out of I2C realm

include/linux/i2c is not for client devices. Move the header file to a
more appropriate location.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 86a39bff 14-Sep-2015 Javier Martinez Canillas <javier@osg.samsung.com>

Input: mms114 - remove unneded semicolons

They aren't needed and are just creating null statements so remove it.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 02d9bd05 30-Jul-2015 Javier Martinez Canillas <javier@osg.samsung.com>

Input: touchscreen - export OF module alias information

The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So technically there's no need for a driver to export
the OF table since currently it's not used.

In fact, the I2C device ID table is mandatory for I2C drivers since
a i2c_device_id is passed to the driver's probe function even if the
I2C core used the OF table to match the driver.

And since the I2C core uses different tables, OF-only drivers needs to
have duplicated data that has to be kept in sync and also the dev node
compatible manufacturer prefix is stripped when reporting the MODALIAS.

To avoid the above, the I2C core behavior may be changed in the future
to not require an I2C device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table to prevent
breaking module autoloading if that happens.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 800e3b9a 17-Jul-2015 Krzysztof Kozlowski <krzk@kernel.org>

Input: drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 02b6a58b 02-Nov-2014 Jingoo Han <jg1.han@samsung.com>

Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resume

Use __maybe_unused instead of ifdef guards around suspend/resume
functions, in order to increase build coverage and fix build warnings.

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


# 58442239 27-May-2014 Beomho Seo <beomho.seo@samsung.com>

Input: mms114 - fix incorrect input device name

This patch fix a typo error in mms114 touchscreen driver.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# e3c3f4a9 07-May-2014 Jingoo Han <jg1.han@samsung.com>

Input: mms114 - make of_device_id array const

Make of_device_id array const, because all OF functions handle it as const.

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


# 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>


# 4b7d293c 03-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

Input: mms114 - Fix regulator enable and disable paths

When it uses regulators the mms114 driver checks to see if it managed to
acquire regulators and ignores errors. This is not the intended usage and
not great style in general.

Since the driver already refuses to probe if it fails to allocate the
regulators simply make the enable and disable calls unconditional and
add appropriate error handling, including adding cleanup of the
regulators if setup_reg() fails.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 8a0b6c5d 09-Jan-2013 Sachin Kamat <sachin.kamat@linaro.org>

Input: mms114 - switch to using managed resources

devm_* APIs are device managed and make the exit and clean up code
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Laxman Dewangan<ldewangan@nvidia.com>
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>


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

Input: remove use of __devinitdata

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

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
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>


# ad5396ee 11-Oct-2012 Tomasz Figa <t.figa@samsung.com>

Input: mms114 - add device tree bindings

Add device tree bindings for mms114 touchscreen.

[Dmitry Torokhov: added #ifdef CONFIG_OF guards]

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# b4adbbef 11-Aug-2012 Henrik Rydberg <rydberg@euromail.se>

Input: MT - Add flags to input_mt_init_slots()

Preparing to move more repeated code into the mt core, add a flags
argument to the input_mt_slots_init() function.

Reviewed-and-tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Ping Cheng <pingc@wacom.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>


# 07b8481d 13-Jul-2012 Joonyoung Shim <jy0922.shim@samsung.com>

Input: add MELFAS mms114 touchscreen driver

This is a initial driver for new touchscreen chip mms114 of MELFAS.
It uses I2C interface and supports 10 multi touch.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>