diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-03-17 11:21:20 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-03-17 11:21:20 -0400 |
| commit | 47239561e39bceefecc3cd67f71fcf86a198a8ff (patch) | |
| tree | 9823d0973494ea8acabb744bc3aba42b610fb434 /drivers/input/touchscreen | |
| parent | ed681a91ab805341675d166a9592551093c0a2d9 (diff) | |
| parent | 5bee17f18b595937e6beafeee5197868a3f74a06 (diff) | |
Merge branch 'linus' into core/printk
Diffstat (limited to 'drivers/input/touchscreen')
| -rw-r--r-- | drivers/input/touchscreen/atmel_tsadcc.c | 2 | ||||
| -rw-r--r-- | drivers/input/touchscreen/corgi_ts.c | 9 | ||||
| -rw-r--r-- | drivers/input/touchscreen/tsc2007.c | 3 | ||||
| -rw-r--r-- | drivers/input/touchscreen/usbtouchscreen.c | 20 |
4 files changed, 26 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c index a89a6a8f05e6..055969e8be13 100644 --- a/drivers/input/touchscreen/atmel_tsadcc.c +++ b/drivers/input/touchscreen/atmel_tsadcc.c | |||
| @@ -236,7 +236,7 @@ static int __devinit atmel_tsadcc_probe(struct platform_device *pdev) | |||
| 236 | ts_dev->bufferedmeasure = 0; | 236 | ts_dev->bufferedmeasure = 0; |
| 237 | 237 | ||
| 238 | snprintf(ts_dev->phys, sizeof(ts_dev->phys), | 238 | snprintf(ts_dev->phys, sizeof(ts_dev->phys), |
| 239 | "%s/input0", pdev->dev.bus_id); | 239 | "%s/input0", dev_name(&pdev->dev)); |
| 240 | 240 | ||
| 241 | input_dev->name = "atmel touch screen controller"; | 241 | input_dev->name = "atmel touch screen controller"; |
| 242 | input_dev->phys = ts_dev->phys; | 242 | input_dev->phys = ts_dev->phys; |
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 65202c9f63ff..3fb51b54fe61 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
| @@ -268,7 +268,7 @@ static int corgits_resume(struct platform_device *dev) | |||
| 268 | #define corgits_resume NULL | 268 | #define corgits_resume NULL |
| 269 | #endif | 269 | #endif |
| 270 | 270 | ||
| 271 | static int __init corgits_probe(struct platform_device *pdev) | 271 | static int __devinit corgits_probe(struct platform_device *pdev) |
| 272 | { | 272 | { |
| 273 | struct corgi_ts *corgi_ts; | 273 | struct corgi_ts *corgi_ts; |
| 274 | struct input_dev *input_dev; | 274 | struct input_dev *input_dev; |
| @@ -343,7 +343,7 @@ static int __init corgits_probe(struct platform_device *pdev) | |||
| 343 | return err; | 343 | return err; |
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | static int corgits_remove(struct platform_device *pdev) | 346 | static int __devexit corgits_remove(struct platform_device *pdev) |
| 347 | { | 347 | { |
| 348 | struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); | 348 | struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); |
| 349 | 349 | ||
| @@ -352,12 +352,13 @@ static int corgits_remove(struct platform_device *pdev) | |||
| 352 | corgi_ts->machinfo->put_hsync(); | 352 | corgi_ts->machinfo->put_hsync(); |
| 353 | input_unregister_device(corgi_ts->input); | 353 | input_unregister_device(corgi_ts->input); |
| 354 | kfree(corgi_ts); | 354 | kfree(corgi_ts); |
| 355 | |||
| 355 | return 0; | 356 | return 0; |
| 356 | } | 357 | } |
| 357 | 358 | ||
| 358 | static struct platform_driver corgits_driver = { | 359 | static struct platform_driver corgits_driver = { |
| 359 | .probe = corgits_probe, | 360 | .probe = corgits_probe, |
| 360 | .remove = corgits_remove, | 361 | .remove = __devexit_p(corgits_remove), |
| 361 | .suspend = corgits_suspend, | 362 | .suspend = corgits_suspend, |
| 362 | .resume = corgits_resume, | 363 | .resume = corgits_resume, |
| 363 | .driver = { | 364 | .driver = { |
| @@ -366,7 +367,7 @@ static struct platform_driver corgits_driver = { | |||
| 366 | }, | 367 | }, |
| 367 | }; | 368 | }; |
| 368 | 369 | ||
| 369 | static int __devinit corgits_init(void) | 370 | static int __init corgits_init(void) |
| 370 | { | 371 | { |
| 371 | return platform_driver_register(&corgits_driver); | 372 | return platform_driver_register(&corgits_driver); |
| 372 | } | 373 | } |
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index b75dc2990574..4ab070246892 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
| @@ -289,7 +289,8 @@ static int tsc2007_probe(struct i2c_client *client, | |||
| 289 | 289 | ||
| 290 | pdata->init_platform_hw(); | 290 | pdata->init_platform_hw(); |
| 291 | 291 | ||
| 292 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", client->dev.bus_id); | 292 | snprintf(ts->phys, sizeof(ts->phys), |
| 293 | "%s/input0", dev_name(&client->dev)); | ||
| 293 | 294 | ||
| 294 | input_dev->name = "TSC2007 Touchscreen"; | 295 | input_dev->name = "TSC2007 Touchscreen"; |
| 295 | input_dev->phys = ts->phys; | 296 | input_dev->phys = ts->phys; |
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 5080b26ba160..fb7cb9bdfbd5 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
| @@ -60,6 +60,10 @@ static int swap_xy; | |||
| 60 | module_param(swap_xy, bool, 0644); | 60 | module_param(swap_xy, bool, 0644); |
| 61 | MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); | 61 | MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); |
| 62 | 62 | ||
| 63 | static int hwcalib_xy; | ||
| 64 | module_param(hwcalib_xy, bool, 0644); | ||
| 65 | MODULE_PARM_DESC(hwcalib_xy, "If set hw-calibrated X/Y are used if available"); | ||
| 66 | |||
| 63 | /* device specifc data/functions */ | 67 | /* device specifc data/functions */ |
| 64 | struct usbtouch_usb; | 68 | struct usbtouch_usb; |
| 65 | struct usbtouch_device_info { | 69 | struct usbtouch_device_info { |
| @@ -118,6 +122,7 @@ enum { | |||
| 118 | 122 | ||
| 119 | #define USB_DEVICE_HID_CLASS(vend, prod) \ | 123 | #define USB_DEVICE_HID_CLASS(vend, prod) \ |
| 120 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ | 124 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ |
| 125 | | USB_DEVICE_ID_MATCH_INT_PROTOCOL \ | ||
| 121 | | USB_DEVICE_ID_MATCH_DEVICE, \ | 126 | | USB_DEVICE_ID_MATCH_DEVICE, \ |
| 122 | .idVendor = (vend), \ | 127 | .idVendor = (vend), \ |
| 123 | .idProduct = (prod), \ | 128 | .idProduct = (prod), \ |
| @@ -260,8 +265,13 @@ static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
| 260 | 265 | ||
| 261 | static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | 266 | static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
| 262 | { | 267 | { |
| 263 | dev->x = (pkt[8] << 8) | pkt[7]; | 268 | if (hwcalib_xy) { |
| 264 | dev->y = (pkt[10] << 8) | pkt[9]; | 269 | dev->x = (pkt[4] << 8) | pkt[3]; |
| 270 | dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]); | ||
| 271 | } else { | ||
| 272 | dev->x = (pkt[8] << 8) | pkt[7]; | ||
| 273 | dev->y = (pkt[10] << 8) | pkt[9]; | ||
| 274 | } | ||
| 265 | dev->touch = (pkt[2] & 0x40) ? 1 : 0; | 275 | dev->touch = (pkt[2] & 0x40) ? 1 : 0; |
| 266 | 276 | ||
| 267 | return 1; | 277 | return 1; |
| @@ -294,6 +304,12 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
| 294 | return ret; | 304 | return ret; |
| 295 | } | 305 | } |
| 296 | 306 | ||
| 307 | /* Default min/max xy are the raw values, override if using hw-calib */ | ||
| 308 | if (hwcalib_xy) { | ||
| 309 | input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0); | ||
| 310 | input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0); | ||
| 311 | } | ||
| 312 | |||
| 297 | return 0; | 313 | return 0; |
| 298 | } | 314 | } |
| 299 | #endif | 315 | #endif |
