diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mcp-sa11x0.c | 20 | ||||
-rw-r--r-- | drivers/mfd/ucb1x00-ts.c | 43 |
2 files changed, 33 insertions, 30 deletions
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index e9806fbbe696..720e7a326308 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c | |||
@@ -219,26 +219,24 @@ static int mcp_sa11x0_remove(struct device *dev) | |||
219 | return 0; | 219 | return 0; |
220 | } | 220 | } |
221 | 221 | ||
222 | static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state, u32 level) | 222 | static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) |
223 | { | 223 | { |
224 | struct mcp *mcp = dev_get_drvdata(dev); | 224 | struct mcp *mcp = dev_get_drvdata(dev); |
225 | 225 | ||
226 | if (level == SUSPEND_DISABLE) { | 226 | priv(mcp)->mccr0 = Ser4MCCR0; |
227 | priv(mcp)->mccr0 = Ser4MCCR0; | 227 | priv(mcp)->mccr1 = Ser4MCCR1; |
228 | priv(mcp)->mccr1 = Ser4MCCR1; | 228 | Ser4MCCR0 &= ~MCCR0_MCE; |
229 | Ser4MCCR0 &= ~MCCR0_MCE; | 229 | |
230 | } | ||
231 | return 0; | 230 | return 0; |
232 | } | 231 | } |
233 | 232 | ||
234 | static int mcp_sa11x0_resume(struct device *dev, u32 level) | 233 | static int mcp_sa11x0_resume(struct device *dev) |
235 | { | 234 | { |
236 | struct mcp *mcp = dev_get_drvdata(dev); | 235 | struct mcp *mcp = dev_get_drvdata(dev); |
237 | 236 | ||
238 | if (level == RESUME_RESTORE_STATE) { | 237 | Ser4MCCR1 = priv(mcp)->mccr1; |
239 | Ser4MCCR1 = priv(mcp)->mccr1; | 238 | Ser4MCCR0 = priv(mcp)->mccr0; |
240 | Ser4MCCR0 = priv(mcp)->mccr0; | 239 | |
241 | } | ||
242 | return 0; | 240 | return 0; |
243 | } | 241 | } |
244 | 242 | ||
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index a260f83bcb02..585cded3d365 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | 41 | ||
42 | struct ucb1x00_ts { | 42 | struct ucb1x00_ts { |
43 | struct input_dev idev; | 43 | struct input_dev *idev; |
44 | struct ucb1x00 *ucb; | 44 | struct ucb1x00 *ucb; |
45 | 45 | ||
46 | wait_queue_head_t irq_wait; | 46 | wait_queue_head_t irq_wait; |
@@ -56,16 +56,16 @@ static int adcsync; | |||
56 | 56 | ||
57 | static inline void ucb1x00_ts_evt_add(struct ucb1x00_ts *ts, u16 pressure, u16 x, u16 y) | 57 | static inline void ucb1x00_ts_evt_add(struct ucb1x00_ts *ts, u16 pressure, u16 x, u16 y) |
58 | { | 58 | { |
59 | input_report_abs(&ts->idev, ABS_X, x); | 59 | input_report_abs(ts->idev, ABS_X, x); |
60 | input_report_abs(&ts->idev, ABS_Y, y); | 60 | input_report_abs(ts->idev, ABS_Y, y); |
61 | input_report_abs(&ts->idev, ABS_PRESSURE, pressure); | 61 | input_report_abs(ts->idev, ABS_PRESSURE, pressure); |
62 | input_sync(&ts->idev); | 62 | input_sync(ts->idev); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline void ucb1x00_ts_event_release(struct ucb1x00_ts *ts) | 65 | static inline void ucb1x00_ts_event_release(struct ucb1x00_ts *ts) |
66 | { | 66 | { |
67 | input_report_abs(&ts->idev, ABS_PRESSURE, 0); | 67 | input_report_abs(ts->idev, ABS_PRESSURE, 0); |
68 | input_sync(&ts->idev); | 68 | input_sync(ts->idev); |
69 | } | 69 | } |
70 | 70 | ||
71 | /* | 71 | /* |
@@ -341,26 +341,30 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) | |||
341 | { | 341 | { |
342 | struct ucb1x00_ts *ts; | 342 | struct ucb1x00_ts *ts; |
343 | 343 | ||
344 | ts = kmalloc(sizeof(struct ucb1x00_ts), GFP_KERNEL); | 344 | ts = kzalloc(sizeof(struct ucb1x00_ts), GFP_KERNEL); |
345 | if (!ts) | 345 | if (!ts) |
346 | return -ENOMEM; | 346 | return -ENOMEM; |
347 | 347 | ||
348 | memset(ts, 0, sizeof(struct ucb1x00_ts)); | 348 | ts->idev = input_allocate_device(); |
349 | if (!ts->idev) { | ||
350 | kfree(ts); | ||
351 | return -ENOMEM; | ||
352 | } | ||
349 | 353 | ||
350 | ts->ucb = dev->ucb; | 354 | ts->ucb = dev->ucb; |
351 | ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC; | 355 | ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC; |
352 | 356 | ||
353 | ts->idev.name = "Touchscreen panel"; | 357 | ts->idev->name = "Touchscreen panel"; |
354 | ts->idev.id.product = ts->ucb->id; | 358 | ts->idev->id.product = ts->ucb->id; |
355 | ts->idev.open = ucb1x00_ts_open; | 359 | ts->idev->open = ucb1x00_ts_open; |
356 | ts->idev.close = ucb1x00_ts_close; | 360 | ts->idev->close = ucb1x00_ts_close; |
357 | 361 | ||
358 | __set_bit(EV_ABS, ts->idev.evbit); | 362 | __set_bit(EV_ABS, ts->idev->evbit); |
359 | __set_bit(ABS_X, ts->idev.absbit); | 363 | __set_bit(ABS_X, ts->idev->absbit); |
360 | __set_bit(ABS_Y, ts->idev.absbit); | 364 | __set_bit(ABS_Y, ts->idev->absbit); |
361 | __set_bit(ABS_PRESSURE, ts->idev.absbit); | 365 | __set_bit(ABS_PRESSURE, ts->idev->absbit); |
362 | 366 | ||
363 | input_register_device(&ts->idev); | 367 | input_register_device(ts->idev); |
364 | 368 | ||
365 | dev->priv = ts; | 369 | dev->priv = ts; |
366 | 370 | ||
@@ -370,7 +374,8 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) | |||
370 | static void ucb1x00_ts_remove(struct ucb1x00_dev *dev) | 374 | static void ucb1x00_ts_remove(struct ucb1x00_dev *dev) |
371 | { | 375 | { |
372 | struct ucb1x00_ts *ts = dev->priv; | 376 | struct ucb1x00_ts *ts = dev->priv; |
373 | input_unregister_device(&ts->idev); | 377 | |
378 | input_unregister_device(ts->idev); | ||
374 | kfree(ts); | 379 | kfree(ts); |
375 | } | 380 | } |
376 | 381 | ||