diff options
-rw-r--r-- | drivers/input/joystick/analog.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/ep93xx_keypad.c | 1 | ||||
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 2 | ||||
-rw-r--r-- | drivers/input/misc/ad714x-i2c.c | 81 | ||||
-rw-r--r-- | drivers/input/misc/ad714x-spi.c | 68 | ||||
-rw-r--r-- | drivers/input/misc/ad714x.c | 116 | ||||
-rw-r--r-- | drivers/input/misc/ad714x.h | 35 | ||||
-rw-r--r-- | drivers/input/misc/mma8450.c | 2 | ||||
-rw-r--r-- | drivers/input/misc/mpu3050.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/bcm5974.c | 40 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 17 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 4 | ||||
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 12 | ||||
-rw-r--r-- | drivers/input/touchscreen/max11801_ts.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/tnetv107x-ts.c | 1 |
15 files changed, 241 insertions, 145 deletions
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index 9882971827e6..358cd7ee905b 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c | |||
@@ -139,7 +139,7 @@ struct analog_port { | |||
139 | #include <linux/i8253.h> | 139 | #include <linux/i8253.h> |
140 | 140 | ||
141 | #define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0) | 141 | #define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0) |
142 | #define DELTA(x,y) (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0))) | 142 | #define DELTA(x,y) (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? PIT_TICK_RATE / HZ : 0))) |
143 | #define TIME_NAME (cpu_has_tsc?"TSC":"PIT") | 143 | #define TIME_NAME (cpu_has_tsc?"TSC":"PIT") |
144 | static unsigned int get_time_pit(void) | 144 | static unsigned int get_time_pit(void) |
145 | { | 145 | { |
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index c8242dd190d0..aa17e024d803 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c | |||
@@ -20,6 +20,7 @@ | |||
20 | * flag. | 20 | * flag. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/module.h> | ||
23 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
24 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
25 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index f270447ba951..a5a77915c650 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
@@ -702,7 +702,7 @@ err_iounmap: | |||
702 | err_free_mem_region: | 702 | err_free_mem_region: |
703 | release_mem_region(res->start, resource_size(res)); | 703 | release_mem_region(res->start, resource_size(res)); |
704 | err_free_mem: | 704 | err_free_mem: |
705 | input_free_device(kbc->idev); | 705 | input_free_device(input_dev); |
706 | kfree(kbc); | 706 | kfree(kbc); |
707 | 707 | ||
708 | return err; | 708 | return err; |
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c index e21deb1baa8a..025417d74ca2 100644 --- a/drivers/input/misc/ad714x-i2c.c +++ b/drivers/input/misc/ad714x-i2c.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * AD714X CapTouch Programmable Controller driver (I2C bus) | 2 | * AD714X CapTouch Programmable Controller driver (I2C bus) |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2011 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -27,54 +27,49 @@ static int ad714x_i2c_resume(struct device *dev) | |||
27 | 27 | ||
28 | static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); | 28 | static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); |
29 | 29 | ||
30 | static int ad714x_i2c_write(struct device *dev, unsigned short reg, | 30 | static int ad714x_i2c_write(struct ad714x_chip *chip, |
31 | unsigned short data) | 31 | unsigned short reg, unsigned short data) |
32 | { | 32 | { |
33 | struct i2c_client *client = to_i2c_client(dev); | 33 | struct i2c_client *client = to_i2c_client(chip->dev); |
34 | int ret = 0; | 34 | int error; |
35 | u8 *_reg = (u8 *)® | 35 | |
36 | u8 *_data = (u8 *)&data; | 36 | chip->xfer_buf[0] = cpu_to_be16(reg); |
37 | 37 | chip->xfer_buf[1] = cpu_to_be16(data); | |
38 | u8 tx[4] = { | 38 | |
39 | _reg[1], | 39 | error = i2c_master_send(client, (u8 *)chip->xfer_buf, |
40 | _reg[0], | 40 | 2 * sizeof(*chip->xfer_buf)); |
41 | _data[1], | 41 | if (unlikely(error < 0)) { |
42 | _data[0] | 42 | dev_err(&client->dev, "I2C write error: %d\n", error); |
43 | }; | 43 | return error; |
44 | 44 | } | |
45 | ret = i2c_master_send(client, tx, 4); | 45 | |
46 | if (ret < 0) | 46 | return 0; |
47 | dev_err(&client->dev, "I2C write error\n"); | ||
48 | |||
49 | return ret; | ||
50 | } | 47 | } |
51 | 48 | ||
52 | static int ad714x_i2c_read(struct device *dev, unsigned short reg, | 49 | static int ad714x_i2c_read(struct ad714x_chip *chip, |
53 | unsigned short *data) | 50 | unsigned short reg, unsigned short *data, size_t len) |
54 | { | 51 | { |
55 | struct i2c_client *client = to_i2c_client(dev); | 52 | struct i2c_client *client = to_i2c_client(chip->dev); |
56 | int ret = 0; | 53 | int i; |
57 | u8 *_reg = (u8 *)® | 54 | int error; |
58 | u8 *_data = (u8 *)data; | 55 | |
59 | 56 | chip->xfer_buf[0] = cpu_to_be16(reg); | |
60 | u8 tx[2] = { | 57 | |
61 | _reg[1], | 58 | error = i2c_master_send(client, (u8 *)chip->xfer_buf, |
62 | _reg[0] | 59 | sizeof(*chip->xfer_buf)); |
63 | }; | 60 | if (error >= 0) |
64 | u8 rx[2]; | 61 | error = i2c_master_recv(client, (u8 *)chip->xfer_buf, |
65 | 62 | len * sizeof(*chip->xfer_buf)); | |
66 | ret = i2c_master_send(client, tx, 2); | 63 | |
67 | if (ret >= 0) | 64 | if (unlikely(error < 0)) { |
68 | ret = i2c_master_recv(client, rx, 2); | 65 | dev_err(&client->dev, "I2C read error: %d\n", error); |
69 | 66 | return error; | |
70 | if (unlikely(ret < 0)) { | ||
71 | dev_err(&client->dev, "I2C read error\n"); | ||
72 | } else { | ||
73 | _data[0] = rx[1]; | ||
74 | _data[1] = rx[0]; | ||
75 | } | 67 | } |
76 | 68 | ||
77 | return ret; | 69 | for (i = 0; i < len; i++) |
70 | data[i] = be16_to_cpu(chip->xfer_buf[i]); | ||
71 | |||
72 | return 0; | ||
78 | } | 73 | } |
79 | 74 | ||
80 | static int __devinit ad714x_i2c_probe(struct i2c_client *client, | 75 | static int __devinit ad714x_i2c_probe(struct i2c_client *client, |
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c index 4120dd549305..875b50811361 100644 --- a/drivers/input/misc/ad714x-spi.c +++ b/drivers/input/misc/ad714x-spi.c | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * AD714X CapTouch Programmable Controller driver (SPI bus) | 2 | * AD714X CapTouch Programmable Controller driver (SPI bus) |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2011 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/input.h> /* BUS_I2C */ | 9 | #include <linux/input.h> /* BUS_SPI */ |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/spi/spi.h> | 11 | #include <linux/spi/spi.h> |
12 | #include <linux/pm.h> | 12 | #include <linux/pm.h> |
@@ -30,30 +30,68 @@ static int ad714x_spi_resume(struct device *dev) | |||
30 | 30 | ||
31 | static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume); | 31 | static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume); |
32 | 32 | ||
33 | static int ad714x_spi_read(struct device *dev, unsigned short reg, | 33 | static int ad714x_spi_read(struct ad714x_chip *chip, |
34 | unsigned short *data) | 34 | unsigned short reg, unsigned short *data, size_t len) |
35 | { | 35 | { |
36 | struct spi_device *spi = to_spi_device(dev); | 36 | struct spi_device *spi = to_spi_device(chip->dev); |
37 | unsigned short tx = AD714x_SPI_CMD_PREFIX | AD714x_SPI_READ | reg; | 37 | struct spi_message message; |
38 | struct spi_transfer xfer[2]; | ||
39 | int i; | ||
40 | int error; | ||
41 | |||
42 | spi_message_init(&message); | ||
43 | memset(xfer, 0, sizeof(xfer)); | ||
44 | |||
45 | chip->xfer_buf[0] = cpu_to_be16(AD714x_SPI_CMD_PREFIX | | ||
46 | AD714x_SPI_READ | reg); | ||
47 | xfer[0].tx_buf = &chip->xfer_buf[0]; | ||
48 | xfer[0].len = sizeof(chip->xfer_buf[0]); | ||
49 | spi_message_add_tail(&xfer[0], &message); | ||
50 | |||
51 | xfer[1].rx_buf = &chip->xfer_buf[1]; | ||
52 | xfer[1].len = sizeof(chip->xfer_buf[1]) * len; | ||
53 | spi_message_add_tail(&xfer[1], &message); | ||
54 | |||
55 | error = spi_sync(spi, &message); | ||
56 | if (unlikely(error)) { | ||
57 | dev_err(chip->dev, "SPI read error: %d\n", error); | ||
58 | return error; | ||
59 | } | ||
60 | |||
61 | for (i = 0; i < len; i++) | ||
62 | data[i] = be16_to_cpu(chip->xfer_buf[i + 1]); | ||
38 | 63 | ||
39 | return spi_write_then_read(spi, (u8 *)&tx, 2, (u8 *)data, 2); | 64 | return 0; |
40 | } | 65 | } |
41 | 66 | ||
42 | static int ad714x_spi_write(struct device *dev, unsigned short reg, | 67 | static int ad714x_spi_write(struct ad714x_chip *chip, |
43 | unsigned short data) | 68 | unsigned short reg, unsigned short data) |
44 | { | 69 | { |
45 | struct spi_device *spi = to_spi_device(dev); | 70 | struct spi_device *spi = to_spi_device(chip->dev); |
46 | unsigned short tx[2] = { | 71 | int error; |
47 | AD714x_SPI_CMD_PREFIX | reg, | 72 | |
48 | data | 73 | chip->xfer_buf[0] = cpu_to_be16(AD714x_SPI_CMD_PREFIX | reg); |
49 | }; | 74 | chip->xfer_buf[1] = cpu_to_be16(data); |
75 | |||
76 | error = spi_write(spi, (u8 *)chip->xfer_buf, | ||
77 | 2 * sizeof(*chip->xfer_buf)); | ||
78 | if (unlikely(error)) { | ||
79 | dev_err(chip->dev, "SPI write error: %d\n", error); | ||
80 | return error; | ||
81 | } | ||
50 | 82 | ||
51 | return spi_write(spi, (u8 *)tx, 4); | 83 | return 0; |
52 | } | 84 | } |
53 | 85 | ||
54 | static int __devinit ad714x_spi_probe(struct spi_device *spi) | 86 | static int __devinit ad714x_spi_probe(struct spi_device *spi) |
55 | { | 87 | { |
56 | struct ad714x_chip *chip; | 88 | struct ad714x_chip *chip; |
89 | int err; | ||
90 | |||
91 | spi->bits_per_word = 8; | ||
92 | err = spi_setup(spi); | ||
93 | if (err < 0) | ||
94 | return err; | ||
57 | 95 | ||
58 | chip = ad714x_probe(&spi->dev, BUS_SPI, spi->irq, | 96 | chip = ad714x_probe(&spi->dev, BUS_SPI, spi->irq, |
59 | ad714x_spi_read, ad714x_spi_write); | 97 | ad714x_spi_read, ad714x_spi_write); |
diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c index c3a62c42cd28..ca42c7d2a3c7 100644 --- a/drivers/input/misc/ad714x.c +++ b/drivers/input/misc/ad714x.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * AD714X CapTouch Programmable Controller driver supporting AD7142/3/7/8/7A | 2 | * AD714X CapTouch Programmable Controller driver supporting AD7142/3/7/8/7A |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2011 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -59,7 +59,6 @@ | |||
59 | #define STAGE11_AMBIENT 0x27D | 59 | #define STAGE11_AMBIENT 0x27D |
60 | 60 | ||
61 | #define PER_STAGE_REG_NUM 36 | 61 | #define PER_STAGE_REG_NUM 36 |
62 | #define STAGE_NUM 12 | ||
63 | #define STAGE_CFGREG_NUM 8 | 62 | #define STAGE_CFGREG_NUM 8 |
64 | #define SYS_CFGREG_NUM 8 | 63 | #define SYS_CFGREG_NUM 8 |
65 | 64 | ||
@@ -124,27 +123,6 @@ struct ad714x_driver_data { | |||
124 | * information to integrate all things which will be private data | 123 | * information to integrate all things which will be private data |
125 | * of spi/i2c device | 124 | * of spi/i2c device |
126 | */ | 125 | */ |
127 | struct ad714x_chip { | ||
128 | unsigned short h_state; | ||
129 | unsigned short l_state; | ||
130 | unsigned short c_state; | ||
131 | unsigned short adc_reg[STAGE_NUM]; | ||
132 | unsigned short amb_reg[STAGE_NUM]; | ||
133 | unsigned short sensor_val[STAGE_NUM]; | ||
134 | |||
135 | struct ad714x_platform_data *hw; | ||
136 | struct ad714x_driver_data *sw; | ||
137 | |||
138 | int irq; | ||
139 | struct device *dev; | ||
140 | ad714x_read_t read; | ||
141 | ad714x_write_t write; | ||
142 | |||
143 | struct mutex mutex; | ||
144 | |||
145 | unsigned product; | ||
146 | unsigned version; | ||
147 | }; | ||
148 | 126 | ||
149 | static void ad714x_use_com_int(struct ad714x_chip *ad714x, | 127 | static void ad714x_use_com_int(struct ad714x_chip *ad714x, |
150 | int start_stage, int end_stage) | 128 | int start_stage, int end_stage) |
@@ -154,13 +132,13 @@ static void ad714x_use_com_int(struct ad714x_chip *ad714x, | |||
154 | 132 | ||
155 | mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1); | 133 | mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1); |
156 | 134 | ||
157 | ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data); | 135 | ad714x->read(ad714x, STG_COM_INT_EN_REG, &data, 1); |
158 | data |= 1 << end_stage; | 136 | data |= 1 << end_stage; |
159 | ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data); | 137 | ad714x->write(ad714x, STG_COM_INT_EN_REG, data); |
160 | 138 | ||
161 | ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data); | 139 | ad714x->read(ad714x, STG_HIGH_INT_EN_REG, &data, 1); |
162 | data &= ~mask; | 140 | data &= ~mask; |
163 | ad714x->write(ad714x->dev, STG_HIGH_INT_EN_REG, data); | 141 | ad714x->write(ad714x, STG_HIGH_INT_EN_REG, data); |
164 | } | 142 | } |
165 | 143 | ||
166 | static void ad714x_use_thr_int(struct ad714x_chip *ad714x, | 144 | static void ad714x_use_thr_int(struct ad714x_chip *ad714x, |
@@ -171,13 +149,13 @@ static void ad714x_use_thr_int(struct ad714x_chip *ad714x, | |||
171 | 149 | ||
172 | mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1); | 150 | mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1); |
173 | 151 | ||
174 | ad714x->read(ad714x->dev, STG_COM_INT_EN_REG, &data); | 152 | ad714x->read(ad714x, STG_COM_INT_EN_REG, &data, 1); |
175 | data &= ~(1 << end_stage); | 153 | data &= ~(1 << end_stage); |
176 | ad714x->write(ad714x->dev, STG_COM_INT_EN_REG, data); | 154 | ad714x->write(ad714x, STG_COM_INT_EN_REG, data); |
177 | 155 | ||
178 | ad714x->read(ad714x->dev, STG_HIGH_INT_EN_REG, &data); | 156 | ad714x->read(ad714x, STG_HIGH_INT_EN_REG, &data, 1); |
179 | data |= mask; | 157 | data |= mask; |
180 | ad714x->write(ad714x->dev, STG_HIGH_INT_EN_REG, data); | 158 | ad714x->write(ad714x, STG_HIGH_INT_EN_REG, data); |
181 | } | 159 | } |
182 | 160 | ||
183 | static int ad714x_cal_highest_stage(struct ad714x_chip *ad714x, | 161 | static int ad714x_cal_highest_stage(struct ad714x_chip *ad714x, |
@@ -273,15 +251,16 @@ static void ad714x_slider_cal_sensor_val(struct ad714x_chip *ad714x, int idx) | |||
273 | struct ad714x_slider_plat *hw = &ad714x->hw->slider[idx]; | 251 | struct ad714x_slider_plat *hw = &ad714x->hw->slider[idx]; |
274 | int i; | 252 | int i; |
275 | 253 | ||
254 | ad714x->read(ad714x, CDC_RESULT_S0 + hw->start_stage, | ||
255 | &ad714x->adc_reg[hw->start_stage], | ||
256 | hw->end_stage - hw->start_stage + 1); | ||
257 | |||
276 | for (i = hw->start_stage; i <= hw->end_stage; i++) { | 258 | for (i = hw->start_stage; i <= hw->end_stage; i++) { |
277 | ad714x->read(ad714x->dev, CDC_RESULT_S0 + i, | 259 | ad714x->read(ad714x, STAGE0_AMBIENT + i * PER_STAGE_REG_NUM, |
278 | &ad714x->adc_reg[i]); | 260 | &ad714x->amb_reg[i], 1); |
279 | ad714x->read(ad714x->dev, | 261 | |
280 | STAGE0_AMBIENT + i * PER_STAGE_REG_NUM, | 262 | ad714x->sensor_val[i] = |
281 | &ad714x->amb_reg[i]); | 263 | abs(ad714x->adc_reg[i] - ad714x->amb_reg[i]); |
282 | |||
283 | ad714x->sensor_val[i] = abs(ad714x->adc_reg[i] - | ||
284 | ad714x->amb_reg[i]); | ||
285 | } | 264 | } |
286 | } | 265 | } |
287 | 266 | ||
@@ -444,15 +423,16 @@ static void ad714x_wheel_cal_sensor_val(struct ad714x_chip *ad714x, int idx) | |||
444 | struct ad714x_wheel_plat *hw = &ad714x->hw->wheel[idx]; | 423 | struct ad714x_wheel_plat *hw = &ad714x->hw->wheel[idx]; |
445 | int i; | 424 | int i; |
446 | 425 | ||
426 | ad714x->read(ad714x, CDC_RESULT_S0 + hw->start_stage, | ||
427 | &ad714x->adc_reg[hw->start_stage], | ||
428 | hw->end_stage - hw->start_stage + 1); | ||
429 | |||
447 | for (i = hw->start_stage; i <= hw->end_stage; i++) { | 430 | for (i = hw->start_stage; i <= hw->end_stage; i++) { |
448 | ad714x->read(ad714x->dev, CDC_RESULT_S0 + i, | 431 | ad714x->read(ad714x, STAGE0_AMBIENT + i * PER_STAGE_REG_NUM, |
449 | &ad714x->adc_reg[i]); | 432 | &ad714x->amb_reg[i], 1); |
450 | ad714x->read(ad714x->dev, | ||
451 | STAGE0_AMBIENT + i * PER_STAGE_REG_NUM, | ||
452 | &ad714x->amb_reg[i]); | ||
453 | if (ad714x->adc_reg[i] > ad714x->amb_reg[i]) | 433 | if (ad714x->adc_reg[i] > ad714x->amb_reg[i]) |
454 | ad714x->sensor_val[i] = ad714x->adc_reg[i] - | 434 | ad714x->sensor_val[i] = |
455 | ad714x->amb_reg[i]; | 435 | ad714x->adc_reg[i] - ad714x->amb_reg[i]; |
456 | else | 436 | else |
457 | ad714x->sensor_val[i] = 0; | 437 | ad714x->sensor_val[i] = 0; |
458 | } | 438 | } |
@@ -597,15 +577,16 @@ static void touchpad_cal_sensor_val(struct ad714x_chip *ad714x, int idx) | |||
597 | struct ad714x_touchpad_plat *hw = &ad714x->hw->touchpad[idx]; | 577 | struct ad714x_touchpad_plat *hw = &ad714x->hw->touchpad[idx]; |
598 | int i; | 578 | int i; |
599 | 579 | ||
580 | ad714x->read(ad714x, CDC_RESULT_S0 + hw->x_start_stage, | ||
581 | &ad714x->adc_reg[hw->x_start_stage], | ||
582 | hw->x_end_stage - hw->x_start_stage + 1); | ||
583 | |||
600 | for (i = hw->x_start_stage; i <= hw->x_end_stage; i++) { | 584 | for (i = hw->x_start_stage; i <= hw->x_end_stage; i++) { |
601 | ad714x->read(ad714x->dev, CDC_RESULT_S0 + i, | 585 | ad714x->read(ad714x, STAGE0_AMBIENT + i * PER_STAGE_REG_NUM, |
602 | &ad714x->adc_reg[i]); | 586 | &ad714x->amb_reg[i], 1); |
603 | ad714x->read(ad714x->dev, | ||
604 | STAGE0_AMBIENT + i * PER_STAGE_REG_NUM, | ||
605 | &ad714x->amb_reg[i]); | ||
606 | if (ad714x->adc_reg[i] > ad714x->amb_reg[i]) | 587 | if (ad714x->adc_reg[i] > ad714x->amb_reg[i]) |
607 | ad714x->sensor_val[i] = ad714x->adc_reg[i] - | 588 | ad714x->sensor_val[i] = |
608 | ad714x->amb_reg[i]; | 589 | ad714x->adc_reg[i] - ad714x->amb_reg[i]; |
609 | else | 590 | else |
610 | ad714x->sensor_val[i] = 0; | 591 | ad714x->sensor_val[i] = 0; |
611 | } | 592 | } |
@@ -891,7 +872,7 @@ static int ad714x_hw_detect(struct ad714x_chip *ad714x) | |||
891 | { | 872 | { |
892 | unsigned short data; | 873 | unsigned short data; |
893 | 874 | ||
894 | ad714x->read(ad714x->dev, AD714X_PARTID_REG, &data); | 875 | ad714x->read(ad714x, AD714X_PARTID_REG, &data, 1); |
895 | switch (data & 0xFFF0) { | 876 | switch (data & 0xFFF0) { |
896 | case AD7142_PARTID: | 877 | case AD7142_PARTID: |
897 | ad714x->product = 0x7142; | 878 | ad714x->product = 0x7142; |
@@ -940,23 +921,20 @@ static void ad714x_hw_init(struct ad714x_chip *ad714x) | |||
940 | for (i = 0; i < STAGE_NUM; i++) { | 921 | for (i = 0; i < STAGE_NUM; i++) { |
941 | reg_base = AD714X_STAGECFG_REG + i * STAGE_CFGREG_NUM; | 922 | reg_base = AD714X_STAGECFG_REG + i * STAGE_CFGREG_NUM; |
942 | for (j = 0; j < STAGE_CFGREG_NUM; j++) | 923 | for (j = 0; j < STAGE_CFGREG_NUM; j++) |
943 | ad714x->write(ad714x->dev, reg_base + j, | 924 | ad714x->write(ad714x, reg_base + j, |
944 | ad714x->hw->stage_cfg_reg[i][j]); | 925 | ad714x->hw->stage_cfg_reg[i][j]); |
945 | } | 926 | } |
946 | 927 | ||
947 | for (i = 0; i < SYS_CFGREG_NUM; i++) | 928 | for (i = 0; i < SYS_CFGREG_NUM; i++) |
948 | ad714x->write(ad714x->dev, AD714X_SYSCFG_REG + i, | 929 | ad714x->write(ad714x, AD714X_SYSCFG_REG + i, |
949 | ad714x->hw->sys_cfg_reg[i]); | 930 | ad714x->hw->sys_cfg_reg[i]); |
950 | for (i = 0; i < SYS_CFGREG_NUM; i++) | 931 | for (i = 0; i < SYS_CFGREG_NUM; i++) |
951 | ad714x->read(ad714x->dev, AD714X_SYSCFG_REG + i, | 932 | ad714x->read(ad714x, AD714X_SYSCFG_REG + i, &data, 1); |
952 | &data); | ||
953 | 933 | ||
954 | ad714x->write(ad714x->dev, AD714X_STG_CAL_EN_REG, 0xFFF); | 934 | ad714x->write(ad714x, AD714X_STG_CAL_EN_REG, 0xFFF); |
955 | 935 | ||
956 | /* clear all interrupts */ | 936 | /* clear all interrupts */ |
957 | ad714x->read(ad714x->dev, STG_LOW_INT_STA_REG, &data); | 937 | ad714x->read(ad714x, STG_LOW_INT_STA_REG, &ad714x->l_state, 3); |
958 | ad714x->read(ad714x->dev, STG_HIGH_INT_STA_REG, &data); | ||
959 | ad714x->read(ad714x->dev, STG_COM_INT_STA_REG, &data); | ||
960 | } | 938 | } |
961 | 939 | ||
962 | static irqreturn_t ad714x_interrupt_thread(int irq, void *data) | 940 | static irqreturn_t ad714x_interrupt_thread(int irq, void *data) |
@@ -966,9 +944,7 @@ static irqreturn_t ad714x_interrupt_thread(int irq, void *data) | |||
966 | 944 | ||
967 | mutex_lock(&ad714x->mutex); | 945 | mutex_lock(&ad714x->mutex); |
968 | 946 | ||
969 | ad714x->read(ad714x->dev, STG_LOW_INT_STA_REG, &ad714x->l_state); | 947 | ad714x->read(ad714x, STG_LOW_INT_STA_REG, &ad714x->l_state, 3); |
970 | ad714x->read(ad714x->dev, STG_HIGH_INT_STA_REG, &ad714x->h_state); | ||
971 | ad714x->read(ad714x->dev, STG_COM_INT_STA_REG, &ad714x->c_state); | ||
972 | 948 | ||
973 | for (i = 0; i < ad714x->hw->button_num; i++) | 949 | for (i = 0; i < ad714x->hw->button_num; i++) |
974 | ad714x_button_state_machine(ad714x, i); | 950 | ad714x_button_state_machine(ad714x, i); |
@@ -1245,7 +1221,7 @@ int ad714x_disable(struct ad714x_chip *ad714x) | |||
1245 | mutex_lock(&ad714x->mutex); | 1221 | mutex_lock(&ad714x->mutex); |
1246 | 1222 | ||
1247 | data = ad714x->hw->sys_cfg_reg[AD714X_PWR_CTRL] | 0x3; | 1223 | data = ad714x->hw->sys_cfg_reg[AD714X_PWR_CTRL] | 0x3; |
1248 | ad714x->write(ad714x->dev, AD714X_PWR_CTRL, data); | 1224 | ad714x->write(ad714x, AD714X_PWR_CTRL, data); |
1249 | 1225 | ||
1250 | mutex_unlock(&ad714x->mutex); | 1226 | mutex_unlock(&ad714x->mutex); |
1251 | 1227 | ||
@@ -1255,24 +1231,20 @@ EXPORT_SYMBOL(ad714x_disable); | |||
1255 | 1231 | ||
1256 | int ad714x_enable(struct ad714x_chip *ad714x) | 1232 | int ad714x_enable(struct ad714x_chip *ad714x) |
1257 | { | 1233 | { |
1258 | unsigned short data; | ||
1259 | |||
1260 | dev_dbg(ad714x->dev, "%s enter\n", __func__); | 1234 | dev_dbg(ad714x->dev, "%s enter\n", __func__); |
1261 | 1235 | ||
1262 | mutex_lock(&ad714x->mutex); | 1236 | mutex_lock(&ad714x->mutex); |
1263 | 1237 | ||
1264 | /* resume to non-shutdown mode */ | 1238 | /* resume to non-shutdown mode */ |
1265 | 1239 | ||
1266 | ad714x->write(ad714x->dev, AD714X_PWR_CTRL, | 1240 | ad714x->write(ad714x, AD714X_PWR_CTRL, |
1267 | ad714x->hw->sys_cfg_reg[AD714X_PWR_CTRL]); | 1241 | ad714x->hw->sys_cfg_reg[AD714X_PWR_CTRL]); |
1268 | 1242 | ||
1269 | /* make sure the interrupt output line is not low level after resume, | 1243 | /* make sure the interrupt output line is not low level after resume, |
1270 | * otherwise we will get no chance to enter falling-edge irq again | 1244 | * otherwise we will get no chance to enter falling-edge irq again |
1271 | */ | 1245 | */ |
1272 | 1246 | ||
1273 | ad714x->read(ad714x->dev, STG_LOW_INT_STA_REG, &data); | 1247 | ad714x->read(ad714x, STG_LOW_INT_STA_REG, &ad714x->l_state, 3); |
1274 | ad714x->read(ad714x->dev, STG_HIGH_INT_STA_REG, &data); | ||
1275 | ad714x->read(ad714x->dev, STG_COM_INT_STA_REG, &data); | ||
1276 | 1248 | ||
1277 | mutex_unlock(&ad714x->mutex); | 1249 | mutex_unlock(&ad714x->mutex); |
1278 | 1250 | ||
diff --git a/drivers/input/misc/ad714x.h b/drivers/input/misc/ad714x.h index 45c54fb13f07..3c85455aa66d 100644 --- a/drivers/input/misc/ad714x.h +++ b/drivers/input/misc/ad714x.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * AD714X CapTouch Programmable Controller driver (bus interfaces) | 2 | * AD714X CapTouch Programmable Controller driver (bus interfaces) |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2011 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -11,11 +11,40 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | 13 | ||
14 | #define STAGE_NUM 12 | ||
15 | |||
14 | struct device; | 16 | struct device; |
17 | struct ad714x_platform_data; | ||
18 | struct ad714x_driver_data; | ||
15 | struct ad714x_chip; | 19 | struct ad714x_chip; |
16 | 20 | ||
17 | typedef int (*ad714x_read_t)(struct device *, unsigned short, unsigned short *); | 21 | typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t); |
18 | typedef int (*ad714x_write_t)(struct device *, unsigned short, unsigned short); | 22 | typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short); |
23 | |||
24 | struct ad714x_chip { | ||
25 | unsigned short l_state; | ||
26 | unsigned short h_state; | ||
27 | unsigned short c_state; | ||
28 | unsigned short adc_reg[STAGE_NUM]; | ||
29 | unsigned short amb_reg[STAGE_NUM]; | ||
30 | unsigned short sensor_val[STAGE_NUM]; | ||
31 | |||
32 | struct ad714x_platform_data *hw; | ||
33 | struct ad714x_driver_data *sw; | ||
34 | |||
35 | int irq; | ||
36 | struct device *dev; | ||
37 | ad714x_read_t read; | ||
38 | ad714x_write_t write; | ||
39 | |||
40 | struct mutex mutex; | ||
41 | |||
42 | unsigned product; | ||
43 | unsigned version; | ||
44 | |||
45 | __be16 xfer_buf[16] ____cacheline_aligned; | ||
46 | |||
47 | }; | ||
19 | 48 | ||
20 | int ad714x_disable(struct ad714x_chip *ad714x); | 49 | int ad714x_disable(struct ad714x_chip *ad714x); |
21 | int ad714x_enable(struct ad714x_chip *ad714x); | 50 | int ad714x_enable(struct ad714x_chip *ad714x); |
diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c index 6c76cf792991..0794778295fc 100644 --- a/drivers/input/misc/mma8450.c +++ b/drivers/input/misc/mma8450.c | |||
@@ -234,7 +234,7 @@ static const struct of_device_id mma8450_dt_ids[] = { | |||
234 | { .compatible = "fsl,mma8450", }, | 234 | { .compatible = "fsl,mma8450", }, |
235 | { /* sentinel */ } | 235 | { /* sentinel */ } |
236 | }; | 236 | }; |
237 | MODULE_DEVICE_TABLE(i2c, mma8450_dt_ids); | 237 | MODULE_DEVICE_TABLE(of, mma8450_dt_ids); |
238 | 238 | ||
239 | static struct i2c_driver mma8450_driver = { | 239 | static struct i2c_driver mma8450_driver = { |
240 | .driver = { | 240 | .driver = { |
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c index b95fac15b2ea..f71dc728da58 100644 --- a/drivers/input/misc/mpu3050.c +++ b/drivers/input/misc/mpu3050.c | |||
@@ -282,7 +282,7 @@ err_free_irq: | |||
282 | err_pm_set_suspended: | 282 | err_pm_set_suspended: |
283 | pm_runtime_set_suspended(&client->dev); | 283 | pm_runtime_set_suspended(&client->dev); |
284 | err_free_mem: | 284 | err_free_mem: |
285 | input_unregister_device(idev); | 285 | input_free_device(idev); |
286 | kfree(sensor); | 286 | kfree(sensor); |
287 | return error; | 287 | return error; |
288 | } | 288 | } |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 3126983c004a..da280189ef07 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -67,6 +67,14 @@ | |||
67 | #define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245 | 67 | #define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245 |
68 | #define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246 | 68 | #define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246 |
69 | #define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 | 69 | #define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 |
70 | /* MacbookAir4,2 (unibody, July 2011) */ | ||
71 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c | ||
72 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d | ||
73 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e | ||
74 | /* Macbook8,2 (unibody) */ | ||
75 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 | ||
76 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 | ||
77 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254 | ||
70 | 78 | ||
71 | #define BCM5974_DEVICE(prod) { \ | 79 | #define BCM5974_DEVICE(prod) { \ |
72 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ | 80 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ |
@@ -104,6 +112,14 @@ static const struct usb_device_id bcm5974_table[] = { | |||
104 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI), | 112 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI), |
105 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO), | 113 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO), |
106 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS), | 114 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS), |
115 | /* MacbookAir4,2 */ | ||
116 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI), | ||
117 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ISO), | ||
118 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_JIS), | ||
119 | /* MacbookPro8,2 */ | ||
120 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), | ||
121 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), | ||
122 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | ||
107 | /* Terminating entry */ | 123 | /* Terminating entry */ |
108 | {} | 124 | {} |
109 | }; | 125 | }; |
@@ -294,6 +310,30 @@ static const struct bcm5974_config bcm5974_config_table[] = { | |||
294 | { DIM_X, DIM_X / SN_COORD, -4415, 5050 }, | 310 | { DIM_X, DIM_X / SN_COORD, -4415, 5050 }, |
295 | { DIM_Y, DIM_Y / SN_COORD, -55, 6680 } | 311 | { DIM_Y, DIM_Y / SN_COORD, -55, 6680 } |
296 | }, | 312 | }, |
313 | { | ||
314 | USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI, | ||
315 | USB_DEVICE_ID_APPLE_WELLSPRING6_ISO, | ||
316 | USB_DEVICE_ID_APPLE_WELLSPRING6_JIS, | ||
317 | HAS_INTEGRATED_BUTTON, | ||
318 | 0x84, sizeof(struct bt_data), | ||
319 | 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, | ||
320 | { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, | ||
321 | { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, | ||
322 | { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, | ||
323 | { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } | ||
324 | }, | ||
325 | { | ||
326 | USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI, | ||
327 | USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO, | ||
328 | USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS, | ||
329 | HAS_INTEGRATED_BUTTON, | ||
330 | 0x84, sizeof(struct bt_data), | ||
331 | 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, | ||
332 | { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, | ||
333 | { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, | ||
334 | { DIM_X, DIM_X / SN_COORD, -4750, 5280 }, | ||
335 | { DIM_Y, DIM_Y / SN_COORD, -150, 6730 } | ||
336 | }, | ||
297 | {} | 337 | {} |
298 | }; | 338 | }; |
299 | 339 | ||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 449c0a46dbac..d27c9d91630b 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -49,6 +49,7 @@ struct hid_descriptor { | |||
49 | #define USB_REQ_GET_REPORT 0x01 | 49 | #define USB_REQ_GET_REPORT 0x01 |
50 | #define USB_REQ_SET_REPORT 0x09 | 50 | #define USB_REQ_SET_REPORT 0x09 |
51 | #define WAC_HID_FEATURE_REPORT 0x03 | 51 | #define WAC_HID_FEATURE_REPORT 0x03 |
52 | #define WAC_MSG_RETRIES 5 | ||
52 | 53 | ||
53 | static int usb_get_report(struct usb_interface *intf, unsigned char type, | 54 | static int usb_get_report(struct usb_interface *intf, unsigned char type, |
54 | unsigned char id, void *buf, int size) | 55 | unsigned char id, void *buf, int size) |
@@ -165,7 +166,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
165 | report, | 166 | report, |
166 | hid_desc->wDescriptorLength, | 167 | hid_desc->wDescriptorLength, |
167 | 5000); /* 5 secs */ | 168 | 5000); /* 5 secs */ |
168 | } while (result < 0 && limit++ < 5); | 169 | } while (result < 0 && limit++ < WAC_MSG_RETRIES); |
169 | 170 | ||
170 | /* No need to parse the Descriptor. It isn't an error though */ | 171 | /* No need to parse the Descriptor. It isn't an error though */ |
171 | if (result < 0) | 172 | if (result < 0) |
@@ -319,24 +320,26 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat | |||
319 | int limit = 0, report_id = 2; | 320 | int limit = 0, report_id = 2; |
320 | int error = -ENOMEM; | 321 | int error = -ENOMEM; |
321 | 322 | ||
322 | rep_data = kmalloc(2, GFP_KERNEL); | 323 | rep_data = kmalloc(4, GFP_KERNEL); |
323 | if (!rep_data) | 324 | if (!rep_data) |
324 | return error; | 325 | return error; |
325 | 326 | ||
326 | /* ask to report tablet data if it is 2FGT Tablet PC or | 327 | /* ask to report tablet data if it is MT Tablet PC or |
327 | * not a Tablet PC */ | 328 | * not a Tablet PC */ |
328 | if (features->type == TABLETPC2FG) { | 329 | if (features->type == TABLETPC2FG) { |
329 | do { | 330 | do { |
330 | rep_data[0] = 3; | 331 | rep_data[0] = 3; |
331 | rep_data[1] = 4; | 332 | rep_data[1] = 4; |
333 | rep_data[2] = 0; | ||
334 | rep_data[3] = 0; | ||
332 | report_id = 3; | 335 | report_id = 3; |
333 | error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, | 336 | error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, |
334 | report_id, rep_data, 2); | 337 | report_id, rep_data, 4); |
335 | if (error >= 0) | 338 | if (error >= 0) |
336 | error = usb_get_report(intf, | 339 | error = usb_get_report(intf, |
337 | WAC_HID_FEATURE_REPORT, report_id, | 340 | WAC_HID_FEATURE_REPORT, report_id, |
338 | rep_data, 3); | 341 | rep_data, 4); |
339 | } while ((error < 0 || rep_data[1] != 4) && limit++ < 5); | 342 | } while ((error < 0 || rep_data[1] != 4) && limit++ < WAC_MSG_RETRIES); |
340 | } else if (features->type != TABLETPC) { | 343 | } else if (features->type != TABLETPC) { |
341 | do { | 344 | do { |
342 | rep_data[0] = 2; | 345 | rep_data[0] = 2; |
@@ -347,7 +350,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat | |||
347 | error = usb_get_report(intf, | 350 | error = usb_get_report(intf, |
348 | WAC_HID_FEATURE_REPORT, report_id, | 351 | WAC_HID_FEATURE_REPORT, report_id, |
349 | rep_data, 2); | 352 | rep_data, 2); |
350 | } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); | 353 | } while ((error < 0 || rep_data[1] != 2) && limit++ < WAC_MSG_RETRIES); |
351 | } | 354 | } |
352 | 355 | ||
353 | kfree(rep_data); | 356 | kfree(rep_data); |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 03ebcc8b24b5..c1c2f7b28d89 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1460,6 +1460,9 @@ static const struct wacom_features wacom_features_0xD3 = | |||
1460 | static const struct wacom_features wacom_features_0xD4 = | 1460 | static const struct wacom_features wacom_features_0xD4 = |
1461 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1461 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1462 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1462 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1463 | static const struct wacom_features wacom_features_0xD5 = | ||
1464 | { "Wacom Bamboo Pen 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, | ||
1465 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | ||
1463 | static const struct wacom_features wacom_features_0xD6 = | 1466 | static const struct wacom_features wacom_features_0xD6 = |
1464 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1467 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1465 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1468 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -1564,6 +1567,7 @@ const struct usb_device_id wacom_ids[] = { | |||
1564 | { USB_DEVICE_WACOM(0xD2) }, | 1567 | { USB_DEVICE_WACOM(0xD2) }, |
1565 | { USB_DEVICE_WACOM(0xD3) }, | 1568 | { USB_DEVICE_WACOM(0xD3) }, |
1566 | { USB_DEVICE_WACOM(0xD4) }, | 1569 | { USB_DEVICE_WACOM(0xD4) }, |
1570 | { USB_DEVICE_WACOM(0xD5) }, | ||
1567 | { USB_DEVICE_WACOM(0xD6) }, | 1571 | { USB_DEVICE_WACOM(0xD6) }, |
1568 | { USB_DEVICE_WACOM(0xD7) }, | 1572 | { USB_DEVICE_WACOM(0xD7) }, |
1569 | { USB_DEVICE_WACOM(0xD8) }, | 1573 | { USB_DEVICE_WACOM(0xD8) }, |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index ae00604a6a81..f5d66859f232 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -244,6 +244,7 @@ struct mxt_finger { | |||
244 | int x; | 244 | int x; |
245 | int y; | 245 | int y; |
246 | int area; | 246 | int area; |
247 | int pressure; | ||
247 | }; | 248 | }; |
248 | 249 | ||
249 | /* Each client has this additional data */ | 250 | /* Each client has this additional data */ |
@@ -536,6 +537,8 @@ static void mxt_input_report(struct mxt_data *data, int single_id) | |||
536 | finger[id].x); | 537 | finger[id].x); |
537 | input_report_abs(input_dev, ABS_MT_POSITION_Y, | 538 | input_report_abs(input_dev, ABS_MT_POSITION_Y, |
538 | finger[id].y); | 539 | finger[id].y); |
540 | input_report_abs(input_dev, ABS_MT_PRESSURE, | ||
541 | finger[id].pressure); | ||
539 | } else { | 542 | } else { |
540 | finger[id].status = 0; | 543 | finger[id].status = 0; |
541 | } | 544 | } |
@@ -546,6 +549,8 @@ static void mxt_input_report(struct mxt_data *data, int single_id) | |||
546 | if (status != MXT_RELEASE) { | 549 | if (status != MXT_RELEASE) { |
547 | input_report_abs(input_dev, ABS_X, finger[single_id].x); | 550 | input_report_abs(input_dev, ABS_X, finger[single_id].x); |
548 | input_report_abs(input_dev, ABS_Y, finger[single_id].y); | 551 | input_report_abs(input_dev, ABS_Y, finger[single_id].y); |
552 | input_report_abs(input_dev, | ||
553 | ABS_PRESSURE, finger[single_id].pressure); | ||
549 | } | 554 | } |
550 | 555 | ||
551 | input_sync(input_dev); | 556 | input_sync(input_dev); |
@@ -560,6 +565,7 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
560 | int x; | 565 | int x; |
561 | int y; | 566 | int y; |
562 | int area; | 567 | int area; |
568 | int pressure; | ||
563 | 569 | ||
564 | /* Check the touch is present on the screen */ | 570 | /* Check the touch is present on the screen */ |
565 | if (!(status & MXT_DETECT)) { | 571 | if (!(status & MXT_DETECT)) { |
@@ -584,6 +590,7 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
584 | y = y >> 2; | 590 | y = y >> 2; |
585 | 591 | ||
586 | area = message->message[4]; | 592 | area = message->message[4]; |
593 | pressure = message->message[5]; | ||
587 | 594 | ||
588 | dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, | 595 | dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, |
589 | status & MXT_MOVE ? "moved" : "pressed", | 596 | status & MXT_MOVE ? "moved" : "pressed", |
@@ -594,6 +601,7 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
594 | finger[id].x = x; | 601 | finger[id].x = x; |
595 | finger[id].y = y; | 602 | finger[id].y = y; |
596 | finger[id].area = area; | 603 | finger[id].area = area; |
604 | finger[id].pressure = pressure; | ||
597 | 605 | ||
598 | mxt_input_report(data, id); | 606 | mxt_input_report(data, id); |
599 | } | 607 | } |
@@ -1116,6 +1124,8 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1116 | 0, data->max_x, 0, 0); | 1124 | 0, data->max_x, 0, 0); |
1117 | input_set_abs_params(input_dev, ABS_Y, | 1125 | input_set_abs_params(input_dev, ABS_Y, |
1118 | 0, data->max_y, 0, 0); | 1126 | 0, data->max_y, 0, 0); |
1127 | input_set_abs_params(input_dev, ABS_PRESSURE, | ||
1128 | 0, 255, 0, 0); | ||
1119 | 1129 | ||
1120 | /* For multi touch */ | 1130 | /* For multi touch */ |
1121 | input_mt_init_slots(input_dev, MXT_MAX_FINGER); | 1131 | input_mt_init_slots(input_dev, MXT_MAX_FINGER); |
@@ -1125,6 +1135,8 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1125 | 0, data->max_x, 0, 0); | 1135 | 0, data->max_x, 0, 0); |
1126 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | 1136 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
1127 | 0, data->max_y, 0, 0); | 1137 | 0, data->max_y, 0, 0); |
1138 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, | ||
1139 | 0, 255, 0, 0); | ||
1128 | 1140 | ||
1129 | input_set_drvdata(input_dev, data); | 1141 | input_set_drvdata(input_dev, data); |
1130 | i2c_set_clientdata(client, data); | 1142 | i2c_set_clientdata(client, data); |
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c index 4f2713d92791..4627fe55b401 100644 --- a/drivers/input/touchscreen/max11801_ts.c +++ b/drivers/input/touchscreen/max11801_ts.c | |||
@@ -9,7 +9,8 @@ | |||
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
12 | * the Free Software Foundation; either version 2 of the License. | 12 | * the Free Software Foundation; either version 2 of the License, or |
13 | * (at your option) any later version. | ||
13 | */ | 14 | */ |
14 | 15 | ||
15 | /* | 16 | /* |
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c index 089b0a0f3d8c..0e8f63e5b36f 100644 --- a/drivers/input/touchscreen/tnetv107x-ts.c +++ b/drivers/input/touchscreen/tnetv107x-ts.c | |||
@@ -13,6 +13,7 @@ | |||
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/module.h> | ||
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
17 | #include <linux/err.h> | 18 | #include <linux/err.h> |
18 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |