diff options
author | Johannes Stezenbach <devnull@localhost> | 2005-03-12 20:23:51 +0000 |
---|---|---|
committer | Johannes Stezenbach <devnull@localhost> | 2005-03-12 20:23:51 +0000 |
commit | d409fb356d6cf8b8f2b146520fed7060b6e89982 (patch) | |
tree | 1aa12a90f56501ada01edaed5baa864dedb2e87c /linux/drivers/media/dvb/dibusb | |
parent | d267ed772fa9b010410b9868ce03e34733d821c3 (diff) | |
download | mediapointer-dvb-s2-d409fb356d6cf8b8f2b146520fed7060b6e89982.tar.gz mediapointer-dvb-s2-d409fb356d6cf8b8f2b146520fed7060b6e89982.tar.bz2 |
a few more whitespace cleanups
Diffstat (limited to 'linux/drivers/media/dvb/dibusb')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c | 104 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c | 26 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | 138 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c | 24 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c | 52 |
6 files changed, 182 insertions, 182 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; } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c index f71e16007..a66f967b0 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c @@ -1,12 +1,12 @@ /* - * dvb-dibusb-dvb.c is part of the driver for mobile USB Budget DVB-T devices + * dvb-dibusb-dvb.c is part of the driver for mobile USB Budget DVB-T devices * based on reference design made by DiBcom (http://www.dibcom.fr/) * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * * see dvb-dibusb-core.c for more copyright details. * - * This file contains functions for initializing and handling the + * This file contains functions for initializing and handling the * linux-dvb API. */ #include "dvb-dibusb.h" @@ -17,7 +17,7 @@ static u32 urb_compl_count; /* - * MPEG2 TS DVB stuff + * MPEG2 TS DVB stuff */ void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) { @@ -46,24 +46,24 @@ void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) if (dib->feedcount > 0) { if (dib->init_state & DIBUSB_STATE_DVB) dvb_dmx_swfilter(&dib->demux, (u8*) urb->transfer_buffer,urb->actual_length); - } else + } else deb_ts("URB dropped because of feedcount.\n"); usb_submit_urb(urb,GFP_ATOMIC); } -static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) +static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) { struct usb_dibusb *dib = dvbdmxfeed->demux->priv; int newfeedcount; - + if (dib == NULL) return -ENODEV; newfeedcount = dib->feedcount + (onoff ? 1 : -1); - /* - * stop feed before setting a new pid if there will be no pid anymore + /* + * stop feed before setting a new pid if there will be no pid anymore */ if (newfeedcount == 0) { deb_ts("stop feeding\n"); @@ -74,7 +74,7 @@ static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) } } } - + dib->feedcount = newfeedcount; /* activate the pid on the device specific pid_filter */ @@ -82,7 +82,7 @@ static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) if (dib->pid_parse && dib->xfer_ops.pid_ctrl != NULL) dib->xfer_ops.pid_ctrl(dib->fe,dvbdmxfeed->index,dvbdmxfeed->pid,onoff); - /* + /* * start the feed if this was the first pid to set and there is still a pid * for reception. */ @@ -94,7 +94,7 @@ static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) err("could not handle pid_parser"); } } - + deb_ts("start feeding\n"); if (dib->xfer_ops.fifo_ctrl != NULL) { if (dib->xfer_ops.fifo_ctrl(dib->fe,1)) { @@ -131,9 +131,9 @@ int dibusb_dvb_init(struct usb_dibusb *dib) goto err; } dib->adapter->priv = dib; - + /* i2c is done in dibusb_i2c_init */ - + dib->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; dib->demux.priv = (void *)dib; diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c index 5cc5723e5..15e67b8dd 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c @@ -1,5 +1,5 @@ /* - * dvb-dibusb-fe-i2c.c is part of the driver for mobile USB Budget DVB-T devices + * dvb-dibusb-fe-i2c.c is part of the driver for mobile USB Budget DVB-T devices * based on reference design made by DiBcom (http://www.dibcom.fr/) * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) @@ -8,30 +8,30 @@ * * This file contains functions for attaching, initializing of an appropriate * demodulator/frontend. I2C-stuff is also located here. - * + * */ #include "dvb-dibusb.h" #include <linux/usb.h> -static int dibusb_i2c_msg(struct usb_dibusb *dib, u8 addr, +static int dibusb_i2c_msg(struct usb_dibusb *dib, u8 addr, u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) { u8 sndbuf[wlen+4]; /* lead(1) devaddr,direction(1) addr(2) data(wlen) (len(2) (when reading)) */ /* write only ? */ - int wo = (rbuf == NULL || rlen == 0), + int wo = (rbuf == NULL || rlen == 0), len = 2 + wlen + (wo ? 0 : 2); - + sndbuf[0] = wo ? DIBUSB_REQ_I2C_WRITE : DIBUSB_REQ_I2C_READ; sndbuf[1] = (addr << 1) | (wo ? 0 : 1); memcpy(&sndbuf[2],wbuf,wlen); - + if (!wo) { sndbuf[wlen+2] = (rlen >> 8) & 0xff; sndbuf[wlen+3] = rlen & 0xff; } - + return dibusb_readwrite_usb(dib,sndbuf,len,rbuf,rlen); } @@ -43,12 +43,12 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num struct usb_dibusb *dib = i2c_get_adapdata(adap); int i; - if (down_interruptible(&dib->i2c_sem) < 0) + if (down_interruptible(&dib->i2c_sem) < 0) return -EAGAIN; if (num > 2) warn("more than 2 i2c messages at a time is not handled yet. TODO."); - + for (i = 0; i < num; i++) { /* write/read request */ if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { @@ -56,13 +56,13 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num msg[i+1].buf,msg[i+1].len) < 0) break; i++; - } else + } else if (dibusb_i2c_msg(dib, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0) break; } - + up(&dib->i2c_sem); - return i; + return i; } static u32 dibusb_i2c_func(struct i2c_adapter *adapter) @@ -80,16 +80,16 @@ static struct i2c_algorithm dibusb_algo = { static int dibusb_general_demod_init(struct dvb_frontend *fe); static u8 dibusb_general_pll_addr(struct dvb_frontend *fe); static int dibusb_general_pll_init(struct dvb_frontend *fe, u8 pll_buf[5]); -static int dibusb_general_pll_set(struct dvb_frontend *fe, +static int dibusb_general_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters* params, u8 pll_buf[5]); static struct mt352_config mt352_hanftek_umt_010_config = { .demod_address = 0x1e, .demod_init = dibusb_general_demod_init, - .pll_set = dibusb_general_pll_set, + .pll_set = dibusb_general_pll_set, }; -static int dibusb_tuner_quirk(struct usb_dibusb *dib) +static int dibusb_tuner_quirk(struct usb_dibusb *dib) { switch (dib->dibdev->dev_cl->id) { case DIBUSB1_1: /* some these device have the ENV77H11D5 and some the THOMSON CABLE */ @@ -100,11 +100,11 @@ static int dibusb_tuner_quirk(struct usb_dibusb *dib) { .flags = 0, .buf = b, .len = 2 }, { .flags = I2C_M_RD, .buf = b2, .len = 1}, }; - + t = &dibusb_tuner[DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5]; - + msg[0].addr = msg[1].addr = t->pll_addr; - + if (dib->xfer_ops.tuner_pass_ctrl != NULL) dib->xfer_ops.tuner_pass_ctrl(dib->fe,1,t->pll_addr); dibusb_i2c_xfer(&dib->i2c_adap,msg,2); @@ -117,7 +117,7 @@ static int dibusb_tuner_quirk(struct usb_dibusb *dib) dib->tuner = t; info("this device has the Panasonic ENV77H11D5 onboard."); } - break; + break; } default: break; @@ -125,7 +125,7 @@ static int dibusb_tuner_quirk(struct usb_dibusb *dib) return 0; } -/* there is a ugly pid_filter in the firmware of the umt devices, it is accessible +/* there is a ugly pid_filter in the firmware of the umt devices, it is accessible * by i2c address 0x8. Don't know how to deactivate it and how many rows it has. */ static int dibusb_umt_pid_control(struct dvb_frontend *fe, int index, int pid, int onoff) @@ -150,9 +150,9 @@ int dibusb_fe_init(struct usb_dibusb* dib) { struct dib3000_config demod_cfg; int i; - - if (dib->init_state & DIBUSB_STATE_I2C) { - for (i = 0; i < sizeof(dib->dibdev->dev_cl->demod->i2c_addrs) / sizeof(unsigned char) && + + if (dib->init_state & DIBUSB_STATE_I2C) { + for (i = 0; i < sizeof(dib->dibdev->dev_cl->demod->i2c_addrs) / sizeof(unsigned char) && dib->dibdev->dev_cl->demod->i2c_addrs[i] != 0; i++) { demod_cfg.demod_address = dib->dibdev->dev_cl->demod->i2c_addrs[i]; @@ -184,11 +184,11 @@ int dibusb_fe_init(struct usb_dibusb* dib) dib->fe_sleep = dib->fe->ops->sleep; dib->fe->ops->sleep = dibusb_hw_sleep; - if (dib->fe->ops->init != NULL ) + if (dib->fe->ops->init != NULL ) dib->fe_init = dib->fe->ops->init; dib->fe->ops->init = dibusb_hw_wakeup; - - /* setting the default tuner */ + + /* setting the default tuner */ dib->tuner = dib->dibdev->dev_cl->tuner; /* check which tuner is mounted on this device, in case this is unsure */ @@ -208,7 +208,7 @@ int dibusb_fe_init(struct usb_dibusb* dib) return -ENODEV; } } - + return 0; } @@ -231,15 +231,15 @@ int dibusb_i2c_init(struct usb_dibusb *dib) #else dib->i2c_adap.class = I2C_CLASS_TV_DIGITAL, #endif - dib->i2c_adap.algo = &dibusb_algo; + dib->i2c_adap.algo = &dibusb_algo; dib->i2c_adap.algo_data = NULL; dib->i2c_adap.id = I2C_ALGO_BIT; - + i2c_set_adapdata(&dib->i2c_adap, dib); - + if ((ret = i2c_add_adapter(&dib->i2c_adap)) < 0) err("could not add i2c adapter"); - + dib->init_state |= DIBUSB_STATE_I2C; return ret; @@ -271,8 +271,8 @@ static int thomson_cable_eu_pll_set(struct dvb_frontend_parameters *fep, u8 pllb pllbuf[0] = (tfreq >> 8) & 0x7f; pllbuf[1] = tfreq & 0xff; - pllbuf[2] = 0x8e; - pllbuf[3] = (vu << 7) | (p2 << 2) | (p1 << 1) | p0; + pllbuf[2] = 0x8e; + pllbuf[3] = (vu << 7) | (p2 << 2) | (p1 << 1) | p0; return 0; } @@ -285,7 +285,7 @@ static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend_parameters *fe err("frequency cannot be larger than 858 MHz."); return -EINVAL; } - + // contol data 1 : 1 | T/A=1 | T2,T1,T0 = 0,0,0 | R2,R1,R0 = 0,1,0 TA = 1; T210 = 0; @@ -293,19 +293,19 @@ static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend_parameters *fe ctrl1 = (1 << 7) | (TA << 6) | (T210 << 3) | R210; // ******** CHARGE PUMP CONFIG vs RF FREQUENCIES ***************** - if (freq_khz < 470000) + if (freq_khz < 470000) cp210 = 2; // VHF Low and High band ch E12 to E4 to E12 - else if (freq_khz < 526000) + else if (freq_khz < 526000) cp210 = 4; // UHF band Ch E21 to E27 - else // if (freq < 862000000) + else // if (freq < 862000000) cp210 = 5; // UHF band ch E28 to E69 //********************* BW select ******************************* - if (freq_khz < 153000) + if (freq_khz < 153000) p4321 = 1; // BW selected for VHF low - else if (freq_khz < 470000) + else if (freq_khz < 470000) p4321 = 2; // BW selected for VHF high E5 to E12 - else // if (freq < 862000000) + else // if (freq < 862000000) p4321 = 4; // BW selection for UHF E21 to E69 pllbuf[0] = (tfreq >> 8) & 0xff; @@ -317,7 +317,7 @@ static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend_parameters *fe } /* - * 7 6 5 4 3 2 1 0 + * 7 6 5 4 3 2 1 0 * Address Byte 1 1 0 0 0 MA1 MA0 R/~W=0 * * Program divider byte 1 0 n14 n13 n12 n11 n10 n9 n8 @@ -325,14 +325,14 @@ static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend_parameters *fe * * Control byte 1 1 T/A=1 T2 T1 T0 R2 R1 R0 * 1 T/A=0 0 0 ATC AL2 AL1 AL0 - * + * * Control byte 2 CP2 CP1 CP0 BS5 BS4 BS3 BS2 BS1 - * + * * MA0/1 = programmable address bits * R/~W = read/write bit (0 for writing) * N14-0 = programmable LO frequency - * - * T/A = test AGC bit (0 = next 6 bits AGC setting, + * + * T/A = test AGC bit (0 = next 6 bits AGC setting, * 1 = next 6 bits test and reference divider ratio settings) * T2-0 = test bits * R2-0 = reference divider ratio and programmable frequency step @@ -422,14 +422,14 @@ static int panasonic_cofdm_env77h11d5_tda6650_set (struct dvb_frontend_parameter } /* - * 7 6 5 4 3 2 1 0 + * 7 6 5 4 3 2 1 0 * Address Byte 1 1 0 0 0 MA1 MA0 R/~W=0 * * Program divider byte 1 0 n14 n13 n12 n11 n10 n9 n8 * Program divider byte 2 n7 n6 n5 n4 n3 n2 n1 n0 * * Control byte 1 CP T2 T1 T0 RSA RSB OS - * + * * Band Switch byte X X X P4 P3 P2 P1 P0 * * Auxiliary byte ATC AL2 AL1 AL0 0 0 0 0 @@ -440,7 +440,7 @@ static int panasonic_cofdm_env77h11d5_tda6650_set (struct dvb_frontend_parameter * 1 0 c4 * 1 1 c6 */ -static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[4]) +static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[4]) { u32 div; u8 p210, p3; @@ -450,18 +450,18 @@ static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[ div = (fep->frequency + 36125000 + TUNER_MUL / 2) / TUNER_MUL; // div = ((fep->frequency/1000 + 36166) * 6) / 1000; - if (fep->frequency < 174500000) + if (fep->frequency < 174500000) p210 = 1; // not supported by the tdtp_e102p else if (fep->frequency < 230000000) // VHF p210 = 2; - else + else p210 = 4; if (fep->u.ofdm.bandwidth == BANDWIDTH_7_MHZ) p3 = 0; - else + else p3 = 1; - + pllbuf[0] = (div >> 8) & 0x7f; pllbuf[1] = div & 0xff; pllbuf[2] = 0xce; @@ -478,7 +478,7 @@ static int lg_tdtp_e102p_mt352_demod_init(struct dvb_frontend *fe) static u8 mt352_mclk_ratio[] = { 0x8b, 0x00 }; static u8 mt352_adc_ctl_1_cfg[] = { 0x8E, 0x40 }; static u8 mt352_agc_cfg[] = { 0x67, 0x10, 0xa0 }; - + static u8 mt352_sec_agc_cfg1[] = { 0x6a, 0xff }; static u8 mt352_sec_agc_cfg2[] = { 0x6d, 0xff }; static u8 mt352_sec_agc_cfg3[] = { 0x70, 0x40 }; @@ -492,7 +492,7 @@ static int lg_tdtp_e102p_mt352_demod_init(struct dvb_frontend *fe) udelay(2000); mt352_write(fe, mt352_reset, sizeof(mt352_reset)); mt352_write(fe, mt352_mclk_ratio, sizeof(mt352_mclk_ratio)); - + mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg)); mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg)); @@ -501,10 +501,10 @@ static int lg_tdtp_e102p_mt352_demod_init(struct dvb_frontend *fe) mt352_write(fe, mt352_sec_agc_cfg3, sizeof(mt352_sec_agc_cfg3)); mt352_write(fe, mt352_sec_agc_cfg4, sizeof(mt352_sec_agc_cfg4)); mt352_write(fe, mt352_sec_agc_cfg5, sizeof(mt352_sec_agc_cfg5)); - + mt352_write(fe, mt352_acq_ctl, sizeof(mt352_acq_ctl)); mt352_write(fe, mt352_input_freq_1, sizeof(mt352_input_freq_1)); - + return 0; } @@ -529,11 +529,11 @@ static u8 dibusb_general_pll_addr(struct dvb_frontend *fe) static int dibusb_pll_i2c_helper(struct usb_dibusb *dib, u8 pll_buf[5], u8 buf[4]) { if (pll_buf == NULL) { - struct i2c_msg msg = { - .addr = dib->tuner->pll_addr, - .flags = 0, - .buf = buf, - .len = sizeof(buf) + struct i2c_msg msg = { + .addr = dib->tuner->pll_addr, + .flags = 0, + .buf = buf, + .len = sizeof(buf) }; if (i2c_transfer (&dib->i2c_adap, &msg, 1) != 1) return -EIO; @@ -546,7 +546,7 @@ static int dibusb_pll_i2c_helper(struct usb_dibusb *dib, u8 pll_buf[5], u8 buf[4 return 0; } -static int dibusb_general_pll_init(struct dvb_frontend *fe, +static int dibusb_general_pll_init(struct dvb_frontend *fe, u8 pll_buf[5]) { struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; @@ -559,14 +559,14 @@ static int dibusb_general_pll_init(struct dvb_frontend *fe, default: break; } - + if (ret) return ret; return dibusb_pll_i2c_helper(dib,pll_buf,buf); } -static int dibusb_general_pll_set(struct dvb_frontend *fe, +static int dibusb_general_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep, u8 pll_buf[5]) { struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; @@ -574,14 +574,14 @@ static int dibusb_general_pll_set(struct dvb_frontend *fe, int ret=0; switch (dib->tuner->id) { - case DIBUSB_TUNER_CABLE_THOMSON: - ret = thomson_cable_eu_pll_set(fep, buf); + case DIBUSB_TUNER_CABLE_THOMSON: + ret = thomson_cable_eu_pll_set(fep, buf); break; case DIBUSB_TUNER_COFDM_PANASONIC_ENV57H1XD5: ret = panasonic_cofdm_env57h1xd5_pll_set(fep, buf); break; case DIBUSB_TUNER_CABLE_LG_TDTP_E102P: - ret = lg_tdtp_e102p_tua6034(fep, buf); + ret = lg_tdtp_e102p_tua6034(fep, buf); break; case DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5: ret = panasonic_cofdm_env77h11d5_tda6650_set(fep,buf); @@ -591,9 +591,9 @@ static int dibusb_general_pll_set(struct dvb_frontend *fe, ret = -ENODEV; break; } - + if (ret) return ret; - + return dibusb_pll_i2c_helper(dib,pll_buf,buf); } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c index c8a0efaf4..b27faf31c 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c @@ -1,5 +1,5 @@ /* - * dvb-dibusb-firmware.c is part of the driver for mobile USB Budget DVB-T devices + * dvb-dibusb-firmware.c is part of the driver for mobile USB Budget DVB-T devices * based on reference design made by DiBcom (http://www.dibcom.fr/) * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) @@ -14,7 +14,7 @@ #include <linux/usb.h> /* - * load a firmware packet to the device + * load a firmware packet to the device */ static int dibusb_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len) { @@ -28,7 +28,7 @@ int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibde u16 addr; u8 *b,*p; int ret = 0,i; - + if ((ret = request_firmware(&fw, dibdev->dev_cl->firmware, &udev->dev)) != 0) { err("did not find the firmware file. (%s) " "Please see linux/Documentation/dvb/ for more details on firmware-problems.", @@ -37,12 +37,12 @@ int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibde } info("downloading firmware from file '%s'.",dibdev->dev_cl->firmware); - - p = kmalloc(fw->size,GFP_KERNEL); + + p = kmalloc(fw->size,GFP_KERNEL); if (p != NULL) { u8 reset; /* - * you cannot use the fw->data as buffer for + * you cannot use the fw->data as buffer for * usb_control_msg, a new buffer has to be * created */ @@ -50,14 +50,14 @@ int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibde /* stop the CPU */ reset = 1; - if ((ret = dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1)) != 1) + if ((ret = dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1)) != 1) err("could not stop the USB controller CPU."); - for(i = 0; p[i+3] == 0 && i < fw->size; ) { + for(i = 0; p[i+3] == 0 && i < fw->size; ) { b = (u8 *) &p[i]; addr = *((u16 *) &b[1]); ret = dibusb_writemem(udev,addr,&b[4],b[0]); - + if (ret != b[0]) { err("error while transferring firmware " "(transferred size: %d, block size: %d)", @@ -78,7 +78,7 @@ int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibde } kfree(p); - } else { + } else { ret = -ENOMEM; } release_firmware(fw); diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c index cdc4067e3..ab5f734db 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c @@ -126,12 +126,12 @@ static const struct { u16 raw; uint32_t key; } haupp_rc_keys [] = { { 0xc4f, KEY_9 }, { 0xc57, KEY_KPASTERISK }, { 0xc77, KEY_GRAVE }, /* # */ - { 0xc5f, KEY_RED }, + { 0xc5f, KEY_RED }, { 0xd77, KEY_GREEN }, { 0xdc7, KEY_YELLOW }, { 0xd4f, KEY_BLUE}, }; - + static int dibusb_key2event_nec(struct usb_dibusb *dib,u8 rb[5]) { int i; @@ -151,7 +151,7 @@ static int dibusb_key2event_nec(struct usb_dibusb *dib,u8 rb[5]) if (nec_rc_keys[i].c0 == rb[1] && nec_rc_keys[i].c1 == rb[2] && nec_rc_keys[i].c2 == rb[3]) { - + dib->last_event = nec_rc_keys[i].key; return 1; } @@ -160,7 +160,7 @@ static int dibusb_key2event_nec(struct usb_dibusb *dib,u8 rb[5]) case DIBUSB_RC_NEC_KEY_REPEATED: /* rb[1]..rb[4] are always zero.*/ /* Repeats often seem to occur so for the moment just ignore this. */ - return 0; + return 0; case DIBUSB_RC_NEC_EMPTY: /* No (more) remote control keys. */ default: break; @@ -184,7 +184,7 @@ static int dibusb_key2event_hauppauge(struct usb_dibusb *dib,u8 rb[4]) if (dib->last_event == haupp_rc_keys[i].key && dib->last_state == state) { deb_rc("key repeat\n"); - return 0; + return 0; } else { dib->last_event = haupp_rc_keys[i].key; dib->last_state = state; @@ -209,10 +209,10 @@ static int dibusb_read_remote_control(struct usb_dibusb *dib) { u8 b[1] = { DIBUSB_REQ_POLL_REMOTE }, rb[5]; int ret,event = 0; - + if ((ret = dibusb_readwrite_usb(dib,b,1,rb,5))) return ret; - + switch (dib->dibdev->dev_cl->remote_type) { case DIBUSB_RC_NEC_PROTOCOL: event = dibusb_key2event_nec(dib,rb); @@ -229,10 +229,10 @@ static int dibusb_read_remote_control(struct usb_dibusb *dib) deb_rc("key repeat dropped. (%d)\n",dib->repeat_key_count); event = -1; /* skip this key repeat */ } - + if (event == 1 || event == 0) { deb_rc("Translated key 0x%04x\n",event); - + /* Signal down and up events for this key. */ input_report_key(&dib->rc_input_dev, dib->last_event, 1); input_report_key(&dib->rc_input_dev, dib->last_event, 0); @@ -262,7 +262,7 @@ int dibusb_remote_init(struct usb_dibusb *dib) if (dib->dibdev->dev_cl->remote_type == DIBUSB_RC_NO) return 0; - + /* Initialise the remote-control structures.*/ init_input_dev(&dib->rc_input_dev); @@ -283,7 +283,7 @@ int dibusb_remote_init(struct usb_dibusb *dib) default: break; } - + input_register_device(&dib->rc_input_dev); @@ -297,7 +297,7 @@ int dibusb_remote_init(struct usb_dibusb *dib) schedule_delayed_work(&dib->rc_query_work,msecs_to_jiffies(dib->rc_query_interval)); dib->init_state |= DIBUSB_STATE_REMOTE; - + return 0; } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c index 97cdc1d28..470807987 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c @@ -1,12 +1,12 @@ /* - * dvb-dibusb-usb.c is part of the driver for mobile USB Budget DVB-T devices + * dvb-dibusb-usb.c is part of the driver for mobile USB Budget DVB-T devices * based on reference design made by DiBcom (http://www.dibcom.fr/) * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * * see dvb-dibusb-core.c for more copyright details. * - * This file contains functions for initializing and handling the + * This file contains functions for initializing and handling the * usb specific stuff. */ #include "dvb-dibusb.h" @@ -30,7 +30,7 @@ int dibusb_readwrite_usb(struct usb_dibusb *dib, u8 *wbuf, u16 wlen, u8 *rbuf, ret = usb_bulk_msg(dib->udev,usb_sndbulkpipe(dib->udev, dib->dibdev->dev_cl->pipe_cmd), wbuf,wlen,&actlen, DIBUSB_I2C_TIMEOUT); - + if (ret) err("bulk message failed: %d (%d/%d)",ret,wlen,actlen); else @@ -49,7 +49,7 @@ int dibusb_readwrite_usb(struct usb_dibusb *dib, u8 *wbuf, u16 wlen, u8 *rbuf, debug_dump(rbuf,actlen); } } - + up(&dib->usb_sem); return ret; } @@ -63,12 +63,12 @@ static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len) } #if 0 -/* - * #if 0'ing the following functions as they are not in use _now_, +/* + * #if 0'ing the following functions as they are not in use _now_, * but probably will be sometime. */ /* - * do not use this, just a workaround for a bug, + * do not use this, just a workaround for a bug, * which will hopefully never occur :). */ int dibusb_interrupt_read_loop(struct usb_dibusb *dib) @@ -79,7 +79,7 @@ int dibusb_interrupt_read_loop(struct usb_dibusb *dib) #endif /* - * ioctl for the firmware + * ioctl for the firmware */ static int dibusb_ioctl_cmd(struct usb_dibusb *dib, u8 cmd, u8 *param, int plen) { @@ -104,10 +104,10 @@ int dibusb_hw_wakeup(struct dvb_frontend *fe) u8 b[1] = { DIBUSB_IOCTL_POWER_WAKEUP }; deb_info("dibusb-device is getting up.\n"); dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); - + if (dib->fe_init) return dib->fe_init(fe); - + return 0; } @@ -127,7 +127,7 @@ int dibusb_hw_sleep(struct dvb_frontend *fe) } if (dib->fe_sleep) return dib->fe_sleep(fe); - + return 0; } @@ -143,7 +143,7 @@ int dibusb_streaming(struct usb_dibusb *dib,int onoff) case DIBUSB2_0: case DIBUSB2_0B: case NOVAT_USB2: - case UMT2_0: + case UMT2_0: if (onoff) return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_ENABLE_STREAM,NULL,0); else @@ -158,9 +158,9 @@ int dibusb_streaming(struct usb_dibusb *dib,int onoff) int dibusb_urb_init(struct usb_dibusb *dib) { int ret,i,bufsize,def_pid_parse = 1; - + /* - * when reloading the driver w/o replugging the device + * when reloading the driver w/o replugging the device * a timeout occures, this helps */ usb_clear_halt(dib->udev,usb_sndbulkpipe(dib->udev,dib->dibdev->dev_cl->pipe_cmd)); @@ -174,7 +174,7 @@ int dibusb_urb_init(struct usb_dibusb *dib) memset(dib->urb_list,0,dib->dibdev->dev_cl->urb_count*sizeof(struct urb *)); dib->init_state |= DIBUSB_STATE_URB_LIST; - + bufsize = dib->dibdev->dev_cl->urb_count*dib->dibdev->dev_cl->urb_buffer_size; deb_info("allocate %d bytes as buffersize for all URBs\n",bufsize); /* allocate the actual buffer for the URBs */ @@ -184,7 +184,7 @@ int dibusb_urb_init(struct usb_dibusb *dib) } deb_info("allocation complete\n"); memset(dib->buffer,0,bufsize); - + dib->init_state |= DIBUSB_STATE_URB_BUF; /* allocate and submit the URBs */ @@ -193,13 +193,13 @@ int dibusb_urb_init(struct usb_dibusb *dib) return -ENOMEM; } deb_info("submitting URB no. %d\n",i); - - usb_fill_bulk_urb( dib->urb_list[i], dib->udev, + + usb_fill_bulk_urb( dib->urb_list[i], dib->udev, usb_rcvbulkpipe(dib->udev,dib->dibdev->dev_cl->pipe_data), - &dib->buffer[i*dib->dibdev->dev_cl->urb_buffer_size], - dib->dibdev->dev_cl->urb_buffer_size, + &dib->buffer[i*dib->dibdev->dev_cl->urb_buffer_size], + dib->dibdev->dev_cl->urb_buffer_size, dibusb_urb_complete, dib); - + dib->urb_list[i]->transfer_flags = 0; if ((ret = usb_submit_urb(dib->urb_list[i],GFP_ATOMIC))) { @@ -210,8 +210,8 @@ int dibusb_urb_init(struct usb_dibusb *dib) } /* dib->pid_parse here contains the value of the module parameter */ - /* decide if pid parsing can be deactivated: - * is possible (by device type) and wanted (by user) + /* decide if pid parsing can be deactivated: + * is possible (by device type) and wanted (by user) */ switch (dib->dibdev->dev_cl->id) { case DIBUSB2_0: @@ -222,12 +222,12 @@ int dibusb_urb_init(struct usb_dibusb *dib) } else info("will use pid_parsing."); break; - default: + default: break; } /* from here on it contains the device and user decision */ dib->pid_parse = def_pid_parse; - + return 0; } @@ -241,7 +241,7 @@ int dibusb_urb_exit(struct usb_dibusb *dib) /* stop the URBs */ usb_kill_urb(dib->urb_list[i]); - + deb_info("freeing URB no. %d.\n",i); /* free the URBs */ usb_free_urb(dib->urb_list[i]); |