diff options
author | Matt Hsu <matt_hsu@openmoko.org> | 2009-02-09 13:03:25 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-02-09 13:03:25 +0000 |
commit | fc193b9ce4fac373a7c7fa55e5bec8d67e4424fe (patch) | |
tree | 0745860553462e04d26b88d58bebcafa334c4c61 /drivers/input | |
parent | 498d0953423a504cd24d11a0307e0ec01b81b68d (diff) |
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 <matt_hsu@openmoko.org>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/pcap7200_ts.c | 12 |
1 files changed, 11 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) { |