diff options
Diffstat (limited to 'linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c index dbf806bd6..bf47b3efc 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c @@ -1,25 +1,25 @@ /* - * Driver for mobile USB Budget DVB-T devices based on reference + * Driver for mobile USB Budget DVB-T devices based on reference * design made by DiBcom (http://www.dibcom.fr/) - * + * * dvb-dibusb-core.c - * + * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) - * + * * based on GPL code from DiBcom, which has * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr) * * Remote control code added by David Matthews (dm@prolingua.co.uk) - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. * * Acknowledgements - * + * * Amaury Demol (ademol@dibcom.fr) from DiBcom for providing specs and driver * sources, on which this driver (and the dib3000mb/mc/p frontends) are based. - * + * * see Documentation/dvb/README.dibusb for more information */ #include "dvb-dibusb.h" @@ -106,12 +106,12 @@ MODULE_PARM_DESC(rc_key_repeat_count, "how many key repeats will be dropped befo /* USB Driver stuff * table of devices that this driver is working with * - * ATTENTION: Never ever change the order of this table, the particular - * devices depend on this order + * ATTENTION: Never ever change the order of this table, the particular + * devices depend on this order * - * Each entry is used as a reference in the device_struct. Currently this is - * the only non-redundant way of assigning USB ids to actual devices I'm aware - * of, because there is only one place in the code where the assignment of + * Each entry is used as a reference in the device_struct. Currently this is + * the only non-redundant way of assigning USB ids to actual devices I'm aware + * of, because there is only one place in the code where the assignment of * vendor and product id is done, here. */ static struct usb_device_id dib_table [] = { @@ -119,8 +119,8 @@ static struct usb_device_id dib_table [] = { /* 01 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_WARM)}, /* 02 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_COLD) }, -/* the following device is actually not supported, but when loading the - * correct firmware (ie. its usb ids will change) everything works fine then +/* the following device is actually not supported, but when loading the + * correct firmware (ie. its usb ids will change) everything works fine then */ /* 03 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_WARM) }, @@ -141,14 +141,14 @@ static struct usb_device_id dib_table [] = { /* 18 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) }, /* 19 */ { USB_DEVICE(USB_VID_IMC_NETWORKS, USB_PID_TWINHAN_VP7041_COLD) }, /* 20 */ { USB_DEVICE(USB_VID_IMC_NETWORKS, USB_PID_TWINHAN_VP7041_WARM) }, -/* 21 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) }, -/* 22 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) }, +/* 21 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) }, +/* 22 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) }, /* 23 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) }, /* 24 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) }, /* 25 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) }, /* 26 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) }, /* 27 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, - + /* 28 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_COLD) }, /* 29 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_WARM) }, @@ -156,11 +156,11 @@ static struct usb_device_id dib_table [] = { /* 31 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_WINTV_NOVA_T_USB2_WARM) }, /* 32 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) }, /* 33 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) }, -/* - * activate the following define when you have one of the devices and want to +/* + * activate the following define when you have one of the devices and want to * build it from build-2.6 in dvb-kernel */ -// #define CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES +// #define CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES #ifdef CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES /* 34 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) }, /* 35 */ { USB_DEVICE(USB_VID_CYPRESS, USB_PID_ULTIMA_TVBOX_USB2_FX_COLD) }, @@ -179,11 +179,11 @@ static struct dibusb_usb_controller dibusb_usb_ctrl[] = { }; struct dibusb_tuner dibusb_tuner[] = { - { DIBUSB_TUNER_CABLE_THOMSON, - 0x61 + { DIBUSB_TUNER_CABLE_THOMSON, + 0x61 }, { DIBUSB_TUNER_COFDM_PANASONIC_ENV57H1XD5, - 0x60 + 0x60 }, { DIBUSB_TUNER_CABLE_LG_TDTP_E102P, 0x61 @@ -200,18 +200,18 @@ static struct dibusb_demod dibusb_demod[] = { }, { DIBUSB_DIB3000MC, 32, - { 0x9, 0xa, 0xb, 0xc }, + { 0x9, 0xa, 0xb, 0xc }, }, { DIBUSB_MT352, 254, - { 0xf, 0 }, + { 0xf, 0 }, }, }; static struct dibusb_device_class dibusb_device_classes[] = { { .id = DIBUSB1_1, .usb_ctrl = &dibusb_usb_ctrl[0], .firmware = "dvb-dibusb-5.0.0.11.fw", - .pipe_cmd = 0x01, .pipe_data = 0x02, + .pipe_cmd = 0x01, .pipe_data = 0x02, .urb_count = 7, .urb_buffer_size = 4096, DIBUSB_RC_NEC_PROTOCOL, &dibusb_demod[DIBUSB_DIB3000MB], @@ -219,7 +219,7 @@ static struct dibusb_device_class dibusb_device_classes[] = { }, { DIBUSB1_1_AN2235, &dibusb_usb_ctrl[1], "dvb-dibusb-an2235-1.fw", - 0x01, 0x02, + 0x01, 0x02, 7, 4096, DIBUSB_RC_NEC_PROTOCOL, &dibusb_demod[DIBUSB_DIB3000MB], @@ -227,7 +227,7 @@ static struct dibusb_device_class dibusb_device_classes[] = { }, { DIBUSB2_0,&dibusb_usb_ctrl[2], "dvb-dibusb-6.0.0.5.fw", - 0x01, 0x06, + 0x01, 0x06, 7, 4096, DIBUSB_RC_NEC_PROTOCOL, &dibusb_demod[DIBUSB_DIB3000MC], @@ -235,7 +235,7 @@ static struct dibusb_device_class dibusb_device_classes[] = { }, { UMT2_0, &dibusb_usb_ctrl[2], "dvb-dibusb-umt-2.fw", - 0x01, 0x06, + 0x01, 0x06, 20, 512, DIBUSB_RC_NO, &dibusb_demod[DIBUSB_MT352], @@ -324,12 +324,12 @@ static struct dibusb_usb_device dibusb_devices[] = { &dibusb_device_classes[UMT2_0], { &dib_table[2], NULL }, { NULL }, - }, + }, { "Hanftek UMT-010 DVB-T USB2.0", &dibusb_device_classes[UMT2_0], { &dib_table[28], NULL }, { &dib_table[29], NULL }, - }, + }, { "KWorld/ADSTech Instant DVB-T USB 2.0", &dibusb_device_classes[DIBUSB2_0B], { &dib_table[32], NULL }, @@ -375,9 +375,9 @@ static int dibusb_init(struct usb_dibusb *dib) sema_init(&dib->i2c_sem, 1); dib->init_state = DIBUSB_STATE_INIT; - + if ((ret = dibusb_urb_init(dib)) || - (ret = dibusb_dvb_init(dib)) || + (ret = dibusb_dvb_init(dib)) || (ret = dibusb_i2c_init(dib))) { dibusb_exit(dib); return ret; @@ -385,10 +385,10 @@ static int dibusb_init(struct usb_dibusb *dib) if ((ret = dibusb_fe_init(dib))) err("could not initialize a frontend."); - + if ((ret = dibusb_remote_init(dib))) err("could not initialize remote control."); - + return 0; } @@ -418,7 +418,7 @@ static struct dibusb_usb_device * dibusb_find_device (struct usb_device *udev,in int i,j; *cold = -1; struct dibusb_usb_device *dev = NULL; - + for (i = 0; i < sizeof(dibusb_devices)/sizeof(struct dibusb_usb_device); i++) { for (j = 0; j < DIBUSB_ID_MAX_NUM && dibusb_devices[i].cold_ids[j] != NULL; j++) { deb_info("check for cold %x %x\n",dibusb_devices[i].cold_ids[j]->idVendor, dibusb_devices[i].cold_ids[j]->idProduct); @@ -429,10 +429,10 @@ static struct dibusb_usb_device * dibusb_find_device (struct usb_device *udev,in break; } } - + if (dev != NULL) break; - + for (j = 0; j < DIBUSB_ID_MAX_NUM && dibusb_devices[i].warm_ids[j] != NULL; j++) { deb_info("check for warm %x %x\n",dibusb_devices[i].warm_ids[j]->idVendor, dibusb_devices[i].warm_ids[j]->idProduct); if (dibusb_devices[i].warm_ids[j]->idVendor == le16_to_cpu(udev->descriptor.idVendor) && @@ -446,20 +446,20 @@ static struct dibusb_usb_device * dibusb_find_device (struct usb_device *udev,in if (dev != NULL) dev = dibusb_device_class_quirk(udev,dev); - + return dev; } /* - * USB + * USB */ -static int dibusb_probe(struct usb_interface *intf, +static int dibusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev = interface_to_usbdev(intf); struct usb_dibusb *dib = NULL; struct dibusb_usb_device *dibdev = NULL; - + int ret = -ENOMEM,cold=0; if ((dibdev = dibusb_find_device(udev,&cold)) == NULL) { @@ -467,7 +467,7 @@ static int dibusb_probe(struct usb_interface *intf, "unknown product ID: %.4x",le16_to_cpu(udev->descriptor.idProduct)); return -ENODEV; } - + if (cold == 1) { info("found a '%s' in cold state, will try to load a firmware",dibdev->name); ret = dibusb_loadfirmware(udev,dibdev); @@ -479,7 +479,7 @@ static int dibusb_probe(struct usb_interface *intf, return ret; } memset(dib,0,sizeof(struct usb_dibusb)); - + dib->udev = udev; dib->dibdev = dibdev; @@ -489,13 +489,13 @@ static int dibusb_probe(struct usb_interface *intf, dib->rc_key_repeat_count = rc_key_repeat_count; usb_set_intfdata(intf, dib); - + ret = dibusb_init(dib); } - + if (ret == 0) info("%s successfully initialized and connected.",dibdev->name); - else + else info("%s error while loading driver (%d)",dibdev->name,ret); return ret; } @@ -504,23 +504,23 @@ static void dibusb_disconnect(struct usb_interface *intf) { struct usb_dibusb *dib = usb_get_intfdata(intf); const char *name = DRIVER_DESC; - + usb_set_intfdata(intf,NULL); if (dib != NULL && dib->dibdev != NULL) { name = dib->dibdev->name; dibusb_exit(dib); } info("%s successfully deinitialized and disconnected.",name); - + } /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver dibusb_driver = { .owner = THIS_MODULE, .name = DRIVER_DESC, - .probe = dibusb_probe, + .probe = dibusb_probe, .disconnect = dibusb_disconnect, - .id_table = dib_table, + .id_table = dib_table, }; /* module stuff */ @@ -531,7 +531,7 @@ static int __init usb_dibusb_init(void) err("usb_register failed. Error number %d",result); return result; } - + return 0; } |