mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-19 09:04:51 +08:00
[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>
This commit is contained in:
parent
c6401af669
commit
50815707ee
@ -63,6 +63,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
|
|||||||
|
|
||||||
struct it913x_state {
|
struct it913x_state {
|
||||||
u8 id;
|
u8 id;
|
||||||
|
struct ite_config it913x_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ite_config it913x_config;
|
struct ite_config it913x_config;
|
||||||
@ -624,6 +625,7 @@ static int it913x_name(struct dvb_usb_adapter *adap)
|
|||||||
static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
|
static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
{
|
{
|
||||||
struct usb_device *udev = adap->dev->udev;
|
struct usb_device *udev = adap->dev->udev;
|
||||||
|
struct it913x_state *st = adap->dev->priv;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5);
|
u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5);
|
||||||
u16 ep_size = adap->props.fe[0].stream.u.bulk.buffersize / 4;
|
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)
|
|||||||
|
|
||||||
it913x_config.adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);
|
it913x_config.adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);
|
||||||
|
|
||||||
|
if (adap->id == 0)
|
||||||
|
memcpy(&st->it913x_config, &it913x_config,
|
||||||
|
sizeof(struct ite_config));
|
||||||
|
|
||||||
adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach,
|
adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach,
|
||||||
&adap->dev->i2c_adap, adap_addr, &it913x_config);
|
&adap->dev->i2c_adap, adap_addr, &st->it913x_config);
|
||||||
|
|
||||||
if (adap->id == 0 && adap->fe_adap[0].fe) {
|
if (adap->id == 0 && adap->fe_adap[0].fe) {
|
||||||
ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1);
|
ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1);
|
||||||
|
Loading…
Reference in New Issue
Block a user