diff options
Diffstat (limited to 'drivers/input/serio/at32psif.c')
-rw-r--r-- | drivers/input/serio/at32psif.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 95280f9207e1..36e799c31f5e 100644 --- a/drivers/input/serio/at32psif.c +++ b/drivers/input/serio/at32psif.c | |||
@@ -98,9 +98,9 @@ struct psif { | |||
98 | struct serio *io; | 98 | struct serio *io; |
99 | void __iomem *regs; | 99 | void __iomem *regs; |
100 | unsigned int irq; | 100 | unsigned int irq; |
101 | unsigned int open; | ||
102 | /* Prevent concurrent writes to PSIF THR. */ | 101 | /* Prevent concurrent writes to PSIF THR. */ |
103 | spinlock_t lock; | 102 | spinlock_t lock; |
103 | bool open; | ||
104 | }; | 104 | }; |
105 | 105 | ||
106 | static irqreturn_t psif_interrupt(int irq, void *_ptr) | 106 | static irqreturn_t psif_interrupt(int irq, void *_ptr) |
@@ -164,7 +164,7 @@ static int psif_open(struct serio *io) | |||
164 | psif_writel(psif, CR, PSIF_BIT(CR_TXEN) | PSIF_BIT(CR_RXEN)); | 164 | psif_writel(psif, CR, PSIF_BIT(CR_TXEN) | PSIF_BIT(CR_RXEN)); |
165 | psif_writel(psif, IER, PSIF_BIT(RXRDY)); | 165 | psif_writel(psif, IER, PSIF_BIT(RXRDY)); |
166 | 166 | ||
167 | psif->open = 1; | 167 | psif->open = true; |
168 | out: | 168 | out: |
169 | return retval; | 169 | return retval; |
170 | } | 170 | } |
@@ -173,7 +173,7 @@ static void psif_close(struct serio *io) | |||
173 | { | 173 | { |
174 | struct psif *psif = io->port_data; | 174 | struct psif *psif = io->port_data; |
175 | 175 | ||
176 | psif->open = 0; | 176 | psif->open = false; |
177 | 177 | ||
178 | psif_writel(psif, IDR, ~0UL); | 178 | psif_writel(psif, IDR, ~0UL); |
179 | psif_writel(psif, CR, PSIF_BIT(CR_TXDIS) | PSIF_BIT(CR_RXDIS)); | 179 | psif_writel(psif, CR, PSIF_BIT(CR_TXDIS) | PSIF_BIT(CR_RXDIS)); |
@@ -319,9 +319,10 @@ static int __exit psif_remove(struct platform_device *pdev) | |||
319 | return 0; | 319 | return 0; |
320 | } | 320 | } |
321 | 321 | ||
322 | #ifdef CONFIG_PM | 322 | #ifdef CONFIG_PM_SLEEP |
323 | static int psif_suspend(struct platform_device *pdev, pm_message_t state) | 323 | static int psif_suspend(struct device *dev) |
324 | { | 324 | { |
325 | struct platform_device *pdev = to_platform_device(dev); | ||
325 | struct psif *psif = platform_get_drvdata(pdev); | 326 | struct psif *psif = platform_get_drvdata(pdev); |
326 | 327 | ||
327 | if (psif->open) { | 328 | if (psif->open) { |
@@ -332,8 +333,9 @@ static int psif_suspend(struct platform_device *pdev, pm_message_t state) | |||
332 | return 0; | 333 | return 0; |
333 | } | 334 | } |
334 | 335 | ||
335 | static int psif_resume(struct platform_device *pdev) | 336 | static int psif_resume(struct device *dev) |
336 | { | 337 | { |
338 | struct platform_device *pdev = to_platform_device(dev); | ||
337 | struct psif *psif = platform_get_drvdata(pdev); | 339 | struct psif *psif = platform_get_drvdata(pdev); |
338 | 340 | ||
339 | if (psif->open) { | 341 | if (psif->open) { |
@@ -344,19 +346,17 @@ static int psif_resume(struct platform_device *pdev) | |||
344 | 346 | ||
345 | return 0; | 347 | return 0; |
346 | } | 348 | } |
347 | #else | ||
348 | #define psif_suspend NULL | ||
349 | #define psif_resume NULL | ||
350 | #endif | 349 | #endif |
351 | 350 | ||
351 | static SIMPLE_DEV_PM_OPS(psif_pm_ops, psif_suspend, psif_resume); | ||
352 | |||
352 | static struct platform_driver psif_driver = { | 353 | static struct platform_driver psif_driver = { |
353 | .remove = __exit_p(psif_remove), | 354 | .remove = __exit_p(psif_remove), |
354 | .driver = { | 355 | .driver = { |
355 | .name = "atmel_psif", | 356 | .name = "atmel_psif", |
356 | .owner = THIS_MODULE, | 357 | .owner = THIS_MODULE, |
358 | .pm = &psif_pm_ops, | ||
357 | }, | 359 | }, |
358 | .suspend = psif_suspend, | ||
359 | .resume = psif_resume, | ||
360 | }; | 360 | }; |
361 | 361 | ||
362 | static int __init psif_init(void) | 362 | static int __init psif_init(void) |