Commit 43402bbd authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] dvb_usb_v2: implement .read_config()

That callback is called	only once when device is connected.
Call is done after the possible firmware is downloaded to the device,
just after the .power_ctrl() and before adapters are created.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5b853004
...@@ -275,6 +275,7 @@ struct dvb_usb_device_properties { ...@@ -275,6 +275,7 @@ struct dvb_usb_device_properties {
struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE]; struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
int (*power_ctrl) (struct dvb_usb_device *, int); int (*power_ctrl) (struct dvb_usb_device *, int);
int (*read_config) (struct dvb_usb_device *d);
int (*read_mac_address) (struct dvb_usb_device *, u8 []); int (*read_mac_address) (struct dvb_usb_device *, u8 []);
#define WARM 0 #define WARM 0
......
...@@ -190,6 +190,13 @@ static int dvb_usb_init(struct dvb_usb_device *d) ...@@ -190,6 +190,13 @@ static int dvb_usb_init(struct dvb_usb_device *d)
/* check the capabilities and set appropriate variables */ /* check the capabilities and set appropriate variables */
dvb_usb_device_power_ctrl(d, 1); dvb_usb_device_power_ctrl(d, 1);
/* read config */
if (d->props.read_config) {
ret = d->props.read_config(d);
if (ret < 0)
goto err;
}
ret = dvb_usb_i2c_init(d); ret = dvb_usb_i2c_init(d);
if (ret == 0) if (ret == 0)
ret = dvb_usb_adapter_init(d); ret = dvb_usb_adapter_init(d);
...@@ -209,6 +216,9 @@ static int dvb_usb_init(struct dvb_usb_device *d) ...@@ -209,6 +216,9 @@ static int dvb_usb_init(struct dvb_usb_device *d)
dvb_usb_device_power_ctrl(d, 0); dvb_usb_device_power_ctrl(d, 0);
return 0; return 0;
err:
pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
} }
int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff) int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment