aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/corgi_ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/corgi_ts.c')
-rw-r--r--drivers/input/touchscreen/corgi_ts.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
index 40ae183ba1c..0ba3e6562bf 100644
--- a/drivers/input/touchscreen/corgi_ts.c
+++ b/drivers/input/touchscreen/corgi_ts.c
@@ -231,34 +231,32 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs)
231} 231}
232 232
233#ifdef CONFIG_PM 233#ifdef CONFIG_PM
234static int corgits_suspend(struct device *dev, pm_message_t state, uint32_t level) 234static int corgits_suspend(struct device *dev, pm_message_t state)
235{ 235{
236 if (level == SUSPEND_POWER_DOWN) { 236 struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
237 struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
238
239 if (corgi_ts->pendown) {
240 del_timer_sync(&corgi_ts->timer);
241 corgi_ts->tc.pressure = 0;
242 new_data(corgi_ts, NULL);
243 corgi_ts->pendown = 0;
244 }
245 corgi_ts->power_mode = PWR_MODE_SUSPEND;
246 237
247 corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS); 238 if (corgi_ts->pendown) {
239 del_timer_sync(&corgi_ts->timer);
240 corgi_ts->tc.pressure = 0;
241 new_data(corgi_ts, NULL);
242 corgi_ts->pendown = 0;
248 } 243 }
244 corgi_ts->power_mode = PWR_MODE_SUSPEND;
245
246 corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
247
249 return 0; 248 return 0;
250} 249}
251 250
252static int corgits_resume(struct device *dev, uint32_t level) 251static int corgits_resume(struct device *dev)
253{ 252{
254 if (level == RESUME_POWER_ON) { 253 struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
255 struct corgi_ts *corgi_ts = dev_get_drvdata(dev); 254
255 corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
256 /* Enable Falling Edge */
257 set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
258 corgi_ts->power_mode = PWR_MODE_ACTIVE;
256 259
257 corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
258 /* Enable Falling Edge */
259 set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
260 corgi_ts->power_mode = PWR_MODE_ACTIVE;
261 }
262 return 0; 260 return 0;
263} 261}
264#else 262#else