aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-09-19 13:21:21 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-09-19 13:21:21 -0400
commit0b6c404a07e3240b95aa5682fb8fd57c41609d7a (patch)
treec4d410b0ec7044922b73c39ecfb3fbb620c29282 /drivers/input
parent609455f481772c5a875b88e860a2ee0e2f25ebf0 (diff)
parent55d512e245bc7699a8800e23df1a24195dd08217 (diff)
Merge tag 'v3.6-rc5' into for-linus
Sync with mainline so that I can revert an input patch that came in through another subsystem tree.
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/lm8333.c2
-rw-r--r--drivers/input/keyboard/tegra-kbc.c4
-rw-r--r--drivers/input/misc/88pm80x_onkey.c168
-rw-r--r--drivers/input/misc/Kconfig10
-rw-r--r--drivers/input/misc/Makefile1
-rw-r--r--drivers/input/misc/ab8500-ponkey.c4
-rw-r--r--drivers/input/misc/cma3000_d0x.c2
-rw-r--r--drivers/input/serio/hp_sdc.c2
-rw-r--r--drivers/input/touchscreen/eeti_ts.c21
-rw-r--r--drivers/input/touchscreen/jornada720_ts.c1
10 files changed, 200 insertions, 15 deletions
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index ca168a6679de..081fd9effa8c 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333)
91 return; 91 return;
92 } 92 }
93 93
94 for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) { 94 for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
95 pressed = keys[i] & 0x80; 95 pressed = keys[i] & 0x80;
96 code = keys[i] & 0x7f; 96 code = keys[i] & 0x7f;
97 97
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 4ffe64d53107..2c1c9ed1bd9f 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -492,7 +492,7 @@ static int tegra_kbc_start(struct tegra_kbc *kbc)
492 unsigned int debounce_cnt; 492 unsigned int debounce_cnt;
493 u32 val = 0; 493 u32 val = 0;
494 494
495 clk_enable(kbc->clk); 495 clk_prepare_enable(kbc->clk);
496 496
497 /* Reset the KBC controller to clear all previous status.*/ 497 /* Reset the KBC controller to clear all previous status.*/
498 tegra_periph_reset_assert(kbc->clk); 498 tegra_periph_reset_assert(kbc->clk);
@@ -556,7 +556,7 @@ static void tegra_kbc_stop(struct tegra_kbc *kbc)
556 disable_irq(kbc->irq); 556 disable_irq(kbc->irq);
557 del_timer_sync(&kbc->timer); 557 del_timer_sync(&kbc->timer);
558 558
559 clk_disable(kbc->clk); 559 clk_disable_unprepare(kbc->clk);
560} 560}
561 561
562static int tegra_kbc_open(struct input_dev *dev) 562static int tegra_kbc_open(struct input_dev *dev)
diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c
new file mode 100644
index 000000000000..7f26e7b6c228
--- /dev/null
+++ b/drivers/input/misc/88pm80x_onkey.c
@@ -0,0 +1,168 @@
1/*
2 * Marvell 88PM80x ONKEY driver
3 *
4 * Copyright (C) 2012 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.com>
6 * Qiao Zhou <zhouqiao@marvell.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of this
10 * archive for more details.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/kernel.h>
23#include <linux/module.h>
24#include <linux/input.h>
25#include <linux/mfd/88pm80x.h>
26#include <linux/regmap.h>
27#include <linux/slab.h>
28
29#define PM800_LONG_ONKEY_EN (1 << 0)
30#define PM800_LONG_KEY_DELAY (8) /* 1 .. 16 seconds */
31#define PM800_LONKEY_PRESS_TIME ((PM800_LONG_KEY_DELAY-1) << 4)
32#define PM800_LONKEY_PRESS_TIME_MASK (0xF0)
33#define PM800_SW_PDOWN (1 << 5)
34
35struct pm80x_onkey_info {
36 struct input_dev *idev;
37 struct pm80x_chip *pm80x;
38 struct regmap *map;
39 int irq;
40};
41
42/* 88PM80x gives us an interrupt when ONKEY is held */
43static irqreturn_t pm80x_onkey_handler(int irq, void *data)
44{
45 struct pm80x_onkey_info *info = data;
46 int ret = 0;
47 unsigned int val;
48
49 ret = regmap_read(info->map, PM800_STATUS_1, &val);
50 if (ret < 0) {
51 dev_err(info->idev->dev.parent, "failed to read status: %d\n", ret);
52 return IRQ_NONE;
53 }
54 val &= PM800_ONKEY_STS1;
55
56 input_report_key(info->idev, KEY_POWER, val);
57 input_sync(info->idev);
58
59 return IRQ_HANDLED;
60}
61
62static SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend,
63 pm80x_dev_resume);
64
65static int __devinit pm80x_onkey_probe(struct platform_device *pdev)
66{
67
68 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
69 struct pm80x_onkey_info *info;
70 int err;
71
72 info = kzalloc(sizeof(struct pm80x_onkey_info), GFP_KERNEL);
73 if (!info)
74 return -ENOMEM;
75
76 info->pm80x = chip;
77
78 info->irq = platform_get_irq(pdev, 0);
79 if (info->irq < 0) {
80 dev_err(&pdev->dev, "No IRQ resource!\n");
81 err = -EINVAL;
82 goto out;
83 }
84
85 info->map = info->pm80x->regmap;
86 if (!info->map) {
87 dev_err(&pdev->dev, "no regmap!\n");
88 err = -EINVAL;
89 goto out;
90 }
91
92 info->idev = input_allocate_device();
93 if (!info->idev) {
94 dev_err(&pdev->dev, "Failed to allocate input dev\n");
95 err = -ENOMEM;
96 goto out;
97 }
98
99 info->idev->name = "88pm80x_on";
100 info->idev->phys = "88pm80x_on/input0";
101 info->idev->id.bustype = BUS_I2C;
102 info->idev->dev.parent = &pdev->dev;
103 info->idev->evbit[0] = BIT_MASK(EV_KEY);
104 __set_bit(KEY_POWER, info->idev->keybit);
105
106 err = pm80x_request_irq(info->pm80x, info->irq, pm80x_onkey_handler,
107 IRQF_ONESHOT, "onkey", info);
108 if (err < 0) {
109 dev_err(&pdev->dev, "Failed to request IRQ: #%d: %d\n",
110 info->irq, err);
111 goto out_reg;
112 }
113
114 err = input_register_device(info->idev);
115 if (err) {
116 dev_err(&pdev->dev, "Can't register input device: %d\n", err);
117 goto out_irq;
118 }
119
120 platform_set_drvdata(pdev, info);
121
122 /* Enable long onkey detection */
123 regmap_update_bits(info->map, PM800_RTC_MISC4, PM800_LONG_ONKEY_EN,
124 PM800_LONG_ONKEY_EN);
125 /* Set 8-second interval */
126 regmap_update_bits(info->map, PM800_RTC_MISC3,
127 PM800_LONKEY_PRESS_TIME_MASK,
128 PM800_LONKEY_PRESS_TIME);
129
130 device_init_wakeup(&pdev->dev, 1);
131 return 0;
132
133out_irq:
134 pm80x_free_irq(info->pm80x, info->irq, info);
135out_reg:
136 input_free_device(info->idev);
137out:
138 kfree(info);
139 return err;
140}
141
142static int __devexit pm80x_onkey_remove(struct platform_device *pdev)
143{
144 struct pm80x_onkey_info *info = platform_get_drvdata(pdev);
145
146 device_init_wakeup(&pdev->dev, 0);
147 pm80x_free_irq(info->pm80x, info->irq, info);
148 input_unregister_device(info->idev);
149 kfree(info);
150 return 0;
151}
152
153static struct platform_driver pm80x_onkey_driver = {
154 .driver = {
155 .name = "88pm80x-onkey",
156 .owner = THIS_MODULE,
157 .pm = &pm80x_onkey_pm_ops,
158 },
159 .probe = pm80x_onkey_probe,
160 .remove = __devexit_p(pm80x_onkey_remove),
161};
162
163module_platform_driver(pm80x_onkey_driver);
164
165MODULE_LICENSE("GPL");
166MODULE_DESCRIPTION("Marvell 88PM80x ONKEY driver");
167MODULE_AUTHOR("Qiao Zhou <zhouqiao@marvell.com>");
168MODULE_ALIAS("platform:88pm80x-onkey");
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 7faf4a7fcaa9..7c0f1ecfdd7a 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -22,6 +22,16 @@ config INPUT_88PM860X_ONKEY
22 To compile this driver as a module, choose M here: the module 22 To compile this driver as a module, choose M here: the module
23 will be called 88pm860x_onkey. 23 will be called 88pm860x_onkey.
24 24
25config INPUT_88PM80X_ONKEY
26 tristate "88PM80x ONKEY support"
27 depends on MFD_88PM800
28 help
29 Support the ONKEY of Marvell 88PM80x PMICs as an input device
30 reporting power button status.
31
32 To compile this driver as a module, choose M here: the module
33 will be called 88pm80x_onkey.
34
25config INPUT_AB8500_PONKEY 35config INPUT_AB8500_PONKEY
26 tristate "AB8500 Pon (PowerOn) Key" 36 tristate "AB8500 Pon (PowerOn) Key"
27 depends on AB8500_CORE 37 depends on AB8500_CORE
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index f55cdf4916fa..83fe6f5b77d1 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -5,6 +5,7 @@
5# Each configuration option enables a list of files. 5# Each configuration option enables a list of files.
6 6
7obj-$(CONFIG_INPUT_88PM860X_ONKEY) += 88pm860x_onkey.o 7obj-$(CONFIG_INPUT_88PM860X_ONKEY) += 88pm860x_onkey.o
8obj-$(CONFIG_INPUT_88PM80X_ONKEY) += 88pm80x_onkey.o
8obj-$(CONFIG_INPUT_AB8500_PONKEY) += ab8500-ponkey.o 9obj-$(CONFIG_INPUT_AB8500_PONKEY) += ab8500-ponkey.o
9obj-$(CONFIG_INPUT_AD714X) += ad714x.o 10obj-$(CONFIG_INPUT_AD714X) += ad714x.o
10obj-$(CONFIG_INPUT_AD714X_I2C) += ad714x-i2c.o 11obj-$(CONFIG_INPUT_AD714X_I2C) += ad714x-i2c.o
diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c
index 84ec691c05aa..f06231b7cab1 100644
--- a/drivers/input/misc/ab8500-ponkey.c
+++ b/drivers/input/misc/ab8500-ponkey.c
@@ -74,8 +74,8 @@ static int __devinit ab8500_ponkey_probe(struct platform_device *pdev)
74 74
75 ponkey->idev = input; 75 ponkey->idev = input;
76 ponkey->ab8500 = ab8500; 76 ponkey->ab8500 = ab8500;
77 ponkey->irq_dbf = irq_dbf; 77 ponkey->irq_dbf = ab8500_irq_get_virq(ab8500, irq_dbf);
78 ponkey->irq_dbr = irq_dbr; 78 ponkey->irq_dbr = ab8500_irq_get_virq(ab8500, irq_dbr);
79 79
80 input->name = "AB8500 POn(PowerOn) Key"; 80 input->name = "AB8500 POn(PowerOn) Key";
81 input->dev.parent = &pdev->dev; 81 input->dev.parent = &pdev->dev;
diff --git a/drivers/input/misc/cma3000_d0x.c b/drivers/input/misc/cma3000_d0x.c
index a3735a01e9fd..df9b756594f8 100644
--- a/drivers/input/misc/cma3000_d0x.c
+++ b/drivers/input/misc/cma3000_d0x.c
@@ -58,7 +58,7 @@
58 58
59/* 59/*
60 * Bit weights in mg for bit 0, other bits need 60 * Bit weights in mg for bit 0, other bits need
61 * multipy factor 2^n. Eight bit is the sign bit. 61 * multiply factor 2^n. Eight bit is the sign bit.
62 */ 62 */
63#define BIT_TO_2G 18 63#define BIT_TO_2G 18
64#define BIT_TO_8G 71 64#define BIT_TO_8G 71
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index 09a089996ded..d7a7e54f6465 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -878,7 +878,7 @@ static int __init hp_sdc_init(void)
878#endif 878#endif
879 879
880 errstr = "IRQ not available for"; 880 errstr = "IRQ not available for";
881 if (request_irq(hp_sdc.irq, &hp_sdc_isr, IRQF_SHARED|IRQF_SAMPLE_RANDOM, 881 if (request_irq(hp_sdc.irq, &hp_sdc_isr, IRQF_SHARED,
882 "HP SDC", &hp_sdc)) 882 "HP SDC", &hp_sdc))
883 goto err1; 883 goto err1;
884 884
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 503c7096ed36..908407efc672 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -48,7 +48,7 @@ struct eeti_ts_priv {
48 struct input_dev *input; 48 struct input_dev *input;
49 struct work_struct work; 49 struct work_struct work;
50 struct mutex mutex; 50 struct mutex mutex;
51 int irq, irq_active_high; 51 int irq_gpio, irq, irq_active_high;
52}; 52};
53 53
54#define EETI_TS_BITDEPTH (11) 54#define EETI_TS_BITDEPTH (11)
@@ -62,7 +62,7 @@ struct eeti_ts_priv {
62 62
63static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv) 63static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)
64{ 64{
65 return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high; 65 return gpio_get_value(priv->irq_gpio) == priv->irq_active_high;
66} 66}
67 67
68static void eeti_ts_read(struct work_struct *work) 68static void eeti_ts_read(struct work_struct *work)
@@ -157,7 +157,7 @@ static void eeti_ts_close(struct input_dev *dev)
157static int __devinit eeti_ts_probe(struct i2c_client *client, 157static int __devinit eeti_ts_probe(struct i2c_client *client,
158 const struct i2c_device_id *idp) 158 const struct i2c_device_id *idp)
159{ 159{
160 struct eeti_ts_platform_data *pdata; 160 struct eeti_ts_platform_data *pdata = client->dev.platform_data;
161 struct eeti_ts_priv *priv; 161 struct eeti_ts_priv *priv;
162 struct input_dev *input; 162 struct input_dev *input;
163 unsigned int irq_flags; 163 unsigned int irq_flags;
@@ -199,9 +199,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
199 199
200 priv->client = client; 200 priv->client = client;
201 priv->input = input; 201 priv->input = input;
202 priv->irq = client->irq; 202 priv->irq_gpio = pdata->irq_gpio;
203 priv->irq = gpio_to_irq(pdata->irq_gpio);
203 204
204 pdata = client->dev.platform_data; 205 err = gpio_request_one(pdata->irq_gpio, GPIOF_IN, client->name);
206 if (err < 0)
207 goto err1;
205 208
206 if (pdata) 209 if (pdata)
207 priv->irq_active_high = pdata->irq_active_high; 210 priv->irq_active_high = pdata->irq_active_high;
@@ -215,13 +218,13 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
215 218
216 err = input_register_device(input); 219 err = input_register_device(input);
217 if (err) 220 if (err)
218 goto err1; 221 goto err2;
219 222
220 err = request_irq(priv->irq, eeti_ts_isr, irq_flags, 223 err = request_irq(priv->irq, eeti_ts_isr, irq_flags,
221 client->name, priv); 224 client->name, priv);
222 if (err) { 225 if (err) {
223 dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); 226 dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
224 goto err2; 227 goto err3;
225 } 228 }
226 229
227 /* 230 /*
@@ -233,9 +236,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
233 device_init_wakeup(&client->dev, 0); 236 device_init_wakeup(&client->dev, 0);
234 return 0; 237 return 0;
235 238
236err2: 239err3:
237 input_unregister_device(input); 240 input_unregister_device(input);
238 input = NULL; /* so we dont try to free it below */ 241 input = NULL; /* so we dont try to free it below */
242err2:
243 gpio_free(pdata->irq_gpio);
239err1: 244err1:
240 input_free_device(input); 245 input_free_device(input);
241 kfree(priv); 246 kfree(priv);
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c
index d9be6eac99b1..7f03d1bd916e 100644
--- a/drivers/input/touchscreen/jornada720_ts.c
+++ b/drivers/input/touchscreen/jornada720_ts.c
@@ -19,6 +19,7 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/io.h>
22 23
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <mach/jornada720.h> 25#include <mach/jornada720.h>