diff options
-rw-r--r-- | linux/drivers/media/dvb/b2c2/skystar2.c | 41 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/Makefile | 2 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 123 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_frontend.h | 33 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_ksyms.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/at76c651.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dst.c | 5 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/nxt6000.c | 5 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/ves1820.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/ves1x93.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-av.c | 29 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-core.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/dvb/vp7041/vp7041.c | 1 |
16 files changed, 44 insertions, 255 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c index 1dc7b801b..9a5449383 100644 --- a/linux/drivers/media/dvb/b2c2/skystar2.c +++ b/linux/drivers/media/dvb/b2c2/skystar2.c @@ -40,7 +40,6 @@ #include <asm/io.h> -#include "dvb_i2c.h" #include "dvb_frontend.h" #include <linux/dvb/frontend.h> @@ -98,7 +97,6 @@ struct adapter { struct dmxdev dmxdev; struct dmx_frontend hw_frontend; struct dmx_frontend mem_frontend; - struct dvb_i2c_bus *i2c_bus; struct i2c_adapter i2c_adap; struct dvb_net dvbnet; @@ -287,9 +285,9 @@ static u32 flex_i2c_write(struct adapter *adapter, u32 device, u32 bus, u32 addr return buf - start; } -static int master_xfer(struct dvb_i2c_bus *i2c, const struct i2c_msg *msgs, int num) +static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msgs[], int num) { - struct adapter *tmp = i2c->data; + struct adapter *tmp = i2c_get_adapdata(adapter); int i, ret = 0; if (down_interruptible(&tmp->i2c_sem)) @@ -2261,15 +2259,6 @@ int client_unregister(struct i2c_client *client) return 0; } -static int flexcop_i2c_xfer(struct i2c_adapter *i2c_adapter, struct i2c_msg msg[], int num) -{ - struct adapter *adapter = i2c_get_adapdata(i2c_adapter); - - dprintk("flexcop_i2c_xfer\n"); - - return master_xfer(adapter->i2c_bus, msg, num); -} - u32 flexcop_i2c_func(struct i2c_adapter *adapter) { printk("flexcop_i2c_func\n"); @@ -2280,7 +2269,7 @@ u32 flexcop_i2c_func(struct i2c_adapter *adapter) static struct i2c_algorithm flexcop_algo = { .name = "flexcop i2c algorithm", .id = I2C_ALGO_BIT, - .master_xfer = flexcop_i2c_xfer, + .master_xfer = master_xfer, .functionality = flexcop_i2c_func, }; @@ -2319,35 +2308,16 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) memset(&adapter->i2c_adap, 0, sizeof(struct i2c_adapter)); strcpy(adapter->i2c_adap.name, "Technisat SkyStar2 driver"); -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ) - adapter->i2c_adap.data = adapter; -#else i2c_set_adapdata(&adapter->i2c_adap, adapter); - #ifdef I2C_ADAP_CLASS_TV_DIGITAL - adapter->i2c_adap.class = I2C_ADAP_CLASS_TV_DIGITAL; - #else - adapter->i2c_adap.class = I2C_CLASS_TV_DIGITAL; - #endif - -#endif + adapter->i2c_adap.class = I2C_CLASS_TV_DIGITAL; adapter->i2c_adap.algo = &flexcop_algo; adapter->i2c_adap.algo_data = NULL; adapter->i2c_adap.id = I2C_ALGO_BIT; adapter->i2c_adap.client_register = client_register; adapter->i2c_adap.client_unregister = client_unregister; - - adapter->i2c_bus = dvb_register_i2c_bus(master_xfer, adapter, adapter->dvb_adapter, 0); - - if (!adapter->i2c_bus) { - dvb_unregister_adapter (adapter->dvb_adapter); - return -ENOMEM; - } - - if (i2c_add_adapter(&adapter->i2c_adap) < 0) { - dvb_unregister_i2c_bus (master_xfer, adapter->i2c_bus->adapter, adapter->i2c_bus->id); dvb_unregister_adapter (adapter->dvb_adapter); return -ENOMEM; } @@ -2418,9 +2388,6 @@ static void skystar2_remove(struct pci_dev *pdev) i2c_del_adapter(&adapter->i2c_adap); - if (adapter->i2c_bus != NULL) - dvb_unregister_i2c_bus(master_xfer, adapter->i2c_bus->adapter, adapter->i2c_bus->id); - dvb_unregister_adapter(adapter->dvb_adapter); } driver_halt(pdev); diff --git a/linux/drivers/media/dvb/dvb-core/Makefile b/linux/drivers/media/dvb/dvb-core/Makefile index 712778914..b21da2ee6 100644 --- a/linux/drivers/media/dvb/dvb-core/Makefile +++ b/linux/drivers/media/dvb/dvb-core/Makefile @@ -4,6 +4,6 @@ dvb-core-objs = dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o \ dvb_ca_en50221.o dvb_functions.o dvb_frontend.o \ - dvb_i2c.o dvb_net.o dvb_ksyms.o dvb_ringbuffer.o + dvb_net.o dvb_ksyms.o dvb_ringbuffer.o obj-$(CONFIG_DVB_CORE) += dvb-core.o diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 565ac9117..affc4dfdc 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -788,6 +788,9 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file, fe->step_size = fe->info->frequency_stepsize * 2; fe->max_drift = (fe->info->frequency_stepsize * 2) + 1; break; + case FE_ATSC: + printk("dvb-core: FE_ATSC not handled yet.\n"); + break; } } if (dvb_override_tune_delay > 0) { @@ -1086,125 +1089,6 @@ static struct file_operations dvb_frontend_fops = { }; int -dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend, - unsigned int cmd, void *arg), - struct dvb_i2c_bus *i2c, - void *data, - struct dvb_frontend_info *info) -{ - struct list_head *entry; - struct dvb_frontend_data *fe; - static const struct dvb_device dvbdev_template = { - .users = ~0, - .writers = 1, - .readers = (~0)-1, - .fops = &dvb_frontend_fops, - .kernel_ioctl = dvb_frontend_ioctl - }; - - dprintk ("%s\n", __FUNCTION__); - - if (down_interruptible (&frontend_mutex)) - return -ERESTARTSYS; - - if (!(fe = kmalloc (sizeof (struct dvb_frontend_data), GFP_KERNEL))) { - up (&frontend_mutex); - return -ENOMEM; - } - - memset (fe, 0, sizeof (struct dvb_frontend_data)); - - init_MUTEX (&fe->sem); - init_waitqueue_head (&fe->wait_queue); - init_waitqueue_head (&fe->events.wait_queue); - init_MUTEX (&fe->events.sem); - fe->events.eventw = fe->events.eventr = 0; - fe->events.overflow = 0; - - fe->frontend.ioctl = ioctl; - fe->frontend.i2c = i2c; - fe->frontend.dvb_adapter = i2c->adapter; - fe->frontend.data = data; - fe->info = info; - fe->inversion = INVERSION_OFF; - - list_for_each (entry, &frontend_ioctl_list) { - struct dvb_frontend_ioctl_data *ioctl; - - ioctl = list_entry (entry, - struct dvb_frontend_ioctl_data, - list_head); - - if (ioctl->adapter == i2c->adapter) { - fe->frontend.before_ioctl = ioctl->before_ioctl; - fe->frontend.after_ioctl = ioctl->after_ioctl; - fe->frontend.before_after_data = ioctl->before_after_data; - break; - } - } - - list_for_each (entry, &frontend_notifier_list) { - struct dvb_frontend_notifier_data *notifier; - - notifier = list_entry (entry, - struct dvb_frontend_notifier_data, - list_head); - - if (notifier->adapter == i2c->adapter) { - fe->frontend.notifier_callback = notifier->callback; - fe->frontend.notifier_data = notifier->data; - break; - } - } - - list_add_tail (&fe->list_head, &frontend_list); - - printk ("DVB: registering frontend %i:%i (%s)...\n", - fe->frontend.i2c->adapter->num, fe->frontend.i2c->id, - fe->info->name); - - dvb_register_device (i2c->adapter, &fe->dvbdev, &dvbdev_template, - fe, DVB_DEVICE_FRONTEND); - - if ((info->caps & FE_NEEDS_BENDING) || (dvb_override_frequency_bending == 2)) - do_frequency_bending = 1; - - up (&frontend_mutex); - - return 0; -} - - -int dvb_unregister_frontend (int (*ioctl) (struct dvb_frontend *frontend, - unsigned int cmd, void *arg), - struct dvb_i2c_bus *i2c) -{ - struct list_head *entry, *n; - - dprintk ("%s\n", __FUNCTION__); - - down (&frontend_mutex); - - list_for_each_safe (entry, n, &frontend_list) { - struct dvb_frontend_data *fe; - - fe = list_entry (entry, struct dvb_frontend_data, list_head); - - if (fe->frontend.ioctl == ioctl && fe->frontend.i2c == i2c) { - dvb_unregister_device (fe->dvbdev); - list_del (entry); - up (&frontend_mutex); - dvb_frontend_stop (fe); - kfree (fe); - return 0; - } - } - - up (&frontend_mutex); - return -EINVAL; -} - -int dvb_register_frontend_new (int (*ioctl) (struct dvb_frontend *frontend, unsigned int cmd, void *arg), struct dvb_adapter *dvb_adapter, @@ -1244,7 +1128,6 @@ dvb_register_frontend_new (int (*ioctl) (struct dvb_frontend *frontend, fe->frontend.ioctl = ioctl; fe->frontend.dvb_adapter = dvb_adapter; - fe->frontend.i2c = NULL; fe->frontend.data = data; fe->info = info; fe->inversion = INVERSION_OFF; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h index d8608d4c3..e23c5f9b2 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h @@ -38,7 +38,24 @@ #include <linux/dvb/frontend.h> #include "dvbdev.h" -#include "dvb_i2c.h" + +/* FIXME: Move to i2c-id.h */ +#define I2C_DRIVERID_DVBFE_ALPS_TDLB7 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_ALPS_TDMB7 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_AT76C651 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_CX24110 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_DST I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_DUMMY I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_L64781 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_MT312 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_MT352 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_NXT6000 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_SP887X I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_STV0299 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_TDA1004X I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_TDA8083 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_VES1820 I2C_DRIVERID_EXP2 +#define I2C_DRIVERID_DVBFE_VES1X93 I2C_DRIVERID_EXP2 /** * when before_ioctl is registered and returns value 0, ioctl and after_ioctl @@ -54,8 +71,6 @@ struct dvb_frontend { void *before_after_data; /* can be used by hardware module... */ void *notifier_data; /* can be used by hardware module... */ void *data; /* can be used by hardware module... */ - - struct dvb_i2c_bus *i2c; /* legacy cruft, currently fe drivers depend on this */ }; struct dvb_frontend_tune_settings { @@ -81,18 +96,6 @@ struct dvb_frontend_tune_settings { #define FE_UNREGISTER _IO ('v', 85) extern int -dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend, - unsigned int cmd, void *arg), - struct dvb_i2c_bus *i2c, - void *data, - struct dvb_frontend_info *info); - -extern int -dvb_unregister_frontend (int (*ioctl) (struct dvb_frontend *frontend, - unsigned int cmd, void *arg), - struct dvb_i2c_bus *i2c); - -extern int dvb_register_frontend_new (int (*ioctl) (struct dvb_frontend *frontend, unsigned int cmd, void *arg), struct dvb_adapter *dvb_adapter, diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c b/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c index c05db66d3..57e9ead04 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c @@ -30,14 +30,6 @@ EXPORT_SYMBOL(dvb_remove_frontend_ioctls); EXPORT_SYMBOL(dvb_add_frontend_notifier); EXPORT_SYMBOL(dvb_remove_frontend_notifier); -#include "dvb_i2c.h" -EXPORT_SYMBOL(dvb_register_i2c_bus); -EXPORT_SYMBOL(dvb_unregister_i2c_bus); -EXPORT_SYMBOL(dvb_register_i2c_device); -EXPORT_SYMBOL(dvb_unregister_i2c_device); -EXPORT_SYMBOL(dvb_register_frontend); -EXPORT_SYMBOL(dvb_unregister_frontend); - EXPORT_SYMBOL(dvb_net_init); EXPORT_SYMBOL(dvb_net_release); diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c index a986d5ccd..49bcf805c 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.c +++ b/linux/drivers/media/dvb/frontends/at76c651.c @@ -41,7 +41,6 @@ #endif #include "dvb_frontend.h" -#include "dvb_i2c.h" #include "dvb_functions.h" #define FRONTEND_NAME "dvbfe_at76c651" diff --git a/linux/drivers/media/dvb/frontends/dst.c b/linux/drivers/media/dvb/frontends/dst.c index 4706a9a49..17ea19740 100644 --- a/linux/drivers/media/dvb/frontends/dst.c +++ b/linux/drivers/media/dvb/frontends/dst.c @@ -33,9 +33,6 @@ #include "dvb_functions.h" #include "dst-bt878.h" -/* fixme */ -#define I2C_DRIVERID_DST I2C_DRIVERID_EXP1 - unsigned int dst_verbose = 0; MODULE_PARM(dst_verbose, "i"); MODULE_PARM_DESC(dst_verbose, "verbose startup messages, default is 1 (yes)"); @@ -1228,7 +1225,7 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "dst", - .id = I2C_DRIVERID_DST, + .id = I2C_DRIVERID_DVBFE_DST, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, diff --git a/linux/drivers/media/dvb/frontends/nxt6000.c b/linux/drivers/media/dvb/frontends/nxt6000.c index 578451749..cb0346ce4 100644 --- a/linux/drivers/media/dvb/frontends/nxt6000.c +++ b/linux/drivers/media/dvb/frontends/nxt6000.c @@ -34,9 +34,6 @@ #include "dvb_frontend.h" #include "nxt6000.h" -/* fixme: add this to i2c-id.h */ -#define I2C_DRIVERID_NXT6000 I2C_DRIVERID_EXP1 - MODULE_DESCRIPTION("NxtWave NXT6000 DVB demodulator driver"); MODULE_AUTHOR("Florian Schirmer"); MODULE_LICENSE("GPL"); @@ -824,7 +821,7 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "nxt6000", - .id = I2C_DRIVERID_NXT6000, + .id = I2C_DRIVERID_DVBFE_NXT6000, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index c8c2fdd9b..23fff9d2d 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -30,7 +30,6 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -#include "dvb_i2c.h" /* I2C_DRIVERID_VES1820 is already defined in i2c-id.h */ diff --git a/linux/drivers/media/dvb/frontends/ves1x93.c b/linux/drivers/media/dvb/frontends/ves1x93.c index 992ca9e45..27e9e0401 100644 --- a/linux/drivers/media/dvb/frontends/ves1x93.c +++ b/linux/drivers/media/dvb/frontends/ves1x93.c @@ -32,8 +32,6 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -/* fixme: add this to i2c-id.h */ -#define I2C_DRIVERID_VES1X93 I2C_DRIVERID_EXP1 static int debug = 0; #define dprintk if (debug) printk @@ -685,7 +683,7 @@ static int command (struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "ves1x93", - .id = I2C_DRIVERID_VES1X93, + .id = I2C_DRIVERID_DVBFE_VES1X93, .flags = I2C_DF_NOTIFY, .attach_adapter = attach_adapter, .detach_client = detach_client, diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index e3e7105b7..178167405 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -60,7 +60,6 @@ #include "dvb_frontend.h" #include "dvb_functions.h" -#include "dvb_i2c.h" #include "ttpci-eeprom.h" #include "av7110.h" @@ -1299,12 +1298,6 @@ u8 i2c_readreg(struct av7110 *av7110, u8 id, u8 reg) return mm2[0]; } -static int master_xfer(struct dvb_i2c_bus *i2c, const struct i2c_msg msgs[], int num) -{ - struct saa7146_dev *dev = i2c->data; - return saa7146_i2c_transfer(dev, msgs, num, 6); -} - /**************************************************************************** * INITIALIZATION ****************************************************************************/ @@ -1480,17 +1473,8 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */ - av7110->i2c_bus = dvb_register_i2c_bus(master_xfer, dev, - av7110->dvb_adapter, 0); - if (!av7110->i2c_bus) { - dvb_unregister_adapter(av7110->dvb_adapter); - kfree(av7110); - return -ENOMEM; - } - if (i2c_add_adapter(&av7110->i2c_adap) < 0) { dvb_unregister_adapter (av7110->dvb_adapter); - dvb_unregister_i2c_bus (master_xfer,av7110->i2c_bus->adapter, av7110->i2c_bus->id); kfree(av7110); return -ENOMEM; } @@ -1599,9 +1583,6 @@ err2: err: i2c_del_adapter(&av7110->i2c_adap); - dvb_unregister_i2c_bus(master_xfer, av7110->i2c_bus->adapter, - av7110->i2c_bus->id); - dvb_unregister_adapter(av7110->dvb_adapter); if (NULL != av7110->debi_virt) @@ -1649,7 +1630,6 @@ static int av7110_detach (struct saa7146_dev* saa) i2c_del_adapter(&av7110->i2c_adap); - dvb_unregister_i2c_bus (master_xfer,av7110->i2c_bus->adapter, av7110->i2c_bus->id); dvb_unregister_adapter (av7110->dvb_adapter); av7110_num--; diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h index 84eaa6310..a11f950bc 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.h +++ b/linux/drivers/media/dvb/ttpci/av7110.h @@ -66,7 +66,6 @@ struct av7110 { struct saa7146_dev *dev; - struct dvb_i2c_bus *i2c_bus; struct i2c_adapter i2c_adap; char *card_name; diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c index 9520f9f1f..3e1f57e83 100644 --- a/linux/drivers/media/dvb/ttpci/budget-av.c +++ b/linux/drivers/media/dvb/ttpci/budget-av.c @@ -45,7 +45,7 @@ struct budget_av { ****************************************************************************/ -static u8 i2c_readreg (struct dvb_i2c_bus *i2c, u8 id, u8 reg) +static u8 i2c_readreg (struct i2c_adapter *i2c, u8 id, u8 reg) { u8 mm1[] = {0x00}; u8 mm2[] = {0x00}; @@ -58,12 +58,12 @@ static u8 i2c_readreg (struct dvb_i2c_bus *i2c, u8 id, u8 reg) msgs[0].len = 1; msgs[1].len = 1; msgs[0].buf = mm1; msgs[1].buf = mm2; - i2c->xfer(i2c, msgs, 2); + i2c_transfer(i2c, msgs, 2); return mm2[0]; } -static int i2c_readregs(struct dvb_i2c_bus *i2c, u8 id, u8 reg, u8 *buf, u8 len) +static int i2c_readregs(struct i2c_adapter *i2c, u8 id, u8 reg, u8 *buf, u8 len) { u8 mm1[] = { reg }; struct i2c_msg msgs[2] = { @@ -71,13 +71,14 @@ static int i2c_readregs(struct dvb_i2c_bus *i2c, u8 id, u8 reg, u8 *buf, u8 len) { .addr = id/2, .flags = I2C_M_RD, .buf = buf, .len = len } }; - if (i2c->xfer(i2c, msgs, 2) != 2) + if (i2c_transfer(i2c, msgs, 2) != 2) return -EIO; + return 0; } -static int i2c_writereg (struct dvb_i2c_bus *i2c, u8 id, u8 reg, u8 val) +static int i2c_writereg (struct i2c_adapter *i2c, u8 id, u8 reg, u8 val) { u8 msg[2]={ reg, val }; struct i2c_msg msgs; @@ -86,7 +87,7 @@ static int i2c_writereg (struct dvb_i2c_bus *i2c, u8 id, u8 reg, u8 val) msgs.addr=id/2; msgs.len=2; msgs.buf=msg; - return i2c->xfer (i2c, &msgs, 1); + return i2c_transfer(i2c, &msgs, 1); } @@ -125,7 +126,7 @@ static int saa7113_init (struct budget_av *budget_av) struct budget *budget = &budget_av->budget; const u8 *data = saa7113_tab; - if (i2c_writereg (budget->i2c_bus, 0x4a, 0x01, 0x08) != 1) { + if (i2c_writereg (&budget->i2c_adap, 0x4a, 0x01, 0x08) != 1) { DEB_D(("saa7113: not found on KNC card\n")); return -ENODEV; } @@ -133,12 +134,12 @@ static int saa7113_init (struct budget_av *budget_av) INFO(("saa7113: detected and initializing\n")); while (*data != 0xff) { - i2c_writereg(budget->i2c_bus, 0x4a, *data, *(data+1)); + i2c_writereg(&budget->i2c_adap, 0x4a, *data, *(data+1)); data += 2; } DEB_D(("saa7113: status=%02x\n", - i2c_readreg(budget->i2c_bus, 0x4a, 0x1f))); + i2c_readreg(&budget->i2c_adap, 0x4a, 0x1f))); return 0; } @@ -152,11 +153,11 @@ static int saa7113_setinput (struct budget_av *budget_av, int input) return -ENODEV; if (input == 1) { - i2c_writereg(budget->i2c_bus, 0x4a, 0x02, 0xc7); - i2c_writereg(budget->i2c_bus, 0x4a, 0x09, 0x80); + i2c_writereg(&budget->i2c_adap, 0x4a, 0x02, 0xc7); + i2c_writereg(&budget->i2c_adap, 0x4a, 0x09, 0x80); } else if (input == 0) { - i2c_writereg(budget->i2c_bus, 0x4a, 0x02, 0xc0); - i2c_writereg(budget->i2c_bus, 0x4a, 0x09, 0x00); + i2c_writereg(&budget->i2c_adap, 0x4a, 0x02, 0xc0); + i2c_writereg(&budget->i2c_adap, 0x4a, 0x09, 0x00); } else return -EINVAL; @@ -257,7 +258,7 @@ static int budget_av_attach (struct saa7146_dev* dev, saa7146_write(dev, PCI_BT_V1, 0x1c00101f); mac = budget_av->budget.dvb_adapter->proposed_mac; - if (i2c_readregs(budget_av->budget.i2c_bus, 0xa0, 0x30, mac, 6)) { + if (i2c_readregs(&budget_av->budget.i2c_adap, 0xa0, 0x30, mac, 6)) { printk("KNC1-%d: Could not read MAC from KNC1 card\n", budget_av->budget.dvb_adapter->num); memset(mac, 0, 6); diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c index 1c5dd1b87..8ba9aa86d 100644 --- a/linux/drivers/media/dvb/ttpci/budget-core.c +++ b/linux/drivers/media/dvb/ttpci/budget-core.c @@ -263,13 +263,6 @@ static void budget_unregister(struct budget *budget) dvb_dmx_release(&budget->demux); } - -static int master_xfer (struct dvb_i2c_bus *i2c, const struct i2c_msg msgs[], int num) -{ - struct saa7146_dev *dev = i2c->data; - return saa7146_i2c_transfer(dev, msgs, num, 6); -} - /* fixme: can this be unified among all saa7146 based dvb cards? */ int client_register(struct i2c_client *client) { @@ -339,18 +332,9 @@ int ttpci_budget_init (struct budget *budget, strlcpy(budget->i2c_adap.name, budget->card->name, sizeof(budget->i2c_adap.name)); saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); - - budget->i2c_bus = dvb_register_i2c_bus (master_xfer, dev, - budget->dvb_adapter, 0); - strcpy(budget->i2c_adap.name, budget->card->name); - if (!budget->i2c_bus) { - dvb_unregister_adapter (budget->dvb_adapter); - return -ENOMEM; - } if (i2c_add_adapter(&budget->i2c_adap) < 0) { - dvb_unregister_i2c_bus (master_xfer, budget->i2c_bus->adapter, budget->i2c_bus->id); dvb_unregister_adapter (budget->dvb_adapter); return -ENOMEM; } @@ -383,9 +367,6 @@ err: if (budget->grabbing) vfree(budget->grabbing); - dvb_unregister_i2c_bus (master_xfer,budget->i2c_bus->adapter, - budget->i2c_bus->id); - dvb_unregister_adapter (budget->dvb_adapter); return ret; @@ -402,9 +383,6 @@ int ttpci_budget_deinit (struct budget *budget) i2c_del_adapter(&budget->i2c_adap); - dvb_unregister_i2c_bus (master_xfer, budget->i2c_bus->adapter, - budget->i2c_bus->id); - dvb_unregister_adapter (budget->dvb_adapter); tasklet_kill (&budget->vpe_tasklet); diff --git a/linux/drivers/media/dvb/ttpci/budget.h b/linux/drivers/media/dvb/ttpci/budget.h index d1289851d..a712c3d3d 100644 --- a/linux/drivers/media/dvb/ttpci/budget.h +++ b/linux/drivers/media/dvb/ttpci/budget.h @@ -28,9 +28,6 @@ struct budget { struct saa7146_dev *dev; -#include "dvb_i2c.h" - struct dvb_i2c_bus *i2c_bus; - struct i2c_adapter i2c_adap; struct budget_info *card; diff --git a/linux/drivers/media/dvb/vp7041/vp7041.c b/linux/drivers/media/dvb/vp7041/vp7041.c index ee8175c36..223fa4d6f 100644 --- a/linux/drivers/media/dvb/vp7041/vp7041.c +++ b/linux/drivers/media/dvb/vp7041/vp7041.c @@ -54,7 +54,6 @@ #include "dmxdev.h" #include "dvb_demux.h" -#include "dvb_i2c.h" #include "dvb_filter.h" #include "dvb_frontend.h" #include "dvb_net.h" |