Commit 8dd93eeee873d2383dbca4cca1983b6731efdb75

Authored by Uwe Kleine-König
Committed by Samuel Ortiz
1 parent fec316d632

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>

Showing 1 changed file with 17 additions and 17 deletions Side-by-side Diff

drivers/input/touchscreen/mc13783_ts.c
... ... @@ -35,7 +35,7 @@
35 35  
36 36 struct mc13783_ts_priv {
37 37 struct input_dev *idev;
38   - struct mc13783 *mc13783;
  38 + struct mc13xxx *mc13xxx;
39 39 struct delayed_work work;
40 40 struct workqueue_struct *workq;
41 41 unsigned int sample[4];
... ... @@ -45,7 +45,7 @@
45 45 {
46 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 51 * Kick off reading coordinates. Note that if work happens already
52 52  
... ... @@ -121,10 +121,10 @@
121 121 {
122 122 struct mc13783_ts_priv *priv =
123 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 125 unsigned int channel = 12;
126 126  
127   - if (mc13783_adc_do_conversion(priv->mc13783,
  127 + if (mc13xxx_adc_do_conversion(priv->mc13xxx,
128 128 mode, channel, priv->sample) == 0)
129 129 mc13783_ts_report_sample(priv);
130 130 }
131 131  
132 132  
133 133  
134 134  
135 135  
... ... @@ -134,21 +134,21 @@
134 134 struct mc13783_ts_priv *priv = input_get_drvdata(dev);
135 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 142 mc13783_ts_handler, MC13783_TS_NAME, priv);
143 143 if (ret)
144 144 goto out;
145 145  
146   - ret = mc13783_reg_rmw(priv->mc13783, MC13783_ADC0,
147   - MC13783_ADC0_TSMOD_MASK, MC13783_ADC0_TSMOD0);
  146 + ret = mc13xxx_reg_rmw(priv->mc13xxx, MC13XXX_ADC0,
  147 + MC13XXX_ADC0_TSMOD_MASK, MC13XXX_ADC0_TSMOD0);
148 148 if (ret)
149   - mc13783_irq_free(priv->mc13783, MC13783_IRQ_TS, priv);
  149 + mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_TS, priv);
150 150 out:
151   - mc13783_unlock(priv->mc13783);
  151 + mc13xxx_unlock(priv->mc13xxx);
152 152 return ret;
153 153 }
154 154  
... ... @@ -156,11 +156,11 @@
156 156 {
157 157 struct mc13783_ts_priv *priv = input_get_drvdata(dev);
158 158  
159   - mc13783_lock(priv->mc13783);
160   - mc13783_reg_rmw(priv->mc13783, MC13783_ADC0,
161   - MC13783_ADC0_TSMOD_MASK, 0);
162   - mc13783_irq_free(priv->mc13783, MC13783_IRQ_TS, priv);
163   - mc13783_unlock(priv->mc13783);
  159 + mc13xxx_lock(priv->mc13xxx);
  160 + mc13xxx_reg_rmw(priv->mc13xxx, MC13XXX_ADC0,
  161 + MC13XXX_ADC0_TSMOD_MASK, 0);
  162 + mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_TS, priv);
  163 + mc13xxx_unlock(priv->mc13xxx);
164 164  
165 165 cancel_delayed_work_sync(&priv->work);
166 166 }
... ... @@ -177,7 +177,7 @@
177 177 goto err_free_mem;
178 178  
179 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 181 priv->idev = idev;
182 182  
183 183 /*