diff options
author | Gerd Knorr <devnull@localhost> | 2004-10-08 11:22:20 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-10-08 11:22:20 +0000 |
commit | afef69a0081705ef086e54df10c1c53a71c6c07a (patch) | |
tree | 12d6c6ab76070144d677dab722894cb5b14e1a59 /linux/drivers/media/video/msp3400-driver.c | |
parent | 36d7a68a17217bd017be81955f43720248319058 (diff) | |
download | mediapointer-dvb-s2-afef69a0081705ef086e54df10c1c53a71c6c07a.tar.gz mediapointer-dvb-s2-afef69a0081705ef086e54df10c1c53a71c6c07a.tar.bz2 |
- add suspend support for some i2c modules.
Diffstat (limited to 'linux/drivers/media/video/msp3400-driver.c')
-rw-r--r-- | linux/drivers/media/video/msp3400-driver.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index c97b899ba..2527681bc 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -48,6 +48,7 @@ #include <linux/init.h> #include <linux/smp_lock.h> #include <linux/kthread.h> +#include <linux/suspend.h> #include <asm/semaphore.h> #include <asm/pgtable.h> @@ -756,6 +757,8 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) #endif } } + if (current->flags & PF_FREEZE) + refrigerator(PF_FREEZE); remove_wait_queue(&msp->wq, &wait); return msp->restart; } @@ -1421,6 +1424,9 @@ static int msp_detach(struct i2c_client *client); static int msp_probe(struct i2c_adapter *adap); static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); +static int msp_suspend(struct device * dev, u32 state, u32 level); +static int msp_resume(struct device * dev, u32 level); + static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c msp3400 driver", @@ -1429,6 +1435,10 @@ static struct i2c_driver driver = { .attach_adapter = msp_probe, .detach_client = msp_detach, .command = msp_command, + .driver { + .suspend = msp_suspend, + .resume = msp_resume, + }, }; static struct i2c_client client_template = @@ -1817,6 +1827,24 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) return 0; } +static int msp_suspend(struct device * dev, u32 state, u32 level) +{ + struct i2c_client *c = container_of(dev, struct i2c_client, dev); + + dprintk("msp34xx: suspend\n"); + msp3400c_reset(c); + return 0; +} + +static int msp_resume(struct device * dev, u32 level) +{ + struct i2c_client *c = container_of(dev, struct i2c_client, dev); + + dprintk("msp34xx: resume\n"); + msp_wake_thread(c); + return 0; +} + /* ----------------------------------------------------------------------- */ static int __init msp3400_init_module(void) |