samsung-keypad.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. /*
  2. * Samsung keypad driver
  3. *
  4. * Copyright (C) 2010 Samsung Electronics Co.Ltd
  5. * Author: Joonyoung Shim <jy0922.shim@samsung.com>
  6. * Author: Donghwa Lee <dh09.lee@samsung.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #include <linux/clk.h>
  14. #include <linux/delay.h>
  15. #include <linux/err.h>
  16. #include <linux/init.h>
  17. #include <linux/input.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/io.h>
  20. #include <linux/module.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/slab.h>
  23. #include <linux/of.h>
  24. #include <linux/of_gpio.h>
  25. #include <linux/sched.h>
  26. #include <plat/keypad.h>
  27. #define SAMSUNG_KEYIFCON 0x00
  28. #define SAMSUNG_KEYIFSTSCLR 0x04
  29. #define SAMSUNG_KEYIFCOL 0x08
  30. #define SAMSUNG_KEYIFROW 0x0c
  31. #define SAMSUNG_KEYIFFC 0x10
  32. /* SAMSUNG_KEYIFCON */
  33. #define SAMSUNG_KEYIFCON_INT_F_EN (1 << 0)
  34. #define SAMSUNG_KEYIFCON_INT_R_EN (1 << 1)
  35. #define SAMSUNG_KEYIFCON_DF_EN (1 << 2)
  36. #define SAMSUNG_KEYIFCON_FC_EN (1 << 3)
  37. #define SAMSUNG_KEYIFCON_WAKEUPEN (1 << 4)
  38. /* SAMSUNG_KEYIFSTSCLR */
  39. #define SAMSUNG_KEYIFSTSCLR_P_INT_MASK (0xff << 0)
  40. #define SAMSUNG_KEYIFSTSCLR_R_INT_MASK (0xff << 8)
  41. #define SAMSUNG_KEYIFSTSCLR_R_INT_OFFSET 8
  42. #define S5PV210_KEYIFSTSCLR_P_INT_MASK (0x3fff << 0)
  43. #define S5PV210_KEYIFSTSCLR_R_INT_MASK (0x3fff << 16)
  44. #define S5PV210_KEYIFSTSCLR_R_INT_OFFSET 16
  45. /* SAMSUNG_KEYIFCOL */
  46. #define SAMSUNG_KEYIFCOL_MASK (0xff << 0)
  47. #define S5PV210_KEYIFCOLEN_MASK (0xff << 8)
  48. /* SAMSUNG_KEYIFROW */
  49. #define SAMSUNG_KEYIFROW_MASK (0xff << 0)
  50. #define S5PV210_KEYIFROW_MASK (0x3fff << 0)
  51. /* SAMSUNG_KEYIFFC */
  52. #define SAMSUNG_KEYIFFC_MASK (0x3ff << 0)
  53. enum samsung_keypad_type {
  54. KEYPAD_TYPE_SAMSUNG,
  55. KEYPAD_TYPE_S5PV210,
  56. };
  57. struct samsung_keypad {
  58. struct input_dev *input_dev;
  59. struct clk *clk;
  60. void __iomem *base;
  61. wait_queue_head_t wait;
  62. bool stopped;
  63. int irq;
  64. enum samsung_keypad_type type;
  65. unsigned int row_shift;
  66. unsigned int rows;
  67. unsigned int cols;
  68. unsigned int row_state[SAMSUNG_MAX_COLS];
  69. #ifdef CONFIG_OF
  70. int row_gpios[SAMSUNG_MAX_ROWS];
  71. int col_gpios[SAMSUNG_MAX_COLS];
  72. #endif
  73. unsigned short keycodes[];
  74. };
  75. static void samsung_keypad_scan(struct samsung_keypad *keypad,
  76. unsigned int *row_state)
  77. {
  78. unsigned int col;
  79. unsigned int val;
  80. for (col = 0; col < keypad->cols; col++) {
  81. if (keypad->type == KEYPAD_TYPE_S5PV210) {
  82. val = S5PV210_KEYIFCOLEN_MASK;
  83. val &= ~(1 << col) << 8;
  84. } else {
  85. val = SAMSUNG_KEYIFCOL_MASK;
  86. val &= ~(1 << col);
  87. }
  88. writel(val, keypad->base + SAMSUNG_KEYIFCOL);
  89. mdelay(1);
  90. val = readl(keypad->base + SAMSUNG_KEYIFROW);
  91. row_state[col] = ~val & ((1 << keypad->rows) - 1);
  92. }
  93. /* KEYIFCOL reg clear */
  94. writel(0, keypad->base + SAMSUNG_KEYIFCOL);
  95. }
  96. static bool samsung_keypad_report(struct samsung_keypad *keypad,
  97. unsigned int *row_state)
  98. {
  99. struct input_dev *input_dev = keypad->input_dev;
  100. unsigned int changed;
  101. unsigned int pressed;
  102. unsigned int key_down = 0;
  103. unsigned int val;
  104. unsigned int col, row;
  105. for (col = 0; col < keypad->cols; col++) {
  106. changed = row_state[col] ^ keypad->row_state[col];
  107. key_down |= row_state[col];
  108. if (!changed)
  109. continue;
  110. for (row = 0; row < keypad->rows; row++) {
  111. if (!(changed & (1 << row)))
  112. continue;
  113. pressed = row_state[col] & (1 << row);
  114. dev_dbg(&keypad->input_dev->dev,
  115. "key %s, row: %d, col: %d\n",
  116. pressed ? "pressed" : "released", row, col);
  117. val = MATRIX_SCAN_CODE(row, col, keypad->row_shift);
  118. input_event(input_dev, EV_MSC, MSC_SCAN, val);
  119. input_report_key(input_dev,
  120. keypad->keycodes[val], pressed);
  121. }
  122. input_sync(keypad->input_dev);
  123. }
  124. memcpy(keypad->row_state, row_state, sizeof(keypad->row_state));
  125. return key_down;
  126. }
  127. static irqreturn_t samsung_keypad_irq(int irq, void *dev_id)
  128. {
  129. struct samsung_keypad *keypad = dev_id;
  130. unsigned int row_state[SAMSUNG_MAX_COLS];
  131. unsigned int val;
  132. bool key_down;
  133. do {
  134. val = readl(keypad->base + SAMSUNG_KEYIFSTSCLR);
  135. /* Clear interrupt. */
  136. writel(~0x0, keypad->base + SAMSUNG_KEYIFSTSCLR);
  137. samsung_keypad_scan(keypad, row_state);
  138. key_down = samsung_keypad_report(keypad, row_state);
  139. if (key_down)
  140. wait_event_timeout(keypad->wait, keypad->stopped,
  141. msecs_to_jiffies(50));
  142. } while (key_down && !keypad->stopped);
  143. return IRQ_HANDLED;
  144. }
  145. static void samsung_keypad_start(struct samsung_keypad *keypad)
  146. {
  147. unsigned int val;
  148. /* Tell IRQ thread that it may poll the device. */
  149. keypad->stopped = false;
  150. clk_enable(keypad->clk);
  151. /* Enable interrupt bits. */
  152. val = readl(keypad->base + SAMSUNG_KEYIFCON);
  153. val |= SAMSUNG_KEYIFCON_INT_F_EN | SAMSUNG_KEYIFCON_INT_R_EN;
  154. writel(val, keypad->base + SAMSUNG_KEYIFCON);
  155. /* KEYIFCOL reg clear. */
  156. writel(0, keypad->base + SAMSUNG_KEYIFCOL);
  157. }
  158. static void samsung_keypad_stop(struct samsung_keypad *keypad)
  159. {
  160. unsigned int val;
  161. /* Signal IRQ thread to stop polling and disable the handler. */
  162. keypad->stopped = true;
  163. wake_up(&keypad->wait);
  164. disable_irq(keypad->irq);
  165. /* Clear interrupt. */
  166. writel(~0x0, keypad->base + SAMSUNG_KEYIFSTSCLR);
  167. /* Disable interrupt bits. */
  168. val = readl(keypad->base + SAMSUNG_KEYIFCON);
  169. val &= ~(SAMSUNG_KEYIFCON_INT_F_EN | SAMSUNG_KEYIFCON_INT_R_EN);
  170. writel(val, keypad->base + SAMSUNG_KEYIFCON);
  171. clk_disable(keypad->clk);
  172. /*
  173. * Now that chip should not generate interrupts we can safely
  174. * re-enable the handler.
  175. */
  176. enable_irq(keypad->irq);
  177. }
  178. static int samsung_keypad_open(struct input_dev *input_dev)
  179. {
  180. struct samsung_keypad *keypad = input_get_drvdata(input_dev);
  181. samsung_keypad_start(keypad);
  182. return 0;
  183. }
  184. static void samsung_keypad_close(struct input_dev *input_dev)
  185. {
  186. struct samsung_keypad *keypad = input_get_drvdata(input_dev);
  187. samsung_keypad_stop(keypad);
  188. }
  189. #ifdef CONFIG_OF
  190. static struct samsung_keypad_platdata *samsung_keypad_parse_dt(
  191. struct device *dev)
  192. {
  193. struct samsung_keypad_platdata *pdata;
  194. struct matrix_keymap_data *keymap_data;
  195. uint32_t *keymap, num_rows = 0, num_cols = 0;
  196. struct device_node *np = dev->of_node, *key_np;
  197. unsigned int key_count = 0;
  198. pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
  199. if (!pdata) {
  200. dev_err(dev, "could not allocate memory for platform data\n");
  201. return NULL;
  202. }
  203. of_property_read_u32(np, "samsung,keypad-num-rows", &num_rows);
  204. of_property_read_u32(np, "samsung,keypad-num-columns", &num_cols);
  205. if (!num_rows || !num_cols) {
  206. dev_err(dev, "number of keypad rows/columns not specified\n");
  207. return NULL;
  208. }
  209. pdata->rows = num_rows;
  210. pdata->cols = num_cols;
  211. keymap_data = devm_kzalloc(dev, sizeof(*keymap_data), GFP_KERNEL);
  212. if (!keymap_data) {
  213. dev_err(dev, "could not allocate memory for keymap data\n");
  214. return NULL;
  215. }
  216. pdata->keymap_data = keymap_data;
  217. for_each_child_of_node(np, key_np)
  218. key_count++;
  219. keymap_data->keymap_size = key_count;
  220. keymap = devm_kzalloc(dev, sizeof(uint32_t) * key_count, GFP_KERNEL);
  221. if (!keymap) {
  222. dev_err(dev, "could not allocate memory for keymap\n");
  223. return NULL;
  224. }
  225. keymap_data->keymap = keymap;
  226. for_each_child_of_node(np, key_np) {
  227. u32 row, col, key_code;
  228. of_property_read_u32(key_np, "keypad,row", &row);
  229. of_property_read_u32(key_np, "keypad,column", &col);
  230. of_property_read_u32(key_np, "linux,code", &key_code);
  231. *keymap++ = KEY(row, col, key_code);
  232. }
  233. if (of_get_property(np, "linux,input-no-autorepeat", NULL))
  234. pdata->no_autorepeat = true;
  235. if (of_get_property(np, "linux,input-wakeup", NULL))
  236. pdata->wakeup = true;
  237. return pdata;
  238. }
  239. static void samsung_keypad_parse_dt_gpio(struct device *dev,
  240. struct samsung_keypad *keypad)
  241. {
  242. struct device_node *np = dev->of_node;
  243. int gpio, ret, row, col;
  244. for (row = 0; row < keypad->rows; row++) {
  245. gpio = of_get_named_gpio(np, "row-gpios", row);
  246. keypad->row_gpios[row] = gpio;
  247. if (!gpio_is_valid(gpio)) {
  248. dev_err(dev, "keypad row[%d]: invalid gpio %d\n",
  249. row, gpio);
  250. continue;
  251. }
  252. ret = gpio_request(gpio, "keypad-row");
  253. if (ret)
  254. dev_err(dev, "keypad row[%d] gpio request failed\n",
  255. row);
  256. }
  257. for (col = 0; col < keypad->cols; col++) {
  258. gpio = of_get_named_gpio(np, "col-gpios", col);
  259. keypad->col_gpios[col] = gpio;
  260. if (!gpio_is_valid(gpio)) {
  261. dev_err(dev, "keypad column[%d]: invalid gpio %d\n",
  262. col, gpio);
  263. continue;
  264. }
  265. ret = gpio_request(gpio, "keypad-col");
  266. if (ret)
  267. dev_err(dev, "keypad column[%d] gpio request failed\n",
  268. col);
  269. }
  270. }
  271. static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad)
  272. {
  273. int cnt;
  274. for (cnt = 0; cnt < keypad->rows; cnt++)
  275. if (gpio_is_valid(keypad->row_gpios[cnt]))
  276. gpio_free(keypad->row_gpios[cnt]);
  277. for (cnt = 0; cnt < keypad->cols; cnt++)
  278. if (gpio_is_valid(keypad->col_gpios[cnt]))
  279. gpio_free(keypad->col_gpios[cnt]);
  280. }
  281. #else
  282. static
  283. struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev)
  284. {
  285. return NULL;
  286. }
  287. static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad)
  288. {
  289. }
  290. #endif
  291. static int __devinit samsung_keypad_probe(struct platform_device *pdev)
  292. {
  293. const struct samsung_keypad_platdata *pdata;
  294. const struct matrix_keymap_data *keymap_data;
  295. struct samsung_keypad *keypad;
  296. struct resource *res;
  297. struct input_dev *input_dev;
  298. unsigned int row_shift;
  299. unsigned int keymap_size;
  300. int error;
  301. if (pdev->dev.of_node)
  302. pdata = samsung_keypad_parse_dt(&pdev->dev);
  303. else
  304. pdata = pdev->dev.platform_data;
  305. if (!pdata) {
  306. dev_err(&pdev->dev, "no platform data defined\n");
  307. return -EINVAL;
  308. }
  309. keymap_data = pdata->keymap_data;
  310. if (!keymap_data) {
  311. dev_err(&pdev->dev, "no keymap data defined\n");
  312. return -EINVAL;
  313. }
  314. if (!pdata->rows || pdata->rows > SAMSUNG_MAX_ROWS)
  315. return -EINVAL;
  316. if (!pdata->cols || pdata->cols > SAMSUNG_MAX_COLS)
  317. return -EINVAL;
  318. /* initialize the gpio */
  319. if (pdata->cfg_gpio)
  320. pdata->cfg_gpio(pdata->rows, pdata->cols);
  321. row_shift = get_count_order(pdata->cols);
  322. keymap_size = (pdata->rows << row_shift) * sizeof(keypad->keycodes[0]);
  323. keypad = kzalloc(sizeof(*keypad) + keymap_size, GFP_KERNEL);
  324. input_dev = input_allocate_device();
  325. if (!keypad || !input_dev) {
  326. error = -ENOMEM;
  327. goto err_free_mem;
  328. }
  329. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  330. if (!res) {
  331. error = -ENODEV;
  332. goto err_free_mem;
  333. }
  334. keypad->base = ioremap(res->start, resource_size(res));
  335. if (!keypad->base) {
  336. error = -EBUSY;
  337. goto err_free_mem;
  338. }
  339. keypad->clk = clk_get(&pdev->dev, "keypad");
  340. if (IS_ERR(keypad->clk)) {
  341. dev_err(&pdev->dev, "failed to get keypad clk\n");
  342. error = PTR_ERR(keypad->clk);
  343. goto err_unmap_base;
  344. }
  345. keypad->input_dev = input_dev;
  346. keypad->row_shift = row_shift;
  347. keypad->rows = pdata->rows;
  348. keypad->cols = pdata->cols;
  349. init_waitqueue_head(&keypad->wait);
  350. if (pdev->dev.of_node) {
  351. #ifdef CONFIG_OF
  352. samsung_keypad_parse_dt_gpio(&pdev->dev, keypad);
  353. keypad->type = of_device_is_compatible(pdev->dev.of_node,
  354. "samsung,s5pv210-keypad");
  355. #endif
  356. } else {
  357. keypad->type = platform_get_device_id(pdev)->driver_data;
  358. }
  359. input_dev->name = pdev->name;
  360. input_dev->id.bustype = BUS_HOST;
  361. input_dev->dev.parent = &pdev->dev;
  362. input_set_drvdata(input_dev, keypad);
  363. input_dev->open = samsung_keypad_open;
  364. input_dev->close = samsung_keypad_close;
  365. input_dev->evbit[0] = BIT_MASK(EV_KEY);
  366. if (!pdata->no_autorepeat)
  367. input_dev->evbit[0] |= BIT_MASK(EV_REP);
  368. input_set_capability(input_dev, EV_MSC, MSC_SCAN);
  369. input_dev->keycode = keypad->keycodes;
  370. input_dev->keycodesize = sizeof(keypad->keycodes[0]);
  371. input_dev->keycodemax = pdata->rows << row_shift;
  372. matrix_keypad_build_keymap(keymap_data, row_shift,
  373. input_dev->keycode, input_dev->keybit);
  374. keypad->irq = platform_get_irq(pdev, 0);
  375. if (keypad->irq < 0) {
  376. error = keypad->irq;
  377. goto err_put_clk;
  378. }
  379. error = request_threaded_irq(keypad->irq, NULL, samsung_keypad_irq,
  380. IRQF_ONESHOT, dev_name(&pdev->dev), keypad);
  381. if (error) {
  382. dev_err(&pdev->dev, "failed to register keypad interrupt\n");
  383. goto err_put_clk;
  384. }
  385. error = input_register_device(keypad->input_dev);
  386. if (error)
  387. goto err_free_irq;
  388. device_init_wakeup(&pdev->dev, pdata->wakeup);
  389. platform_set_drvdata(pdev, keypad);
  390. if (pdev->dev.of_node) {
  391. devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap);
  392. devm_kfree(&pdev->dev, (void *)pdata->keymap_data);
  393. devm_kfree(&pdev->dev, (void *)pdata);
  394. }
  395. return 0;
  396. err_free_irq:
  397. free_irq(keypad->irq, keypad);
  398. err_put_clk:
  399. clk_put(keypad->clk);
  400. samsung_keypad_dt_gpio_free(keypad);
  401. err_unmap_base:
  402. iounmap(keypad->base);
  403. err_free_mem:
  404. input_free_device(input_dev);
  405. kfree(keypad);
  406. return error;
  407. }
  408. static int __devexit samsung_keypad_remove(struct platform_device *pdev)
  409. {
  410. struct samsung_keypad *keypad = platform_get_drvdata(pdev);
  411. device_init_wakeup(&pdev->dev, 0);
  412. platform_set_drvdata(pdev, NULL);
  413. input_unregister_device(keypad->input_dev);
  414. /*
  415. * It is safe to free IRQ after unregistering device because
  416. * samsung_keypad_close will shut off interrupts.
  417. */
  418. free_irq(keypad->irq, keypad);
  419. clk_put(keypad->clk);
  420. samsung_keypad_dt_gpio_free(keypad);
  421. iounmap(keypad->base);
  422. kfree(keypad);
  423. return 0;
  424. }
  425. #ifdef CONFIG_PM
  426. static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad,
  427. bool enable)
  428. {
  429. struct device *dev = keypad->input_dev->dev.parent;
  430. unsigned int val;
  431. clk_enable(keypad->clk);
  432. val = readl(keypad->base + SAMSUNG_KEYIFCON);
  433. if (enable) {
  434. val |= SAMSUNG_KEYIFCON_WAKEUPEN;
  435. if (device_may_wakeup(dev))
  436. enable_irq_wake(keypad->irq);
  437. } else {
  438. val &= ~SAMSUNG_KEYIFCON_WAKEUPEN;
  439. if (device_may_wakeup(dev))
  440. disable_irq_wake(keypad->irq);
  441. }
  442. writel(val, keypad->base + SAMSUNG_KEYIFCON);
  443. clk_disable(keypad->clk);
  444. }
  445. static int samsung_keypad_suspend(struct device *dev)
  446. {
  447. struct platform_device *pdev = to_platform_device(dev);
  448. struct samsung_keypad *keypad = platform_get_drvdata(pdev);
  449. struct input_dev *input_dev = keypad->input_dev;
  450. mutex_lock(&input_dev->mutex);
  451. if (input_dev->users)
  452. samsung_keypad_stop(keypad);
  453. samsung_keypad_toggle_wakeup(keypad, true);
  454. mutex_unlock(&input_dev->mutex);
  455. return 0;
  456. }
  457. static int samsung_keypad_resume(struct device *dev)
  458. {
  459. struct platform_device *pdev = to_platform_device(dev);
  460. struct samsung_keypad *keypad = platform_get_drvdata(pdev);
  461. struct input_dev *input_dev = keypad->input_dev;
  462. mutex_lock(&input_dev->mutex);
  463. samsung_keypad_toggle_wakeup(keypad, false);
  464. if (input_dev->users)
  465. samsung_keypad_start(keypad);
  466. mutex_unlock(&input_dev->mutex);
  467. return 0;
  468. }
  469. static const struct dev_pm_ops samsung_keypad_pm_ops = {
  470. .suspend = samsung_keypad_suspend,
  471. .resume = samsung_keypad_resume,
  472. };
  473. #endif
  474. #ifdef CONFIG_OF
  475. static const struct of_device_id samsung_keypad_dt_match[] = {
  476. { .compatible = "samsung,s3c6410-keypad" },
  477. { .compatible = "samsung,s5pv210-keypad" },
  478. {},
  479. };
  480. MODULE_DEVICE_TABLE(of, samsung_keypad_dt_match);
  481. #else
  482. #define samsung_keypad_dt_match NULL
  483. #endif
  484. static struct platform_device_id samsung_keypad_driver_ids[] = {
  485. {
  486. .name = "samsung-keypad",
  487. .driver_data = KEYPAD_TYPE_SAMSUNG,
  488. }, {
  489. .name = "s5pv210-keypad",
  490. .driver_data = KEYPAD_TYPE_S5PV210,
  491. },
  492. { },
  493. };
  494. MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids);
  495. static struct platform_driver samsung_keypad_driver = {
  496. .probe = samsung_keypad_probe,
  497. .remove = __devexit_p(samsung_keypad_remove),
  498. .driver = {
  499. .name = "samsung-keypad",
  500. .owner = THIS_MODULE,
  501. .of_match_table = samsung_keypad_dt_match,
  502. #ifdef CONFIG_PM
  503. .pm = &samsung_keypad_pm_ops,
  504. #endif
  505. },
  506. .id_table = samsung_keypad_driver_ids,
  507. };
  508. static int __init samsung_keypad_init(void)
  509. {
  510. return platform_driver_register(&samsung_keypad_driver);
  511. }
  512. module_init(samsung_keypad_init);
  513. static void __exit samsung_keypad_exit(void)
  514. {
  515. platform_driver_unregister(&samsung_keypad_driver);
  516. }
  517. module_exit(samsung_keypad_exit);
  518. MODULE_DESCRIPTION("Samsung keypad driver");
  519. MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
  520. MODULE_AUTHOR("Donghwa Lee <dh09.lee@samsung.com>");
  521. MODULE_LICENSE("GPL");
  522. MODULE_ALIAS("platform:samsung-keypad");