summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/hideep.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-07Input: hideep - use device core to create driver-specific device attributesDmitry Torokhov1-12/+3
Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20230729005133.1095051-11-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-05-17Input: Switch i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
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>
2023-03-17Input: hideep - optionally reset controller work mode to native HiDeep protocolHans de Goede1-0/+20
The HiDeep IST940E touchscreen controller used on the Lenovo Yoga Book X90F convertible comes up in HID mode by default. This works well on the X91F Windows model where the touchscreen is correctly described in ACPI and ACPI takes care of controlling the reset GPIO and regulators. But the X90F ships with Android and the ACPI tables on this model don't describe the touchscreen. Instead this is hardcoded in the vendor kernel. The vendor kernel uses the touchscreen in native HiDeep 20 (2.0?) protocol mode and switches the controller to this mode by writing 0 to reg 0x081e. Adjusting the i2c-hid code to deal with the reset-gpio and regulators on this non devicetree (but rather broken ACPI) convertible is somewhat tricky and the native protocol reports ABS_MT_PRESSURE and ABS_MT_TOUCH_MAJOR which are not reported in HID mode, so it is preferable to use the native mode. Add support to the hideep driver to reset the work-mode to the native HiDeep protocol to allow using it on the Lenovo Yoga Book X90F. This is guarded behind a new "hideep,force-native-protocol" boolean property, to avoid changing behavior on other devices. For the record: I did test using the i2c-hid driver with some quick hacks and it does work. The I2C-HID descriptor is available from address 0x0020, just like on the X91F Windows model. So far the new "hideep,force-native-protocol" property is only used on x86/ACPI (non devicetree) devs. IOW it is not used in actual devicetree files. The devicetree-bindings maintainers have requested properties like these to not be added to the devicetree-bindings, so the new property is deliberately not added to the existing devicetree-bindings. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230311114726.182789-3-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-03-17Input: hideep - silence error in SW_RESET()Hans de Goede1-1/+6
On some models the first HIDEEP_SYSCON_WDT_CON write alone is enough to cause the controller to reset, causing the second write to fail: i2c-hideep_ts: write to register 0x52000014 (0x000001) failed: -121 Switch this write to a raw hideep_pgm_w_mem() to avoid an error getting logged in this case. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230311114726.182789-2-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-03-17Input: hideep - clean up some inconsistent indentingYang Li1-3/+3
Turn the space into a tab to Eliminate the follow smatch warning: drivers/input/touchscreen/hideep.c:470 hideep_program_nvm() warn: inconsistent indenting Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20220429070103.4747-1-yang.lee@linux.alibaba.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-01-10Input: hideep - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
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> Cc: Anthony Kim <anthony.kim@hideep.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230102181842.718010-48-jic23@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-12-03Input: hideep - Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
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-243-uwe@kleine-koenig.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-20Input: hideep - fix the uninitialized use in hideep_nvm_unlock()Yizhuo Zhai1-3/+10
Inside function hideep_nvm_unlock(), variable "unmask_code" could be uninitialized if hideep_pgm_r_reg() returns error, however, it is used in the later if statement after an "and" operation, which is potentially unsafe. Signed-off-by: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-12Input: hideep - switch to use device_property_count_u32()Andy Shevchenko1-2/+1
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 475Thomas Gleixner1-4/+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 as published by the free software foudation extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 1 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Enrico Weigelt <info@metux.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081203.770334822@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19Input: hideep - fix compile error due to missing include fileAnthony Kim1-2/+1
gpiod_() API requires including "linux/gpio/consumer.h". Also, we are not using the legacy API nor the static board files descriptions, so no need to include gpio.h nor gpio/machine.h. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Anthony Kim <anthony.kim@hideep.com> Patchwork-Id: 10094831 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-11-10Input: add support for HiDeep touchscreenAnthony Kim1-0/+1120
The HiDeep touchscreen device is a capacitive multi-touch controller mainly for multi-touch supported devices use. It use I2C interface for communication to IC and provide axis X, Y, Z locations for ten finger touch through input event interface to userspace. It support the Crimson and the Lime two type IC. They are different the number of channel supported and FW size. But the working protocol is same. Signed-off-by: Anthony Kim <anthony.kim@hideep.com> Acked-by: Rob Herring <robh+dt@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>