Commit 62899a28 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (11085): au0828/au8522: Codingstyle fixes

Take a pass over all of the au0828/au8522 files and cleanup all the codingstyle
issues.  This patch does not make *any* functional change to the code.
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3d62287e
...@@ -36,16 +36,16 @@ static int debug; ...@@ -36,16 +36,16 @@ static int debug;
static LIST_HEAD(hybrid_tuner_instance_list); static LIST_HEAD(hybrid_tuner_instance_list);
static DEFINE_MUTEX(au8522_list_mutex); static DEFINE_MUTEX(au8522_list_mutex);
#define dprintk(arg...) do { \ #define dprintk(arg...)\
if (debug) \ do { if (debug)\
printk(arg); \ printk(arg);\
} while (0) } while (0)
/* 16 bit registers, 8 bit values */ /* 16 bit registers, 8 bit values */
int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
{ {
int ret; int ret;
u8 buf [] = { (reg >> 8) | 0x80, reg & 0xff, data }; u8 buf[] = { (reg >> 8) | 0x80, reg & 0xff, data };
struct i2c_msg msg = { .addr = state->config->demod_address, struct i2c_msg msg = { .addr = state->config->demod_address,
.flags = 0, .buf = buf, .len = 3 }; .flags = 0, .buf = buf, .len = 3 };
...@@ -62,10 +62,10 @@ int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) ...@@ -62,10 +62,10 @@ int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
u8 au8522_readreg(struct au8522_state *state, u16 reg) u8 au8522_readreg(struct au8522_state *state, u16 reg)
{ {
int ret; int ret;
u8 b0 [] = { (reg >> 8) | 0x40, reg & 0xff }; u8 b0[] = { (reg >> 8) | 0x40, reg & 0xff };
u8 b1 [] = { 0 }; u8 b1[] = { 0 };
struct i2c_msg msg [] = { struct i2c_msg msg[] = {
{ .addr = state->config->demod_address, .flags = 0, { .addr = state->config->demod_address, .flags = 0,
.buf = b0, .len = 2 }, .buf = b0, .len = 2 },
{ .addr = state->config->demod_address, .flags = I2C_M_RD, { .addr = state->config->demod_address, .flags = I2C_M_RD,
......
...@@ -150,13 +150,13 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data) ...@@ -150,13 +150,13 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
/* Make sure we support the board model */ /* Make sure we support the board model */
switch (tv.model) { switch (tv.model) {
case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */ case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */
case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */ case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and basic analog video */ case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and basic analog video */ case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and basic analog video */ case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and basic analog video */ case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */ case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and basic analog video */ case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */
case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */ case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */
break; break;
default: default:
...@@ -202,9 +202,8 @@ void au0828_card_setup(struct au0828_dev *dev) ...@@ -202,9 +202,8 @@ void au0828_card_setup(struct au0828_dev *dev)
demod) */ demod) */
sd = v4l2_i2c_new_subdev(&dev->i2c_adap, "au8522", "au8522", sd = v4l2_i2c_new_subdev(&dev->i2c_adap, "au8522", "au8522",
0x8e >> 1); 0x8e >> 1);
if (sd == NULL) { if (sd == NULL)
printk("analog subdev registration failure\n"); printk(KERN_ERR "analog subdev registration failed\n");
}
} }
/* Setup tuners */ /* Setup tuners */
...@@ -212,9 +211,8 @@ void au0828_card_setup(struct au0828_dev *dev) ...@@ -212,9 +211,8 @@ void au0828_card_setup(struct au0828_dev *dev)
/* Load the tuner module, which does the attach */ /* Load the tuner module, which does the attach */
sd = v4l2_i2c_new_subdev(&dev->i2c_adap, "tuner", "tuner", sd = v4l2_i2c_new_subdev(&dev->i2c_adap, "tuner", "tuner",
dev->board.tuner_addr); dev->board.tuner_addr);
if (sd == NULL) { if (sd == NULL)
printk("analog tuner subdev registration failure\n"); printk(KERN_ERR "tuner subdev registration fail\n");
}
tun_setup.mode_mask = mode_mask; tun_setup.mode_mask = mode_mask;
tun_setup.type = dev->board.tuner_type; tun_setup.type = dev->board.tuner_type;
......
...@@ -145,11 +145,10 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, ...@@ -145,11 +145,10 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
requires us to slow down the i2c clock until we have a better requires us to slow down the i2c clock until we have a better
strategy (such as using the secondary i2c bus to do firmware strategy (such as using the secondary i2c bus to do firmware
loading */ loading */
if ((msg->addr << 1) == 0xc2) { if ((msg->addr << 1) == 0xc2)
au0828_write(dev, REG_202, 0x40); au0828_write(dev, REG_202, 0x40);
} else { else
au0828_write(dev, REG_202, 0x07); au0828_write(dev, REG_202, 0x07);
}
/* Hardware needs 8 bit addresses */ /* Hardware needs 8 bit addresses */
au0828_write(dev, REG_203, msg->addr << 1); au0828_write(dev, REG_203, msg->addr << 1);
...@@ -223,11 +222,10 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, ...@@ -223,11 +222,10 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
requires us to slow down the i2c clock until we have a better requires us to slow down the i2c clock until we have a better
strategy (such as using the secondary i2c bus to do firmware strategy (such as using the secondary i2c bus to do firmware
loading */ loading */
if ((msg->addr << 1) == 0xc2) { if ((msg->addr << 1) == 0xc2)
au0828_write(dev, REG_202, 0x40); au0828_write(dev, REG_202, 0x40);
} else { else
au0828_write(dev, REG_202, 0x07); au0828_write(dev, REG_202, 0x07);
}
/* Hardware needs 8 bit addresses */ /* Hardware needs 8 bit addresses */
au0828_write(dev, REG_203, msg->addr << 1); au0828_write(dev, REG_203, msg->addr << 1);
......
This diff is collapsed.
...@@ -54,16 +54,10 @@ ...@@ -54,16 +54,10 @@
/* Defination for AU0828 USB transfer */ /* Defination for AU0828 USB transfer */
#define AU0828_MAX_ISO_BUFS 12 /* maybe resize this value in the future */ #define AU0828_MAX_ISO_BUFS 12 /* maybe resize this value in the future */
#define AU0828_ISO_PACKETS_PER_URB 10 #define AU0828_ISO_PACKETS_PER_URB 10
#define AU0828_ISO_MAX_FRAME_SIZE (3 * 1024)
#define AU0828_ISO_BUFFER_SIZE (AU0828_ISO_PACKETS_PER_URB * AU0828_ISO_MAX_FRAME_SIZE)
#define AU0828_MIN_BUF 4 #define AU0828_MIN_BUF 4
#define AU0828_DEF_BUF 8 #define AU0828_DEF_BUF 8
#define AU0828_MAX_IMAGES 10
#define AU0828_FRAME_SIZE (1028 * 1024 * 4)
#define AU0828_URB_TIMEOUT msecs_to_jiffies(AU0828_MAX_ISO_BUFS * AU0828_ISO_PACKETS_PER_URB)
#define AU0828_MAX_INPUT 4 #define AU0828_MAX_INPUT 4
enum au0828_itype { enum au0828_itype {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment