summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/bt8xx')
-rw-r--r--linux/drivers/media/video/bt8xx/bt832.c29
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-cards.c23
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c51
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-i2c.c8
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-input.c2
-rw-r--r--linux/drivers/media/video/bt8xx/bttv.h10
-rw-r--r--linux/drivers/media/video/bt8xx/bttvp.h13
7 files changed, 1 insertions, 135 deletions
diff --git a/linux/drivers/media/video/bt8xx/bt832.c b/linux/drivers/media/video/bt8xx/bt832.c
index 4eefaba8f..e860f7725 100644
--- a/linux/drivers/media/video/bt8xx/bt832.c
+++ b/linux/drivers/media/video/bt8xx/bt832.c
@@ -33,9 +33,6 @@
#include <linux/slab.h>
#include <media/v4l2-common.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include "i2c-compat.h"
-#endif
#include "bttv.h"
#include "bt832.h"
@@ -44,17 +41,10 @@ MODULE_LICENSE("GPL");
/* Addresses to scan */
static unsigned short normal_i2c[] = { I2C_ADDR_BT832_ALT1>>1, I2C_ADDR_BT832_ALT2>>1,
I2C_CLIENT_END };
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
-#endif
I2C_CLIENT_INSMOD;
int debug; /* debug output */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
module_param(debug, int, 0644);
-#else
-MODULE_PARM(debug, "i");
-#endif
/* ---------------------------------------------------------------------- */
@@ -187,12 +177,7 @@ int bt832_init(struct i2c_client *i2c_client_s)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static int bt832_attach(struct i2c_adapter *adap, int addr, int kind)
-#else
-static int bt832_attach(struct i2c_adapter *adap, int addr,
- unsigned short flags, int kind)
-#endif
{
struct bt832 *t;
@@ -207,10 +192,6 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,
v4l_info(&t->client,"chip found @ 0x%x\n", addr<<1);
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
- MOD_INC_USE_COUNT;
-#endif
if(! bt832_init(&t->client)) {
bt832_detach(&t->client);
return -1;
@@ -221,13 +202,8 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,
static int bt832_probe(struct i2c_adapter *adap)
{
-#ifdef I2C_CLASS_TV_ANALOG
if (adap->class & I2C_CLASS_TV_ANALOG)
return i2c_probe(adap, &addr_data, bt832_attach);
-#else
- if (adap->id == I2C_HW_B_BT848)
- return i2c_probe(adap, &addr_data, bt832_attach);
-#endif
return 0;
}
@@ -238,9 +214,6 @@ static int bt832_detach(struct i2c_client *client)
v4l_info(&t->client,"dettach\n");
i2c_detach_client(client);
kfree(t);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
- MOD_DEC_USE_COUNT;
-#endif
return 0;
}
@@ -277,7 +250,7 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15))
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
.owner = THIS_MODULE,
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
diff --git a/linux/drivers/media/video/bt8xx/bttv-cards.c b/linux/drivers/media/video/bt8xx/bttv-cards.c
index 0e6771643..4d283be22 100644
--- a/linux/drivers/media/video/bt8xx/bttv-cards.c
+++ b/linux/drivers/media/video/bt8xx/bttv-cards.c
@@ -115,31 +115,12 @@ module_param(gpiomask, int, 0444);
module_param(audioall, int, 0444);
module_param(autoload, int, 0444);
-#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");
-#else
-#if 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);
-module_param_array(tuner, int, dummy, 0444);
-module_param_array(svhs, int, dummy, 0444);
-module_param_array(remote, int, dummy, 0444);
-module_param_array(audiomux, int, dummy, 0444);
-#else
module_param_array(card, int, NULL, 0444);
module_param_array(pll, int, NULL, 0444);
module_param_array(tuner, int, NULL, 0444);
module_param_array(svhs, int, NULL, 0444);
module_param_array(remote, int, NULL, 0444);
module_param_array(audiomux, int, NULL, 0444);
-#endif
-#endif
MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
"[enable bug compatibility for triton1 + others]");
@@ -3870,11 +3851,7 @@ static int __devinit pvr_boot(struct bttv *btv)
const struct firmware *fw_entry;
int rc;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
-#else
- rc = request_firmware(&fw_entry, "hcwamc.rbf", pci_name(btv->c.pci));
-#endif
if (rc != 0) {
printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
btv->c.nr);
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c
index 15f10b88a..36efd08f8 100644
--- a/linux/drivers/media/video/bt8xx/bttv-driver.c
+++ b/linux/drivers/media/video/bt8xx/bttv-driver.c
@@ -48,9 +48,7 @@
#include <media/tvaudio.h>
#include <media/msp3400.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/dma-mapping.h>
-#endif
#include <asm/io.h>
#include <asm/byteorder.h>
@@ -132,16 +130,7 @@ 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,5,0)
-MODULE_PARM(radio,"1-" __stringify(BTTV_MAX) "i");
-#else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
-static int dummy;
-module_param_array(radio, int, dummy, 0444);
-#else
module_param_array(radio, int, NULL, 0444);
-#endif
-#endif
MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)");
MODULE_PARM_DESC(bigendian,"byte order of the framebuffer, default is native endian");
@@ -171,20 +160,14 @@ MODULE_LICENSE("GPL");
/* ----------------------------------------------------------------------- */
/* sysfs */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
static ssize_t show_card(struct device *cd,
struct device_attribute *attr, char *buf)
-#else
-static ssize_t show_card(struct class_device *cd, char *buf)
-#endif
{
struct video_device *vfd = container_of(cd, struct video_device, class_dev);
struct bttv *btv = dev_get_drvdata(vfd->dev);
return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET);
}
static DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
-#endif
/* ----------------------------------------------------------------------- */
/* dvb auto-load setup */
@@ -198,9 +181,6 @@ static void request_module_async(struct work_struct *work)
request_module("dvb-bt8xx");
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#define request_modules(dev)
-#else
static void request_modules(struct bttv *dev)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
@@ -210,7 +190,6 @@ static void request_modules(struct bttv *dev)
#endif
schedule_work(&dev->request_module_wk);
}
-#endif
#else
#define request_modules(dev)
#endif /* CONFIG_MODULES */
@@ -3391,9 +3370,7 @@ static const struct file_operations bttv_fops =
.open = bttv_open,
.release = bttv_release,
.ioctl = video_ioctl2,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
.compat_ioctl = v4l_compat_ioctl32,
-#endif
.llseek = no_llseek,
.read = bttv_read,
.mmap = bttv_mmap,
@@ -3672,9 +3649,7 @@ static const struct file_operations radio_fops =
.open = radio_open,
.read = radio_read,
.release = radio_release,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
.compat_ioctl = v4l_compat_ioctl32,
-#endif
.ioctl = video_ioctl2,
.llseek = no_llseek,
.poll = radio_poll,
@@ -4115,10 +4090,8 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
btv=(struct bttv *)dev_id;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if (btv->custom_irq)
handled = btv->custom_irq(btv);
-#endif
count=0;
while (1) {
@@ -4156,9 +4129,7 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
if ((astat & BT848_INT_GPINT) && btv->remote) {
wake_up(&btv->gpioq);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
bttv_input_irq(btv);
-#endif
}
if (astat & BT848_INT_I2CDONE) {
@@ -4238,10 +4209,8 @@ static struct video_device *vdev_init(struct bttv *btv,
return NULL;
*vfd = *template;
vfd->minor = -1;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
vfd->dev = &btv->c.pci->dev;
vfd->release = video_device_release;
-#endif
vfd->type = type;
vfd->debug = bttv_debug;
snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)",
@@ -4394,11 +4363,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
btv->c.nr);
return -EIO;
}
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7)
- if (pci_set_dma_mask(dev, 0xffffffff)) {
-#else
if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
-#endif
printk(KERN_WARNING "bttv%d: No suitable DMA available.\n",
btv->c.nr);
return -EIO;
@@ -4509,13 +4474,11 @@ static int __devinit bttv_probe(struct pci_dev *dev,
disclaim_video_lines(btv);
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/* add subdevices and autoload dvb-bt8xx if needed */
if (bttv_tvcards[btv->c.type].has_dvb) {
bttv_sub_add_device(&btv->c, "dvb");
request_modules(btv);
}
-#endif
bttv_input_init(btv);
@@ -4554,9 +4517,7 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
btv->shutdown=1;
wake_up(&btv->gpioq);
bttv_input_fini(btv);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
bttv_sub_del_devices(&btv->c);
-#endif
/* unregister i2c_bus + input */
fini_bttv_i2c(btv);
@@ -4609,11 +4570,7 @@ static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
btv->state.gpio_data = gpio_read();
/* save pci state */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
- pci_save_state(pci_dev, btv->state.pci_cfg);
-#else
pci_save_state(pci_dev);
-#endif
if (0 != pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state))) {
pci_disable_device(pci_dev);
btv->state.disabled = 1;
@@ -4648,11 +4605,7 @@ static int bttv_resume(struct pci_dev *pci_dev)
return err;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
- pci_restore_state(pci_dev, btv->state.pci_cfg);
-#else
pci_restore_state(pci_dev);
-#endif
/* restore bt878 state */
bttv_reinit_bt848(btv);
@@ -4722,13 +4675,11 @@ static int __init bttv_init_module(void)
bttv_check_chipset();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
ret = bus_register(&bttv_sub_bus_type);
if (ret < 0) {
printk(KERN_WARNING "bttv: bus_register error: %d\n", ret);
return ret;
}
-#endif
ret = pci_register_driver(&bttv_pci_driver);
if (ret < 0)
bus_unregister(&bttv_sub_bus_type);
@@ -4739,9 +4690,7 @@ static int __init bttv_init_module(void)
static void __exit bttv_cleanup_module(void)
{
pci_unregister_driver(&bttv_pci_driver);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
bus_unregister(&bttv_sub_bus_type);
-#endif
}
module_init(bttv_init_module);
diff --git a/linux/drivers/media/video/bt8xx/bttv-i2c.c b/linux/drivers/media/video/bt8xx/bttv-i2c.c
index 746b9dd77..4f48dfb26 100644
--- a/linux/drivers/media/video/bt8xx/bttv-i2c.c
+++ b/linux/drivers/media/video/bt8xx/bttv-i2c.c
@@ -33,9 +33,7 @@
#include "bttvp.h"
#include <media/v4l2-common.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/jiffies.h>
-#endif
#include <asm/io.h>
static int attach_inform(struct i2c_client *client);
@@ -423,14 +421,10 @@ int __devinit init_bttv_i2c(struct bttv *btv)
btv->c.i2c_adap.algo_data = &btv->i2c_algo;
}
btv->c.i2c_adap.owner = THIS_MODULE;
-#ifdef I2C_CLASS_TV_ANALOG
btv->c.i2c_adap.class = I2C_CLASS_TV_ANALOG;
-#endif
btv->c.i2c_adap.client_register = attach_inform;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,66)
btv->c.i2c_adap.dev.parent = &btv->c.pci->dev;
-#endif
snprintf(btv->c.i2c_adap.name, sizeof(btv->c.i2c_adap.name),
"bt%d #%d [%s]", btv->id, btv->c.nr,
btv->use_i2c_hw ? "hw" : "sw");
@@ -438,12 +432,10 @@ int __devinit init_bttv_i2c(struct bttv *btv)
i2c_set_adapdata(&btv->c.i2c_adap, btv);
btv->i2c_client.adapter = &btv->c.i2c_adap;
-#ifdef I2C_CLASS_TV_ANALOG
if (bttv_tvcards[btv->c.type].no_video)
btv->c.i2c_adap.class &= ~I2C_CLASS_TV_ANALOG;
if (bttv_tvcards[btv->c.type].has_dvb)
btv->c.i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
-#endif
if (btv->use_i2c_hw) {
btv->i2c_rc = i2c_add_adapter(&btv->c.i2c_adap);
diff --git a/linux/drivers/media/video/bt8xx/bttv-input.c b/linux/drivers/media/video/bt8xx/bttv-input.c
index f82213990..ada104826 100644
--- a/linux/drivers/media/video/bt8xx/bttv-input.c
+++ b/linux/drivers/media/video/bt8xx/bttv-input.c
@@ -313,7 +313,6 @@ int bttv_input_init(struct bttv *btv)
ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
input_dev->name = ir->name;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
input_dev->phys = ir->phys;
input_dev->id.bustype = BUS_PCI;
input_dev->id.version = 1;
@@ -333,7 +332,6 @@ int bttv_input_init(struct bttv *btv)
input_dev->dev = &btv->c.pci->dev;
#endif
#endif
-#endif
btv->remote = ir;
bttv_ir_start(btv, ir);
diff --git a/linux/drivers/media/video/bt8xx/bttv.h b/linux/drivers/media/video/bt8xx/bttv.h
index 4c73aacdb..dab61e62e 100644
--- a/linux/drivers/media/video/bt8xx/bttv.h
+++ b/linux/drivers/media/video/bt8xx/bttv.h
@@ -302,8 +302,6 @@ extern int bttv_write_gpio(unsigned int card,
/* ---------------------------------------------------------- */
/* sysfs/driver-moded based gpio access interface */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-
struct bttv_sub_device {
struct device dev;
struct bttv_core *core;
@@ -335,14 +333,6 @@ void bttv_gpio_bits(struct bttv_core *core, u32 mask, u32 bits);
#define gpio_write(value) bttv_gpio_write(&btv->c, value)
#define gpio_bits(mask,bits) bttv_gpio_bits(&btv->c, mask, bits)
-#else
-
-#define gpio_inout(mask,bits) btaor((mask)&(bits),~(mask),BT848_GPIO_OUT_EN)
-#define gpio_read() btread(BT848_GPIO_DATA)
-#define gpio_write(value) btwrite((value),BT848_GPIO_DATA)
-#define gpio_bits(mask,bits) btaor((mask)&(bits),~(mask),BT848_GPIO_DATA)
-
-#endif
/* ---------------------------------------------------------- */
/* i2c */
diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h
index 9fd8eeddf..c3d1703ac 100644
--- a/linux/drivers/media/video/bt8xx/bttvp.h
+++ b/linux/drivers/media/video/bt8xx/bttvp.h
@@ -42,13 +42,7 @@
#include <asm/io.h>
#include "compat.h"
#include <media/v4l2-common.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include "i2c-compat.h"
-#define strlcpy(dest,src,len) strncpy(dest,src,(len)-1)
-#else
#include <linux/device.h>
-#endif
#include <media/videobuf-dma-sg.h>
#include <media/tveeprom.h>
#include <media/ir-common.h>
@@ -272,14 +266,10 @@ extern struct videobuf_queue_ops bttv_vbi_qops;
/* ---------------------------------------------------------- */
/* bttv-gpio.c */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-
extern struct bus_type bttv_sub_bus_type;
int bttv_sub_add_device(struct bttv_core *core, char *name);
int bttv_sub_del_devices(struct bttv_core *core);
-#endif
-
/* ---------------------------------------------------------- */
/* bttv-driver.c */
@@ -318,9 +308,6 @@ struct bttv_input {
};
struct bttv_suspend_state {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
- u32 pci_cfg[64 / sizeof(u32)];
-#endif
u32 gpio_enable;
u32 gpio_data;
int disabled;