Commit a5bef1d2 authored by Hans Petter Selasky's avatar Hans Petter Selasky Committed by Mauro Carvalho Chehab

[media] itd1000: Don't reuse core macro names

The dbg, warn and info macros are already defined by the USB stack.
Rename these macros to avoid macro redefinition warnings.

Refactor lineshift in printouts.
Signed-off-by: default avatarHans Petter Selasky <hselasky@c2i.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f54ba7f1
...@@ -35,21 +35,18 @@ static int debug; ...@@ -35,21 +35,18 @@ static int debug;
module_param(debug, int, 0644); module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
#define deb(args...) do { \ #define itd_dbg(args...) do { \
if (debug) { \ if (debug) { \
printk(KERN_DEBUG "ITD1000: " args);\ printk(KERN_DEBUG "ITD1000: " args);\
printk("\n"); \
} \ } \
} while (0) } while (0)
#define warn(args...) do { \ #define itd_warn(args...) do { \
printk(KERN_WARNING "ITD1000: " args); \ printk(KERN_WARNING "ITD1000: " args); \
printk("\n"); \
} while (0) } while (0)
#define info(args...) do { \ #define itd_info(args...) do { \
printk(KERN_INFO "ITD1000: " args); \ printk(KERN_INFO "ITD1000: " args); \
printk("\n"); \
} while (0) } while (0)
/* don't write more than one byte with flexcop behind */ /* don't write more than one byte with flexcop behind */
...@@ -62,7 +59,7 @@ static int itd1000_write_regs(struct itd1000_state *state, u8 reg, u8 v[], u8 le ...@@ -62,7 +59,7 @@ static int itd1000_write_regs(struct itd1000_state *state, u8 reg, u8 v[], u8 le
buf[0] = reg; buf[0] = reg;
memcpy(&buf[1], v, len); memcpy(&buf[1], v, len);
/* deb("wr %02x: %02x", reg, v[0]); */ /* itd_dbg("wr %02x: %02x\n", reg, v[0]); */
if (i2c_transfer(state->i2c, &msg, 1) != 1) { if (i2c_transfer(state->i2c, &msg, 1) != 1) {
printk(KERN_WARNING "itd1000 I2C write failed\n"); printk(KERN_WARNING "itd1000 I2C write failed\n");
...@@ -83,7 +80,7 @@ static int itd1000_read_reg(struct itd1000_state *state, u8 reg) ...@@ -83,7 +80,7 @@ static int itd1000_read_reg(struct itd1000_state *state, u8 reg)
itd1000_write_regs(state, (reg - 1) & 0xff, &state->shadow[(reg - 1) & 0xff], 1); itd1000_write_regs(state, (reg - 1) & 0xff, &state->shadow[(reg - 1) & 0xff], 1);
if (i2c_transfer(state->i2c, msg, 2) != 2) { if (i2c_transfer(state->i2c, msg, 2) != 2) {
warn("itd1000 I2C read failed"); itd_warn("itd1000 I2C read failed\n");
return -EREMOTEIO; return -EREMOTEIO;
} }
return val; return val;
...@@ -127,14 +124,14 @@ static void itd1000_set_lpf_bw(struct itd1000_state *state, u32 symbol_rate) ...@@ -127,14 +124,14 @@ static void itd1000_set_lpf_bw(struct itd1000_state *state, u32 symbol_rate)
u8 bbgvmin = itd1000_read_reg(state, BBGVMIN) & 0xf0; u8 bbgvmin = itd1000_read_reg(state, BBGVMIN) & 0xf0;
u8 bw = itd1000_read_reg(state, BW) & 0xf0; u8 bw = itd1000_read_reg(state, BW) & 0xf0;
deb("symbol_rate = %d", symbol_rate); itd_dbg("symbol_rate = %d\n", symbol_rate);
/* not sure what is that ? - starting to download the table */ /* not sure what is that ? - starting to download the table */
itd1000_write_reg(state, CON1, con1 | (1 << 1)); itd1000_write_reg(state, CON1, con1 | (1 << 1));
for (i = 0; i < ARRAY_SIZE(itd1000_lpf_pga); i++) for (i = 0; i < ARRAY_SIZE(itd1000_lpf_pga); i++)
if (symbol_rate < itd1000_lpf_pga[i].symbol_rate) { if (symbol_rate < itd1000_lpf_pga[i].symbol_rate) {
deb("symrate: index: %d pgaext: %x, bbgvmin: %x", i, itd1000_lpf_pga[i].pgaext, itd1000_lpf_pga[i].bbgvmin); itd_dbg("symrate: index: %d pgaext: %x, bbgvmin: %x\n", i, itd1000_lpf_pga[i].pgaext, itd1000_lpf_pga[i].bbgvmin);
itd1000_write_reg(state, PLLFH, pllfh | (itd1000_lpf_pga[i].pgaext << 4)); itd1000_write_reg(state, PLLFH, pllfh | (itd1000_lpf_pga[i].pgaext << 4));
itd1000_write_reg(state, BBGVMIN, bbgvmin | (itd1000_lpf_pga[i].bbgvmin)); itd1000_write_reg(state, BBGVMIN, bbgvmin | (itd1000_lpf_pga[i].bbgvmin));
itd1000_write_reg(state, BW, bw | (i & 0x0f)); itd1000_write_reg(state, BW, bw | (i & 0x0f));
...@@ -182,7 +179,7 @@ static void itd1000_set_vco(struct itd1000_state *state, u32 freq_khz) ...@@ -182,7 +179,7 @@ static void itd1000_set_vco(struct itd1000_state *state, u32 freq_khz)
adcout = itd1000_read_reg(state, PLLLOCK) & 0x0f; adcout = itd1000_read_reg(state, PLLLOCK) & 0x0f;
deb("VCO: %dkHz: %d -> ADCOUT: %d %02x", freq_khz, itd1000_vcorg[i].vcorg, adcout, vco_chp1_i2c); itd_dbg("VCO: %dkHz: %d -> ADCOUT: %d %02x\n", freq_khz, itd1000_vcorg[i].vcorg, adcout, vco_chp1_i2c);
if (adcout > 13) { if (adcout > 13) {
if (!(itd1000_vcorg[i].vcorg == 7 || itd1000_vcorg[i].vcorg == 15)) if (!(itd1000_vcorg[i].vcorg == 7 || itd1000_vcorg[i].vcorg == 15))
...@@ -232,7 +229,7 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz) ...@@ -232,7 +229,7 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz)
pllf = (u32) tmp; pllf = (u32) tmp;
state->frequency = ((plln * 1000) + (pllf * 1000)/1048576) * 2*FREF; state->frequency = ((plln * 1000) + (pllf * 1000)/1048576) * 2*FREF;
deb("frequency: %dkHz (wanted) %dkHz (set), PLLF = %d, PLLN = %d", freq_khz, state->frequency, pllf, plln); itd_dbg("frequency: %dkHz (wanted) %dkHz (set), PLLF = %d, PLLN = %d\n", freq_khz, state->frequency, pllf, plln);
itd1000_write_reg(state, PLLNH, 0x80); /* PLLNH */; itd1000_write_reg(state, PLLNH, 0x80); /* PLLNH */;
itd1000_write_reg(state, PLLNL, plln & 0xff); itd1000_write_reg(state, PLLNL, plln & 0xff);
...@@ -242,7 +239,7 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz) ...@@ -242,7 +239,7 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz)
for (i = 0; i < ARRAY_SIZE(itd1000_fre_values); i++) { for (i = 0; i < ARRAY_SIZE(itd1000_fre_values); i++) {
if (freq_khz <= itd1000_fre_values[i].freq) { if (freq_khz <= itd1000_fre_values[i].freq) {
deb("fre_values: %d", i); itd_dbg("fre_values: %d\n", i);
itd1000_write_reg(state, RFTR, itd1000_fre_values[i].values[0]); itd1000_write_reg(state, RFTR, itd1000_fre_values[i].values[0]);
for (j = 0; j < 9; j++) for (j = 0; j < 9; j++)
itd1000_write_reg(state, RFST1+j, itd1000_fre_values[i].values[j+1]); itd1000_write_reg(state, RFST1+j, itd1000_fre_values[i].values[j+1]);
...@@ -382,7 +379,7 @@ struct dvb_frontend *itd1000_attach(struct dvb_frontend *fe, struct i2c_adapter ...@@ -382,7 +379,7 @@ struct dvb_frontend *itd1000_attach(struct dvb_frontend *fe, struct i2c_adapter
kfree(state); kfree(state);
return NULL; return NULL;
} }
info("successfully identified (ID: %d)", i); itd_info("successfully identified (ID: %d)\n", i);
memset(state->shadow, 0xff, sizeof(state->shadow)); memset(state->shadow, 0xff, sizeof(state->shadow));
for (i = 0x65; i < 0x9c; i++) for (i = 0x65; i < 0x9c; i++)
......
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