Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (3266): Add support for DViCO FusionHDTV5 USB Gold


- Adds Bluebird ATSC support to the cxusb driver,
using dvb-usb-bluebird-atsc-01.fw firmware.

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>

authored by

Michael Krufky and committed by
Mauro Carvalho Chehab
effee033 af36c82c

+86 -8
+84 -8
drivers/media/dvb/dvb-usb/cxusb.c
··· 25 25 #include "cxusb.h" 26 26 27 27 #include "cx22702.h" 28 + #include "lgdt330x.h" 28 29 29 30 /* debug */ 30 31 int dvb_usb_cxusb_debug; ··· 166 165 .pll_set = dvb_usb_pll_set_i2c, 167 166 }; 168 167 168 + struct lgdt330x_config cxusb_lgdt330x_config = { 169 + .demod_address = 0x0e, 170 + .demod_chip = LGDT3303, 171 + .pll_set = dvb_usb_pll_set_i2c, 172 + }; 173 + 169 174 /* Callbacks for DVB USB */ 170 - static int cxusb_tuner_attach(struct dvb_usb_device *d) 175 + static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) 171 176 { 172 177 u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 }; 173 178 d->pll_addr = 0x61; 174 - memcpy(d->pll_init,bpll,4); 179 + memcpy(d->pll_init, bpll, 4); 175 180 d->pll_desc = &dvb_pll_fmd1216me; 176 181 return 0; 177 182 } 178 183 179 - static int cxusb_frontend_attach(struct dvb_usb_device *d) 184 + static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d) 185 + { 186 + u8 bpll[4] = { 0x00, 0x00, 0x18, 0x50 }; 187 + /* bpll[2] : unset bit 3, set bits 4&5 188 + bpll[3] : 0x50 - digital, 0x20 - analog */ 189 + d->pll_addr = 0x61; 190 + memcpy(d->pll_init, bpll, 4); 191 + d->pll_desc = &dvb_pll_tdvs_tua6034; 192 + return 0; 193 + } 194 + 195 + static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) 180 196 { 181 197 u8 b; 182 198 if (usb_set_interface(d->udev,0,6) < 0) ··· 207 189 return -EIO; 208 190 } 209 191 192 + static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) 193 + { 194 + if (usb_set_interface(d->udev,0,0) < 0) 195 + err("set interface failed"); 196 + 197 + cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 198 + 199 + if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) 200 + return 0; 201 + 202 + return -EIO; 203 + } 204 + 210 205 /* DVB USB Driver stuff */ 211 - static struct dvb_usb_properties cxusb_properties; 206 + static struct dvb_usb_properties cxusb_medion_properties; 207 + static struct dvb_usb_properties cxusb_bluebird_atsc_properties; 212 208 213 209 static int cxusb_probe(struct usb_interface *intf, 214 210 const struct usb_device_id *id) 215 211 { 216 - return dvb_usb_device_init(intf,&cxusb_properties,THIS_MODULE,NULL); 212 + if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || 213 + dvb_usb_device_init(intf,&cxusb_bluebird_atsc_properties,THIS_MODULE,NULL) == 0) { 214 + return 0; 215 + } 216 + 217 + return -EINVAL; 217 218 } 218 219 219 220 static struct usb_device_id cxusb_table [] = { 220 221 { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) }, 222 + { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) }, 223 + { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, 221 224 {} /* Terminating entry */ 222 225 }; 223 226 MODULE_DEVICE_TABLE (usb, cxusb_table); 224 227 225 - static struct dvb_usb_properties cxusb_properties = { 228 + static struct dvb_usb_properties cxusb_medion_properties = { 226 229 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 227 230 228 231 .usb_ctrl = CYPRESS_FX2, ··· 252 213 253 214 .streaming_ctrl = cxusb_streaming_ctrl, 254 215 .power_ctrl = cxusb_power_ctrl, 255 - .frontend_attach = cxusb_frontend_attach, 256 - .tuner_attach = cxusb_tuner_attach, 216 + .frontend_attach = cxusb_cx22702_frontend_attach, 217 + .tuner_attach = cxusb_fmd1216me_tuner_attach, 257 218 258 219 .i2c_algo = &cxusb_i2c_algo, 259 220 ··· 275 236 { "Medion MD95700 (MDUSBTV-HYBRID)", 276 237 { NULL }, 277 238 { &cxusb_table[0], NULL }, 239 + }, 240 + } 241 + }; 242 + 243 + static struct dvb_usb_properties cxusb_bluebird_atsc_properties = { 244 + .caps = DVB_USB_IS_AN_I2C_ADAPTER, 245 + 246 + .usb_ctrl = CYPRESS_FX2, 247 + .firmware = "dvb-usb-bluebird-atsc-01.fw", 248 + 249 + .size_of_priv = sizeof(struct cxusb_state), 250 + 251 + .streaming_ctrl = cxusb_streaming_ctrl, 252 + .power_ctrl = cxusb_power_ctrl, 253 + .frontend_attach = cxusb_lgdt330x_frontend_attach, 254 + .tuner_attach = cxusb_lgh064f_tuner_attach, 255 + 256 + .i2c_algo = &cxusb_i2c_algo, 257 + 258 + .generic_bulk_ctrl_endpoint = 0x01, 259 + /* parameter for the MPEG2-data transfer */ 260 + .urb = { 261 + .type = DVB_USB_BULK, 262 + .count = 5, 263 + .endpoint = 0x02, 264 + .u = { 265 + .bulk = { 266 + .buffersize = 8192, 267 + } 268 + } 269 + }, 270 + 271 + .num_device_descs = 1, 272 + .devices = { 273 + { "DViCO FusionHDTV5 USB Gold", 274 + { &cxusb_table[1], NULL }, 275 + { &cxusb_table[2], NULL }, 278 276 }, 279 277 } 280 278 };
+2
drivers/media/dvb/dvb-usb/dvb-usb-ids.h
··· 91 91 #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 92 92 #define USB_PID_DVICO_BLUEBIRD_LGZ201_1 0xdb01 93 93 #define USB_PID_DVICO_BLUEBIRD_TH7579_2 0xdb11 94 + #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 95 + #define USB_PID_DVICO_BLUEBIRD_LG064F_WARM 0xd700 94 96 #define USB_PID_MEDION_MD95700 0x0932 95 97 #define USB_PID_KYE_DVB_T_COLD 0x701e 96 98 #define USB_PID_KYE_DVB_T_WARM 0x701f