summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-03-12 23:20:15 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2007-03-12 23:20:15 +0100
commit8a7a0ee25a1986aafc124cb0b77f61b219f4d505 (patch)
tree27271a865f8ea0838a7df086c62b04b672305583
parent47d4a8221878fed035681e7c31de36f9ae2764d5 (diff)
downloadmediapointer-dvb-s2-8a7a0ee25a1986aafc124cb0b77f61b219f4d505.tar.gz
mediapointer-dvb-s2-8a7a0ee25a1986aafc124cb0b77f61b219f4d505.tar.bz2
Fix suspend/resume in msp3400 and tuner
From: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r--linux/drivers/media/video/msp3400-driver.c18
-rw-r--r--linux/drivers/media/video/tuner-core.c18
2 files changed, 36 insertions, 0 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 66002ed1b..d6364b01f 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -829,7 +829,11 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+static int msp_suspend(struct i2c_client *client, pm_message_t state)
+#else
static int msp_suspend(struct device * dev, pm_message_t state)
+#endif
#else
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
static int msp_suspend(struct device * dev, pm_message_t state, u32 level)
@@ -838,7 +842,9 @@ static int msp_suspend(struct device * dev, u32 state, u32 level)
#endif
#endif
{
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+#endif
v4l_dbg(1, msp_debug, client, "suspend\n");
msp_reset(client);
@@ -846,12 +852,18 @@ static int msp_suspend(struct device * dev, u32 state, u32 level)
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+static int msp_resume(struct i2c_client *client)
+#else
static int msp_resume(struct device * dev)
+#endif
#else
static int msp_resume(struct device * dev, u32 level)
#endif
{
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+#endif
v4l_dbg(1, msp_debug, client, "resume\n");
msp_wake_thread(client);
@@ -1110,14 +1122,20 @@ static struct i2c_driver i2c_driver = {
.id = I2C_DRIVERID_MSP3400,
.attach_adapter = msp_probe,
.detach_client = msp_detach,
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+ .suspend = msp_suspend,
+ .resume = msp_resume,
+#endif
.command = msp_command,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.driver = {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
.name = "msp3400",
#endif
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
.suspend = msp_suspend,
.resume = msp_resume,
+#endif
},
#endif
};
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 02fb067e2..e7bc60a5e 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -903,7 +903,11 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+static int tuner_suspend(struct i2c_client *c, pm_message_t state)
+#else
static int tuner_suspend(struct device *dev, pm_message_t state)
+#endif
#else
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
static int tuner_suspend(struct device *dev, pm_message_t state, u32 level)
@@ -912,7 +916,9 @@ static int tuner_suspend(struct device *dev, u32 state, u32 level)
#endif
#endif
{
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
struct i2c_client *c = container_of (dev, struct i2c_client, dev);
+#endif
struct tuner *t = i2c_get_clientdata (c);
tuner_dbg ("suspend\n");
@@ -921,12 +927,18 @@ static int tuner_suspend(struct device *dev, u32 state, u32 level)
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+static int tuner_resume(struct i2c_client *c)
+#else
static int tuner_resume(struct device *dev)
+#endif
#else
static int tuner_resume(struct device *dev, u32 level)
#endif
{
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
struct i2c_client *c = container_of (dev, struct i2c_client, dev);
+#endif
struct tuner *t = i2c_get_clientdata (c);
tuner_dbg ("resume\n");
@@ -955,13 +967,19 @@ static struct i2c_driver driver = {
.attach_adapter = tuner_probe,
.detach_client = tuner_detach,
.command = tuner_command,
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+ .suspend = tuner_suspend,
+ .resume = tuner_resume,
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
.driver = {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
.name = "tuner",
#endif
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
.suspend = tuner_suspend,
.resume = tuner_resume,
+#endif
},
#endif
};