From 28e85f92ecc97b644f75edc5b4acf94a0c0aae2f Mon Sep 17 00:00:00 2001 From: Trilok Soni Date: Mon, 7 May 2007 21:21:15 +0530 Subject: [PATCH] SPI: TSC2046 Fix supend/resume functions - 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 Signed-off-by: Tony Lindgren --- drivers/input/touchscreen/tsc2046_ts.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/tsc2046_ts.c b/drivers/input/touchscreen/tsc2046_ts.c index a56ae5a891e..50c63832c73 100644 --- a/drivers/input/touchscreen/tsc2046_ts.c +++ b/drivers/input/touchscreen/tsc2046_ts.c @@ -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) -- 2.41.1