diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-08-24 09:28:22 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-24 08:09:12 -0400 |
commit | 8dd93eeee873d2383dbca4cca1983b6731efdb75 (patch) | |
tree | 2f08b5b8a0068a831cef3c3c7079017361e3283a /drivers/input/touchscreen | |
parent | fec316d63219f610e5385f5e54e6c3ea459e58e9 (diff) |
input: Convert mc13783-ts to mc13xxx API
This is the first step to also support the touch interface of the mc13892
pmic chip.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/mc13783_ts.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index c5bc62d85bb6..ede02743eac1 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c | |||
@@ -35,7 +35,7 @@ MODULE_PARM_DESC(sample_tolerance, | |||
35 | 35 | ||
36 | struct mc13783_ts_priv { | 36 | struct mc13783_ts_priv { |
37 | struct input_dev *idev; | 37 | struct input_dev *idev; |
38 | struct mc13783 *mc13783; | 38 | struct mc13xxx *mc13xxx; |
39 | struct delayed_work work; | 39 | struct delayed_work work; |
40 | struct workqueue_struct *workq; | 40 | struct workqueue_struct *workq; |
41 | unsigned int sample[4]; | 41 | unsigned int sample[4]; |
@@ -45,7 +45,7 @@ static irqreturn_t mc13783_ts_handler(int irq, void *data) | |||
45 | { | 45 | { |
46 | struct mc13783_ts_priv *priv = data; | 46 | struct mc13783_ts_priv *priv = data; |
47 | 47 | ||
48 | mc13783_irq_ack(priv->mc13783, irq); | 48 | mc13xxx_irq_ack(priv->mc13xxx, irq); |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * Kick off reading coordinates. Note that if work happens already | 51 | * Kick off reading coordinates. Note that if work happens already |
@@ -121,10 +121,10 @@ static void mc13783_ts_work(struct work_struct *work) | |||
121 | { | 121 | { |
122 | struct mc13783_ts_priv *priv = | 122 | struct mc13783_ts_priv *priv = |
123 | container_of(work, struct mc13783_ts_priv, work.work); | 123 | container_of(work, struct mc13783_ts_priv, work.work); |
124 | unsigned int mode = MC13783_ADC_MODE_TS; | 124 | unsigned int mode = MC13XXX_ADC_MODE_TS; |
125 | unsigned int channel = 12; | 125 | unsigned int channel = 12; |
126 | 126 | ||
127 | if (mc13783_adc_do_conversion(priv->mc13783, | 127 | if (mc13xxx_adc_do_conversion(priv->mc13xxx, |
128 | mode, channel, priv->sample) == 0) | 128 | mode, channel, priv->sample) == 0) |
129 | mc13783_ts_report_sample(priv); | 129 | mc13783_ts_report_sample(priv); |
130 | } | 130 | } |
@@ -134,21 +134,21 @@ static int mc13783_ts_open(struct input_dev *dev) | |||
134 | struct mc13783_ts_priv *priv = input_get_drvdata(dev); | 134 | struct mc13783_ts_priv *priv = input_get_drvdata(dev); |
135 | int ret; | 135 | int ret; |
136 | 136 | ||
137 | mc13783_lock(priv->mc13783); | 137 | mc13xxx_lock(priv->mc13xxx); |
138 | 138 | ||
139 | mc13783_irq_ack(priv->mc13783, MC13783_IRQ_TS); | 139 | mc13xxx_irq_ack(priv->mc13xxx, MC13XXX_IRQ_TS); |
140 | 140 | ||
141 | ret = mc13783_irq_request(priv->mc13783, MC13783_IRQ_TS, | 141 | ret = mc13xxx_irq_request(priv->mc13xxx, MC13XXX_IRQ_TS, |
142 | mc13783_ts_handler, MC13783_TS_NAME, priv); | 142 | mc13783_ts_handler, MC13783_TS_NAME, priv); |
143 | if (ret) | 143 | if (ret) |
144 | goto out; | 144 | goto out; |
145 | 145 | ||
146 | ret = mc13783_reg_rmw(priv->mc13783, MC13783_ADC0, | 146 | ret = mc13xxx_reg_rmw(priv->mc13xxx, MC13XXX_ADC0, |
147 | MC13783_ADC0_TSMOD_MASK, MC13783_ADC0_TSMOD0); | 147 | MC13XXX_ADC0_TSMOD_MASK, MC13XXX_ADC0_TSMOD0); |
148 | if (ret) | 148 | if (ret) |
149 | mc13783_irq_free(priv->mc13783, MC13783_IRQ_TS, priv); | 149 | mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_TS, priv); |
150 | out: | 150 | out: |
151 | mc13783_unlock(priv->mc13783); | 151 | mc13xxx_unlock(priv->mc13xxx); |
152 | return ret; | 152 | return ret; |
153 | } | 153 | } |
154 | 154 | ||
@@ -156,11 +156,11 @@ static void mc13783_ts_close(struct input_dev *dev) | |||
156 | { | 156 | { |
157 | struct mc13783_ts_priv *priv = input_get_drvdata(dev); | 157 | struct mc13783_ts_priv *priv = input_get_drvdata(dev); |
158 | 158 | ||
159 | mc13783_lock(priv->mc13783); | 159 | mc13xxx_lock(priv->mc13xxx); |
160 | mc13783_reg_rmw(priv->mc13783, MC13783_ADC0, | 160 | mc13xxx_reg_rmw(priv->mc13xxx, MC13XXX_ADC0, |
161 | MC13783_ADC0_TSMOD_MASK, 0); | 161 | MC13XXX_ADC0_TSMOD_MASK, 0); |
162 | mc13783_irq_free(priv->mc13783, MC13783_IRQ_TS, priv); | 162 | mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_TS, priv); |
163 | mc13783_unlock(priv->mc13783); | 163 | mc13xxx_unlock(priv->mc13xxx); |
164 | 164 | ||
165 | cancel_delayed_work_sync(&priv->work); | 165 | cancel_delayed_work_sync(&priv->work); |
166 | } | 166 | } |
@@ -177,7 +177,7 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) | |||
177 | goto err_free_mem; | 177 | goto err_free_mem; |
178 | 178 | ||
179 | INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); | 179 | INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); |
180 | priv->mc13783 = dev_get_drvdata(pdev->dev.parent); | 180 | priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); |
181 | priv->idev = idev; | 181 | priv->idev = idev; |
182 | 182 | ||
183 | /* | 183 | /* |