aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2018-10-22 12:04:33 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-10-22 12:04:33 -0700
commitcacd9759eea2f1c7e8792ecd91ed4602f963b1a5 (patch)
tree59281a932bf0b3d736044eb33067cf1507ada1d7 /drivers/input/touchscreen
parentInput: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM (diff)
parentInput: synaptics - avoid using uninitialized variable when probing (diff)
downloadlinux-dev-cacd9759eea2f1c7e8792ecd91ed4602f963b1a5.tar.xz
linux-dev-cacd9759eea2f1c7e8792ecd91ed4602f963b1a5.zip
Merge branch 'next' into for-linus
Prepare input updates for 4.20 merge window.
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c3
-rw-r--r--drivers/input/touchscreen/elants_i2c.c7
-rw-r--r--drivers/input/touchscreen/of_touchscreen.c36
-rw-r--r--drivers/input/touchscreen/silead.c13
-rw-r--r--drivers/input/touchscreen/st1232.c1
-rw-r--r--drivers/input/touchscreen/wm97xx-core.c3
6 files changed, 49 insertions, 14 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 3232af5dcf89..d3aacd534e9c 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -29,7 +29,6 @@
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
-#include <linux/property.h>
#include <asm/unaligned.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
@@ -489,7 +488,7 @@ static int mxt_lookup_bootloader_address(struct mxt_data *data, bool retry)
bootloader = appmode - 0x24;
break;
}
- /* Fall through for normal case */
+ /* Fall through - for normal case */
case 0x4c:
case 0x4d:
case 0x5a:
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index d21ca39b0fdb..f2cb23121833 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -147,10 +147,11 @@ struct elants_data {
u8 cmd_resp[HEADER_SIZE];
struct completion cmd_done;
- u8 buf[MAX_PACKET_SIZE];
-
bool wake_irq_enabled;
bool keep_power_in_suspend;
+
+ /* Must be last to be used for DMA operations */
+ u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned;
};
static int elants_i2c_send(struct i2c_client *client,
@@ -863,7 +864,7 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev)
int i;
int len;
- len = i2c_master_recv(client, ts->buf, sizeof(ts->buf));
+ len = i2c_master_recv_dmasafe(client, ts->buf, sizeof(ts->buf));
if (len < 0) {
dev_err(&client->dev, "%s: failed to read data: %d\n",
__func__, len);
diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
index 9642f103b726..6d241d45e312 100644
--- a/drivers/input/touchscreen/of_touchscreen.c
+++ b/drivers/input/touchscreen/of_touchscreen.c
@@ -35,7 +35,7 @@ static bool touchscreen_get_prop_u32(struct device *dev,
static void touchscreen_set_params(struct input_dev *dev,
unsigned long axis,
- int max, int fuzz)
+ int min, int max, int fuzz)
{
struct input_absinfo *absinfo;
@@ -47,6 +47,7 @@ static void touchscreen_set_params(struct input_dev *dev,
}
absinfo = &dev->absinfo[axis];
+ absinfo->minimum = min;
absinfo->maximum = max;
absinfo->fuzz = fuzz;
}
@@ -68,8 +69,9 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
struct touchscreen_properties *prop)
{
struct device *dev = input->dev.parent;
+ struct input_absinfo *absinfo;
unsigned int axis;
- unsigned int maximum, fuzz;
+ unsigned int minimum, maximum, fuzz;
bool data_present;
input_alloc_absinfo(input);
@@ -77,7 +79,10 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
return;
axis = multitouch ? ABS_MT_POSITION_X : ABS_X;
- data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-x",
+ data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x",
+ input_abs_get_min(input, axis),
+ &minimum) |
+ touchscreen_get_prop_u32(dev, "touchscreen-size-x",
input_abs_get_max(input,
axis) + 1,
&maximum) |
@@ -85,10 +90,13 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
input_abs_get_fuzz(input, axis),
&fuzz);
if (data_present)
- touchscreen_set_params(input, axis, maximum - 1, fuzz);
+ touchscreen_set_params(input, axis, minimum, maximum - 1, fuzz);
axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y;
- data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-y",
+ data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-y",
+ input_abs_get_min(input, axis),
+ &minimum) |
+ touchscreen_get_prop_u32(dev, "touchscreen-size-y",
input_abs_get_max(input,
axis) + 1,
&maximum) |
@@ -96,7 +104,7 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
input_abs_get_fuzz(input, axis),
&fuzz);
if (data_present)
- touchscreen_set_params(input, axis, maximum - 1, fuzz);
+ touchscreen_set_params(input, axis, minimum, maximum - 1, fuzz);
axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE;
data_present = touchscreen_get_prop_u32(dev,
@@ -108,7 +116,7 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
input_abs_get_fuzz(input, axis),
&fuzz);
if (data_present)
- touchscreen_set_params(input, axis, maximum, fuzz);
+ touchscreen_set_params(input, axis, 0, maximum, fuzz);
if (!prop)
return;
@@ -117,13 +125,25 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
prop->max_x = input_abs_get_max(input, axis);
prop->max_y = input_abs_get_max(input, axis + 1);
+
prop->invert_x =
device_property_read_bool(dev, "touchscreen-inverted-x");
+ if (prop->invert_x) {
+ absinfo = &input->absinfo[axis];
+ absinfo->maximum -= absinfo->minimum;
+ absinfo->minimum = 0;
+ }
+
prop->invert_y =
device_property_read_bool(dev, "touchscreen-inverted-y");
+ if (prop->invert_y) {
+ absinfo = &input->absinfo[axis + 1];
+ absinfo->maximum -= absinfo->minimum;
+ absinfo->minimum = 0;
+ }
+
prop->swap_x_y =
device_property_read_bool(dev, "touchscreen-swapped-x-y");
-
if (prop->swap_x_y)
swap(input->absinfo[axis], input->absinfo[axis + 1]);
}
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index d196ac3d8b8c..09241d4cdebc 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -558,20 +558,33 @@ static int __maybe_unused silead_ts_suspend(struct device *dev)
static int __maybe_unused silead_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
+ bool second_try = false;
int error, status;
silead_ts_set_power(client, SILEAD_POWER_ON);
+ retry:
error = silead_ts_reset(client);
if (error)
return error;
+ if (second_try) {
+ error = silead_ts_load_fw(client);
+ if (error)
+ return error;
+ }
+
error = silead_ts_startup(client);
if (error)
return error;
status = silead_ts_get_status(client);
if (status != SILEAD_STATUS_OK) {
+ if (!second_try) {
+ second_try = true;
+ dev_dbg(dev, "Reloading firmware after unsuccessful resume\n");
+ goto retry;
+ }
dev_err(dev, "Resume error, status: 0x%02x\n", status);
return -ENODEV;
}
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index d5dfa4053bbf..b71673911aac 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -195,6 +195,7 @@ static int st1232_ts_probe(struct i2c_client *client,
input_dev->id.bustype = BUS_I2C;
input_dev->dev.parent = &client->dev;
+ __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
__set_bit(EV_SYN, input_dev->evbit);
__set_bit(EV_KEY, input_dev->evbit);
__set_bit(EV_ABS, input_dev->evbit);
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index fd714ee881f7..5eb2a33111ec 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -929,7 +929,8 @@ static int __init wm97xx_init(void)
static void __exit wm97xx_exit(void)
{
- driver_unregister(&wm97xx_driver);
+ if (IS_BUILTIN(CONFIG_AC97_BUS))
+ driver_unregister(&wm97xx_driver);
platform_driver_unregister(&wm97xx_mfd_driver);
}