aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-04-17 20:41:28 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:43 -0400
commita9c36aad59a06df199cdbb365d0b05663f8008f1 (patch)
tree505cceb8d6842bf3ff7624de1d619deea98fc8cc /drivers
parent0daa5de740c65de7c9554071eec84c6731370065 (diff)
V4L/DVB (7634): au0828: Cleanup
au0828: Cleanup Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/au0828/au0828-cards.c8
-rw-r--r--drivers/media/video/au0828/au0828-core.c11
-rw-r--r--drivers/media/video/au0828/au0828-dvb.c12
-rw-r--r--drivers/media/video/au0828/au0828-i2c.c6
-rw-r--r--drivers/media/video/au0828/au0828-reg.h3
-rw-r--r--drivers/media/video/au0828/au0828.h1
6 files changed, 21 insertions, 20 deletions
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c
index 5c9c3aea99d4..f6c6228b6672 100644
--- a/drivers/media/video/au0828/au0828-cards.c
+++ b/drivers/media/video/au0828/au0828-cards.c
@@ -51,7 +51,7 @@ int au0828_tuner_callback(void *priv, int command, int arg)
51 case AU0828_BOARD_HAUPPAUGE_HVR850: 51 case AU0828_BOARD_HAUPPAUGE_HVR850:
52 case AU0828_BOARD_HAUPPAUGE_HVR950Q: 52 case AU0828_BOARD_HAUPPAUGE_HVR950Q:
53 case AU0828_BOARD_DVICO_FUSIONHDTV7: 53 case AU0828_BOARD_DVICO_FUSIONHDTV7:
54 if(command == 0) { 54 if (command == 0) {
55 /* Tuner Reset Command from xc5000 */ 55 /* Tuner Reset Command from xc5000 */
56 /* Drive the tuner into reset and out */ 56 /* Drive the tuner into reset and out */
57 au0828_clear(dev, REG_001, 2); 57 au0828_clear(dev, REG_001, 2);
@@ -78,8 +78,7 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
78 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, eeprom_data); 78 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, eeprom_data);
79 79
80 /* Make sure we support the board model */ 80 /* Make sure we support the board model */
81 switch (tv.model) 81 switch (tv.model) {
82 {
83 case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */ 82 case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */
84 break; 83 break;
85 default: 84 default:
@@ -92,7 +91,6 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
92 __func__, tv.model); 91 __func__, tv.model);
93} 92}
94 93
95
96void au0828_card_setup(struct au0828_dev *dev) 94void au0828_card_setup(struct au0828_dev *dev)
97{ 95{
98 static u8 eeprom[256]; 96 static u8 eeprom[256];
@@ -116,7 +114,7 @@ void au0828_card_setup(struct au0828_dev *dev)
116/* 114/*
117 * The bridge has between 8 and 12 gpios. 115 * The bridge has between 8 and 12 gpios.
118 * Regs 1 and 0 deal with output enables. 116 * Regs 1 and 0 deal with output enables.
119 * Regs 3 and 2 * deal with direction. 117 * Regs 3 and 2 deal with direction.
120 */ 118 */
121void au0828_gpio_setup(struct au0828_dev *dev) 119void au0828_gpio_setup(struct au0828_dev *dev)
122{ 120{
diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c
index efecac3979ae..530c675e53a4 100644
--- a/drivers/media/video/au0828/au0828-core.c
+++ b/drivers/media/video/au0828/au0828-core.c
@@ -143,6 +143,7 @@ static int recv_control_msg(struct au0828_dev *dev, u16 request, u32 value,
143 mutex_unlock(&dev->mutex); 143 mutex_unlock(&dev->mutex);
144 return status; 144 return status;
145} 145}
146
146static void au0828_usb_disconnect(struct usb_interface *interface) 147static void au0828_usb_disconnect(struct usb_interface *interface)
147{ 148{
148 struct au0828_dev *dev = usb_get_intfdata(interface); 149 struct au0828_dev *dev = usb_get_intfdata(interface);
@@ -177,7 +178,7 @@ static int au0828_usb_probe (struct usb_interface *interface,
177 if (ifnum != 0) 178 if (ifnum != 0)
178 return -ENODEV; 179 return -ENODEV;
179 180
180 dprintk(1,"%s() vendor id 0x%x device id 0x%x ifnum:%d\n", __func__, 181 dprintk(1, "%s() vendor id 0x%x device id 0x%x ifnum:%d\n", __func__,
181 le16_to_cpu(usbdev->descriptor.idVendor), 182 le16_to_cpu(usbdev->descriptor.idVendor),
182 le16_to_cpu(usbdev->descriptor.idProduct), 183 le16_to_cpu(usbdev->descriptor.idProduct),
183 ifnum); 184 ifnum);
@@ -228,20 +229,20 @@ static int __init au0828_init(void)
228{ 229{
229 int ret; 230 int ret;
230 231
231 if(debug) 232 if (debug)
232 printk(KERN_INFO "%s() Debugging is enabled\n", __func__); 233 printk(KERN_INFO "%s() Debugging is enabled\n", __func__);
233 234
234 if(usb_debug) { 235 if (usb_debug) {
235 printk(KERN_INFO "%s() USB Debugging is enabled\n", __func__); 236 printk(KERN_INFO "%s() USB Debugging is enabled\n", __func__);
236 debug |= 2; 237 debug |= 2;
237 } 238 }
238 239
239 if(i2c_debug) { 240 if (i2c_debug) {
240 printk(KERN_INFO "%s() I2C Debugging is enabled\n", __func__); 241 printk(KERN_INFO "%s() I2C Debugging is enabled\n", __func__);
241 debug |= 4; 242 debug |= 4;
242 } 243 }
243 244
244 if(bridge_debug) { 245 if (bridge_debug) {
245 printk(KERN_INFO "%s() Bridge Debugging is enabled\n", 246 printk(KERN_INFO "%s() Bridge Debugging is enabled\n",
246 __func__); 247 __func__);
247 debug |= 8; 248 debug |= 8;
diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c
index 8853f4e26092..4a27e5b41f53 100644
--- a/drivers/media/video/au0828/au0828-dvb.c
+++ b/drivers/media/video/au0828/au0828-dvb.c
@@ -31,6 +31,9 @@
31 31
32DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 32DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
33 33
34#define _AU0828_BULKPIPE 0x83
35#define _BULKPIPESIZE 0xe522
36
34static struct au8522_config hauppauge_hvr950q_config = { 37static struct au8522_config hauppauge_hvr950q_config = {
35 .demod_address = 0x8e >> 1, 38 .demod_address = 0x8e >> 1,
36 .status_mode = AU8522_DEMODLOCKING, 39 .status_mode = AU8522_DEMODLOCKING,
@@ -66,7 +69,8 @@ static void urb_completion(struct urb *purb)
66 ptr = (u8 *)purb->transfer_buffer; 69 ptr = (u8 *)purb->transfer_buffer;
67 70
68 /* Feed the transport payload into the kernel demux */ 71 /* Feed the transport payload into the kernel demux */
69 dvb_dmx_swfilter_packets(&dev->dvb.demux, purb->transfer_buffer, purb->actual_length / 188); 72 dvb_dmx_swfilter_packets(&dev->dvb.demux,
73 purb->transfer_buffer, purb->actual_length / 188);
70 74
71 /* Clean the buffer before we requeue */ 75 /* Clean the buffer before we requeue */
72 memset(purb->transfer_buffer, 0, URB_BUFSIZE); 76 memset(purb->transfer_buffer, 0, URB_BUFSIZE);
@@ -81,7 +85,6 @@ static int stop_urb_transfer(struct au0828_dev *dev)
81 85
82 dprintk(2, "%s()\n", __func__); 86 dprintk(2, "%s()\n", __func__);
83 87
84 /* FIXME: Do we need to free the transfer_buffers? */
85 for (i = 0; i < URB_COUNT; i++) { 88 for (i = 0; i < URB_COUNT; i++) {
86 usb_kill_urb(dev->urbs[i]); 89 usb_kill_urb(dev->urbs[i]);
87 kfree(dev->urbs[i]->transfer_buffer); 90 kfree(dev->urbs[i]->transfer_buffer);
@@ -93,9 +96,6 @@ static int stop_urb_transfer(struct au0828_dev *dev)
93 return 0; 96 return 0;
94} 97}
95 98
96#define _AU0828_BULKPIPE 0x83
97#define _BULKPIPESIZE 0xe522
98
99static int start_urb_transfer(struct au0828_dev *dev) 99static int start_urb_transfer(struct au0828_dev *dev)
100{ 100{
101 struct urb *purb; 101 struct urb *purb;
@@ -306,7 +306,7 @@ void au0828_dvb_unregister(struct au0828_dev *dev)
306 306
307 dprintk(1, "%s()\n", __func__); 307 dprintk(1, "%s()\n", __func__);
308 308
309 if(dvb->frontend == NULL) 309 if (dvb->frontend == NULL)
310 return; 310 return;
311 311
312 dvb_net_release(&dvb->net); 312 dvb_net_release(&dvb->net);
diff --git a/drivers/media/video/au0828/au0828-i2c.c b/drivers/media/video/au0828/au0828-i2c.c
index c1e1cf6ed95a..ae73a6769296 100644
--- a/drivers/media/video/au0828/au0828-i2c.c
+++ b/drivers/media/video/au0828/au0828-i2c.c
@@ -151,7 +151,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
151 151
152 dprintk(4, "SEND: %02x\n", msg->addr); 152 dprintk(4, "SEND: %02x\n", msg->addr);
153 153
154 for (i=0; i < msg->len;) { 154 for (i = 0; i < msg->len;) {
155 155
156 dprintk(4, " %02x\n", msg->buf[i]); 156 dprintk(4, " %02x\n", msg->buf[i]);
157 157
@@ -210,7 +210,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
210 return 0; 210 return 0;
211 } 211 }
212 212
213 for (i=0; i < msg->len;) { 213 for (i = 0; i < msg->len;) {
214 214
215 i++; 215 i++;
216 216
@@ -241,7 +241,7 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap,
241 241
242 dprintk(4, "%s(num = %d)\n", __func__, num); 242 dprintk(4, "%s(num = %d)\n", __func__, num);
243 243
244 for (i = 0 ; i < num; i++) { 244 for (i = 0; i < num; i++) {
245 dprintk(4, "%s(num = %d) addr = 0x%02x len = 0x%x\n", 245 dprintk(4, "%s(num = %d) addr = 0x%02x len = 0x%x\n",
246 __func__, num, msgs[i].addr, msgs[i].len); 246 __func__, num, msgs[i].addr, msgs[i].len);
247 if (msgs[i].flags & I2C_M_RD) { 247 if (msgs[i].flags & I2C_M_RD) {
diff --git a/drivers/media/video/au0828/au0828-reg.h b/drivers/media/video/au0828/au0828-reg.h
index c501f6a52af3..39827550891c 100644
--- a/drivers/media/video/au0828/au0828-reg.h
+++ b/drivers/media/video/au0828/au0828-reg.h
@@ -19,6 +19,9 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22/* We'll start to rename these registers once we have a better
23 * understanding of their meaning.
24 */
22#define REG_000 0x000 25#define REG_000 0x000
23#define REG_001 0x001 26#define REG_001 0x001
24#define REG_002 0x002 27#define REG_002 0x002
diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h
index 94426770a6df..7e6aeb727baa 100644
--- a/drivers/media/video/au0828/au0828.h
+++ b/drivers/media/video/au0828/au0828.h
@@ -37,7 +37,6 @@
37 37
38#define DRIVER_NAME "au0828" 38#define DRIVER_NAME "au0828"
39#define URB_COUNT 16 39#define URB_COUNT 16
40//#define URB_BUFSIZE (312 * 188)
41#define URB_BUFSIZE (0xe522) 40#define URB_BUFSIZE (0xe522)
42 41
43struct au0828_board { 42struct au0828_board {