aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/sh_keysc.c17
-rw-r--r--drivers/input/touchscreen/migor_ts.c23
2 files changed, 39 insertions, 1 deletions
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index e1480fb11de3..cea70e6a1031 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -259,12 +259,15 @@ static int sh_keysc_suspend(struct device *dev)
259{ 259{
260 struct platform_device *pdev = to_platform_device(dev); 260 struct platform_device *pdev = to_platform_device(dev);
261 struct sh_keysc_priv *priv = platform_get_drvdata(pdev); 261 struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
262 int irq = platform_get_irq(pdev, 0);
262 unsigned short value; 263 unsigned short value;
263 264
264 value = ioread16(priv->iomem_base + KYCR1_OFFS); 265 value = ioread16(priv->iomem_base + KYCR1_OFFS);
265 266
266 if (device_may_wakeup(dev)) 267 if (device_may_wakeup(dev)) {
267 value |= 0x80; 268 value |= 0x80;
269 enable_irq_wake(irq);
270 }
268 else 271 else
269 value &= ~0x80; 272 value &= ~0x80;
270 273
@@ -272,8 +275,20 @@ static int sh_keysc_suspend(struct device *dev)
272 return 0; 275 return 0;
273} 276}
274 277
278static int sh_keysc_resume(struct device *dev)
279{
280 struct platform_device *pdev = to_platform_device(dev);
281 int irq = platform_get_irq(pdev, 0);
282
283 if (device_may_wakeup(dev))
284 disable_irq_wake(irq);
285
286 return 0;
287}
288
275static struct dev_pm_ops sh_keysc_dev_pm_ops = { 289static struct dev_pm_ops sh_keysc_dev_pm_ops = {
276 .suspend = sh_keysc_suspend, 290 .suspend = sh_keysc_suspend,
291 .resume = sh_keysc_resume,
277}; 292};
278 293
279struct platform_driver sh_keysc_device_driver = { 294struct platform_driver sh_keysc_device_driver = {
diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c
index 504ca11749a1..141dd584330e 100644
--- a/drivers/input/touchscreen/migor_ts.c
+++ b/drivers/input/touchscreen/migor_ts.c
@@ -198,6 +198,7 @@ static int migor_ts_probe(struct i2c_client *client,
198 goto err2; 198 goto err2;
199 } 199 }
200 200
201 device_init_wakeup(&client->dev, 1);
201 return 0; 202 return 0;
202 203
203 err2: 204 err2:
@@ -224,6 +225,26 @@ static int migor_ts_remove(struct i2c_client *client)
224 return 0; 225 return 0;
225} 226}
226 227
228static int migor_ts_suspend(struct i2c_client *client, pm_message_t mesg)
229{
230 struct migor_ts_priv *priv = dev_get_drvdata(&client->dev);
231
232 if (device_may_wakeup(&client->dev))
233 enable_irq_wake(priv->irq);
234
235 return 0;
236}
237
238static int migor_ts_resume(struct i2c_client *client)
239{
240 struct migor_ts_priv *priv = dev_get_drvdata(&client->dev);
241
242 if (device_may_wakeup(&client->dev))
243 disable_irq_wake(priv->irq);
244
245 return 0;
246}
247
227static const struct i2c_device_id migor_ts_id[] = { 248static const struct i2c_device_id migor_ts_id[] = {
228 { "migor_ts", 0 }, 249 { "migor_ts", 0 },
229 { } 250 { }
@@ -236,6 +257,8 @@ static struct i2c_driver migor_ts_driver = {
236 }, 257 },
237 .probe = migor_ts_probe, 258 .probe = migor_ts_probe,
238 .remove = migor_ts_remove, 259 .remove = migor_ts_remove,
260 .suspend = migor_ts_suspend,
261 .resume = migor_ts_resume,
239 .id_table = migor_ts_id, 262 .id_table = migor_ts_id,
240}; 263};
241 264