diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-18 21:12:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:43 -0400 |
commit | 18d73c58b5ea7425db05b666408f6f682d837b73 (patch) | |
tree | d071b99fdbb10abbed2c9c81ec3ea2a2519c4ffc /drivers | |
parent | bbdf855b0e98ba576b3577522af5e5c7503c4ed0 (diff) |
V4L/DVB (7638): CodingStyle fixes for au8522 and au0828
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/au8522.c | 29 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/au8522.h | 6 | ||||
-rw-r--r-- | drivers/media/video/au0828/au0828-cards.c | 9 | ||||
-rw-r--r-- | drivers/media/video/au0828/au0828-core.c | 20 | ||||
-rw-r--r-- | drivers/media/video/au0828/au0828-dvb.c | 3 | ||||
-rw-r--r-- | drivers/media/video/au0828/au0828-i2c.c | 18 | ||||
-rw-r--r-- | drivers/media/video/au0828/au0828.h | 15 |
7 files changed, 50 insertions, 50 deletions
diff --git a/drivers/media/dvb/frontends/au8522.c b/drivers/media/dvb/frontends/au8522.c index dbea1da79672..e340faacc78b 100644 --- a/drivers/media/dvb/frontends/au8522.c +++ b/drivers/media/dvb/frontends/au8522.c | |||
@@ -43,8 +43,12 @@ struct au8522_state { | |||
43 | 43 | ||
44 | }; | 44 | }; |
45 | 45 | ||
46 | static int debug = 0; | 46 | static int debug; |
47 | #define dprintk if (debug) printk | 47 | |
48 | #define dprintk(arg...) do { \ | ||
49 | if (debug) \ | ||
50 | printk(##arg); } \ | ||
51 | } while (0) | ||
48 | 52 | ||
49 | /* 16 bit registers, 8 bit values */ | 53 | /* 16 bit registers, 8 bit values */ |
50 | static int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) | 54 | static int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) |
@@ -284,7 +288,8 @@ static struct mse2snr_tab qam256_mse2snr_tab[] = { | |||
284 | { 256, 280 }, | 288 | { 256, 280 }, |
285 | }; | 289 | }; |
286 | 290 | ||
287 | static int au8522_mse2snr_lookup(struct mse2snr_tab *tab, int sz, int mse, u16 *snr) | 291 | static int au8522_mse2snr_lookup(struct mse2snr_tab *tab, int sz, int mse, |
292 | u16 *snr) | ||
288 | { | 293 | { |
289 | int i, ret = -EINVAL; | 294 | int i, ret = -EINVAL; |
290 | dprintk("%s()\n", __func__); | 295 | dprintk("%s()\n", __func__); |
@@ -427,7 +432,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, | |||
427 | 432 | ||
428 | dprintk("%s(0x%08x)\n", __func__, m); | 433 | dprintk("%s(0x%08x)\n", __func__, m); |
429 | 434 | ||
430 | switch(m) { | 435 | switch (m) { |
431 | case VSB_8: | 436 | case VSB_8: |
432 | dprintk("%s() VSB_8\n", __func__); | 437 | dprintk("%s() VSB_8\n", __func__); |
433 | for (i = 0; i < ARRAY_SIZE(VSB_mod_tab); i++) | 438 | for (i = 0; i < ARRAY_SIZE(VSB_mod_tab); i++) |
@@ -469,9 +474,11 @@ static int au8522_set_frontend(struct dvb_frontend *fe, | |||
469 | msleep(100); | 474 | msleep(100); |
470 | 475 | ||
471 | if (fe->ops.tuner_ops.set_params) { | 476 | if (fe->ops.tuner_ops.set_params) { |
472 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); | 477 | if (fe->ops.i2c_gate_ctrl) |
478 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
473 | fe->ops.tuner_ops.set_params(fe, p); | 479 | fe->ops.tuner_ops.set_params(fe, p); |
474 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); | 480 | if (fe->ops.i2c_gate_ctrl) |
481 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
475 | } | 482 | } |
476 | 483 | ||
477 | return 0; | 484 | return 0; |
@@ -515,7 +522,7 @@ static int au8522_read_status(struct dvb_frontend *fe, fe_status_t *status) | |||
515 | *status |= FE_HAS_LOCK | FE_HAS_SYNC; | 522 | *status |= FE_HAS_LOCK | FE_HAS_SYNC; |
516 | } | 523 | } |
517 | 524 | ||
518 | switch(state->config->status_mode) { | 525 | switch (state->config->status_mode) { |
519 | case AU8522_DEMODLOCKING: | 526 | case AU8522_DEMODLOCKING: |
520 | dprintk("%s() DEMODLOCKING\n", __func__); | 527 | dprintk("%s() DEMODLOCKING\n", __func__); |
521 | if (*status & FE_HAS_VITERBI) | 528 | if (*status & FE_HAS_VITERBI) |
@@ -651,6 +658,7 @@ error: | |||
651 | kfree(state); | 658 | kfree(state); |
652 | return NULL; | 659 | return NULL; |
653 | } | 660 | } |
661 | EXPORT_SYMBOL(au8522_attach); | ||
654 | 662 | ||
655 | static struct dvb_frontend_ops au8522_ops = { | 663 | static struct dvb_frontend_ops au8522_ops = { |
656 | 664 | ||
@@ -682,10 +690,3 @@ MODULE_PARM_DESC(debug, "Enable verbose debug messages"); | |||
682 | MODULE_DESCRIPTION("Auvitek AU8522 QAM-B/ATSC Demodulator driver"); | 690 | MODULE_DESCRIPTION("Auvitek AU8522 QAM-B/ATSC Demodulator driver"); |
683 | MODULE_AUTHOR("Steven Toth"); | 691 | MODULE_AUTHOR("Steven Toth"); |
684 | MODULE_LICENSE("GPL"); | 692 | MODULE_LICENSE("GPL"); |
685 | |||
686 | EXPORT_SYMBOL(au8522_attach); | ||
687 | |||
688 | /* | ||
689 | * Local variables: | ||
690 | * c-basic-offset: 8 | ||
691 | */ | ||
diff --git a/drivers/media/dvb/frontends/au8522.h b/drivers/media/dvb/frontends/au8522.h index 19d5d1ef9842..d7affa3cdb27 100644 --- a/drivers/media/dvb/frontends/au8522.h +++ b/drivers/media/dvb/frontends/au8522.h | |||
@@ -24,8 +24,7 @@ | |||
24 | 24 | ||
25 | #include <linux/dvb/frontend.h> | 25 | #include <linux/dvb/frontend.h> |
26 | 26 | ||
27 | struct au8522_config | 27 | struct au8522_config { |
28 | { | ||
29 | /* the demodulator's i2c address */ | 28 | /* the demodulator's i2c address */ |
30 | u8 demod_address; | 29 | u8 demod_address; |
31 | 30 | ||
@@ -35,7 +34,8 @@ struct au8522_config | |||
35 | u8 status_mode; | 34 | u8 status_mode; |
36 | }; | 35 | }; |
37 | 36 | ||
38 | #if defined(CONFIG_DVB_AU8522) || (defined(CONFIG_DVB_AU8522_MODULE) && defined(MODULE)) | 37 | #if defined(CONFIG_DVB_AU8522) || \ |
38 | (defined(CONFIG_DVB_AU8522_MODULE) && defined(MODULE)) | ||
39 | extern struct dvb_frontend *au8522_attach(const struct au8522_config *config, | 39 | extern struct dvb_frontend *au8522_attach(const struct au8522_config *config, |
40 | struct i2c_adapter *i2c); | 40 | struct i2c_adapter *i2c); |
41 | #else | 41 | #else |
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c index 688cb8d26b30..8ca91f814277 100644 --- a/drivers/media/video/au0828/au0828-cards.c +++ b/drivers/media/video/au0828/au0828-cards.c | |||
@@ -47,7 +47,7 @@ int au0828_tuner_callback(void *priv, int command, int arg) | |||
47 | 47 | ||
48 | dprintk(1, "%s()\n", __func__); | 48 | dprintk(1, "%s()\n", __func__); |
49 | 49 | ||
50 | switch(dev->board) { | 50 | switch (dev->board) { |
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: |
@@ -59,8 +59,7 @@ int au0828_tuner_callback(void *priv, int command, int arg) | |||
59 | au0828_set(dev, REG_001, 2); | 59 | au0828_set(dev, REG_001, 2); |
60 | mdelay(50); | 60 | mdelay(50); |
61 | return 0; | 61 | return 0; |
62 | } | 62 | } else { |
63 | else { | ||
64 | printk(KERN_ERR | 63 | printk(KERN_ERR |
65 | "%s(): Unknown command.\n", __func__); | 64 | "%s(): Unknown command.\n", __func__); |
66 | return -EINVAL; | 65 | return -EINVAL; |
@@ -103,7 +102,7 @@ void au0828_card_setup(struct au0828_dev *dev) | |||
103 | tveeprom_read(&dev->i2c_client, eeprom, sizeof(eeprom)); | 102 | tveeprom_read(&dev->i2c_client, eeprom, sizeof(eeprom)); |
104 | } | 103 | } |
105 | 104 | ||
106 | switch(dev->board) { | 105 | switch (dev->board) { |
107 | case AU0828_BOARD_HAUPPAUGE_HVR850: | 106 | case AU0828_BOARD_HAUPPAUGE_HVR850: |
108 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: | 107 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: |
109 | if (dev->i2c_rc == 0) | 108 | if (dev->i2c_rc == 0) |
@@ -121,7 +120,7 @@ void au0828_gpio_setup(struct au0828_dev *dev) | |||
121 | { | 120 | { |
122 | dprintk(1, "%s()\n", __func__); | 121 | dprintk(1, "%s()\n", __func__); |
123 | 122 | ||
124 | switch(dev->board) { | 123 | switch (dev->board) { |
125 | case AU0828_BOARD_HAUPPAUGE_HVR850: | 124 | case AU0828_BOARD_HAUPPAUGE_HVR850: |
126 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: | 125 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: |
127 | /* GPIO's | 126 | /* GPIO's |
diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c index 530c675e53a4..e65d5642cb1d 100644 --- a/drivers/media/video/au0828/au0828-core.c +++ b/drivers/media/video/au0828/au0828-core.c | |||
@@ -32,15 +32,15 @@ | |||
32 | * 4 = I2C related | 32 | * 4 = I2C related |
33 | * 8 = Bridge related | 33 | * 8 = Bridge related |
34 | */ | 34 | */ |
35 | unsigned int debug = 0; | 35 | unsigned int debug; |
36 | module_param(debug, int, 0644); | 36 | module_param(debug, int, 0644); |
37 | MODULE_PARM_DESC(debug, "enable debug messages"); | 37 | MODULE_PARM_DESC(debug, "enable debug messages"); |
38 | 38 | ||
39 | unsigned int usb_debug = 0; | 39 | unsigned int usb_debug; |
40 | module_param(usb_debug, int, 0644); | 40 | module_param(usb_debug, int, 0644); |
41 | MODULE_PARM_DESC(usb_debug, "enable usb debug messages"); | 41 | MODULE_PARM_DESC(usb_debug, "enable usb debug messages"); |
42 | 42 | ||
43 | unsigned int bridge_debug = 0; | 43 | unsigned int bridge_debug; |
44 | module_param(bridge_debug, int, 0644); | 44 | module_param(bridge_debug, int, 0644); |
45 | MODULE_PARM_DESC(bridge_debug, "enable bridge debug messages"); | 45 | MODULE_PARM_DESC(bridge_debug, "enable bridge debug messages"); |
46 | 46 | ||
@@ -66,16 +66,17 @@ u32 au0828_readreg(struct au0828_dev *dev, u16 reg) | |||
66 | u32 au0828_writereg(struct au0828_dev *dev, u16 reg, u32 val) | 66 | u32 au0828_writereg(struct au0828_dev *dev, u16 reg, u32 val) |
67 | { | 67 | { |
68 | dprintk(8, "%s(0x%x, 0x%x)\n", __func__, reg, val); | 68 | dprintk(8, "%s(0x%x, 0x%x)\n", __func__, reg, val); |
69 | return send_control_msg(dev, CMD_REQUEST_OUT, val, reg, dev->ctrlmsg, 0); | 69 | return send_control_msg(dev, CMD_REQUEST_OUT, val, reg, |
70 | dev->ctrlmsg, 0); | ||
70 | } | 71 | } |
71 | 72 | ||
72 | static void cmd_msg_dump(struct au0828_dev *dev) | 73 | static void cmd_msg_dump(struct au0828_dev *dev) |
73 | { | 74 | { |
74 | int i; | 75 | int i; |
75 | 76 | ||
76 | for (i = 0;i < sizeof(dev->ctrlmsg); i+=16) | 77 | for (i = 0; i < sizeof(dev->ctrlmsg); i += 16) |
77 | dprintk(2,"%s() %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x " | 78 | dprintk(2, "%s() %02x %02x %02x %02x %02x %02x %02x %02x " |
78 | "%02x %02x %02x %02x %02x %02x\n", | 79 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", |
79 | __func__, | 80 | __func__, |
80 | dev->ctrlmsg[i+0], dev->ctrlmsg[i+1], | 81 | dev->ctrlmsg[i+0], dev->ctrlmsg[i+1], |
81 | dev->ctrlmsg[i+2], dev->ctrlmsg[i+3], | 82 | dev->ctrlmsg[i+2], dev->ctrlmsg[i+3], |
@@ -136,8 +137,7 @@ static int recv_control_msg(struct au0828_dev *dev, u16 request, u32 value, | |||
136 | if (status < 0) { | 137 | if (status < 0) { |
137 | printk(KERN_ERR "%s() Failed receiving control message, error %d.\n", | 138 | printk(KERN_ERR "%s() Failed receiving control message, error %d.\n", |
138 | __func__, status); | 139 | __func__, status); |
139 | } | 140 | } else |
140 | else | ||
141 | cmd_msg_dump(dev); | 141 | cmd_msg_dump(dev); |
142 | } | 142 | } |
143 | mutex_unlock(&dev->mutex); | 143 | mutex_unlock(&dev->mutex); |
@@ -166,7 +166,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface) | |||
166 | 166 | ||
167 | } | 167 | } |
168 | 168 | ||
169 | static int au0828_usb_probe (struct usb_interface *interface, | 169 | static int au0828_usb_probe(struct usb_interface *interface, |
170 | const struct usb_device_id *id) | 170 | const struct usb_device_id *id) |
171 | { | 171 | { |
172 | int ifnum; | 172 | int ifnum; |
diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c index 4a27e5b41f53..85d0ae9a322f 100644 --- a/drivers/media/video/au0828/au0828-dvb.c +++ b/drivers/media/video/au0828/au0828-dvb.c | |||
@@ -111,9 +111,8 @@ static int start_urb_transfer(struct au0828_dev *dev) | |||
111 | for (i = 0; i < URB_COUNT; i++) { | 111 | for (i = 0; i < URB_COUNT; i++) { |
112 | 112 | ||
113 | dev->urbs[i] = usb_alloc_urb(0, GFP_KERNEL); | 113 | dev->urbs[i] = usb_alloc_urb(0, GFP_KERNEL); |
114 | if (!dev->urbs[i]) { | 114 | if (!dev->urbs[i]) |
115 | goto err; | 115 | goto err; |
116 | } | ||
117 | 116 | ||
118 | purb = dev->urbs[i]; | 117 | purb = dev->urbs[i]; |
119 | 118 | ||
diff --git a/drivers/media/video/au0828/au0828-i2c.c b/drivers/media/video/au0828/au0828-i2c.c index ae73a6769296..94c8b74a6651 100644 --- a/drivers/media/video/au0828/au0828-i2c.c +++ b/drivers/media/video/au0828/au0828-i2c.c | |||
@@ -23,17 +23,17 @@ | |||
23 | #include <linux/moduleparam.h> | 23 | #include <linux/moduleparam.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <asm/io.h> | 26 | #include <linux/io.h> |
27 | 27 | ||
28 | #include "au0828.h" | 28 | #include "au0828.h" |
29 | 29 | ||
30 | #include <media/v4l2-common.h> | 30 | #include <media/v4l2-common.h> |
31 | 31 | ||
32 | unsigned int i2c_debug = 0; | 32 | unsigned int i2c_debug; |
33 | module_param(i2c_debug, int, 0444); | 33 | module_param(i2c_debug, int, 0444); |
34 | MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); | 34 | MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); |
35 | 35 | ||
36 | unsigned int i2c_scan = 0; | 36 | unsigned int i2c_scan; |
37 | module_param(i2c_scan, int, 0444); | 37 | module_param(i2c_scan, int, 0444); |
38 | MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time"); | 38 | MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time"); |
39 | 39 | ||
@@ -323,9 +323,9 @@ static struct i2c_client au0828_i2c_client_template = { | |||
323 | }; | 323 | }; |
324 | 324 | ||
325 | static char *i2c_devs[128] = { | 325 | static char *i2c_devs[128] = { |
326 | [ 0x8e >> 1 ] = "au8522", | 326 | [0x8e >> 1] = "au8522", |
327 | [ 0xa0 >> 1 ] = "eeprom", | 327 | [0xa0 >> 1] = "eeprom", |
328 | [ 0xc2 >> 1 ] = "tuner/xc5000", | 328 | [0xc2 >> 1] = "tuner/xc5000", |
329 | }; | 329 | }; |
330 | 330 | ||
331 | static void do_i2c_scan(char *name, struct i2c_client *c) | 331 | static void do_i2c_scan(char *name, struct i2c_client *c) |
@@ -338,7 +338,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c) | |||
338 | rc = i2c_master_recv(c, &buf, 0); | 338 | rc = i2c_master_recv(c, &buf, 0); |
339 | if (rc < 0) | 339 | if (rc < 0) |
340 | continue; | 340 | continue; |
341 | printk("%s: i2c scan: found device @ 0x%x [%s]\n", | 341 | printk(KERN_INFO "%s: i2c scan: found device @ 0x%x [%s]\n", |
342 | name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); | 342 | name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); |
343 | } | 343 | } |
344 | } | 344 | } |
@@ -368,11 +368,11 @@ int au0828_i2c_register(struct au0828_dev *dev) | |||
368 | dev->i2c_client.adapter = &dev->i2c_adap; | 368 | dev->i2c_client.adapter = &dev->i2c_adap; |
369 | 369 | ||
370 | if (0 == dev->i2c_rc) { | 370 | if (0 == dev->i2c_rc) { |
371 | printk("%s: i2c bus registered\n", DRIVER_NAME); | 371 | printk(KERN_INFO "%s: i2c bus registered\n", DRIVER_NAME); |
372 | if (i2c_scan) | 372 | if (i2c_scan) |
373 | do_i2c_scan(DRIVER_NAME, &dev->i2c_client); | 373 | do_i2c_scan(DRIVER_NAME, &dev->i2c_client); |
374 | } else | 374 | } else |
375 | printk("%s: i2c bus register FAILED\n", DRIVER_NAME); | 375 | printk(KERN_INFO "%s: i2c bus register FAILED\n", DRIVER_NAME); |
376 | 376 | ||
377 | return dev->i2c_rc; | 377 | return dev->i2c_rc; |
378 | } | 378 | } |
diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h index 7e6aeb727baa..0200b9fc5dc4 100644 --- a/drivers/media/video/au0828/au0828.h +++ b/drivers/media/video/au0828/au0828.h | |||
@@ -83,13 +83,14 @@ struct au0828_buff { | |||
83 | }; | 83 | }; |
84 | 84 | ||
85 | /* ----------------------------------------------------------- */ | 85 | /* ----------------------------------------------------------- */ |
86 | #define au0828_read(dev,reg) au0828_readreg(dev,reg) | 86 | #define au0828_read(dev, reg) au0828_readreg(dev, reg) |
87 | #define au0828_write(dev,reg,value) au0828_writereg(dev,reg,value) | 87 | #define au0828_write(dev, reg, value) au0828_writereg(dev, reg, value) |
88 | #define au0828_andor(dev,reg,mask,value) \ | 88 | #define au0828_andor(dev, reg, mask, value) \ |
89 | au0828_writereg(dev,reg,(au0828_readreg(dev,reg)&~(mask))|((value)&(mask))) | 89 | au0828_writereg(dev, reg, \ |
90 | 90 | (au0828_readreg(dev, reg) & ~(mask)) | ((value) & (mask))) | |
91 | #define au0828_set(dev,reg,bit) au0828_andor(dev,(reg),(bit),(bit)) | 91 | |
92 | #define au0828_clear(dev,reg,bit) au0828_andor(dev,(reg),(bit),0) | 92 | #define au0828_set(dev, reg, bit) au0828_andor(dev, (reg), (bit), (bit)) |
93 | #define au0828_clear(dev, reg, bit) au0828_andor(dev, (reg), (bit), 0) | ||
93 | 94 | ||
94 | /* ----------------------------------------------------------- */ | 95 | /* ----------------------------------------------------------- */ |
95 | /* au0828-core.c */ | 96 | /* au0828-core.c */ |