aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2011-12-04 06:20:37 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-11 06:24:38 -0500
commit50815707eebc7ce12bfd97933a6e68a482c4d7ab (patch)
treebc0eda56c8113b6786e11fef950aa36adcc9fec3
parentc6401af6692bac94b7ae1ff04f1d32c5dd1a38e3 (diff)
[media] it913x: multiple devices on system. Copy ite_config to priv area
If there are two or more different it913x devices on the system they share the same ite_config and over write its settings. To over come this, the ite_config is copied to the priv area. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/dvb-usb/it913x.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c
index c43bddf692b..47317e9faa4 100644
--- a/drivers/media/dvb/dvb-usb/it913x.c
+++ b/drivers/media/dvb/dvb-usb/it913x.c
@@ -63,6 +63,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
63 63
64struct it913x_state { 64struct it913x_state {
65 u8 id; 65 u8 id;
66 struct ite_config it913x_config;
66}; 67};
67 68
68struct ite_config it913x_config; 69struct ite_config it913x_config;
@@ -624,6 +625,7 @@ static int it913x_name(struct dvb_usb_adapter *adap)
624static int it913x_frontend_attach(struct dvb_usb_adapter *adap) 625static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
625{ 626{
626 struct usb_device *udev = adap->dev->udev; 627 struct usb_device *udev = adap->dev->udev;
628 struct it913x_state *st = adap->dev->priv;
627 int ret = 0; 629 int ret = 0;
628 u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5); 630 u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5);
629 u16 ep_size = adap->props.fe[0].stream.u.bulk.buffersize / 4; 631 u16 ep_size = adap->props.fe[0].stream.u.bulk.buffersize / 4;
@@ -634,8 +636,12 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
634 636
635 it913x_config.adf = it913x_read_reg(udev, IO_MUX_POWER_CLK); 637 it913x_config.adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);
636 638
639 if (adap->id == 0)
640 memcpy(&st->it913x_config, &it913x_config,
641 sizeof(struct ite_config));
642
637 adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach, 643 adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach,
638 &adap->dev->i2c_adap, adap_addr, &it913x_config); 644 &adap->dev->i2c_adap, adap_addr, &st->it913x_config);
639 645
640 if (adap->id == 0 && adap->fe_adap[0].fe) { 646 if (adap->id == 0 && adap->fe_adap[0].fe) {
641 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1); 647 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1);