diff options
author | Guy Martin <gmsoft@tuxicoman.be> | 2010-05-07 03:09:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:21:49 -0400 |
commit | 76952c7e598f68bf12adf307d6a9a0de3b33b985 (patch) | |
tree | 168a0478506b8c3d9c9d1b3f0d36b66422e0d651 /drivers/media | |
parent | 283d637bbd7301c9fb2236103b990b9d66099d78 (diff) |
V4L/DVB: TT CT-3650 DVB-C support
Add support for the DVB-C frontend of the TT CT-3650.
DVB-T fe, CI and IR are not implemented.
Signed-off-by: Guy Martin <gmsoft@tuxicoman.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/ttusb2.c | 95 |
2 files changed, 90 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 085c4e457e0e..b4afe6f8ed19 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -198,6 +198,7 @@ | |||
198 | #define USB_PID_AVERMEDIA_A850 0x850a | 198 | #define USB_PID_AVERMEDIA_A850 0x850a |
199 | #define USB_PID_AVERMEDIA_A805 0xa805 | 199 | #define USB_PID_AVERMEDIA_A805 0xa805 |
200 | #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 | 200 | #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 |
201 | #define USB_PID_TECHNOTREND_CONNECT_CT3650 0x300d | ||
201 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a | 202 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a |
202 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081 | 203 | #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081 |
203 | #define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058 | 204 | #define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058 |
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c index 20ca9d9ee99b..a6de489a6a39 100644 --- a/drivers/media/dvb/dvb-usb/ttusb2.c +++ b/drivers/media/dvb/dvb-usb/ttusb2.c | |||
@@ -29,6 +29,8 @@ | |||
29 | 29 | ||
30 | #include "tda826x.h" | 30 | #include "tda826x.h" |
31 | #include "tda10086.h" | 31 | #include "tda10086.h" |
32 | #include "tda1002x.h" | ||
33 | #include "tda827x.h" | ||
32 | #include "lnbp21.h" | 34 | #include "lnbp21.h" |
33 | 35 | ||
34 | /* debug */ | 36 | /* debug */ |
@@ -150,7 +152,17 @@ static struct tda10086_config tda10086_config = { | |||
150 | .xtal_freq = TDA10086_XTAL_16M, | 152 | .xtal_freq = TDA10086_XTAL_16M, |
151 | }; | 153 | }; |
152 | 154 | ||
153 | static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap) | 155 | static struct tda10023_config tda10023_config = { |
156 | .demod_address = 0x0c, | ||
157 | .invert = 0, | ||
158 | .xtal = 16000000, | ||
159 | .pll_m = 11, | ||
160 | .pll_p = 3, | ||
161 | .pll_n = 1, | ||
162 | .deltaf = 0xa511, | ||
163 | }; | ||
164 | |||
165 | static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap) | ||
154 | { | 166 | { |
155 | if (usb_set_interface(adap->dev->udev,0,3) < 0) | 167 | if (usb_set_interface(adap->dev->udev,0,3) < 0) |
156 | err("set interface to alts=3 failed"); | 168 | err("set interface to alts=3 failed"); |
@@ -163,7 +175,27 @@ static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap) | |||
163 | return 0; | 175 | return 0; |
164 | } | 176 | } |
165 | 177 | ||
166 | static int ttusb2_tuner_attach(struct dvb_usb_adapter *adap) | 178 | static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap) |
179 | { | ||
180 | if (usb_set_interface(adap->dev->udev, 0, 3) < 0) | ||
181 | err("set interface to alts=3 failed"); | ||
182 | if ((adap->fe = dvb_attach(tda10023_attach, &tda10023_config, &adap->dev->i2c_adap, 0x48)) == NULL) { | ||
183 | deb_info("TDA10023 attach failed\n"); | ||
184 | return -ENODEV; | ||
185 | } | ||
186 | return 0; | ||
187 | } | ||
188 | |||
189 | static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap) | ||
190 | { | ||
191 | if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL) { | ||
192 | printk(KERN_ERR "%s: No tda827x found!\n", __func__); | ||
193 | return -ENODEV; | ||
194 | } | ||
195 | return 0; | ||
196 | } | ||
197 | |||
198 | static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap) | ||
167 | { | 199 | { |
168 | if (dvb_attach(tda826x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) { | 200 | if (dvb_attach(tda826x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) { |
169 | deb_info("TDA8263 attach failed\n"); | 201 | deb_info("TDA8263 attach failed\n"); |
@@ -180,6 +212,7 @@ static int ttusb2_tuner_attach(struct dvb_usb_adapter *adap) | |||
180 | /* DVB USB Driver stuff */ | 212 | /* DVB USB Driver stuff */ |
181 | static struct dvb_usb_device_properties ttusb2_properties; | 213 | static struct dvb_usb_device_properties ttusb2_properties; |
182 | static struct dvb_usb_device_properties ttusb2_properties_s2400; | 214 | static struct dvb_usb_device_properties ttusb2_properties_s2400; |
215 | static struct dvb_usb_device_properties ttusb2_properties_ct3650; | ||
183 | 216 | ||
184 | static int ttusb2_probe(struct usb_interface *intf, | 217 | static int ttusb2_probe(struct usb_interface *intf, |
185 | const struct usb_device_id *id) | 218 | const struct usb_device_id *id) |
@@ -187,6 +220,8 @@ static int ttusb2_probe(struct usb_interface *intf, | |||
187 | if (0 == dvb_usb_device_init(intf, &ttusb2_properties, | 220 | if (0 == dvb_usb_device_init(intf, &ttusb2_properties, |
188 | THIS_MODULE, NULL, adapter_nr) || | 221 | THIS_MODULE, NULL, adapter_nr) || |
189 | 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400, | 222 | 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400, |
223 | THIS_MODULE, NULL, adapter_nr) || | ||
224 | 0 == dvb_usb_device_init(intf, &ttusb2_properties_ct3650, | ||
190 | THIS_MODULE, NULL, adapter_nr)) | 225 | THIS_MODULE, NULL, adapter_nr)) |
191 | return 0; | 226 | return 0; |
192 | return -ENODEV; | 227 | return -ENODEV; |
@@ -197,6 +232,8 @@ static struct usb_device_id ttusb2_table [] = { | |||
197 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) }, | 232 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) }, |
198 | { USB_DEVICE(USB_VID_TECHNOTREND, | 233 | { USB_DEVICE(USB_VID_TECHNOTREND, |
199 | USB_PID_TECHNOTREND_CONNECT_S2400) }, | 234 | USB_PID_TECHNOTREND_CONNECT_S2400) }, |
235 | { USB_DEVICE(USB_VID_TECHNOTREND, | ||
236 | USB_PID_TECHNOTREND_CONNECT_CT3650) }, | ||
200 | {} /* Terminating entry */ | 237 | {} /* Terminating entry */ |
201 | }; | 238 | }; |
202 | MODULE_DEVICE_TABLE (usb, ttusb2_table); | 239 | MODULE_DEVICE_TABLE (usb, ttusb2_table); |
@@ -214,8 +251,8 @@ static struct dvb_usb_device_properties ttusb2_properties = { | |||
214 | { | 251 | { |
215 | .streaming_ctrl = NULL, // ttusb2_streaming_ctrl, | 252 | .streaming_ctrl = NULL, // ttusb2_streaming_ctrl, |
216 | 253 | ||
217 | .frontend_attach = ttusb2_frontend_attach, | 254 | .frontend_attach = ttusb2_frontend_tda10086_attach, |
218 | .tuner_attach = ttusb2_tuner_attach, | 255 | .tuner_attach = ttusb2_tuner_tda826x_attach, |
219 | 256 | ||
220 | /* parameter for the MPEG2-data transfer */ | 257 | /* parameter for the MPEG2-data transfer */ |
221 | .stream = { | 258 | .stream = { |
@@ -266,8 +303,8 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = { | |||
266 | { | 303 | { |
267 | .streaming_ctrl = NULL, | 304 | .streaming_ctrl = NULL, |
268 | 305 | ||
269 | .frontend_attach = ttusb2_frontend_attach, | 306 | .frontend_attach = ttusb2_frontend_tda10086_attach, |
270 | .tuner_attach = ttusb2_tuner_attach, | 307 | .tuner_attach = ttusb2_tuner_tda826x_attach, |
271 | 308 | ||
272 | /* parameter for the MPEG2-data transfer */ | 309 | /* parameter for the MPEG2-data transfer */ |
273 | .stream = { | 310 | .stream = { |
@@ -301,6 +338,52 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = { | |||
301 | } | 338 | } |
302 | }; | 339 | }; |
303 | 340 | ||
341 | static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { | ||
342 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | ||
343 | |||
344 | .usb_ctrl = CYPRESS_FX2, | ||
345 | |||
346 | .size_of_priv = sizeof(struct ttusb2_state), | ||
347 | |||
348 | .num_adapters = 1, | ||
349 | .adapter = { | ||
350 | { | ||
351 | .streaming_ctrl = NULL, | ||
352 | |||
353 | .frontend_attach = ttusb2_frontend_tda10023_attach, | ||
354 | .tuner_attach = ttusb2_tuner_tda827x_attach, | ||
355 | |||
356 | /* parameter for the MPEG2-data transfer */ | ||
357 | .stream = { | ||
358 | .type = USB_ISOC, | ||
359 | .count = 5, | ||
360 | .endpoint = 0x02, | ||
361 | .u = { | ||
362 | .isoc = { | ||
363 | .framesperurb = 4, | ||
364 | .framesize = 940, | ||
365 | .interval = 1, | ||
366 | } | ||
367 | } | ||
368 | } | ||
369 | }, | ||
370 | }, | ||
371 | |||
372 | .power_ctrl = ttusb2_power_ctrl, | ||
373 | .identify_state = ttusb2_identify_state, | ||
374 | |||
375 | .i2c_algo = &ttusb2_i2c_algo, | ||
376 | |||
377 | .generic_bulk_ctrl_endpoint = 0x01, | ||
378 | |||
379 | .num_device_descs = 1, | ||
380 | .devices = { | ||
381 | { "Technotrend TT-connect CT-3650", | ||
382 | .warm_ids = { &ttusb2_table[3], NULL }, | ||
383 | }, | ||
384 | } | ||
385 | }; | ||
386 | |||
304 | static struct usb_driver ttusb2_driver = { | 387 | static struct usb_driver ttusb2_driver = { |
305 | .name = "dvb_usb_ttusb2", | 388 | .name = "dvb_usb_ttusb2", |
306 | .probe = ttusb2_probe, | 389 | .probe = ttusb2_probe, |