aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/ves1820.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/ves1820.c')
-rw-r--r--drivers/media/dvb/frontends/ves1820.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c
index 9c0d23e1d9e5..05dc1cdf6d55 100644
--- a/drivers/media/dvb/frontends/ves1820.c
+++ b/drivers/media/dvb/frontends/ves1820.c
@@ -193,7 +193,7 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate)
193 193
194static int ves1820_init(struct dvb_frontend* fe) 194static int ves1820_init(struct dvb_frontend* fe)
195{ 195{
196 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 196 struct ves1820_state* state = fe->demodulator_priv;
197 int i; 197 int i;
198 int val; 198 int val;
199 199
@@ -214,7 +214,7 @@ static int ves1820_init(struct dvb_frontend* fe)
214 214
215static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 215static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
216{ 216{
217 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 217 struct ves1820_state* state = fe->demodulator_priv;
218 static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; 218 static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 };
219 static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; 219 static const u8 reg0x01[] = { 140, 140, 106, 100, 92 };
220 static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; 220 static const u8 reg0x05[] = { 135, 100, 70, 54, 38 };
@@ -241,7 +241,7 @@ static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_p
241 241
242static int ves1820_read_status(struct dvb_frontend* fe, fe_status_t* status) 242static int ves1820_read_status(struct dvb_frontend* fe, fe_status_t* status)
243{ 243{
244 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 244 struct ves1820_state* state = fe->demodulator_priv;
245 int sync; 245 int sync;
246 246
247 *status = 0; 247 *status = 0;
@@ -267,7 +267,7 @@ static int ves1820_read_status(struct dvb_frontend* fe, fe_status_t* status)
267 267
268static int ves1820_read_ber(struct dvb_frontend* fe, u32* ber) 268static int ves1820_read_ber(struct dvb_frontend* fe, u32* ber)
269{ 269{
270 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 270 struct ves1820_state* state = fe->demodulator_priv;
271 271
272 u32 _ber = ves1820_readreg(state, 0x14) | 272 u32 _ber = ves1820_readreg(state, 0x14) |
273 (ves1820_readreg(state, 0x15) << 8) | 273 (ves1820_readreg(state, 0x15) << 8) |
@@ -279,7 +279,7 @@ static int ves1820_read_ber(struct dvb_frontend* fe, u32* ber)
279 279
280static int ves1820_read_signal_strength(struct dvb_frontend* fe, u16* strength) 280static int ves1820_read_signal_strength(struct dvb_frontend* fe, u16* strength)
281{ 281{
282 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 282 struct ves1820_state* state = fe->demodulator_priv;
283 283
284 u8 gain = ves1820_readreg(state, 0x17); 284 u8 gain = ves1820_readreg(state, 0x17);
285 *strength = (gain << 8) | gain; 285 *strength = (gain << 8) | gain;
@@ -289,7 +289,7 @@ static int ves1820_read_signal_strength(struct dvb_frontend* fe, u16* strength)
289 289
290static int ves1820_read_snr(struct dvb_frontend* fe, u16* snr) 290static int ves1820_read_snr(struct dvb_frontend* fe, u16* snr)
291{ 291{
292 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 292 struct ves1820_state* state = fe->demodulator_priv;
293 293
294 u8 quality = ~ves1820_readreg(state, 0x18); 294 u8 quality = ~ves1820_readreg(state, 0x18);
295 *snr = (quality << 8) | quality; 295 *snr = (quality << 8) | quality;
@@ -299,7 +299,7 @@ static int ves1820_read_snr(struct dvb_frontend* fe, u16* snr)
299 299
300static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) 300static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
301{ 301{
302 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 302 struct ves1820_state* state = fe->demodulator_priv;
303 303
304 *ucblocks = ves1820_readreg(state, 0x13) & 0x7f; 304 *ucblocks = ves1820_readreg(state, 0x13) & 0x7f;
305 if (*ucblocks == 0x7f) 305 if (*ucblocks == 0x7f)
@@ -314,7 +314,7 @@ static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
314 314
315static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 315static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
316{ 316{
317 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 317 struct ves1820_state* state = fe->demodulator_priv;
318 int sync; 318 int sync;
319 s8 afc = 0; 319 s8 afc = 0;
320 320
@@ -345,7 +345,7 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
345 345
346static int ves1820_sleep(struct dvb_frontend* fe) 346static int ves1820_sleep(struct dvb_frontend* fe)
347{ 347{
348 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 348 struct ves1820_state* state = fe->demodulator_priv;
349 349
350 ves1820_writereg(state, 0x1b, 0x02); /* pdown ADC */ 350 ves1820_writereg(state, 0x1b, 0x02); /* pdown ADC */
351 ves1820_writereg(state, 0x00, 0x80); /* standby */ 351 ves1820_writereg(state, 0x00, 0x80); /* standby */
@@ -364,7 +364,7 @@ static int ves1820_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten
364 364
365static void ves1820_release(struct dvb_frontend* fe) 365static void ves1820_release(struct dvb_frontend* fe)
366{ 366{
367 struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; 367 struct ves1820_state* state = fe->demodulator_priv;
368 kfree(state); 368 kfree(state);
369} 369}
370 370
@@ -377,7 +377,7 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config,
377 struct ves1820_state* state = NULL; 377 struct ves1820_state* state = NULL;
378 378
379 /* allocate memory for the internal state */ 379 /* allocate memory for the internal state */
380 state = (struct ves1820_state*) kmalloc(sizeof(struct ves1820_state), GFP_KERNEL); 380 state = kmalloc(sizeof(struct ves1820_state), GFP_KERNEL);
381 if (state == NULL) 381 if (state == NULL)
382 goto error; 382 goto error;
383 383