aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-02 17:59:48 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:43 -0400
commite059b0fac7d9df8bf759d7092a16221f0fd250e8 (patch)
tree6c5a3d42a5652a6061d626bf2aa13355c4ae9c6a
parentf07e8e4bb790f6cb462d5d5425193cad874ac0de (diff)
V4L/DVB (7628): au8522: codingstyle cleanups
Fixed some checkpatch.pl warnings Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/dvb/frontends/au8522.c70
-rw-r--r--drivers/media/dvb/frontends/au8522.h9
2 files changed, 40 insertions, 39 deletions
diff --git a/drivers/media/dvb/frontends/au8522.c b/drivers/media/dvb/frontends/au8522.c
index d3c44b95e240..caef885a122f 100644
--- a/drivers/media/dvb/frontends/au8522.c
+++ b/drivers/media/dvb/frontends/au8522.c
@@ -31,10 +31,10 @@
31 31
32struct au8522_state { 32struct au8522_state {
33 33
34 struct i2c_adapter* i2c; 34 struct i2c_adapter *i2c;
35 35
36 /* configuration settings */ 36 /* configuration settings */
37 const struct au8522_config* config; 37 const struct au8522_config *config;
38 38
39 struct dvb_frontend frontend; 39 struct dvb_frontend frontend;
40 40
@@ -47,7 +47,7 @@ static int debug = 0;
47#define dprintk if (debug) printk 47#define dprintk if (debug) printk
48 48
49/* 16 bit registers, 8 bit values */ 49/* 16 bit registers, 8 bit values */
50static int au8522_writereg(struct au8522_state* state, u16 reg, u8 data) 50static int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
51{ 51{
52 int ret; 52 int ret;
53 u8 buf [] = { reg >> 8, reg & 0xff, data }; 53 u8 buf [] = { reg >> 8, reg & 0xff, data };
@@ -64,7 +64,7 @@ static int au8522_writereg(struct au8522_state* state, u16 reg, u8 data)
64 return (ret != 1) ? -1 : 0; 64 return (ret != 1) ? -1 : 0;
65} 65}
66 66
67static u8 au8522_readreg(struct au8522_state* state, u16 reg) 67static u8 au8522_readreg(struct au8522_state *state, u16 reg)
68{ 68{
69 int ret; 69 int ret;
70 u8 b0 [] = { reg >> 8, reg & 0xff }; 70 u8 b0 [] = { reg >> 8, reg & 0xff };
@@ -83,9 +83,9 @@ static u8 au8522_readreg(struct au8522_state* state, u16 reg)
83 return b1[0]; 83 return b1[0];
84} 84}
85 85
86static int au8522_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) 86static int au8522_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
87{ 87{
88 struct au8522_state* state = fe->demodulator_priv; 88 struct au8522_state *state = fe->demodulator_priv;
89 89
90 dprintk("%s(%d)\n", __FUNCTION__, enable); 90 dprintk("%s(%d)\n", __FUNCTION__, enable);
91 91
@@ -95,10 +95,10 @@ static int au8522_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
95 return au8522_writereg(state, 0x106, 0); 95 return au8522_writereg(state, 0x106, 0);
96} 96}
97 97
98static int au8522_enable_modulation(struct dvb_frontend* fe, 98static int au8522_enable_modulation(struct dvb_frontend *fe,
99 fe_modulation_t m) 99 fe_modulation_t m)
100{ 100{
101 struct au8522_state* state = fe->demodulator_priv; 101 struct au8522_state *state = fe->demodulator_priv;
102 102
103 dprintk("%s(0x%08x)\n", __FUNCTION__, m); 103 dprintk("%s(0x%08x)\n", __FUNCTION__, m);
104 104
@@ -230,10 +230,10 @@ static int au8522_enable_modulation(struct dvb_frontend* fe,
230} 230}
231 231
232/* Talk to the demod, set the FEC, GUARD, QAM settings etc */ 232/* Talk to the demod, set the FEC, GUARD, QAM settings etc */
233static int au8522_set_frontend (struct dvb_frontend* fe, 233static int au8522_set_frontend(struct dvb_frontend *fe,
234 struct dvb_frontend_parameters *p) 234 struct dvb_frontend_parameters *p)
235{ 235{
236 struct au8522_state* state = fe->demodulator_priv; 236 struct au8522_state *state = fe->demodulator_priv;
237 237
238 dprintk("%s(frequency=%d)\n", __FUNCTION__, p->frequency); 238 dprintk("%s(frequency=%d)\n", __FUNCTION__, p->frequency);
239 239
@@ -255,9 +255,9 @@ static int au8522_set_frontend (struct dvb_frontend* fe,
255 255
256/* Reset the demod hardware and reset all of the configuration registers 256/* Reset the demod hardware and reset all of the configuration registers
257 to a default state. */ 257 to a default state. */
258static int au8522_init(struct dvb_frontend* fe) 258static int au8522_init(struct dvb_frontend *fe)
259{ 259{
260 struct au8522_state* state = fe->demodulator_priv; 260 struct au8522_state *state = fe->demodulator_priv;
261 dprintk("%s()\n", __FUNCTION__); 261 dprintk("%s()\n", __FUNCTION__);
262 262
263 au8522_writereg(state, 0xa4, 1 << 5); 263 au8522_writereg(state, 0xa4, 1 << 5);
@@ -267,9 +267,9 @@ static int au8522_init(struct dvb_frontend* fe)
267 return 0; 267 return 0;
268} 268}
269 269
270static int au8522_read_status(struct dvb_frontend* fe, fe_status_t* status) 270static int au8522_read_status(struct dvb_frontend *fe, fe_status_t *status)
271{ 271{
272 struct au8522_state* state = fe->demodulator_priv; 272 struct au8522_state *state = fe->demodulator_priv;
273 u8 reg; 273 u8 reg;
274 u32 tuner_status = 0; 274 u32 tuner_status = 0;
275 275
@@ -279,16 +279,16 @@ static int au8522_read_status(struct dvb_frontend* fe, fe_status_t* status)
279 dprintk("%s() Checking VSB_8\n", __FUNCTION__); 279 dprintk("%s() Checking VSB_8\n", __FUNCTION__);
280 //au8522_writereg(state, 0x80a4, 0x20); 280 //au8522_writereg(state, 0x80a4, 0x20);
281 reg = au8522_readreg(state, 0x4088); 281 reg = au8522_readreg(state, 0x4088);
282 if(reg & 0x01) 282 if (reg & 0x01)
283 *status |= FE_HAS_VITERBI; 283 *status |= FE_HAS_VITERBI;
284 if(reg & 0x02) 284 if (reg & 0x02)
285 *status |= FE_HAS_LOCK | FE_HAS_SYNC; 285 *status |= FE_HAS_LOCK | FE_HAS_SYNC;
286 } else { 286 } else {
287 dprintk("%s() Checking QAM\n", __FUNCTION__); 287 dprintk("%s() Checking QAM\n", __FUNCTION__);
288 reg = au8522_readreg(state, 0x4541); 288 reg = au8522_readreg(state, 0x4541);
289 if(reg & 0x80) 289 if (reg & 0x80)
290 *status |= FE_HAS_VITERBI; 290 *status |= FE_HAS_VITERBI;
291 if(reg & 0x20) 291 if (reg & 0x20)
292 *status |= FE_HAS_LOCK | FE_HAS_SYNC; 292 *status |= FE_HAS_LOCK | FE_HAS_SYNC;
293 } 293 }
294 294
@@ -320,7 +320,7 @@ static int au8522_read_status(struct dvb_frontend* fe, fe_status_t* status)
320 return 0; 320 return 0;
321} 321}
322 322
323static int au8522_read_snr(struct dvb_frontend* fe, u16* snr) 323static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr)
324{ 324{
325 dprintk("%s()\n", __FUNCTION__); 325 dprintk("%s()\n", __FUNCTION__);
326 326
@@ -329,30 +329,30 @@ static int au8522_read_snr(struct dvb_frontend* fe, u16* snr)
329 return 0; 329 return 0;
330} 330}
331 331
332static int au8522_read_signal_strength(struct dvb_frontend* fe, 332static int au8522_read_signal_strength(struct dvb_frontend *fe,
333 u16* signal_strength) 333 u16 *signal_strength)
334{ 334{
335 return au8522_read_snr(fe, signal_strength); 335 return au8522_read_snr(fe, signal_strength);
336} 336}
337 337
338static int au8522_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) 338static int au8522_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
339{ 339{
340 struct au8522_state* state = fe->demodulator_priv; 340 struct au8522_state *state = fe->demodulator_priv;
341 341
342 *ucblocks = au8522_readreg(state, 0x4087); 342 *ucblocks = au8522_readreg(state, 0x4087);
343 343
344 return 0; 344 return 0;
345} 345}
346 346
347static int au8522_read_ber(struct dvb_frontend* fe, u32* ber) 347static int au8522_read_ber(struct dvb_frontend *fe, u32 *ber)
348{ 348{
349 return au8522_read_ucblocks(fe, ber); 349 return au8522_read_ucblocks(fe, ber);
350} 350}
351 351
352static int au8522_get_frontend(struct dvb_frontend* fe, 352static int au8522_get_frontend(struct dvb_frontend *fe,
353 struct dvb_frontend_parameters *p) 353 struct dvb_frontend_parameters *p)
354{ 354{
355 struct au8522_state* state = fe->demodulator_priv; 355 struct au8522_state *state = fe->demodulator_priv;
356 356
357 p->frequency = state->current_frequency; 357 p->frequency = state->current_frequency;
358 p->u.vsb.modulation = state->current_modulation; 358 p->u.vsb.modulation = state->current_modulation;
@@ -360,25 +360,25 @@ static int au8522_get_frontend(struct dvb_frontend* fe,
360 return 0; 360 return 0;
361} 361}
362 362
363static int au8522_get_tune_settings(struct dvb_frontend* fe, 363static int au8522_get_tune_settings(struct dvb_frontend *fe,
364 struct dvb_frontend_tune_settings *tune) 364 struct dvb_frontend_tune_settings *tune)
365{ 365{
366 tune->min_delay_ms = 1000; 366 tune->min_delay_ms = 1000;
367 return 0; 367 return 0;
368} 368}
369 369
370static void au8522_release(struct dvb_frontend* fe) 370static void au8522_release(struct dvb_frontend *fe)
371{ 371{
372 struct au8522_state* state = fe->demodulator_priv; 372 struct au8522_state *state = fe->demodulator_priv;
373 kfree(state); 373 kfree(state);
374} 374}
375 375
376static struct dvb_frontend_ops au8522_ops; 376static struct dvb_frontend_ops au8522_ops;
377 377
378struct dvb_frontend* au8522_attach(const struct au8522_config* config, 378struct dvb_frontend *au8522_attach(const struct au8522_config *config,
379 struct i2c_adapter* i2c) 379 struct i2c_adapter *i2c)
380{ 380{
381 struct au8522_state* state = NULL; 381 struct au8522_state *state = NULL;
382 382
383 /* allocate memory for the internal state */ 383 /* allocate memory for the internal state */
384 state = kmalloc(sizeof(struct au8522_state), GFP_KERNEL); 384 state = kmalloc(sizeof(struct au8522_state), GFP_KERNEL);
diff --git a/drivers/media/dvb/frontends/au8522.h b/drivers/media/dvb/frontends/au8522.h
index a75627155fed..9952957ab7b0 100644
--- a/drivers/media/dvb/frontends/au8522.h
+++ b/drivers/media/dvb/frontends/au8522.h
@@ -36,11 +36,12 @@ struct au8522_config
36}; 36};
37 37
38#if defined(CONFIG_DVB_AU8522) || (defined(CONFIG_DVB_AU8522_MODULE) && defined(MODULE)) 38#if defined(CONFIG_DVB_AU8522) || (defined(CONFIG_DVB_AU8522_MODULE) && defined(MODULE))
39extern struct dvb_frontend* au8522_attach(const struct au8522_config* config, 39extern struct dvb_frontend *au8522_attach(const struct au8522_config *config,
40 struct i2c_adapter* i2c); 40 struct i2c_adapter *i2c);
41#else 41#else
42static inline struct dvb_frontend* au8522_attach(const struct au8522_config* config, 42static inline
43 struct i2c_adapter* i2c) 43struct dvb_frontend *au8522_attach(const struct au8522_config *config,
44 struct i2c_adapter *i2c)
44{ 45{
45 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 46 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
46 return NULL; 47 return NULL;