diff options
-rw-r--r-- | drivers/input/touchscreen/pcap7200_ts.c | 12 | ||||
-rw-r--r-- | include/linux/pcap7200.h | 5 |
2 files changed, 16 insertions, 1 deletions
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 */ |