diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-07-24 15:36:56 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-07-24 15:36:56 -0400 |
| commit | b9f12a5d97f652c77ef6803dccd0d40d1290f5be (patch) | |
| tree | 8f58c8620ffef0d350a5ec022feda492a96b179a /drivers/input | |
| parent | 9d8dc3e529a19e427fd379118acd132520935c5d (diff) | |
| parent | 9a3c4145af32125c5ee39c0272662b47307a8323 (diff) | |
Merge tag 'v3.16-rc6' into next
Merge with mainline to bring in changes to MFD to allow merging
ipaq-micro-ts driver.
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/keyboard/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/input/keyboard/pxa27x_keypad.c | 7 | ||||
| -rw-r--r-- | drivers/input/mouse/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/synaptics.c | 169 | ||||
| -rw-r--r-- | drivers/input/serio/ambakmi.c | 3 | ||||
| -rw-r--r-- | drivers/input/touchscreen/Kconfig | 14 | ||||
| -rw-r--r-- | drivers/input/touchscreen/Makefile | 1 | ||||
| -rw-r--r-- | drivers/input/touchscreen/atmel_tsadcc.c | 358 |
8 files changed, 63 insertions, 493 deletions
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 942338b4109f..a3958c63d7d5 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -71,7 +71,7 @@ config KEYBOARD_ATKBD | |||
| 71 | default y | 71 | default y |
| 72 | select SERIO | 72 | select SERIO |
| 73 | select SERIO_LIBPS2 | 73 | select SERIO_LIBPS2 |
| 74 | select SERIO_I8042 if X86 | 74 | select SERIO_I8042 if ARCH_MIGHT_HAVE_PC_SERIO |
| 75 | select SERIO_GSCPS2 if GSC | 75 | select SERIO_GSCPS2 if GSC |
| 76 | help | 76 | help |
| 77 | Say Y here if you want to use a standard AT or PS/2 keyboard. Usually | 77 | Say Y here if you want to use a standard AT or PS/2 keyboard. Usually |
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index d8241ba0afa0..a15063bea700 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c | |||
| @@ -111,6 +111,8 @@ struct pxa27x_keypad { | |||
| 111 | unsigned short keycodes[MAX_KEYPAD_KEYS]; | 111 | unsigned short keycodes[MAX_KEYPAD_KEYS]; |
| 112 | int rotary_rel_code[2]; | 112 | int rotary_rel_code[2]; |
| 113 | 113 | ||
| 114 | unsigned int row_shift; | ||
| 115 | |||
| 114 | /* state row bits of each column scan */ | 116 | /* state row bits of each column scan */ |
| 115 | uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS]; | 117 | uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS]; |
| 116 | uint32_t direct_key_state; | 118 | uint32_t direct_key_state; |
| @@ -467,7 +469,8 @@ scan: | |||
| 467 | if ((bits_changed & (1 << row)) == 0) | 469 | if ((bits_changed & (1 << row)) == 0) |
| 468 | continue; | 470 | continue; |
| 469 | 471 | ||
| 470 | code = MATRIX_SCAN_CODE(row, col, MATRIX_ROW_SHIFT); | 472 | code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); |
| 473 | |||
| 471 | input_event(input_dev, EV_MSC, MSC_SCAN, code); | 474 | input_event(input_dev, EV_MSC, MSC_SCAN, code); |
| 472 | input_report_key(input_dev, keypad->keycodes[code], | 475 | input_report_key(input_dev, keypad->keycodes[code], |
| 473 | new_state[col] & (1 << row)); | 476 | new_state[col] & (1 << row)); |
| @@ -802,6 +805,8 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) | |||
| 802 | goto failed_put_clk; | 805 | goto failed_put_clk; |
| 803 | } | 806 | } |
| 804 | 807 | ||
| 808 | keypad->row_shift = get_count_order(pdata->matrix_key_cols); | ||
| 809 | |||
| 805 | if ((pdata->enable_rotary0 && keypad->rotary_rel_code[0] != -1) || | 810 | if ((pdata->enable_rotary0 && keypad->rotary_rel_code[0] != -1) || |
| 806 | (pdata->enable_rotary1 && keypad->rotary_rel_code[1] != -1)) { | 811 | (pdata->enable_rotary1 && keypad->rotary_rel_code[1] != -1)) { |
| 807 | input_dev->evbit[0] |= BIT_MASK(EV_REL); | 812 | input_dev->evbit[0] |= BIT_MASK(EV_REL); |
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index ff9b65d02103..366fc7ad5eb6 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig | |||
| @@ -17,7 +17,7 @@ config MOUSE_PS2 | |||
| 17 | default y | 17 | default y |
| 18 | select SERIO | 18 | select SERIO |
| 19 | select SERIO_LIBPS2 | 19 | select SERIO_LIBPS2 |
| 20 | select SERIO_I8042 if X86 | 20 | select SERIO_I8042 if ARCH_MIGHT_HAVE_PC_SERIO |
| 21 | select SERIO_GSCPS2 if GSC | 21 | select SERIO_GSCPS2 if GSC |
| 22 | help | 22 | help |
| 23 | Say Y here if you have a PS/2 mouse connected to your system. This | 23 | Say Y here if you have a PS/2 mouse connected to your system. This |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index d68d33fb5ac2..ec772d962f06 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -117,6 +117,31 @@ void synaptics_reset(struct psmouse *psmouse) | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS | 119 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS |
| 120 | struct min_max_quirk { | ||
| 121 | const char * const *pnp_ids; | ||
| 122 | int x_min, x_max, y_min, y_max; | ||
| 123 | }; | ||
| 124 | |||
| 125 | static const struct min_max_quirk min_max_pnpid_table[] = { | ||
| 126 | { | ||
| 127 | (const char * const []){"LEN0033", NULL}, | ||
| 128 | 1024, 5052, 2258, 4832 | ||
| 129 | }, | ||
| 130 | { | ||
| 131 | (const char * const []){"LEN0035", "LEN0042", NULL}, | ||
| 132 | 1232, 5710, 1156, 4696 | ||
| 133 | }, | ||
| 134 | { | ||
| 135 | (const char * const []){"LEN0034", "LEN0036", "LEN2004", NULL}, | ||
| 136 | 1024, 5112, 2024, 4832 | ||
| 137 | }, | ||
| 138 | { | ||
| 139 | (const char * const []){"LEN2001", NULL}, | ||
| 140 | 1024, 5022, 2508, 4832 | ||
| 141 | }, | ||
| 142 | { } | ||
| 143 | }; | ||
| 144 | |||
| 120 | /* This list has been kindly provided by Synaptics. */ | 145 | /* This list has been kindly provided by Synaptics. */ |
| 121 | static const char * const topbuttonpad_pnp_ids[] = { | 146 | static const char * const topbuttonpad_pnp_ids[] = { |
| 122 | "LEN0017", | 147 | "LEN0017", |
| @@ -129,7 +154,7 @@ static const char * const topbuttonpad_pnp_ids[] = { | |||
| 129 | "LEN002D", | 154 | "LEN002D", |
| 130 | "LEN002E", | 155 | "LEN002E", |
| 131 | "LEN0033", /* Helix */ | 156 | "LEN0033", /* Helix */ |
| 132 | "LEN0034", /* T431s, T540, X1 Carbon 2nd */ | 157 | "LEN0034", /* T431s, L440, L540, T540, W540, X1 Carbon 2nd */ |
| 133 | "LEN0035", /* X240 */ | 158 | "LEN0035", /* X240 */ |
| 134 | "LEN0036", /* T440 */ | 159 | "LEN0036", /* T440 */ |
| 135 | "LEN0037", | 160 | "LEN0037", |
| @@ -142,7 +167,7 @@ static const char * const topbuttonpad_pnp_ids[] = { | |||
| 142 | "LEN0048", | 167 | "LEN0048", |
| 143 | "LEN0049", | 168 | "LEN0049", |
| 144 | "LEN2000", | 169 | "LEN2000", |
| 145 | "LEN2001", | 170 | "LEN2001", /* Edge E431 */ |
| 146 | "LEN2002", | 171 | "LEN2002", |
| 147 | "LEN2003", | 172 | "LEN2003", |
| 148 | "LEN2004", /* L440 */ | 173 | "LEN2004", /* L440 */ |
| @@ -156,6 +181,18 @@ static const char * const topbuttonpad_pnp_ids[] = { | |||
| 156 | NULL | 181 | NULL |
| 157 | }; | 182 | }; |
| 158 | 183 | ||
| 184 | static bool matches_pnp_id(struct psmouse *psmouse, const char * const ids[]) | ||
| 185 | { | ||
| 186 | int i; | ||
| 187 | |||
| 188 | if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) | ||
| 189 | for (i = 0; ids[i]; i++) | ||
| 190 | if (strstr(psmouse->ps2dev.serio->firmware_id, ids[i])) | ||
| 191 | return true; | ||
| 192 | |||
| 193 | return false; | ||
| 194 | } | ||
| 195 | |||
| 159 | /***************************************************************************** | 196 | /***************************************************************************** |
| 160 | * Synaptics communications functions | 197 | * Synaptics communications functions |
| 161 | ****************************************************************************/ | 198 | ****************************************************************************/ |
| @@ -304,20 +341,11 @@ static int synaptics_identify(struct psmouse *psmouse) | |||
| 304 | * Resolution is left zero if touchpad does not support the query | 341 | * Resolution is left zero if touchpad does not support the query |
| 305 | */ | 342 | */ |
| 306 | 343 | ||
| 307 | static const int *quirk_min_max; | ||
| 308 | |||
| 309 | static int synaptics_resolution(struct psmouse *psmouse) | 344 | static int synaptics_resolution(struct psmouse *psmouse) |
| 310 | { | 345 | { |
| 311 | struct synaptics_data *priv = psmouse->private; | 346 | struct synaptics_data *priv = psmouse->private; |
| 312 | unsigned char resp[3]; | 347 | unsigned char resp[3]; |
| 313 | 348 | int i; | |
| 314 | if (quirk_min_max) { | ||
| 315 | priv->x_min = quirk_min_max[0]; | ||
| 316 | priv->x_max = quirk_min_max[1]; | ||
| 317 | priv->y_min = quirk_min_max[2]; | ||
| 318 | priv->y_max = quirk_min_max[3]; | ||
| 319 | return 0; | ||
| 320 | } | ||
| 321 | 349 | ||
| 322 | if (SYN_ID_MAJOR(priv->identity) < 4) | 350 | if (SYN_ID_MAJOR(priv->identity) < 4) |
| 323 | return 0; | 351 | return 0; |
| @@ -329,6 +357,16 @@ static int synaptics_resolution(struct psmouse *psmouse) | |||
| 329 | } | 357 | } |
| 330 | } | 358 | } |
| 331 | 359 | ||
| 360 | for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) { | ||
| 361 | if (matches_pnp_id(psmouse, min_max_pnpid_table[i].pnp_ids)) { | ||
| 362 | priv->x_min = min_max_pnpid_table[i].x_min; | ||
| 363 | priv->x_max = min_max_pnpid_table[i].x_max; | ||
| 364 | priv->y_min = min_max_pnpid_table[i].y_min; | ||
| 365 | priv->y_max = min_max_pnpid_table[i].y_max; | ||
| 366 | return 0; | ||
| 367 | } | ||
| 368 | } | ||
| 369 | |||
| 332 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 && | 370 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 && |
| 333 | SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) { | 371 | SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) { |
| 334 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) { | 372 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) { |
| @@ -1365,17 +1403,8 @@ static void set_input_params(struct psmouse *psmouse, | |||
| 1365 | 1403 | ||
| 1366 | if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { | 1404 | if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { |
| 1367 | __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); | 1405 | __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); |
| 1368 | /* See if this buttonpad has a top button area */ | 1406 | if (matches_pnp_id(psmouse, topbuttonpad_pnp_ids)) |
| 1369 | if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) { | 1407 | __set_bit(INPUT_PROP_TOPBUTTONPAD, dev->propbit); |
| 1370 | for (i = 0; topbuttonpad_pnp_ids[i]; i++) { | ||
| 1371 | if (strstr(psmouse->ps2dev.serio->firmware_id, | ||
| 1372 | topbuttonpad_pnp_ids[i])) { | ||
| 1373 | __set_bit(INPUT_PROP_TOPBUTTONPAD, | ||
| 1374 | dev->propbit); | ||
| 1375 | break; | ||
| 1376 | } | ||
| 1377 | } | ||
| 1378 | } | ||
| 1379 | /* Clickpads report only left button */ | 1408 | /* Clickpads report only left button */ |
| 1380 | __clear_bit(BTN_RIGHT, dev->keybit); | 1409 | __clear_bit(BTN_RIGHT, dev->keybit); |
| 1381 | __clear_bit(BTN_MIDDLE, dev->keybit); | 1410 | __clear_bit(BTN_MIDDLE, dev->keybit); |
| @@ -1547,104 +1576,10 @@ static const struct dmi_system_id olpc_dmi_table[] __initconst = { | |||
| 1547 | { } | 1576 | { } |
| 1548 | }; | 1577 | }; |
| 1549 | 1578 | ||
| 1550 | static const struct dmi_system_id min_max_dmi_table[] __initconst = { | ||
| 1551 | #if defined(CONFIG_DMI) | ||
| 1552 | { | ||
| 1553 | /* Lenovo ThinkPad Helix */ | ||
| 1554 | .matches = { | ||
| 1555 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1556 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Helix"), | ||
| 1557 | }, | ||
| 1558 | .driver_data = (int []){1024, 5052, 2258, 4832}, | ||
| 1559 | }, | ||
| 1560 | { | ||
| 1561 | /* Lenovo ThinkPad X240 */ | ||
| 1562 | .matches = { | ||
| 1563 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1564 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X240"), | ||
| 1565 | }, | ||
| 1566 | .driver_data = (int []){1232, 5710, 1156, 4696}, | ||
| 1567 | }, | ||
| 1568 | { | ||
| 1569 | /* Lenovo ThinkPad Edge E431 */ | ||
| 1570 | .matches = { | ||
| 1571 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1572 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Edge E431"), | ||
| 1573 | }, | ||
| 1574 | .driver_data = (int []){1024, 5022, 2508, 4832}, | ||
| 1575 | }, | ||
| 1576 | { | ||
| 1577 | /* Lenovo ThinkPad T431s */ | ||
| 1578 | .matches = { | ||
| 1579 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1580 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T431"), | ||
| 1581 | }, | ||
| 1582 | .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
| 1583 | }, | ||
| 1584 | { | ||
| 1585 | /* Lenovo ThinkPad T440s */ | ||
| 1586 | .matches = { | ||
| 1587 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1588 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T440"), | ||
| 1589 | }, | ||
| 1590 | .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
| 1591 | }, | ||
| 1592 | { | ||
| 1593 | /* Lenovo ThinkPad L440 */ | ||
| 1594 | .matches = { | ||
| 1595 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1596 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L440"), | ||
| 1597 | }, | ||
| 1598 | .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
| 1599 | }, | ||
| 1600 | { | ||
| 1601 | /* Lenovo ThinkPad T540p */ | ||
| 1602 | .matches = { | ||
| 1603 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1604 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T540"), | ||
| 1605 | }, | ||
| 1606 | .driver_data = (int []){1024, 5056, 2058, 4832}, | ||
| 1607 | }, | ||
| 1608 | { | ||
| 1609 | /* Lenovo ThinkPad L540 */ | ||
| 1610 | .matches = { | ||
| 1611 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1612 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L540"), | ||
| 1613 | }, | ||
| 1614 | .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
| 1615 | }, | ||
| 1616 | { | ||
| 1617 | /* Lenovo Yoga S1 */ | ||
| 1618 | .matches = { | ||
| 1619 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1620 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
| 1621 | "ThinkPad S1 Yoga"), | ||
| 1622 | }, | ||
| 1623 | .driver_data = (int []){1232, 5710, 1156, 4696}, | ||
| 1624 | }, | ||
| 1625 | { | ||
| 1626 | /* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */ | ||
| 1627 | .matches = { | ||
| 1628 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1629 | DMI_MATCH(DMI_PRODUCT_VERSION, | ||
| 1630 | "ThinkPad X1 Carbon 2nd"), | ||
| 1631 | }, | ||
| 1632 | .driver_data = (int []){1024, 5112, 2024, 4832}, | ||
| 1633 | }, | ||
| 1634 | #endif | ||
| 1635 | { } | ||
| 1636 | }; | ||
| 1637 | |||
| 1638 | void __init synaptics_module_init(void) | 1579 | void __init synaptics_module_init(void) |
| 1639 | { | 1580 | { |
| 1640 | const struct dmi_system_id *min_max_dmi; | ||
| 1641 | |||
| 1642 | impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); | 1581 | impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); |
| 1643 | broken_olpc_ec = dmi_check_system(olpc_dmi_table); | 1582 | broken_olpc_ec = dmi_check_system(olpc_dmi_table); |
| 1644 | |||
| 1645 | min_max_dmi = dmi_first_match(min_max_dmi_table); | ||
| 1646 | if (min_max_dmi) | ||
| 1647 | quirk_min_max = min_max_dmi->driver_data; | ||
| 1648 | } | 1583 | } |
| 1649 | 1584 | ||
| 1650 | static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) | 1585 | static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) |
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 762b08432de0..8b748d99b934 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c | |||
| @@ -79,7 +79,8 @@ static int amba_kmi_open(struct serio *io) | |||
| 79 | writeb(divisor, KMICLKDIV); | 79 | writeb(divisor, KMICLKDIV); |
| 80 | writeb(KMICR_EN, KMICR); | 80 | writeb(KMICR_EN, KMICR); |
| 81 | 81 | ||
| 82 | ret = request_irq(kmi->irq, amba_kmi_int, 0, "kmi-pl050", kmi); | 82 | ret = request_irq(kmi->irq, amba_kmi_int, IRQF_SHARED, "kmi-pl050", |
| 83 | kmi); | ||
| 83 | if (ret) { | 84 | if (ret) { |
| 84 | printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq); | 85 | printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq); |
| 85 | writeb(0, KMICR); | 86 | writeb(0, KMICR); |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 8e07fe8505fd..a23a94bb4bcb 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
| @@ -555,18 +555,6 @@ config TOUCHSCREEN_TI_AM335X_TSC | |||
| 555 | To compile this driver as a module, choose M here: the | 555 | To compile this driver as a module, choose M here: the |
| 556 | module will be called ti_am335x_tsc. | 556 | module will be called ti_am335x_tsc. |
| 557 | 557 | ||
| 558 | config TOUCHSCREEN_ATMEL_TSADCC | ||
| 559 | tristate "Atmel Touchscreen Interface" | ||
| 560 | depends on ARCH_AT91 | ||
| 561 | help | ||
| 562 | Say Y here if you have a 4-wire touchscreen connected to the | ||
| 563 | ADC Controller on your Atmel SoC. | ||
| 564 | |||
| 565 | If unsure, say N. | ||
| 566 | |||
| 567 | To compile this driver as a module, choose M here: the | ||
| 568 | module will be called atmel_tsadcc. | ||
| 569 | |||
| 570 | config TOUCHSCREEN_UCB1400 | 558 | config TOUCHSCREEN_UCB1400 |
| 571 | tristate "Philips UCB1400 touchscreen" | 559 | tristate "Philips UCB1400 touchscreen" |
| 572 | depends on AC97_BUS | 560 | depends on AC97_BUS |
| @@ -645,7 +633,7 @@ config TOUCHSCREEN_WM9713 | |||
| 645 | 633 | ||
| 646 | config TOUCHSCREEN_WM97XX_ATMEL | 634 | config TOUCHSCREEN_WM97XX_ATMEL |
| 647 | tristate "WM97xx Atmel accelerated touch" | 635 | tristate "WM97xx Atmel accelerated touch" |
| 648 | depends on TOUCHSCREEN_WM97XX && (AVR32 || ARCH_AT91) | 636 | depends on TOUCHSCREEN_WM97XX && AVR32 |
| 649 | help | 637 | help |
| 650 | Say Y here for support for streaming mode with WM97xx touchscreens | 638 | Say Y here for support for streaming mode with WM97xx touchscreens |
| 651 | on Atmel AT91 or AVR32 systems with an AC97C module. | 639 | on Atmel AT91 or AVR32 systems with an AC97C module. |
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 4d479fb0a768..126479d8c29a 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile | |||
| @@ -14,7 +14,6 @@ obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C) += ad7879-i2c.o | |||
| 14 | obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o | 14 | obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o |
| 15 | obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o | 15 | obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o |
| 16 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o | 16 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o |
| 17 | obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o | ||
| 18 | obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o | 17 | obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o |
| 19 | obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o | 18 | obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o |
| 20 | obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o | 19 | obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o |
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c deleted file mode 100644 index a7c9d6967d1e..000000000000 --- a/drivers/input/touchscreen/atmel_tsadcc.c +++ /dev/null | |||
| @@ -1,358 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Atmel Touch Screen Driver | ||
| 3 | * | ||
| 4 | * Copyright (c) 2008 ATMEL | ||
| 5 | * Copyright (c) 2008 Dan Liang | ||
| 6 | * Copyright (c) 2008 TimeSys Corporation | ||
| 7 | * Copyright (c) 2008 Justin Waters | ||
| 8 | * | ||
| 9 | * Based on touchscreen code from Atmel Corporation. | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License version 2 as | ||
| 13 | * published by the Free Software Foundation. | ||
| 14 | */ | ||
| 15 | #include <linux/err.h> | ||
| 16 | #include <linux/kernel.h> | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/input.h> | ||
| 19 | #include <linux/slab.h> | ||
| 20 | #include <linux/interrupt.h> | ||
| 21 | #include <linux/clk.h> | ||
| 22 | #include <linux/platform_device.h> | ||
| 23 | #include <linux/io.h> | ||
| 24 | #include <linux/platform_data/atmel.h> | ||
| 25 | #include <mach/cpu.h> | ||
| 26 | |||
| 27 | /* Register definitions based on AT91SAM9RL64 preliminary draft datasheet */ | ||
| 28 | |||
| 29 | #define ATMEL_TSADCC_CR 0x00 /* Control register */ | ||
| 30 | #define ATMEL_TSADCC_SWRST (1 << 0) /* Software Reset*/ | ||
| 31 | #define ATMEL_TSADCC_START (1 << 1) /* Start conversion */ | ||
| 32 | |||
| 33 | #define ATMEL_TSADCC_MR 0x04 /* Mode register */ | ||
| 34 | #define ATMEL_TSADCC_TSAMOD (3 << 0) /* ADC mode */ | ||
| 35 | #define ATMEL_TSADCC_TSAMOD_ADC_ONLY_MODE (0x0) /* ADC Mode */ | ||
| 36 | #define ATMEL_TSADCC_TSAMOD_TS_ONLY_MODE (0x1) /* Touch Screen Only Mode */ | ||
| 37 | #define ATMEL_TSADCC_LOWRES (1 << 4) /* Resolution selection */ | ||
| 38 | #define ATMEL_TSADCC_SLEEP (1 << 5) /* Sleep mode */ | ||
| 39 | #define ATMEL_TSADCC_PENDET (1 << 6) /* Pen Detect selection */ | ||
| 40 | #define ATMEL_TSADCC_PRES (1 << 7) /* Pressure Measurement Selection */ | ||
| 41 | #define ATMEL_TSADCC_PRESCAL (0x3f << 8) /* Prescalar Rate Selection */ | ||
| 42 | #define ATMEL_TSADCC_EPRESCAL (0xff << 8) /* Prescalar Rate Selection (Extended) */ | ||
| 43 | #define ATMEL_TSADCC_STARTUP (0x7f << 16) /* Start Up time */ | ||
| 44 | #define ATMEL_TSADCC_SHTIM (0xf << 24) /* Sample & Hold time */ | ||
| 45 | #define ATMEL_TSADCC_PENDBC (0xf << 28) /* Pen Detect debouncing time */ | ||
| 46 | |||
| 47 | #define ATMEL_TSADCC_TRGR 0x08 /* Trigger register */ | ||
| 48 | #define ATMEL_TSADCC_TRGMOD (7 << 0) /* Trigger mode */ | ||
| 49 | #define ATMEL_TSADCC_TRGMOD_NONE (0 << 0) | ||
| 50 | #define ATMEL_TSADCC_TRGMOD_EXT_RISING (1 << 0) | ||
| 51 | #define ATMEL_TSADCC_TRGMOD_EXT_FALLING (2 << 0) | ||
| 52 | #define ATMEL_TSADCC_TRGMOD_EXT_ANY (3 << 0) | ||
| 53 | #define ATMEL_TSADCC_TRGMOD_PENDET (4 << 0) | ||
| 54 | #define ATMEL_TSADCC_TRGMOD_PERIOD (5 << 0) | ||
| 55 | #define ATMEL_TSADCC_TRGMOD_CONTINUOUS (6 << 0) | ||
| 56 | #define ATMEL_TSADCC_TRGPER (0xffff << 16) /* Trigger period */ | ||
| 57 | |||
| 58 | #define ATMEL_TSADCC_TSR 0x0C /* Touch Screen register */ | ||
| 59 | #define ATMEL_TSADCC_TSFREQ (0xf << 0) /* TS Frequency in Interleaved mode */ | ||
| 60 | #define ATMEL_TSADCC_TSSHTIM (0xf << 24) /* Sample & Hold time */ | ||
| 61 | |||
| 62 | #define ATMEL_TSADCC_CHER 0x10 /* Channel Enable register */ | ||
| 63 | #define ATMEL_TSADCC_CHDR 0x14 /* Channel Disable register */ | ||
| 64 | #define ATMEL_TSADCC_CHSR 0x18 /* Channel Status register */ | ||
| 65 | #define ATMEL_TSADCC_CH(n) (1 << (n)) /* Channel number */ | ||
| 66 | |||
| 67 | #define ATMEL_TSADCC_SR 0x1C /* Status register */ | ||
| 68 | #define ATMEL_TSADCC_EOC(n) (1 << ((n)+0)) /* End of conversion for channel N */ | ||
| 69 | #define ATMEL_TSADCC_OVRE(n) (1 << ((n)+8)) /* Overrun error for channel N */ | ||
| 70 | #define ATMEL_TSADCC_DRDY (1 << 16) /* Data Ready */ | ||
| 71 | #define ATMEL_TSADCC_GOVRE (1 << 17) /* General Overrun Error */ | ||
| 72 | #define ATMEL_TSADCC_ENDRX (1 << 18) /* End of RX Buffer */ | ||
| 73 | #define ATMEL_TSADCC_RXBUFF (1 << 19) /* TX Buffer full */ | ||
| 74 | #define ATMEL_TSADCC_PENCNT (1 << 20) /* Pen contact */ | ||
| 75 | #define ATMEL_TSADCC_NOCNT (1 << 21) /* No contact */ | ||
| 76 | |||
| 77 | #define ATMEL_TSADCC_LCDR 0x20 /* Last Converted Data register */ | ||
| 78 | #define ATMEL_TSADCC_DATA (0x3ff << 0) /* Channel data */ | ||
| 79 | |||
| 80 | #define ATMEL_TSADCC_IER 0x24 /* Interrupt Enable register */ | ||
| 81 | #define ATMEL_TSADCC_IDR 0x28 /* Interrupt Disable register */ | ||
| 82 | #define ATMEL_TSADCC_IMR 0x2C /* Interrupt Mask register */ | ||
| 83 | #define ATMEL_TSADCC_CDR0 0x30 /* Channel Data 0 */ | ||
| 84 | #define ATMEL_TSADCC_CDR1 0x34 /* Channel Data 1 */ | ||
| 85 | #define ATMEL_TSADCC_CDR2 0x38 /* Channel Data 2 */ | ||
| 86 | #define ATMEL_TSADCC_CDR3 0x3C /* Channel Data 3 */ | ||
| 87 | #define ATMEL_TSADCC_CDR4 0x40 /* Channel Data 4 */ | ||
| 88 | #define ATMEL_TSADCC_CDR5 0x44 /* Channel Data 5 */ | ||
| 89 | |||
| 90 | #define ATMEL_TSADCC_XPOS 0x50 | ||
| 91 | #define ATMEL_TSADCC_Z1DAT 0x54 | ||
| 92 | #define ATMEL_TSADCC_Z2DAT 0x58 | ||
| 93 | |||
| 94 | #define PRESCALER_VAL(x) ((x) >> 8) | ||
| 95 | |||
| 96 | #define ADC_DEFAULT_CLOCK 100000 | ||
| 97 | |||
| 98 | struct atmel_tsadcc { | ||
| 99 | struct input_dev *input; | ||
| 100 | char phys[32]; | ||
| 101 | struct clk *clk; | ||
| 102 | int irq; | ||
| 103 | unsigned int prev_absx; | ||
| 104 | unsigned int prev_absy; | ||
| 105 | unsigned char bufferedmeasure; | ||
| 106 | }; | ||
| 107 | |||
| 108 | static void __iomem *tsc_base; | ||
| 109 | |||
| 110 | #define atmel_tsadcc_read(reg) __raw_readl(tsc_base + (reg)) | ||
| 111 | #define atmel_tsadcc_write(reg, val) __raw_writel((val), tsc_base + (reg)) | ||
| 112 | |||
| 113 | static irqreturn_t atmel_tsadcc_interrupt(int irq, void *dev) | ||
| 114 | { | ||
| 115 | struct atmel_tsadcc *ts_dev = (struct atmel_tsadcc *)dev; | ||
| 116 | struct input_dev *input_dev = ts_dev->input; | ||
| 117 | |||
| 118 | unsigned int status; | ||
| 119 | unsigned int reg; | ||
| 120 | |||
| 121 | status = atmel_tsadcc_read(ATMEL_TSADCC_SR); | ||
| 122 | status &= atmel_tsadcc_read(ATMEL_TSADCC_IMR); | ||
| 123 | |||
| 124 | if (status & ATMEL_TSADCC_NOCNT) { | ||
| 125 | /* Contact lost */ | ||
| 126 | reg = atmel_tsadcc_read(ATMEL_TSADCC_MR) | ATMEL_TSADCC_PENDBC; | ||
| 127 | |||
| 128 | atmel_tsadcc_write(ATMEL_TSADCC_MR, reg); | ||
| 129 | atmel_tsadcc_write(ATMEL_TSADCC_TRGR, ATMEL_TSADCC_TRGMOD_NONE); | ||
| 130 | atmel_tsadcc_write(ATMEL_TSADCC_IDR, | ||
| 131 | ATMEL_TSADCC_EOC(3) | ATMEL_TSADCC_NOCNT); | ||
| 132 | atmel_tsadcc_write(ATMEL_TSADCC_IER, ATMEL_TSADCC_PENCNT); | ||
| 133 | |||
| 134 | input_report_key(input_dev, BTN_TOUCH, 0); | ||
| 135 | ts_dev->bufferedmeasure = 0; | ||
| 136 | input_sync(input_dev); | ||
| 137 | |||
| 138 | } else if (status & ATMEL_TSADCC_PENCNT) { | ||
| 139 | /* Pen detected */ | ||
| 140 | reg = atmel_tsadcc_read(ATMEL_TSADCC_MR); | ||
| 141 | reg &= ~ATMEL_TSADCC_PENDBC; | ||
| 142 | |||
| 143 | atmel_tsadcc_write(ATMEL_TSADCC_IDR, ATMEL_TSADCC_PENCNT); | ||
| 144 | atmel_tsadcc_write(ATMEL_TSADCC_MR, reg); | ||
| 145 | atmel_tsadcc_write(ATMEL_TSADCC_IER, | ||
| 146 | ATMEL_TSADCC_EOC(3) | ATMEL_TSADCC_NOCNT); | ||
| 147 | atmel_tsadcc_write(ATMEL_TSADCC_TRGR, | ||
| 148 | ATMEL_TSADCC_TRGMOD_PERIOD | (0x0FFF << 16)); | ||
| 149 | |||
| 150 | } else if (status & ATMEL_TSADCC_EOC(3)) { | ||
| 151 | /* Conversion finished */ | ||
| 152 | |||
| 153 | if (ts_dev->bufferedmeasure) { | ||
| 154 | /* Last measurement is always discarded, since it can | ||
| 155 | * be erroneous. | ||
| 156 | * Always report previous measurement */ | ||
| 157 | input_report_abs(input_dev, ABS_X, ts_dev->prev_absx); | ||
| 158 | input_report_abs(input_dev, ABS_Y, ts_dev->prev_absy); | ||
| 159 | input_report_key(input_dev, BTN_TOUCH, 1); | ||
| 160 | input_sync(input_dev); | ||
| 161 | } else | ||
| 162 | ts_dev->bufferedmeasure = 1; | ||
| 163 | |||
| 164 | /* Now make new measurement */ | ||
| 165 | ts_dev->prev_absx = atmel_tsadcc_read(ATMEL_TSADCC_CDR3) << 10; | ||
| 166 | ts_dev->prev_absx /= atmel_tsadcc_read(ATMEL_TSADCC_CDR2); | ||
| 167 | |||
| 168 | ts_dev->prev_absy = atmel_tsadcc_read(ATMEL_TSADCC_CDR1) << 10; | ||
| 169 | ts_dev->prev_absy /= atmel_tsadcc_read(ATMEL_TSADCC_CDR0); | ||
| 170 | } | ||
| 171 | |||
| 172 | return IRQ_HANDLED; | ||
| 173 | } | ||
| 174 | |||
| 175 | /* | ||
| 176 | * The functions for inserting/removing us as a module. | ||
| 177 | */ | ||
| 178 | |||
| 179 | static int atmel_tsadcc_probe(struct platform_device *pdev) | ||
| 180 | { | ||
| 181 | struct atmel_tsadcc *ts_dev; | ||
| 182 | struct input_dev *input_dev; | ||
| 183 | struct resource *res; | ||
| 184 | struct at91_tsadcc_data *pdata = dev_get_platdata(&pdev->dev); | ||
| 185 | int err; | ||
| 186 | unsigned int prsc; | ||
| 187 | unsigned int reg; | ||
| 188 | |||
| 189 | if (!pdata) | ||
| 190 | return -EINVAL; | ||
| 191 | |||
| 192 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 193 | if (!res) { | ||
| 194 | dev_err(&pdev->dev, "no mmio resource defined.\n"); | ||
| 195 | return -ENXIO; | ||
| 196 | } | ||
| 197 | |||
| 198 | /* Allocate memory for device */ | ||
| 199 | ts_dev = kzalloc(sizeof(struct atmel_tsadcc), GFP_KERNEL); | ||
| 200 | if (!ts_dev) { | ||
| 201 | dev_err(&pdev->dev, "failed to allocate memory.\n"); | ||
| 202 | return -ENOMEM; | ||
| 203 | } | ||
| 204 | platform_set_drvdata(pdev, ts_dev); | ||
| 205 | |||
| 206 | input_dev = input_allocate_device(); | ||
| 207 | if (!input_dev) { | ||
| 208 | dev_err(&pdev->dev, "failed to allocate input device.\n"); | ||
| 209 | err = -EBUSY; | ||
| 210 | goto err_free_mem; | ||
| 211 | } | ||
| 212 | |||
| 213 | ts_dev->irq = platform_get_irq(pdev, 0); | ||
| 214 | if (ts_dev->irq < 0) { | ||
| 215 | dev_err(&pdev->dev, "no irq ID is designated.\n"); | ||
| 216 | err = -ENODEV; | ||
| 217 | goto err_free_dev; | ||
| 218 | } | ||
| 219 | |||
| 220 | if (!request_mem_region(res->start, resource_size(res), | ||
| 221 | "atmel tsadcc regs")) { | ||
| 222 | dev_err(&pdev->dev, "resources is unavailable.\n"); | ||
| 223 | err = -EBUSY; | ||
| 224 | goto err_free_dev; | ||
| 225 | } | ||
| 226 | |||
| 227 | tsc_base = ioremap(res->start, resource_size(res)); | ||
| 228 | if (!tsc_base) { | ||
| 229 | dev_err(&pdev->dev, "failed to map registers.\n"); | ||
| 230 | err = -ENOMEM; | ||
| 231 | goto err_release_mem; | ||
| 232 | } | ||
| 233 | |||
| 234 | err = request_irq(ts_dev->irq, atmel_tsadcc_interrupt, 0, | ||
| 235 | pdev->dev.driver->name, ts_dev); | ||
| 236 | if (err) { | ||
| 237 | dev_err(&pdev->dev, "failed to allocate irq.\n"); | ||
| 238 | goto err_unmap_regs; | ||
| 239 | } | ||
| 240 | |||
| 241 | ts_dev->clk = clk_get(&pdev->dev, "tsc_clk"); | ||
| 242 | if (IS_ERR(ts_dev->clk)) { | ||
| 243 | dev_err(&pdev->dev, "failed to get ts_clk\n"); | ||
| 244 | err = PTR_ERR(ts_dev->clk); | ||
| 245 | goto err_free_irq; | ||
| 246 | } | ||
| 247 | |||
| 248 | ts_dev->input = input_dev; | ||
| 249 | ts_dev->bufferedmeasure = 0; | ||
| 250 | |||
| 251 | snprintf(ts_dev->phys, sizeof(ts_dev->phys), | ||
| 252 | "%s/input0", dev_name(&pdev->dev)); | ||
| 253 | |||
| 254 | input_dev->name = "atmel touch screen controller"; | ||
| 255 | input_dev->phys = ts_dev->phys; | ||
| 256 | input_dev->dev.parent = &pdev->dev; | ||
| 257 | |||
| 258 | __set_bit(EV_ABS, input_dev->evbit); | ||
| 259 | input_set_abs_params(input_dev, ABS_X, 0, 0x3FF, 0, 0); | ||
| 260 | input_set_abs_params(input_dev, ABS_Y, 0, 0x3FF, 0, 0); | ||
| 261 | |||
| 262 | input_set_capability(input_dev, EV_KEY, BTN_TOUCH); | ||
| 263 | |||
| 264 | /* clk_enable() always returns 0, no need to check it */ | ||
| 265 | clk_enable(ts_dev->clk); | ||
| 266 | |||
| 267 | prsc = clk_get_rate(ts_dev->clk); | ||
| 268 | dev_info(&pdev->dev, "Master clock is set at: %d Hz\n", prsc); | ||
| 269 | |||
| 270 | if (!pdata->adc_clock) | ||
| 271 | pdata->adc_clock = ADC_DEFAULT_CLOCK; | ||
| 272 | |||
| 273 | prsc = (prsc / (2 * pdata->adc_clock)) - 1; | ||
| 274 | |||
| 275 | /* saturate if this value is too high */ | ||
| 276 | if (cpu_is_at91sam9rl()) { | ||
| 277 | if (prsc > PRESCALER_VAL(ATMEL_TSADCC_PRESCAL)) | ||
| 278 | prsc = PRESCALER_VAL(ATMEL_TSADCC_PRESCAL); | ||
| 279 | } else { | ||
| 280 | if (prsc > PRESCALER_VAL(ATMEL_TSADCC_EPRESCAL)) | ||
| 281 | prsc = PRESCALER_VAL(ATMEL_TSADCC_EPRESCAL); | ||
| 282 | } | ||
| 283 | |||
| 284 | dev_info(&pdev->dev, "Prescaler is set at: %d\n", prsc); | ||
| 285 | |||
| 286 | reg = ATMEL_TSADCC_TSAMOD_TS_ONLY_MODE | | ||
| 287 | ((0x00 << 5) & ATMEL_TSADCC_SLEEP) | /* Normal Mode */ | ||
| 288 | ((0x01 << 6) & ATMEL_TSADCC_PENDET) | /* Enable Pen Detect */ | ||
| 289 | (prsc << 8) | | ||
| 290 | ((0x26 << 16) & ATMEL_TSADCC_STARTUP) | | ||
| 291 | ((pdata->pendet_debounce << 28) & ATMEL_TSADCC_PENDBC); | ||
| 292 | |||
| 293 | atmel_tsadcc_write(ATMEL_TSADCC_CR, ATMEL_TSADCC_SWRST); | ||
| 294 | atmel_tsadcc_write(ATMEL_TSADCC_MR, reg); | ||
| 295 | atmel_tsadcc_write(ATMEL_TSADCC_TRGR, ATMEL_TSADCC_TRGMOD_NONE); | ||
| 296 | atmel_tsadcc_write(ATMEL_TSADCC_TSR, | ||
| 297 | (pdata->ts_sample_hold_time << 24) & ATMEL_TSADCC_TSSHTIM); | ||
| 298 | |||
| 299 | atmel_tsadcc_read(ATMEL_TSADCC_SR); | ||
| 300 | atmel_tsadcc_write(ATMEL_TSADCC_IER, ATMEL_TSADCC_PENCNT); | ||
| 301 | |||
| 302 | /* All went ok, so register to the input system */ | ||
| 303 | err = input_register_device(input_dev); | ||
| 304 | if (err) | ||
| 305 | goto err_fail; | ||
| 306 | |||
| 307 | return 0; | ||
| 308 | |||
| 309 | err_fail: | ||
| 310 | clk_disable(ts_dev->clk); | ||
| 311 | clk_put(ts_dev->clk); | ||
| 312 | err_free_irq: | ||
| 313 | free_irq(ts_dev->irq, ts_dev); | ||
| 314 | err_unmap_regs: | ||
| 315 | iounmap(tsc_base); | ||
| 316 | err_release_mem: | ||
| 317 | release_mem_region(res->start, resource_size(res)); | ||
| 318 | err_free_dev: | ||
| 319 | input_free_device(input_dev); | ||
| 320 | err_free_mem: | ||
| 321 | kfree(ts_dev); | ||
| 322 | return err; | ||
| 323 | } | ||
| 324 | |||
| 325 | static int atmel_tsadcc_remove(struct platform_device *pdev) | ||
| 326 | { | ||
| 327 | struct atmel_tsadcc *ts_dev = platform_get_drvdata(pdev); | ||
| 328 | struct resource *res; | ||
| 329 | |||
| 330 | free_irq(ts_dev->irq, ts_dev); | ||
| 331 | |||
| 332 | input_unregister_device(ts_dev->input); | ||
| 333 | |||
| 334 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 335 | iounmap(tsc_base); | ||
| 336 | release_mem_region(res->start, resource_size(res)); | ||
| 337 | |||
| 338 | clk_disable(ts_dev->clk); | ||
| 339 | clk_put(ts_dev->clk); | ||
| 340 | |||
| 341 | kfree(ts_dev); | ||
| 342 | |||
| 343 | return 0; | ||
| 344 | } | ||
| 345 | |||
| 346 | static struct platform_driver atmel_tsadcc_driver = { | ||
| 347 | .probe = atmel_tsadcc_probe, | ||
| 348 | .remove = atmel_tsadcc_remove, | ||
| 349 | .driver = { | ||
| 350 | .name = "atmel_tsadcc", | ||
| 351 | }, | ||
| 352 | }; | ||
| 353 | module_platform_driver(atmel_tsadcc_driver); | ||
| 354 | |||
| 355 | MODULE_LICENSE("GPL"); | ||
| 356 | MODULE_DESCRIPTION("Atmel TouchScreen Driver"); | ||
| 357 | MODULE_AUTHOR("Dan Liang <dan.liang@atmel.com>"); | ||
| 358 | |||
