diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-09-30 05:53:48 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-10-03 14:10:54 -0400 |
commit | 4d43e13f723e12734257277cc38497fab1efc605 (patch) | |
tree | 7debc4f9b7997f7d768dcf387210436b532198f4 /drivers/media/dvb/dvb-usb/digitv.c | |
parent | 8ccb3dcd1f8e80e8702642e1de26541b52f6bb7c (diff) |
V4L/DVB (4643): Multi-input patch for DVB-USB device
This patch is the first commit of the Multiple Input Patch for the DVB-USB frame
work.
It changes the DVB-USB-device to be able to have more than one streaming input
(e.g. multiple DVB-T sources) on one device. This is a necessary feature for
the upcoming DiB7700 driven devices.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/digitv.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 015854487308..8fb34375c1fb 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -83,7 +83,7 @@ static struct i2c_algorithm digitv_i2c_algo = { | |||
83 | 83 | ||
84 | /* Callbacks for DVB USB */ | 84 | /* Callbacks for DVB USB */ |
85 | static int digitv_identify_state (struct usb_device *udev, struct | 85 | static int digitv_identify_state (struct usb_device *udev, struct |
86 | dvb_usb_properties *props, struct dvb_usb_device_description **desc, | 86 | dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, |
87 | int *cold) | 87 | int *cold) |
88 | { | 88 | { |
89 | *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0; | 89 | *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0; |
@@ -116,33 +116,33 @@ static struct mt352_config digitv_mt352_config = { | |||
116 | 116 | ||
117 | static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) | 117 | static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
118 | { | 118 | { |
119 | struct dvb_usb_device *d = fe->dvb->priv; | 119 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
120 | u8 b[5]; | 120 | u8 b[5]; |
121 | dvb_usb_tuner_calc_regs(fe,fep,b, 5); | 121 | dvb_usb_tuner_calc_regs(fe,fep,b, 5); |
122 | return digitv_ctrl_msg(d,USB_WRITE_TUNER,0,&b[1],4,NULL,0); | 122 | return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0); |
123 | } | 123 | } |
124 | 124 | ||
125 | static struct nxt6000_config digitv_nxt6000_config = { | 125 | static struct nxt6000_config digitv_nxt6000_config = { |
126 | .clock_inversion = 1, | 126 | .clock_inversion = 1, |
127 | }; | 127 | }; |
128 | 128 | ||
129 | static int digitv_frontend_attach(struct dvb_usb_device *d) | 129 | static int digitv_frontend_attach(struct dvb_usb_adapter *adap) |
130 | { | 130 | { |
131 | if ((d->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &d->i2c_adap)) != NULL) { | 131 | if ((adap->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) { |
132 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | 132 | adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; |
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | if ((d->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &d->i2c_adap)) != NULL) { | 135 | if ((adap->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) { |
136 | d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; | 136 | adap->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; |
137 | return 0; | 137 | return 0; |
138 | } | 138 | } |
139 | return -EIO; | 139 | return -EIO; |
140 | } | 140 | } |
141 | 141 | ||
142 | static int digitv_tuner_attach(struct dvb_usb_device *d) | 142 | static int digitv_tuner_attach(struct dvb_usb_adapter *adap) |
143 | { | 143 | { |
144 | d->pll_addr = 0x60; | 144 | adap->pll_addr = 0x60; |
145 | d->pll_desc = &dvb_pll_tded4; | 145 | adap->pll_desc = &dvb_pll_tded4; |
146 | return 0; | 146 | return 0; |
147 | } | 147 | } |
148 | 148 | ||
@@ -238,7 +238,7 @@ static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
238 | } | 238 | } |
239 | 239 | ||
240 | /* DVB USB Driver stuff */ | 240 | /* DVB USB Driver stuff */ |
241 | static struct dvb_usb_properties digitv_properties; | 241 | static struct dvb_usb_device_properties digitv_properties; |
242 | 242 | ||
243 | static int digitv_probe(struct usb_interface *intf, | 243 | static int digitv_probe(struct usb_interface *intf, |
244 | const struct usb_device_id *id) | 244 | const struct usb_device_id *id) |
@@ -265,30 +265,21 @@ static struct usb_device_id digitv_table [] = { | |||
265 | }; | 265 | }; |
266 | MODULE_DEVICE_TABLE (usb, digitv_table); | 266 | MODULE_DEVICE_TABLE (usb, digitv_table); |
267 | 267 | ||
268 | static struct dvb_usb_properties digitv_properties = { | 268 | static struct dvb_usb_device_properties digitv_properties = { |
269 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 269 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
270 | 270 | ||
271 | .usb_ctrl = CYPRESS_FX2, | 271 | .usb_ctrl = CYPRESS_FX2, |
272 | .firmware = "dvb-usb-digitv-02.fw", | 272 | .firmware = "dvb-usb-digitv-02.fw", |
273 | 273 | ||
274 | .size_of_priv = 0, | 274 | .num_adapters = 1, |
275 | 275 | .adapter = { | |
276 | { | ||
276 | .frontend_attach = digitv_frontend_attach, | 277 | .frontend_attach = digitv_frontend_attach, |
277 | .tuner_attach = digitv_tuner_attach, | 278 | .tuner_attach = digitv_tuner_attach, |
278 | 279 | ||
279 | .rc_interval = 1000, | ||
280 | .rc_key_map = digitv_rc_keys, | ||
281 | .rc_key_map_size = ARRAY_SIZE(digitv_rc_keys), | ||
282 | .rc_query = digitv_rc_query, | ||
283 | |||
284 | .identify_state = digitv_identify_state, | ||
285 | |||
286 | .i2c_algo = &digitv_i2c_algo, | ||
287 | |||
288 | .generic_bulk_ctrl_endpoint = 0x01, | ||
289 | /* parameter for the MPEG2-data transfer */ | 280 | /* parameter for the MPEG2-data transfer */ |
290 | .urb = { | 281 | .stream = { |
291 | .type = DVB_USB_BULK, | 282 | .type = USB_BULK, |
292 | .count = 7, | 283 | .count = 7, |
293 | .endpoint = 0x02, | 284 | .endpoint = 0x02, |
294 | .u = { | 285 | .u = { |
@@ -297,6 +288,18 @@ static struct dvb_usb_properties digitv_properties = { | |||
297 | } | 288 | } |
298 | } | 289 | } |
299 | }, | 290 | }, |
291 | } | ||
292 | }, | ||
293 | .identify_state = digitv_identify_state, | ||
294 | |||
295 | .rc_interval = 1000, | ||
296 | .rc_key_map = digitv_rc_keys, | ||
297 | .rc_key_map_size = ARRAY_SIZE(digitv_rc_keys), | ||
298 | .rc_query = digitv_rc_query, | ||
299 | |||
300 | .i2c_algo = &digitv_i2c_algo, | ||
301 | |||
302 | .generic_bulk_ctrl_endpoint = 0x01, | ||
300 | 303 | ||
301 | .num_device_descs = 1, | 304 | .num_device_descs = 1, |
302 | .devices = { | 305 | .devices = { |