aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib0090.c
diff options
context:
space:
mode:
authorOlivier Grenie <Olivier.Grenie@dibcom.fr>2009-12-07 05:49:40 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:16 -0500
commit9c78303681278b983fac3c6c3c0aa3f93cf2ffa8 (patch)
tree1407987d9fa1d4234c46fcab6d22da1997e303a2 /drivers/media/dvb/frontends/dib0090.c
parent03245a5ee69a5faa99b020fe1aca9bafe10c46a9 (diff)
V4L/DVB (13584): DiBXXX0: fix most of the Codingstyle violations from the previous patch
This patch changes most of the Codingstyle violations which were introduced by the previous patch. Line length less that 80 chars are not corrected. Signed-off-by: Olivier Grenie <Olivier.Grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/dib0090.c')
-rw-r--r--drivers/media/dvb/frontends/dib0090.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/media/dvb/frontends/dib0090.c b/drivers/media/dvb/frontends/dib0090.c
index e37d32dbd5c5..614552709a6f 100644
--- a/drivers/media/dvb/frontends/dib0090.c
+++ b/drivers/media/dvb/frontends/dib0090.c
@@ -149,8 +149,8 @@ static u16 dib0090_read_reg(struct dib0090_state *state, u8 reg)
149{ 149{
150 u8 b[2]; 150 u8 b[2];
151 struct i2c_msg msg[2] = { 151 struct i2c_msg msg[2] = {
152 {.addr = state->config->i2c_address,.flags = 0,.buf = &reg,.len = 1}, 152 {.addr = state->config->i2c_address, .flags = 0, .buf = &reg, .len = 1},
153 {.addr = state->config->i2c_address,.flags = I2C_M_RD,.buf = b,.len = 2}, 153 {.addr = state->config->i2c_address, .flags = I2C_M_RD, .buf = b, .len = 2},
154 }; 154 };
155 if (i2c_transfer(state->i2c, msg, 2) != 2) { 155 if (i2c_transfer(state->i2c, msg, 2) != 2) {
156 printk(KERN_WARNING "DiB0090 I2C read failed\n"); 156 printk(KERN_WARNING "DiB0090 I2C read failed\n");
@@ -162,7 +162,7 @@ static u16 dib0090_read_reg(struct dib0090_state *state, u8 reg)
162static int dib0090_write_reg(struct dib0090_state *state, u32 reg, u16 val) 162static int dib0090_write_reg(struct dib0090_state *state, u32 reg, u16 val)
163{ 163{
164 u8 b[3] = { reg & 0xff, val >> 8, val & 0xff }; 164 u8 b[3] = { reg & 0xff, val >> 8, val & 0xff };
165 struct i2c_msg msg = {.addr = state->config->i2c_address,.flags = 0,.buf = b,.len = 3 }; 165 struct i2c_msg msg = {.addr = state->config->i2c_address, .flags = 0, .buf = b, .len = 3 };
166 if (i2c_transfer(state->i2c, &msg, 1) != 1) { 166 if (i2c_transfer(state->i2c, &msg, 1) != 1) {
167 printk(KERN_WARNING "DiB0090 I2C write failed\n"); 167 printk(KERN_WARNING "DiB0090 I2C write failed\n");
168 return -EREMOTEIO; 168 return -EREMOTEIO;
@@ -287,12 +287,12 @@ extern void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast)
287{ 287{
288 struct dib0090_state *state = fe->tuner_priv; 288 struct dib0090_state *state = fe->tuner_priv;
289 if (fast) 289 if (fast)
290 dib0090_write_reg(state, 0x04, 0); //1kHz 290 dib0090_write_reg(state, 0x04, 0);
291 else 291 else
292 dib0090_write_reg(state, 0x04, 1); //almost frozen 292 dib0090_write_reg(state, 0x04, 1);
293} 293}
294
295EXPORT_SYMBOL(dib0090_dcc_freq); 294EXPORT_SYMBOL(dib0090_dcc_freq);
295
296static const u16 rf_ramp_pwm_cband[] = { 296static const u16 rf_ramp_pwm_cband[] = {
297 0, /* max RF gain in 10th of dB */ 297 0, /* max RF gain in 10th of dB */
298 0, /* ramp_slope = 1dB of gain -> clock_ticks_per_db = clk_khz / ramp_slope -> 0x2b */ 298 0, /* ramp_slope = 1dB of gain -> clock_ticks_per_db = clk_khz / ramp_slope -> 0x2b */
@@ -616,11 +616,11 @@ void dib0090_pwm_gain_reset(struct dvb_frontend *fe)
616 else 616 else
617 dib0090_write_reg(state, 0x32, (0 << 11)); 617 dib0090_write_reg(state, 0x32, (0 << 11));
618 618
619 dib0090_write_reg(state, 0x39, (1 << 10)); // 0 gain by default 619 dib0090_write_reg(state, 0x39, (1 << 10));
620 } 620 }
621} 621}
622
623EXPORT_SYMBOL(dib0090_pwm_gain_reset); 622EXPORT_SYMBOL(dib0090_pwm_gain_reset);
623
624int dib0090_gain_control(struct dvb_frontend *fe) 624int dib0090_gain_control(struct dvb_frontend *fe)
625{ 625{
626 struct dib0090_state *state = fe->tuner_priv; 626 struct dib0090_state *state = fe->tuner_priv;
@@ -760,7 +760,7 @@ int dib0090_gain_control(struct dvb_frontend *fe)
760#ifdef DEBUG_AGC 760#ifdef DEBUG_AGC
761 dprintk 761 dprintk
762 ("FE: %d, tune state %d, ADC = %3ddB (ADC err %3d) WBD %3ddB (WBD err %3d, WBD val SADC: %4d), RFGainLimit (TOP): %3d, signal: %3ddBm", 762 ("FE: %d, tune state %d, ADC = %3ddB (ADC err %3d) WBD %3ddB (WBD err %3d, WBD val SADC: %4d), RFGainLimit (TOP): %3d, signal: %3ddBm",
763 (u32) fe->id, (u32) * tune_state, (u32) adc, (u32) adc_error, (u32) wbd, (u32) wbd_error, (u32) wbd_val, 763 (u32) fe->id, (u32) *tune_state, (u32) adc, (u32) adc_error, (u32) wbd, (u32) wbd_error, (u32) wbd_val,
764 (u32) state->rf_gain_limit >> WBD_ALPHA, (s32) 200 + adc - (state->current_gain >> GAIN_ALPHA)); 764 (u32) state->rf_gain_limit >> WBD_ALPHA, (s32) 200 + adc - (state->current_gain >> GAIN_ALPHA));
765#endif 765#endif
766 } 766 }
@@ -770,8 +770,8 @@ int dib0090_gain_control(struct dvb_frontend *fe)
770 dib0090_gain_apply(state, adc_error, wbd_error, apply_gain_immediatly); 770 dib0090_gain_apply(state, adc_error, wbd_error, apply_gain_immediatly);
771 return ret; 771 return ret;
772} 772}
773
774EXPORT_SYMBOL(dib0090_gain_control); 773EXPORT_SYMBOL(dib0090_gain_control);
774
775void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt) 775void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt)
776{ 776{
777 struct dib0090_state *state = fe->tuner_priv; 777 struct dib0090_state *state = fe->tuner_priv;
@@ -784,15 +784,15 @@ void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 *
784 if (rflt) 784 if (rflt)
785 *rflt = (state->rf_lt_def >> 10) & 0x7; 785 *rflt = (state->rf_lt_def >> 10) & 0x7;
786} 786}
787
788EXPORT_SYMBOL(dib0090_get_current_gain); 787EXPORT_SYMBOL(dib0090_get_current_gain);
788
789u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner) 789u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner)
790{ 790{
791 struct dib0090_state *st = tuner->tuner_priv; 791 struct dib0090_state *st = tuner->tuner_priv;
792 return st->wbd_offset; 792 return st->wbd_offset;
793} 793}
794
795EXPORT_SYMBOL(dib0090_get_wbd_offset); 794EXPORT_SYMBOL(dib0090_get_wbd_offset);
795
796static const u16 dib0090_defaults[] = { 796static const u16 dib0090_defaults[] = {
797 797
798 25, 0x01, 798 25, 0x01,
@@ -891,7 +891,7 @@ static int dib0090_reset(struct dvb_frontend *fe)
891 return 0; 891 return 0;
892} 892}
893 893
894#define steps(u) (((u)>15)?((u)-16):(u)) 894#define steps(u) (((u) > 15) ? ((u)-16) : (u))
895#define INTERN_WAIT 10 895#define INTERN_WAIT 10
896static int dib0090_get_offset(struct dib0090_state *state, enum frontend_tune_state *tune_state) 896static int dib0090_get_offset(struct dib0090_state *state, enum frontend_tune_state *tune_state)
897{ 897{
@@ -1439,7 +1439,6 @@ enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)
1439 1439
1440 return state->tune_state; 1440 return state->tune_state;
1441} 1441}
1442
1443EXPORT_SYMBOL(dib0090_get_tune_state); 1442EXPORT_SYMBOL(dib0090_get_tune_state);
1444 1443
1445int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state) 1444int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
@@ -1449,7 +1448,6 @@ int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tun
1449 state->tune_state = tune_state; 1448 state->tune_state = tune_state;
1450 return 0; 1449 return 0;
1451} 1450}
1452
1453EXPORT_SYMBOL(dib0090_set_tune_state); 1451EXPORT_SYMBOL(dib0090_set_tune_state);
1454 1452
1455static int dib0090_get_frequency(struct dvb_frontend *fe, u32 * frequency) 1453static int dib0090_get_frequency(struct dvb_frontend *fe, u32 * frequency)
@@ -1516,7 +1514,6 @@ struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapte
1516 fe->tuner_priv = NULL; 1514 fe->tuner_priv = NULL;
1517 return NULL; 1515 return NULL;
1518} 1516}
1519
1520EXPORT_SYMBOL(dib0090_register); 1517EXPORT_SYMBOL(dib0090_register);
1521 1518
1522MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>"); 1519MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>");