summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/au0828
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-18 19:12:52 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-18 19:12:52 -0300
commit8ace45c3f08656c82d005b7a6aac4e4dac1ddcfe (patch)
treef6b34b635389845928693d21eb69bbe7ec1cd1d6 /linux/drivers/media/video/au0828
parente01f2e9690837fa45cfc339bf5c5ce5d945250be (diff)
downloadmediapointer-dvb-s2-8ace45c3f08656c82d005b7a6aac4e4dac1ddcfe.tar.gz
mediapointer-dvb-s2-8ace45c3f08656c82d005b7a6aac4e4dac1ddcfe.tar.bz2
CodingStyle fixes for au8522 and au0828
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/au0828')
-rw-r--r--linux/drivers/media/video/au0828/au0828-cards.c9
-rw-r--r--linux/drivers/media/video/au0828/au0828-core.c24
-rw-r--r--linux/drivers/media/video/au0828/au0828-dvb.c15
-rw-r--r--linux/drivers/media/video/au0828/au0828-i2c.c20
-rw-r--r--linux/drivers/media/video/au0828/au0828.h17
5 files changed, 42 insertions, 43 deletions
diff --git a/linux/drivers/media/video/au0828/au0828-cards.c b/linux/drivers/media/video/au0828/au0828-cards.c
index 688cb8d26..8ca91f814 100644
--- a/linux/drivers/media/video/au0828/au0828-cards.c
+++ b/linux/drivers/media/video/au0828/au0828-cards.c
@@ -47,7 +47,7 @@ int au0828_tuner_callback(void *priv, int command, int arg)
dprintk(1, "%s()\n", __func__);
- switch(dev->board) {
+ switch (dev->board) {
case AU0828_BOARD_HAUPPAUGE_HVR850:
case AU0828_BOARD_HAUPPAUGE_HVR950Q:
case AU0828_BOARD_DVICO_FUSIONHDTV7:
@@ -59,8 +59,7 @@ int au0828_tuner_callback(void *priv, int command, int arg)
au0828_set(dev, REG_001, 2);
mdelay(50);
return 0;
- }
- else {
+ } else {
printk(KERN_ERR
"%s(): Unknown command.\n", __func__);
return -EINVAL;
@@ -103,7 +102,7 @@ void au0828_card_setup(struct au0828_dev *dev)
tveeprom_read(&dev->i2c_client, eeprom, sizeof(eeprom));
}
- switch(dev->board) {
+ switch (dev->board) {
case AU0828_BOARD_HAUPPAUGE_HVR850:
case AU0828_BOARD_HAUPPAUGE_HVR950Q:
if (dev->i2c_rc == 0)
@@ -121,7 +120,7 @@ void au0828_gpio_setup(struct au0828_dev *dev)
{
dprintk(1, "%s()\n", __func__);
- switch(dev->board) {
+ switch (dev->board) {
case AU0828_BOARD_HAUPPAUGE_HVR850:
case AU0828_BOARD_HAUPPAUGE_HVR950Q:
/* GPIO's
diff --git a/linux/drivers/media/video/au0828/au0828-core.c b/linux/drivers/media/video/au0828/au0828-core.c
index 024bca881..b3a4346b1 100644
--- a/linux/drivers/media/video/au0828/au0828-core.c
+++ b/linux/drivers/media/video/au0828/au0828-core.c
@@ -23,7 +23,7 @@
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include "compat.h"
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 15)
#include <linux/mutex.h>
#endif
@@ -35,15 +35,15 @@
* 4 = I2C related
* 8 = Bridge related
*/
-unsigned int debug = 0;
+unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages");
-unsigned int usb_debug = 0;
+unsigned int usb_debug;
module_param(usb_debug, int, 0644);
MODULE_PARM_DESC(usb_debug, "enable usb debug messages");
-unsigned int bridge_debug = 0;
+unsigned int bridge_debug;
module_param(bridge_debug, int, 0644);
MODULE_PARM_DESC(bridge_debug, "enable bridge debug messages");
@@ -69,16 +69,17 @@ u32 au0828_readreg(struct au0828_dev *dev, u16 reg)
u32 au0828_writereg(struct au0828_dev *dev, u16 reg, u32 val)
{
dprintk(8, "%s(0x%x, 0x%x)\n", __func__, reg, val);
- return send_control_msg(dev, CMD_REQUEST_OUT, val, reg, dev->ctrlmsg, 0);
+ return send_control_msg(dev, CMD_REQUEST_OUT, val, reg,
+ dev->ctrlmsg, 0);
}
static void cmd_msg_dump(struct au0828_dev *dev)
{
int i;
- for (i = 0;i < sizeof(dev->ctrlmsg); i+=16)
- dprintk(2,"%s() %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x "
- "%02x %02x %02x %02x %02x %02x\n",
+ for (i = 0; i < sizeof(dev->ctrlmsg); i += 16)
+ dprintk(2, "%s() %02x %02x %02x %02x %02x %02x %02x %02x "
+ "%02x %02x %02x %02x %02x %02x %02x %02x\n",
__func__,
dev->ctrlmsg[i+0], dev->ctrlmsg[i+1],
dev->ctrlmsg[i+2], dev->ctrlmsg[i+3],
@@ -139,8 +140,7 @@ static int recv_control_msg(struct au0828_dev *dev, u16 request, u32 value,
if (status < 0) {
printk(KERN_ERR "%s() Failed receiving control message, error %d.\n",
__func__, status);
- }
- else
+ } else
cmd_msg_dump(dev);
}
mutex_unlock(&dev->mutex);
@@ -169,7 +169,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
}
-static int au0828_usb_probe (struct usb_interface *interface,
+static int au0828_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
int ifnum;
@@ -226,7 +226,7 @@ static struct usb_driver au0828_usb_driver = {
.probe = au0828_usb_probe,
.disconnect = au0828_usb_disconnect,
.id_table = au0828_usb_id_table,
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15)
.owner = THIS_MODULE,
#endif
};
diff --git a/linux/drivers/media/video/au0828/au0828-dvb.c b/linux/drivers/media/video/au0828/au0828-dvb.c
index 4b4595fec..f911bbac6 100644
--- a/linux/drivers/media/video/au0828/au0828-dvb.c
+++ b/linux/drivers/media/video/au0828/au0828-dvb.c
@@ -47,7 +47,7 @@ static struct xc5000_config hauppauge_hvr950q_tunerconfig = {
};
/*-------------------------------------------------------------------*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
static void urb_completion(struct urb *purb, struct pt_regs *regs)
#else
static void urb_completion(struct urb *purb)
@@ -116,9 +116,8 @@ static int start_urb_transfer(struct au0828_dev *dev)
for (i = 0; i < URB_COUNT; i++) {
dev->urbs[i] = usb_alloc_urb(0, GFP_KERNEL);
- if (!dev->urbs[i]) {
+ if (!dev->urbs[i])
goto err;
- }
purb = dev->urbs[i];
@@ -225,7 +224,7 @@ int dvb_register(struct au0828_dev *dev)
"(errno = %d)\n", DRIVER_NAME, result);
goto fail_adapter;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
dvb->adapter.priv = dev;
/* register frontend */
@@ -261,7 +260,7 @@ int dvb_register(struct au0828_dev *dev)
dvb->dmxdev.filternum = 256;
dvb->dmxdev.demux = &dvb->demux.dmx;
dvb->dmxdev.capabilities = 0;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
#else
result = dvb_dmxdev_init(&dvb->dmxdev, dvb->adapter);
@@ -296,7 +295,7 @@ int dvb_register(struct au0828_dev *dev)
}
/* register network adapter */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
#else
dvb_net_init(dvb->adapter, &dvb->net, &dvb->demux.dmx);
@@ -315,7 +314,7 @@ fail_dmx:
dvb_unregister_frontend(dvb->frontend);
fail_frontend:
dvb_frontend_detach(dvb->frontend);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
dvb_unregister_adapter(&dvb->adapter);
#else
dvb_unregister_adapter(dvb->adapter);
@@ -340,7 +339,7 @@ void au0828_dvb_unregister(struct au0828_dev *dev)
dvb_dmx_release(&dvb->demux);
dvb_unregister_frontend(dvb->frontend);
dvb_frontend_detach(dvb->frontend);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
dvb_unregister_adapter(&dvb->adapter);
#else
dvb_unregister_adapter(dvb->adapter);
diff --git a/linux/drivers/media/video/au0828/au0828-i2c.c b/linux/drivers/media/video/au0828/au0828-i2c.c
index 95e4e3b44..08d2a6080 100644
--- a/linux/drivers/media/video/au0828/au0828-i2c.c
+++ b/linux/drivers/media/video/au0828/au0828-i2c.c
@@ -23,18 +23,18 @@
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "compat.h"
#include "au0828.h"
#include <media/v4l2-common.h>
-unsigned int i2c_debug = 0;
+unsigned int i2c_debug;
module_param(i2c_debug, int, 0444);
MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
-unsigned int i2c_scan = 0;
+unsigned int i2c_scan;
module_param(i2c_scan, int, 0444);
MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
@@ -311,7 +311,7 @@ static struct i2c_algorithm au0828_i2c_algo_template = {
static struct i2c_adapter au0828_i2c_adap_template = {
.name = DRIVER_NAME,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
.owner = THIS_MODULE,
#endif
.id = I2C_HW_B_AU0828,
@@ -326,9 +326,9 @@ static struct i2c_client au0828_i2c_client_template = {
};
static char *i2c_devs[128] = {
- [ 0x8e >> 1 ] = "au8522",
- [ 0xa0 >> 1 ] = "eeprom",
- [ 0xc2 >> 1 ] = "tuner/xc5000",
+ [0x8e >> 1] = "au8522",
+ [0xa0 >> 1] = "eeprom",
+ [0xc2 >> 1] = "tuner/xc5000",
};
static void do_i2c_scan(char *name, struct i2c_client *c)
@@ -341,7 +341,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
rc = i2c_master_recv(c, &buf, 0);
if (rc < 0)
continue;
- printk("%s: i2c scan: found device @ 0x%x [%s]\n",
+ printk(KERN_INFO "%s: i2c scan: found device @ 0x%x [%s]\n",
name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???");
}
}
@@ -371,11 +371,11 @@ int au0828_i2c_register(struct au0828_dev *dev)
dev->i2c_client.adapter = &dev->i2c_adap;
if (0 == dev->i2c_rc) {
- printk("%s: i2c bus registered\n", DRIVER_NAME);
+ printk(KERN_INFO "%s: i2c bus registered\n", DRIVER_NAME);
if (i2c_scan)
do_i2c_scan(DRIVER_NAME, &dev->i2c_client);
} else
- printk("%s: i2c bus register FAILED\n", DRIVER_NAME);
+ printk(KERN_INFO "%s: i2c bus register FAILED\n", DRIVER_NAME);
return dev->i2c_rc;
}
diff --git a/linux/drivers/media/video/au0828/au0828.h b/linux/drivers/media/video/au0828/au0828.h
index c004e00c0..4b0ad1b3e 100644
--- a/linux/drivers/media/video/au0828/au0828.h
+++ b/linux/drivers/media/video/au0828/au0828.h
@@ -60,7 +60,7 @@ struct au0828_dvb {
};
struct au0828_dev {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 15)
struct mutex mutex;
#else
struct semaphore mutex;
@@ -91,13 +91,14 @@ struct au0828_buff {
};
/* ----------------------------------------------------------- */
-#define au0828_read(dev,reg) au0828_readreg(dev,reg)
-#define au0828_write(dev,reg,value) au0828_writereg(dev,reg,value)
-#define au0828_andor(dev,reg,mask,value) \
- au0828_writereg(dev,reg,(au0828_readreg(dev,reg)&~(mask))|((value)&(mask)))
-
-#define au0828_set(dev,reg,bit) au0828_andor(dev,(reg),(bit),(bit))
-#define au0828_clear(dev,reg,bit) au0828_andor(dev,(reg),(bit),0)
+#define au0828_read(dev, reg) au0828_readreg(dev, reg)
+#define au0828_write(dev, reg, value) au0828_writereg(dev, reg, value)
+#define au0828_andor(dev, reg, mask, value) \
+ au0828_writereg(dev, reg, \
+ (au0828_readreg(dev, reg) & ~(mask)) | ((value) & (mask)))
+
+#define au0828_set(dev, reg, bit) au0828_andor(dev, (reg), (bit), (bit))
+#define au0828_clear(dev, reg, bit) au0828_andor(dev, (reg), (bit), 0)
/* ----------------------------------------------------------- */
/* au0828-core.c */