]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
SPI: TSC2046 Fix supend/resume functions
authorTrilok Soni <soni.trilok@gmail.com>
Mon, 7 May 2007 15:51:15 +0000 (21:21 +0530)
committerTony Lindgren <tony@atomide.com>
Tue, 8 May 2007 00:18:07 +0000 (17:18 -0700)
- Add suspend, resume function to tsc2046 device driver.
- Change tsc2046_suspend/resume function accoradingly,
  as tsc2046 is TS only device not like TSC2301.

Signed-off-by: Trilok Soni <soni.trilok@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/input/touchscreen/tsc2046_ts.c

index a56ae5a891e7f75a2b9a56695fef4485ab0c38c0..50c63832c7305af06f2042b9fd226c572c7e7640 100644 (file)
@@ -254,8 +254,9 @@ static void tsc2046_ts_enable(struct tsc2046 *tsc)
 }
 
 #ifdef CONFIG_PM
-int tsc2046_ts_suspend(struct tsc2046 *tsc)
+static int tsc2046_suspend(struct spi_device *spi, pm_message_t mesg)
 {
+       struct tsc2046 *tsc = dev_get_drvdata(&spi->dev);
        struct tsc2046_ts *ts = tsc->ts;
 
        spin_lock_irq(&ts->lock);
@@ -265,13 +266,16 @@ int tsc2046_ts_suspend(struct tsc2046 *tsc)
        return 0;
 }
 
-void tsc2046_ts_resume(struct tsc2046 *tsc)
+static int tsc2046_resume(struct spi_device *spi)
 {
+       struct tsc2046 *tsc = dev_get_drvdata(&spi->dev);
        struct tsc2046_ts *ts = tsc->ts;
 
        spin_lock_irq(&ts->lock);
        tsc2046_ts_enable(tsc);
        spin_unlock_irq(&ts->lock);
+
+       return 0;
 }
 #endif
 
@@ -535,6 +539,10 @@ static struct spi_driver tsc2046_driver = {
        },
        .probe = tsc2046_probe,
        .remove = __devexit_p(tsc2046_remove),
+#ifdef CONFIG_PM
+       .suspend = tsc2046_suspend,
+       .resume = tsc2046_resume,
+#endif
 };
 
 static int __init tsc2046_init(void)