aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/keyboard/Kconfig10
-rw-r--r--drivers/input/keyboard/Makefile1
-rw-r--r--drivers/input/keyboard/tnetv107x-keypad.c329
-rw-r--r--drivers/input/touchscreen/Kconfig9
-rw-r--r--drivers/input/touchscreen/Makefile1
-rw-r--r--drivers/input/touchscreen/tnetv107x-ts.c384
6 files changed, 0 insertions, 734 deletions
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index a673c9f3a0b9..935dcaf16646 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -595,16 +595,6 @@ config KEYBOARD_TC3589X
595 To compile this driver as a module, choose M here: the 595 To compile this driver as a module, choose M here: the
596 module will be called tc3589x-keypad. 596 module will be called tc3589x-keypad.
597 597
598config KEYBOARD_TNETV107X
599 tristate "TI TNETV107X keypad support"
600 depends on ARCH_DAVINCI_TNETV107X
601 select INPUT_MATRIXKMAP
602 help
603 Say Y here if you want to use the TNETV107X keypad.
604
605 To compile this driver as a module, choose M here: the
606 module will be called tnetv107x-keypad.
607
608config KEYBOARD_TWL4030 598config KEYBOARD_TWL4030
609 tristate "TI TWL4030/TWL5030/TPS659x0 keypad support" 599 tristate "TI TWL4030/TWL5030/TPS659x0 keypad support"
610 depends on TWL4030_CORE 600 depends on TWL4030_CORE
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index a699b6172303..81014d94a0c1 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
53obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o 53obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o
54obj-$(CONFIG_KEYBOARD_TC3589X) += tc3589x-keypad.o 54obj-$(CONFIG_KEYBOARD_TC3589X) += tc3589x-keypad.o
55obj-$(CONFIG_KEYBOARD_TEGRA) += tegra-kbc.o 55obj-$(CONFIG_KEYBOARD_TEGRA) += tegra-kbc.o
56obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o
57obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o 56obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o
58obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o 57obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o
59obj-$(CONFIG_KEYBOARD_W90P910) += w90p910_keypad.o 58obj-$(CONFIG_KEYBOARD_W90P910) += w90p910_keypad.o
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c
deleted file mode 100644
index 086511c2121b..000000000000
--- a/drivers/input/keyboard/tnetv107x-keypad.c
+++ /dev/null
@@ -1,329 +0,0 @@
1/*
2 * Texas Instruments TNETV107X Keypad Driver
3 *
4 * Copyright (C) 2010 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/kernel.h>
17#include <linux/err.h>
18#include <linux/errno.h>
19#include <linux/input.h>
20#include <linux/platform_device.h>
21#include <linux/interrupt.h>
22#include <linux/slab.h>
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/clk.h>
26#include <linux/input/matrix_keypad.h>
27#include <linux/module.h>
28
29#define BITS(x) (BIT(x) - 1)
30
31#define KEYPAD_ROWS 9
32#define KEYPAD_COLS 9
33
34#define DEBOUNCE_MIN 0x400ul
35#define DEBOUNCE_MAX 0x3ffffffful
36
37struct keypad_regs {
38 u32 rev;
39 u32 mode;
40 u32 mask;
41 u32 pol;
42 u32 dclock;
43 u32 rclock;
44 u32 stable_cnt;
45 u32 in_en;
46 u32 out;
47 u32 out_en;
48 u32 in;
49 u32 lock;
50 u32 pres[3];
51};
52
53#define keypad_read(kp, reg) __raw_readl(&(kp)->regs->reg)
54#define keypad_write(kp, reg, val) __raw_writel(val, &(kp)->regs->reg)
55
56struct keypad_data {
57 struct input_dev *input_dev;
58 struct resource *res;
59 struct keypad_regs __iomem *regs;
60 struct clk *clk;
61 struct device *dev;
62 spinlock_t lock;
63 int irq_press;
64 int irq_release;
65 int rows, cols, row_shift;
66 int debounce_ms, active_low;
67 u32 prev_keys[3];
68 unsigned short keycodes[];
69};
70
71static irqreturn_t keypad_irq(int irq, void *data)
72{
73 struct keypad_data *kp = data;
74 int i, bit, val, row, col, code;
75 unsigned long flags;
76 u32 curr_keys[3];
77 u32 change;
78
79 spin_lock_irqsave(&kp->lock, flags);
80
81 memset(curr_keys, 0, sizeof(curr_keys));
82 if (irq == kp->irq_press)
83 for (i = 0; i < 3; i++)
84 curr_keys[i] = keypad_read(kp, pres[i]);
85
86 for (i = 0; i < 3; i++) {
87 change = curr_keys[i] ^ kp->prev_keys[i];
88
89 while (change) {
90 bit = fls(change) - 1;
91 change ^= BIT(bit);
92 val = curr_keys[i] & BIT(bit);
93 bit += i * 32;
94 row = bit / KEYPAD_COLS;
95 col = bit % KEYPAD_COLS;
96
97 code = MATRIX_SCAN_CODE(row, col, kp->row_shift);
98 input_event(kp->input_dev, EV_MSC, MSC_SCAN, code);
99 input_report_key(kp->input_dev, kp->keycodes[code],
100 val);
101 }
102 }
103 input_sync(kp->input_dev);
104 memcpy(kp->prev_keys, curr_keys, sizeof(curr_keys));
105
106 if (irq == kp->irq_press)
107 keypad_write(kp, lock, 0); /* Allow hardware updates */
108
109 spin_unlock_irqrestore(&kp->lock, flags);
110
111 return IRQ_HANDLED;
112}
113
114static int keypad_start(struct input_dev *dev)
115{
116 struct keypad_data *kp = input_get_drvdata(dev);
117 unsigned long mask, debounce, clk_rate_khz;
118 unsigned long flags;
119
120 clk_enable(kp->clk);
121 clk_rate_khz = clk_get_rate(kp->clk) / 1000;
122
123 spin_lock_irqsave(&kp->lock, flags);
124
125 /* Initialize device registers */
126 keypad_write(kp, mode, 0);
127
128 mask = BITS(kp->rows) << KEYPAD_COLS;
129 mask |= BITS(kp->cols);
130 keypad_write(kp, mask, ~mask);
131
132 keypad_write(kp, pol, kp->active_low ? 0 : 0x3ffff);
133 keypad_write(kp, stable_cnt, 3);
134
135 debounce = kp->debounce_ms * clk_rate_khz;
136 debounce = clamp(debounce, DEBOUNCE_MIN, DEBOUNCE_MAX);
137 keypad_write(kp, dclock, debounce);
138 keypad_write(kp, rclock, 4 * debounce);
139
140 keypad_write(kp, in_en, 1);
141
142 spin_unlock_irqrestore(&kp->lock, flags);
143
144 return 0;
145}
146
147static void keypad_stop(struct input_dev *dev)
148{
149 struct keypad_data *kp = input_get_drvdata(dev);
150
151 synchroni