diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-03-13 13:49:04 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-03-13 13:49:04 -0300 |
commit | a73981e95b53d62cc7e42ce54e54473f3758d2e7 (patch) | |
tree | 94a39a23ddd291bb3ba1897bf72e69a532cff60e /linux/drivers/media/video/msp3400-driver.c | |
parent | ed98e2514b5928698127958acf047de216986cb9 (diff) | |
parent | 619f7ef871542e60ea54401cb52dda1b6679cfb9 (diff) | |
download | mediapointer-dvb-s2-a73981e95b53d62cc7e42ce54e54473f3758d2e7.tar.gz mediapointer-dvb-s2-a73981e95b53d62cc7e42ce54e54473f3758d2e7.tar.bz2 |
merge: http://linuxtv.org/hg/~mkrufky/m920x
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/msp3400-driver.c')
-rw-r--r-- | linux/drivers/media/video/msp3400-driver.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 0e21a5b57..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); @@ -894,7 +906,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) if (msp_reset(client) == -1) { v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); kfree(client); - return -1; + return 0; } state = kmalloc(sizeof(*state), GFP_KERNEL); @@ -928,7 +940,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); kfree(state); kfree(client); - return -1; + return 0; } #if 0 @@ -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 }; |