diff options
Diffstat (limited to 'linux/drivers/media/video')
30 files changed, 273 insertions, 114 deletions
diff --git a/linux/drivers/media/video/bttv-cards.c b/linux/drivers/media/video/bttv-cards.c index 5a0b52e8f..71dab01ac 100644 --- a/linux/drivers/media/video/bttv-cards.c +++ b/linux/drivers/media/video/bttv-cards.c @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.89 2005/10/06 03:09:59 mkrufky Exp $ + $Id: bttv-cards.c,v 1.90 2005/10/09 18:07:06 mchehab Exp $ bttv-cards.c @@ -125,7 +125,14 @@ module_param(gpiomask, int, 0444); module_param(audioall, int, 0444); module_param(autoload, int, 0444); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(card,"1-" __stringify(BTTV_MAX) "i"); +MODULE_PARM(pll,"1-" __stringify(BTTV_MAX) "i"); +MODULE_PARM(tuner,"1-" __stringify(BTTV_MAX) "i"); +MODULE_PARM(svhs,"1-" __stringify(BTTV_MAX) "i"); +MODULE_PARM(remote,"1-" __stringify(BTTV_MAX) "i"); +MODULE_PARM(audiomux,"1-" __stringify(BTTV_MAX) "i"); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int dummy; module_param_array(card, int, dummy, 0444); module_param_array(pll, int, dummy, 0444); diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c index 92c1ca0b8..fc3cfe53b 100644 --- a/linux/drivers/media/video/bttv-driver.c +++ b/linux/drivers/media/video/bttv-driver.c @@ -1,5 +1,5 @@ /* - $Id: bttv-driver.c,v 1.60 2005/09/29 20:09:24 mchehab Exp $ + $Id: bttv-driver.c,v 1.61 2005/10/09 18:07:06 mchehab Exp $ bttv - Bt848 frame grabber driver @@ -35,13 +35,14 @@ #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/kdev_t.h> +#include "bttvp.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #include <linux/dma-mapping.h> -#include "compat.h" +#endif #include <asm/io.h> #include <asm/byteorder.h> -#include "bttvp.h" #include "rds.h" @@ -119,7 +120,9 @@ module_param(uv_ratio, int, 0444); module_param(full_luma_range, int, 0444); module_param(coring, int, 0444); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(radio,"1-" __stringify(BTTV_MAX) "i"); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int dummy; module_param_array(radio, int, dummy, 0444); #else diff --git a/linux/drivers/media/video/bttv-i2c.c b/linux/drivers/media/video/bttv-i2c.c index f7d74a52c..937f02e42 100644 --- a/linux/drivers/media/video/bttv-i2c.c +++ b/linux/drivers/media/video/bttv-i2c.c @@ -1,5 +1,5 @@ /* - $Id: bttv-i2c.c,v 1.27 2005/09/13 20:11:39 mkrufky Exp $ + $Id: bttv-i2c.c,v 1.28 2005/10/09 18:07:06 mchehab Exp $ bttv-i2c.c -- all the i2c code is here @@ -29,10 +29,12 @@ #include <linux/moduleparam.h> #include <linux/init.h> #include <linux/delay.h> -#include <linux/jiffies.h> #include <asm/io.h> #include "bttvp.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) +#include <linux/jiffies.h> +#endif static struct i2c_algo_bit_data bttv_i2c_algo_bit_template; static struct i2c_adapter bttv_i2c_adap_sw_template; @@ -105,7 +107,9 @@ static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = { }; static struct i2c_adapter bttv_i2c_adap_sw_template = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .owner = THIS_MODULE, +#endif #ifdef I2C_CLASS_TV_ANALOG .class = I2C_CLASS_TV_ANALOG, #endif @@ -276,7 +280,9 @@ static struct i2c_algorithm bttv_algo = { }; static struct i2c_adapter bttv_i2c_adap_hw_template = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .owner = THIS_MODULE, +#endif #ifdef I2C_CLASS_TV_ANALOG .class = I2C_CLASS_TV_ANALOG, #endif diff --git a/linux/drivers/media/video/bttvp.h b/linux/drivers/media/video/bttvp.h index befe6834d..d2057a58d 100644 --- a/linux/drivers/media/video/bttvp.h +++ b/linux/drivers/media/video/bttvp.h @@ -1,5 +1,5 @@ /* - $Id: bttvp.h,v 1.22 2005/09/28 19:07:59 nsh Exp $ + $Id: bttvp.h,v 1.23 2005/10/09 18:07:06 mchehab Exp $ bttv - Bt848 frame grabber driver @@ -41,20 +41,17 @@ #include <asm/io.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "video-buf.h" -#include "audiochip.h" -#include "tuner.h" -#include "i2c-compat.h" -#include "ir-common.h" +#include <media/i2c-compat.h> #define strlcpy(dest,src,len) strncpy(dest,src,(len)-1) #else #include <linux/device.h> +#endif #include <media/video-buf.h> #include <media/audiochip.h> #include <media/tuner.h> #include <media/tveeprom.h> #include <media/ir-common.h> -#endif + #include "compat.h" #include "bt848.h" diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index bff84dca2..6f41172ef 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-blackbird.c,v 1.36 2005/09/10 12:04:22 catalin Exp $ + * $Id: cx88-blackbird.c,v 1.37 2005/10/09 18:07:06 mchehab Exp $ * * Support for a cx23416 mpeg encoder via cx2388x host port. * "blackbird" reference design. @@ -29,15 +29,16 @@ #include <linux/init.h> #include <linux/fs.h> #include <linux/delay.h> +#include "compat.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/device.h> +#endif #include <linux/firmware.h> -#include "compat.h" #include "cx88.h" MODULE_DESCRIPTION("driver for cx2388x/cx23416 based mpeg encoder cards"); -MODULE_AUTHOR("Jelle Foks <jelle@foks.8m.com>"); -MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); +MODULE_AUTHOR("Jelle Foks <jelle@foks.8m.com>, Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); MODULE_LICENSE("GPL"); static unsigned int mpegbufs = 32; @@ -619,8 +620,15 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) if (retval < 0) dprintk(0, "Error with register_write\n"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) retval = request_firmware(&firmware, BLACKBIRD_FIRM_ENC_FILENAME, &dev->pci->dev); +#else + retval = request_firmware(&firmware, BLACKBIRD_FIRM_ENC_FILENAME, + pci_name(dev->pci)); +#endif + + if (retval != 0) { dprintk(0, "ERROR: Hotplug firmware request failed (%s).\n", BLACKBIRD_FIRM_ENC_FILENAME); diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index 72cbf9d6b..525876cb1 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-core.c,v 1.43 2005/10/09 03:35:25 mchehab Exp $ + * $Id: cx88-core.c,v 1.44 2005/10/09 18:07:06 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * driver core @@ -55,7 +55,11 @@ static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(tuner,"1-" __stringify(CX88_MAXBOARDS) "i"); +MODULE_PARM(radiox,"1-" __stringify(CX88_MAXBOARDS) "i"); +MODULE_PARM(card,"1-" __stringify(CX88_MAXBOARDS) "i"); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int dummy; module_param_array(tuner, int, dummy, 0444); module_param_array(radio, int, dummy, 0444); diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c index 1705c060d..41cb1012f 100644 --- a/linux/drivers/media/video/cx88/cx88-i2c.c +++ b/linux/drivers/media/video/cx88/cx88-i2c.c @@ -1,5 +1,5 @@ /* - $Id: cx88-i2c.c,v 1.31 2005/09/13 20:11:39 mkrufky Exp $ + $Id: cx88-i2c.c,v 1.32 2005/10/09 18:07:06 mchehab Exp $ cx88-i2c.c -- all the i2c code is here @@ -32,6 +32,9 @@ #include "compat.h" #include "cx88.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <media/i2c-compat.h> +#endif static unsigned int i2c_debug = 0; module_param(i2c_debug, int, 0644); @@ -154,7 +157,9 @@ static struct i2c_algo_bit_data cx8800_i2c_algo_template = { static struct i2c_adapter cx8800_i2c_adap_template = { .name = "cx2388x", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .owner = THIS_MODULE, +#endif .id = I2C_HW_B_CX2388x, .client_register = attach_inform, .client_unregister = detach_inform, @@ -197,12 +202,18 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) memcpy(&core->i2c_client, &cx8800_i2c_client_template, sizeof(core->i2c_client)); +#ifdef I2C_CLASS_TV_ANALOG if (core->tuner_type != TUNER_ABSENT) core->i2c_adap.class |= I2C_CLASS_TV_ANALOG; +#endif +#ifdef I2C_CLASS_TV_DIGITAL if (cx88_boards[core->board].dvb) core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL; +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,66) core->i2c_adap.dev.parent = &pci->dev; +#endif strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name)); core->i2c_algo.data = core; i2c_set_adapdata(&core->i2c_adap,core); diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c index 37a73ffba..522ba3f45 100644 --- a/linux/drivers/media/video/cx88/cx88-input.c +++ b/linux/drivers/media/video/cx88/cx88-input.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-input.c,v 1.20 2005/09/11 05:39:23 mkrufky Exp $ + * $Id: cx88-input.c,v 1.21 2005/10/09 18:07:06 mchehab Exp $ * * Device driver for GPIO attached remote control interfaces * on Conexant 2388x based TV/DVB cards. @@ -30,9 +30,9 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <media/ir-common.h> - +#include "compat.h" #include "cx88.h" +#include <media/ir-common.h> /* ---------------------------------------------------------------------- */ @@ -436,6 +436,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes); ir->input.name = ir->name; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ir->input.phys = ir->phys; ir->input.id.bustype = BUS_PCI; ir->input.id.version = 1; @@ -447,7 +448,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ir->input.id.product = pci->device; } ir->input.dev = &pci->dev; - +#endif /* record handles to ourself */ ir->core = core; core->ir = ir; @@ -578,10 +579,11 @@ void cx88_ir_irq(struct cx88_core *core) /* ---------------------------------------------------------------------- */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) MODULE_AUTHOR("Gerd Knorr, Pavel Machek, Chris Pascoe"); MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls"); MODULE_LICENSE("GPL"); - +#endif /* * Local variables: * c-basic-offset: 8 diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c index d57e1c0d8..e6d1970b3 100644 --- a/linux/drivers/media/video/cx88/cx88-tvaudio.c +++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c @@ -1,5 +1,5 @@ /* - $Id: cx88-tvaudio.c,v 1.45 2005/10/04 14:47:12 nsh Exp $ + $Id: cx88-tvaudio.c,v 1.46 2005/10/09 18:07:06 mchehab Exp $ cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver @@ -53,9 +53,11 @@ #include <linux/init.h> #include <linux/smp_lock.h> #include <linux/delay.h> +#include "compat.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #include <linux/kthread.h> +#endif -#include "compat.h" #include "cx88.h" static unsigned int audio_debug = 0; diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 5bbea7789..27fe1af22 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.94 2005/09/14 23:42:53 nsh Exp $ + * $Id: cx88-video.c,v 1.95 2005/10/09 18:07:06 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -30,10 +30,12 @@ #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/delay.h> +#include "compat.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/kthread.h> +#endif #include <asm/div64.h> -#include "compat.h" #include "cx88.h" MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); @@ -46,7 +48,11 @@ static unsigned int video_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; static unsigned int vbi_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; static unsigned int radio_nr[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(video_nr,"1-" __stringify(CX88_MAXBOARDS) "i"); +MODULE_PARM(vbi_nr,"1-" __stringify(CX88_MAXBOARDS) "i"); +MODULE_PARM(radio_nr,"1-" __stringify(CX88_MAXBOARDS) "i"); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static unsigned int dummy; module_param_array(video_nr, int, dummy, 0444); module_param_array(vbi_nr, int, dummy, 0444); diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 757614cbf..ea16e8300 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -1,5 +1,5 @@ /* - * $Id: cx88.h,v 1.83 2005/10/09 03:35:25 mchehab Exp $ + * $Id: cx88.h,v 1.84 2005/10/09 18:07:06 mchehab Exp $ * * v4l2 device driver for cx2388x based TV cards * @@ -30,7 +30,9 @@ #include <media/tveeprom.h> #include <media/audiochip.h> #include <media/video-buf.h> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) #include <media/video-buf-dvb.h> +#endif #include "compat.h" #include "btcx-risc.h" @@ -436,11 +438,12 @@ struct cx8802_dev { int width; int height; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) /* for dvb only */ struct videobuf_dvb dvb; void* fe_handle; int (*fe_release)(void *handle); - +#endif /* for switching modulation types */ unsigned char ts_gen_cntrl; diff --git a/linux/drivers/media/video/ir-kbd-gpio.c b/linux/drivers/media/video/ir-kbd-gpio.c index 2abb30c65..f136d9df8 100644 --- a/linux/drivers/media/video/ir-kbd-gpio.c +++ b/linux/drivers/media/video/ir-kbd-gpio.c @@ -1,5 +1,5 @@ /* - * $Id: ir-kbd-gpio.c,v 1.19 2005/09/29 20:09:24 mchehab Exp $ + * $Id: ir-kbd-gpio.c,v 1.20 2005/10/09 18:07:06 mchehab Exp $ * * Copyright (c) 2003 Gerd Knorr * Copyright (c) 2003 Pavel Machek @@ -27,9 +27,8 @@ #include <linux/input.h> #include <linux/pci.h> -#include <media/ir-common.h> - #include "bttv.h" +#include <media/ir-common.h> /* ---------------------------------------------------------------------- */ diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c index 2bd0ce1ab..bf40fe0cf 100644 --- a/linux/drivers/media/video/ir-kbd-i2c.c +++ b/linux/drivers/media/video/ir-kbd-i2c.c @@ -1,5 +1,5 @@ /* - * $Id: ir-kbd-i2c.c,v 1.13 2005/09/19 01:20:14 mkrufky Exp $ + * $Id: ir-kbd-i2c.c,v 1.14 2005/10/09 18:07:06 mchehab Exp $ * * keyboard input driver for i2c IR remote controls * @@ -39,8 +39,9 @@ #include <linux/i2c.h> #include <linux/workqueue.h> #include <asm/semaphore.h> -#include <media/ir-common.h> + #include "compat.h" +#include <media/ir-common.h> /* Mark Phalan <phalanm@o2.ie> */ static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = { diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index e91267516..62b2d4a10 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -45,19 +45,24 @@ #include <linux/errno.h> #include <linux/slab.h> #include <linux/i2c.h> -#include "compat.h" -#include <linux/videodev.h> #include <linux/init.h> #include <linux/smp_lock.h> +#include "compat.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/kthread.h> #include <linux/suspend.h> +#endif #include <asm/semaphore.h> #include <asm/pgtable.h> +#include <linux/videodev.h> #include <media/audiochip.h> #include <media/id.h> #include "msp3400.h" -#include "compat.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <media/i2c-compat.h> +#endif + #define OPMODE_AUTO -1 #define OPMODE_MANUAL 0 @@ -762,7 +767,7 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) #endif } } -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12) +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) if (current->flags & PF_FREEZE) { refrigerator (PF_FREEZE); } @@ -1459,25 +1464,31 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int msp_suspend(struct device * dev, pm_message_t state, u32 level); -#else +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_suspend(struct device * dev, u32 state, u32 level); #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_resume(struct device * dev, u32 level); +#endif static void msp_wake_thread(struct i2c_client *client); static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .owner = THIS_MODULE, +#endif .name = "i2c msp3400 driver", .id = I2C_DRIVERID_MSP3400, .flags = I2C_DF_NOTIFY, .attach_adapter = msp_probe, .detach_client = msp_detach, .command = msp_command, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .driver = { .suspend = msp_suspend, .resume = msp_resume, }, +#endif }; static struct i2c_client client_template = @@ -1618,9 +1629,13 @@ static int msp_detach(struct i2c_client *client) static int msp_probe(struct i2c_adapter *adap) { +#ifdef I2C_CLASS_TV_ANALOG if (adap->class & I2C_CLASS_TV_ANALOG) return i2c_probe(adap, &addr_data, msp_attach); return 0; +#else + return i2c_probe(adap, &addr_data, msp_attach); +#endif } static void msp_wake_thread(struct i2c_client *client) @@ -1956,9 +1971,10 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int msp_suspend(struct device * dev, pm_message_t state, u32 level) -#else +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_suspend(struct device * dev, u32 state, u32 level) #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) { struct i2c_client *c = container_of(dev, struct i2c_client, dev); @@ -1975,7 +1991,7 @@ static int msp_resume(struct device * dev, u32 level) msp_wake_thread(c); return 0; } - +#endif /* LINUX_VERSION_CODE */ /* ----------------------------------------------------------------------- */ static int __init msp3400_init_module(void) diff --git a/linux/drivers/media/video/msp3400.c b/linux/drivers/media/video/msp3400.c index e91267516..62b2d4a10 100644 --- a/linux/drivers/media/video/msp3400.c +++ b/linux/drivers/media/video/msp3400.c @@ -45,19 +45,24 @@ #include <linux/errno.h> #include <linux/slab.h> #include <linux/i2c.h> -#include "compat.h" -#include <linux/videodev.h> #include <linux/init.h> #include <linux/smp_lock.h> +#include "compat.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/kthread.h> #include <linux/suspend.h> +#endif #include <asm/semaphore.h> #include <asm/pgtable.h> +#include <linux/videodev.h> #include <media/audiochip.h> #include <media/id.h> #include "msp3400.h" -#include "compat.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <media/i2c-compat.h> +#endif + #define OPMODE_AUTO -1 #define OPMODE_MANUAL 0 @@ -762,7 +767,7 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) #endif } } -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12) +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) if (current->flags & PF_FREEZE) { refrigerator (PF_FREEZE); } @@ -1459,25 +1464,31 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int msp_suspend(struct device * dev, pm_message_t state, u32 level); -#else +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_suspend(struct device * dev, u32 state, u32 level); #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_resume(struct device * dev, u32 level); +#endif static void msp_wake_thread(struct i2c_client *client); static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .owner = THIS_MODULE, +#endif .name = "i2c msp3400 driver", .id = I2C_DRIVERID_MSP3400, .flags = I2C_DF_NOTIFY, .attach_adapter = msp_probe, .detach_client = msp_detach, .command = msp_command, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .driver = { .suspend = msp_suspend, .resume = msp_resume, }, +#endif }; static struct i2c_client client_template = @@ -1618,9 +1629,13 @@ static int msp_detach(struct i2c_client *client) static int msp_probe(struct i2c_adapter *adap) { +#ifdef I2C_CLASS_TV_ANALOG if (adap->class & I2C_CLASS_TV_ANALOG) return i2c_probe(adap, &addr_data, msp_attach); return 0; +#else + return i2c_probe(adap, &addr_data, msp_attach); +#endif } static void msp_wake_thread(struct i2c_client *client) @@ -1956,9 +1971,10 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int msp_suspend(struct device * dev, pm_message_t state, u32 level) -#else +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int msp_suspend(struct device * dev, u32 state, u32 level) #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) { struct i2c_client *c = container_of(dev, struct i2c_client, dev); @@ -1975,7 +1991,7 @@ static int msp_resume(struct device * dev, u32 level) msp_wake_thread(c); return 0; } - +#endif /* LINUX_VERSION_CODE */ /* ----------------------------------------------------------------------- */ static int __init msp3400_init_module(void) diff --git a/linux/drivers/media/video/saa6588.c b/linux/drivers/media/video/saa6588.c index 818fd1f22..0ccfa5da0 100644 --- a/linux/drivers/media/video/saa6588.c +++ b/linux/drivers/media/video/saa6588.c @@ -33,6 +33,9 @@ #include <asm/uaccess.h> #include <media/id.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <media/i2c-compat.h> +#endif #include "rds.h" @@ -440,7 +443,9 @@ static int saa6588_probe(struct i2c_adapter *adap) switch (adap->id) { case I2C_HW_B_BT848: case I2C_HW_B_RIVA: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) case I2C_HW_SAA7134: +#endif return i2c_probe(adap, &addr_data, saa6588_attach); break; } @@ -501,7 +506,9 @@ static int saa6588_command(struct i2c_client *client, unsigned int cmd, /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54) .owner = THIS_MODULE, +#endif .name = "i2c saa6588 driver", .id = -1, /* FIXME */ .flags = I2C_DF_NOTIFY, diff --git a/linux/drivers/media/video/saa6752hs.c b/linux/drivers/media/video/saa6752hs.c index 888e0b19d..fa3df17a4 100644 --- a/linux/drivers/media/video/saa6752hs.c +++ b/linux/drivers/media/video/saa6752hs.c @@ -15,11 +15,9 @@ #include <linux/crc32.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "i2c-compat.h" -#include "id.h" -#else -#include <media/id.h> +#include <media/i2c-compat.h> #endif +#include <media/id.h> #define MPEG_VIDEO_TARGET_BITRATE_MAX 27000 #define MPEG_VIDEO_MAX_BITRATE_MAX 27000 @@ -543,8 +541,12 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) static int saa6752hs_probe(struct i2c_adapter *adap) { +#if I2C_CLASS_TV_ANALOG if (adap->class & I2C_CLASS_TV_ANALOG) return i2c_probe(adap, &addr_data, saa6752hs_attach); +#else + return i2c_probe(adap, &addr_data, saa6752hs_attach); +#endif return 0; } @@ -610,7 +612,9 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) .owner = THIS_MODULE, +#endif .name = "i2c saa6752hs MPEG encoder", .id = I2C_DRIVERID_SAA6752HS, .flags = I2C_DF_NOTIFY, diff --git a/linux/drivers/media/video/saa7134/saa6752hs.c b/linux/drivers/media/video/saa7134/saa6752hs.c index 888e0b19d..fa3df17a4 100644 --- a/linux/drivers/media/video/saa7134/saa6752hs.c +++ b/linux/drivers/media/video/saa7134/saa6752hs.c @@ -15,11 +15,9 @@ #include <linux/crc32.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "i2c-compat.h" -#include "id.h" -#else -#include <media/id.h> +#include <media/i2c-compat.h> #endif +#include <media/id.h> #define MPEG_VIDEO_TARGET_BITRATE_MAX 27000 #define MPEG_VIDEO_MAX_BITRATE_MAX 27000 @@ -543,8 +541,12 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) static int saa6752hs_probe(struct i2c_adapter *adap) { +#if I2C_CLASS_TV_ANALOG if (adap->class & I2C_CLASS_TV_ANALOG) return i2c_probe(adap, &addr_data, saa6752hs_attach); +#else + return i2c_probe(adap, &addr_data, saa6752hs_attach); +#endif return 0; } @@ -610,7 +612,9 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) .owner = THIS_MODULE, +#endif .name = "i2c saa6752hs MPEG encoder", .id = I2C_DRIVERID_SAA6752HS, .flags = I2C_DF_NOTIFY, diff --git a/linux/drivers/media/video/saa7134/saa7134-alsa.c b/linux/drivers/media/video/saa7134/saa7134-alsa.c index 782d11a7e..bb7eccc72 100644 --- a/linux/drivers/media/video/saa7134/saa7134-alsa.c +++ b/linux/drivers/media/video/saa7134/saa7134-alsa.c @@ -2,7 +2,7 @@ * SAA713x ALSA support for V4L * Ricardo Cerqueira <v4l@cerqueira.org> * - * $Id: saa7134-alsa.c,v 1.5 2005/10/08 09:20:24 nsh Exp $ + * $Id: saa7134-alsa.c,v 1.6 2005/10/09 18:07:06 mchehab Exp $ * * Caveats: * - Volume doesn't work (it's always at max) @@ -22,20 +22,21 @@ * */ -#include <sound/driver.h> +#include "compat.h" +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) #include <linux/init.h> #include <linux/slab.h> #include <linux/time.h> #include <linux/wait.h> #include <linux/moduleparam.h> #include <linux/module.h> +#include <sound/driver.h> #include <sound/core.h> #include <sound/control.h> #include <sound/pcm.h> #include <sound/rawmidi.h> #include <sound/initval.h> -#include "compat.h" #include "saa7134.h" #include "saa7134-reg.h" @@ -988,3 +989,5 @@ void alsa_card_saa7134_exit(void) snd_card_free(snd_saa7134_cards[idx]); } } +#endif /* LINUX_VERSION_CODE */ + diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index ee4d489ad..80350ccc8 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-core.c,v 1.44 2005/10/08 09:20:24 nsh Exp $ + * $Id: saa7134-core.c,v 1.45 2005/10/09 18:07:06 mchehab Exp $ * * device driver for philips saa7134 based TV cards * driver core @@ -75,7 +75,16 @@ static unsigned int mixer_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; static unsigned int tuner[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; static unsigned int card[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(video_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +MODULE_PARM(vbi_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +MODULE_PARM(radio_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +MODULE_PARM(dsp_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +MODULE_PARM(mixer_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +MODULE_PARM(tuner_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +MODULE_PARM(card,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int dummy; module_param_array(video_nr, int, dummy, 0444); module_param_array(vbi_nr, int, dummy, 0444); @@ -244,9 +253,13 @@ static void dump_statusregs(struct saa7134_dev *dev) /* delayed request_module */ #ifdef CONFIG_MODULES - static int need_empress; static int need_dvb; +static int pending_registered=0; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#define request_module_depend(name,flag) request_module(name); +#else static int pending_call(struct notifier_block *self, unsigned long state, void *module) @@ -261,7 +274,6 @@ static int pending_call(struct notifier_block *self, unsigned long state, return NOTIFY_DONE; } -static int pending_registered; static struct notifier_block pending_notifier = { .notifier_call = pending_call, }; @@ -284,6 +296,7 @@ static void request_module_depend(char *name, int *flag) break; } } +#endif #else @@ -1258,9 +1271,11 @@ static int saa7134_init(void) static void saa7134_fini(void) { #ifdef CONFIG_MODULES +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) if (pending_registered) unregister_module_notifier(&pending_notifier); #endif +#endif pci_unregister_driver(&saa7134_pci_driver); } diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c index 6c61550cb..aa5936b5a 100644 --- a/linux/drivers/media/video/saa7134/saa7134-empress.c +++ b/linux/drivers/media/video/saa7134/saa7134-empress.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-empress.c,v 1.12 2005/07/15 21:44:14 mchehab Exp $ + * $Id: saa7134-empress.c,v 1.13 2005/10/09 18:07:06 mchehab Exp $ * * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] * @@ -30,11 +30,7 @@ #include "saa7134-reg.h" #include "saa7134.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,64) -#include "saa6752hs.h" -#else #include <media/saa6752hs.h> -#endif /* ------------------------------------------------------------------ */ @@ -42,7 +38,10 @@ MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); MODULE_LICENSE("GPL"); static unsigned int empress_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(empress_nr,"1-" __stringify(SAA7134_MAXBOARDS) "i"); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) static int dummy; module_param_array(empress_nr, int, dummy, 0444); #else diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c index a199d7a76..dd4c3b60e 100644 --- a/linux/drivers/media/video/saa7134/saa7134-i2c.c +++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-i2c.c,v 1.24 2005/09/19 01:20:14 mkrufky Exp $ + * $Id: saa7134-i2c.c,v 1.25 2005/10/09 18:07:06 mchehab Exp $ * * device driver for philips saa7134 based TV cards * i2c interface support @@ -382,7 +382,9 @@ static struct i2c_algorithm saa7134_algo = { }; static struct i2c_adapter saa7134_adap_template = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) .owner = THIS_MODULE, +#endif #ifdef I2C_CLASS_TV_ANALOG .class = I2C_CLASS_TV_ANALOG, #endif diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index 9d54dbd45..e50d2ab64 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -1,5 +1,5 @@ /* - * $Id: saa7134.h,v 1.61 2005/10/08 09:20:24 nsh Exp $ + * $Id: saa7134.h,v 1.62 2005/10/09 18:07:06 mchehab Exp $ * * v4l2 device driver for philips saa7134 based TV cards * @@ -31,22 +31,21 @@ #include <asm/io.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,64) -#include "video-buf.h" -#include "tuner.h" -#include "audiochip.h" -#include "id.h" -#include "i2c-compat.h" -#include "ir-common.h" -#else +#include "compat.h" #include <media/tuner.h> #include <media/audiochip.h> #include <media/id.h> #include <media/ir-common.h> #include <media/video-buf.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,64) +#include <media/i2c-compat.h> +#else #include <media/video-buf-dvb.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> #endif -#include "compat.h" + #ifndef TRUE # define TRUE (1==1) @@ -56,10 +55,6 @@ #endif #define UNSET (-1U) -#include <sound/driver.h> -#include <sound/core.h> -#include <sound/pcm.h> - /* ----------------------------------------------------------- */ /* enums */ @@ -379,7 +374,9 @@ struct saa7134_oss { unsigned int dma_blk; unsigned int read_offset; unsigned int read_count; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) snd_pcm_substream_t *substream; +#endif }; /* IR input */ @@ -511,8 +508,10 @@ struct saa7134_dev { struct work_struct empress_workqueue; int empress_started; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* SAA7134_MPEG_DVB only */ struct videobuf_dvb dvb; +#endif }; /* ----------------------------------------------------------- */ diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index de92fadf5..32cce5eec 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -11,16 +11,12 @@ #include <linux/delay.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "audiochip.h" -#include "tuner.h" -#include "id.h" -#include "i2c-compat.h" -#else +#include <media/i2c-compat.h> +#endif #include <media/audiochip.h> #include <media/tuner.h> #include <media/id.h> -#endif -#include "compat.h" + /* Chips: TDA9885 (PAL, NTSC) @@ -505,9 +501,15 @@ static int tda9887_set_pinnacle(struct tda9887 *t, char *buf) /* ---------------------------------------------------------------------- */ static char pal[] = "-"; -module_param_string(pal, pal, sizeof(pal), 0644); static char secam[] = "-"; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +MODULE_PARM(pal,"s"); +MODULE_PARM(secam,"s"); +#else +module_param_string(pal, pal, sizeof(pal), 0644); module_param_string(secam, secam, sizeof(secam), 0644); +#endif static int tda9887_fixup_std(struct tda9887 *t) { @@ -667,7 +669,9 @@ static int tda9887_probe(struct i2c_adapter *adap) switch (adap->id) { case I2C_HW_B_BT848: case I2C_HW_B_RIVA: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) case I2C_HW_SAA7134: +#endif return i2c_probe(adap, &addr_data, tda9887_attach); break; } @@ -819,9 +823,10 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) static int tda9887_suspend(struct device * dev, pm_message_t state, u32 level) -#else +#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) static int tda9887_suspend(struct device * dev, u32 state, u32 level) #endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) { dprintk("tda9887: suspend\n"); return 0; @@ -836,7 +841,7 @@ static int tda9887_resume(struct device * dev, u32 level) tda9887_configure(t); return 0; } - +#endif /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { @@ -849,10 +854,12 @@ static struct i2c_driver driver = { .attach_adapter = tda9887_probe, .detach_client = tda9887_detach, .command = tda9887_command, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) .driver = { .suspend = tda9887_suspend, .resume = tda9887_resume, }, +#endif }; static struct i2c_client client_template = { diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c index 4c8a7149e..ddf72da42 100644 --- a/linux/drivers/media/video/tvaudio.c +++ b/linux/drivers/media/video/tvaudio.c @@ -32,13 +32,11 @@ #include <linux/smp_lock.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "audiochip.h" -#include "id.h" -#include "i2c-compat.h" +#include <media/i2c-compat.h> #else +#endif #include <media/audiochip.h> #include <media/id.h> -#endif #include "tvaudio.h" @@ -54,6 +52,7 @@ MODULE_LICENSE("GPL"); #define UNSET (-1U) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #define tvaudio_info(fmt, arg...) do {\ printk(KERN_INFO "tvaudio %d-%04x: " fmt, \ chip->c.adapter->nr, chip->c.addr , ##arg); } while (0) @@ -64,6 +63,18 @@ MODULE_LICENSE("GPL"); if (debug) \ printk(KERN_INFO "tvaudio %d-%04x: " fmt, \ chip->c.adapter->nr, chip->c.addr , ##arg); } while (0) +#else +#define tvaudio_info(fmt, arg...) do {\ + printk(KERN_INFO "tvaudio %04x: " fmt, \ + chip->c.addr , ##arg); } while (0) +#define tvaudio_warn(fmt, arg...) do {\ + printk(KERN_WARNING "tvaudio %04x: " fmt, \ + chip->c.addr , ##arg); } while (0) +#define tvaudio_dbg(fmt, arg...) do {\ + if (debug) \ + printk(KERN_INFO "tvaudio %04x: " fmt, \ + chip->c.addr , ##arg); } while (0) +#endif /* ---------------------------------------------------------------------- */ /* our structs */ @@ -293,7 +304,11 @@ static int chip_thread(void *data) struct CHIPSTATE *chip = data; struct CHIPDESC *desc = chiplist + chip->type; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) daemonize("%s", chip->c.name); +#else + daemonize(); +#endif allow_signal(SIGTERM); tvaudio_dbg("%s: thread started\n", chip->c.name); @@ -1594,7 +1609,9 @@ static int chip_probe(struct i2c_adapter *adap) switch (adap->id) { case I2C_HW_B_BT848: case I2C_HW_B_RIVA: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) case I2C_HW_SAA7134: +#endif return i2c_probe(adap, &addr_data, chip_attach); } #endif diff --git a/linux/drivers/media/video/tveeprom.c b/linux/drivers/media/video/tveeprom.c index 13680675f..e457e5745 100644 --- a/linux/drivers/media/video/tveeprom.c +++ b/linux/drivers/media/video/tveeprom.c @@ -53,6 +53,7 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)"); #define STRM(array,i) (i < sizeof(array)/sizeof(char*) ? array[i] : "unknown") +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #define tveeprom_info(fmt, arg...) do {\ printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ c->adapter->nr, c->addr , ##arg); } while (0) @@ -63,6 +64,18 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)"); if (debug) \ printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ c->adapter->nr, c->addr , ##arg); } while (0) +#else +#define tveeprom_info(fmt, arg...) do {\ + printk(KERN_INFO "tveeprom %04x: " fmt, \ + c->addr , ##arg); } while (0) +#define tveeprom_warn(fmt, arg...) do {\ + printk(KERN_WARNING "tveeprom %04x: " fmt, \ + c->addr , ##arg); } while (0) +#define tveeprom_dbg(fmt, arg...) do {\ + if (debug) \ + printk(KERN_INFO "tveeprom %04x: " fmt, \ + c->addr , ##arg); } while (0) +#endif /* ----------------------------------------------------------------------- */ @@ -744,7 +757,9 @@ tveeprom_detach_client (struct i2c_client *client) } static struct i2c_driver i2c_driver_tveeprom = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .owner = THIS_MODULE, +#endif .name = "tveeprom", .id = I2C_DRIVERID_TVEEPROM, .flags = I2C_DF_NOTIFY, diff --git a/linux/drivers/media/video/tvmixer.c b/linux/drivers/media/video/tvmixer.c index 4fac79b76..bba440343 100644 --- a/linux/drivers/media/video/tvmixer.c +++ b/linux/drivers/media/video/tvmixer.c @@ -1,5 +1,5 @@ /* - * $Id: tvmixer.c,v 1.10 2005/09/13 20:11:39 mkrufky Exp $ + * $Id: tvmixer.c,v 1.11 2005/10/09 18:07:06 mchehab Exp $ */ #include <linux/module.h> @@ -23,8 +23,7 @@ #include <asm/uaccess.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -# include "i2c-compat.h" -# include "id.h" +# include <media/i2c-compat.h> #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) # define strlcpy(dest,src,len) strncpy(dest,src,(len)-1) diff --git a/linux/drivers/media/video/tvp5150.c b/linux/drivers/media/video/tvp5150.c index 6c43a85b0..235e1f700 100644 --- a/linux/drivers/media/video/tvp5150.c +++ b/linux/drivers/media/video/tvp5150.c @@ -6,10 +6,15 @@ */ #include <linux/i2c.h> +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/delay.h> #include "compat.h" #include <linux/videodev.h> -#include <linux/delay.h> #include <linux/video_decoder.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <media/i2c-compat.h> +#endif #include "tvp5150_reg.h" @@ -842,7 +847,9 @@ static int tvp5150_detach_client(struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) .owner = THIS_MODULE, +#endif .name = "tvp5150", /* FIXME */ diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c index 01b19c58d..92685d9fa 100644 --- a/linux/drivers/media/video/video-buf-dvb.c +++ b/linux/drivers/media/video/video-buf-dvb.c @@ -1,5 +1,5 @@ /* - * $Id: video-buf-dvb.c,v 1.12 2005/07/15 21:44:14 mchehab Exp $ + * $Id: video-buf-dvb.c,v 1.13 2005/10/09 18:07:06 mchehab Exp $ * * some helper function for simple DVB cards which simply DMA the * complete transport stream and let the computer sort everything else @@ -14,6 +14,9 @@ * (at your option) any later version. */ +#include "compat.h" +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + #include <linux/module.h> #include <linux/init.h> #include <linux/device.h> @@ -22,7 +25,6 @@ #include <linux/file.h> #include <linux/suspend.h> -#include "compat.h" #include <media/video-buf.h> #include <media/video-buf-dvb.h> @@ -278,3 +280,5 @@ EXPORT_SYMBOL(videobuf_dvb_unregister); * compile-command: "make DVB=1" * End: */ +#endif /* LINUX_VERSION_CODE */ + diff --git a/linux/drivers/media/video/video-buf.c b/linux/drivers/media/video/video-buf.c index 1550c8bd3..81a61e51b 100644 --- a/linux/drivers/media/video/video-buf.c +++ b/linux/drivers/media/video/video-buf.c @@ -1,5 +1,5 @@ /* - * $Id: video-buf.c,v 1.19 2005/09/13 20:11:39 mkrufky Exp $ + * $Id: video-buf.c,v 1.20 2005/10/09 18:07:06 mchehab Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -30,11 +30,7 @@ #include <asm/page.h> #include <asm/pgtable.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,64) -#include "video-buf.h" -#else #include <media/video-buf.h> -#endif #define MAGIC_DMABUF 0x19721112 #define MAGIC_BUFFER 0x20040302 |