Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1186497
| From | Vignesh R <vigneshr@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt |
| Date | 2015-07-17 08:50 +0200 |
| Message-ID | <pN7D3-666-5@gated-at.bofh.it> (permalink) |
| References | <pN7D3-666-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On am437x-gp-evm, pixcir touchscreen can wake the system from low power
state by generating wake-up interrupt via pinctrl and IO daisy chain.
Add support for optional wakeup interrupt source by regsitering to
automated wake IRQ framework introduced by commit 4990d4fe327b ("PM /
Wakeirq: Add automated device wake IRQ handling").
This is similar in approach to commit 2a0b965cfb6e ("serial: omap: Add
support for optional wake-up")
Signed-off-by: Vignesh R <vigneshr@ti.com>
---
drivers/input/touchscreen/pixcir_i2c_ts.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index 8f3e243a62bf..f7c602027fbd 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -29,6 +29,8 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/of_device.h>
+#include <linux/of_irq.h>
+#include <linux/pm_wakeirq.h>
#define PIXCIR_MAX_SLOTS 5 /* Max fingers supported by driver */
@@ -38,6 +40,7 @@ struct pixcir_i2c_ts_data {
const struct pixcir_ts_platform_data *pdata;
bool running;
int max_fingers; /* Max fingers supported in this instance */
+ int wakeirq;
};
struct pixcir_touch {
@@ -564,11 +567,22 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client,
i2c_set_clientdata(client, tsdata);
device_init_wakeup(&client->dev, 1);
+ /* Register wakeirq, if available */
+ tsdata->wakeirq = of_irq_get(dev->of_node, 1);
+ if (tsdata->wakeirq) {
+ error = dev_pm_set_dedicated_wake_irq(dev,
+ tsdata->wakeirq);
+ if (error)
+ dev_dbg(dev, "unable to get wakeirq %d\n",
+ error);
+ }
+
return 0;
}
static int pixcir_i2c_ts_remove(struct i2c_client *client)
{
+ dev_pm_clear_wake_irq(&client->dev);
device_init_wakeup(&client->dev, 0);
return 0;
--
2.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] pixcir_i2c_ts: Add optional wakeup irq support Vignesh R <vigneshr@ti.com> - 2015-07-17 08:50 +0200
[PATCH 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt Vignesh R <vigneshr@ti.com> - 2015-07-17 08:50 +0200
Re: [PATCH 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-18 00:00 +0200
[PATCH 2/2] ARM: dts: am437x-gp-evm: Add wakeup interrupt source for pixcir_i2c_tsc Vignesh R <vigneshr@ti.com> - 2015-07-17 08:50 +0200
csiph-web