summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c20
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.h1
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c29
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c22
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.h3
5 files changed, 15 insertions, 60 deletions
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;