From fc193b9ce4fac373a7c7fa55e5bec8d67e4424fe Mon Sep 17 00:00:00 2001 From: Matt Hsu Date: Mon, 9 Feb 2009 13:03:25 +0000 Subject: Add platform data of pcap7200 touch panel device. The following two features are added as platform data. - externel reset - operating mode Signed-off-by: Matt Hsu --- drivers/input/touchscreen/pcap7200_ts.c | 12 +++++++++++- include/linux/pcap7200.h | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/pcap7200_ts.c b/drivers/input/touchscreen/pcap7200_ts.c index 730ee32138e..70f7d8935d9 100644 --- a/drivers/input/touchscreen/pcap7200_ts.c +++ b/drivers/input/touchscreen/pcap7200_ts.c @@ -161,8 +161,9 @@ pcap7200_probe(struct i2c_client *client, const struct i2c_device_id *ids) struct pcap7200_data *pcap; struct input_dev *input_dev; int err; + struct pcap7200_platform_data *pdata = client->dev.platform_data; - /* allocat pcap7200 data */ + /* allocate pcap7200 data */ pcap = kzalloc(sizeof(struct pcap7200_data), GFP_KERNEL); if (!pcap) return -ENOMEM; @@ -172,6 +173,15 @@ pcap7200_probe(struct i2c_client *client, const struct i2c_device_id *ids) mutex_init(&pcap->lock); + /* reset */ + if (pdata->reset) { + pdata->reset(); + dev_dbg(&client->dev, "hard reset\n"); + } + + /* operating mode */ + __set_op_mode(pcap, pdata->mode); + /* initialize input device */ input_dev = input_allocate_device(); if (!input_dev) { diff --git a/include/linux/pcap7200.h b/include/linux/pcap7200.h index f52ba15c556..0fafb863e6b 100644 --- a/include/linux/pcap7200.h +++ b/include/linux/pcap7200.h @@ -17,4 +17,9 @@ enum gesture { SND_SLIDE, }; +struct pcap7200_platform_data { + enum op_mode mode; + void (*reset)(void); +}; + #endif /* _LINUX_PCPA7200_H */ -- cgit v1.2.3