Commit a0a030bdbe612b7d8a941fba672300f7fc21b275

Authored by Malcolm Priestley
Committed by Mauro Carvalho Chehab
1 parent 668a8b3b57

[media] ts2020: call get_rf_strength from frontend

Restore ds3000.c read_signal_strength.
Call tuner get_rf_strength from frontend read_signal_strength.
We are able to do a NULL check and doesn't limit the tuner
attach to the frontend attach area.
At the moment the lmedm04 tuner attach is stuck in frontend
attach area.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Showing 3 changed files with 13 additions and 2 deletions Side-by-side Diff

drivers/media/dvb-frontends/ds3000.c
... ... @@ -533,6 +533,15 @@
533 533 return 0;
534 534 }
535 535  
  536 +static int ds3000_read_signal_strength(struct dvb_frontend *fe,
  537 + u16 *signal_strength)
  538 +{
  539 + if (fe->ops.tuner_ops.get_rf_strength)
  540 + fe->ops.tuner_ops.get_rf_strength(fe, signal_strength);
  541 +
  542 + return 0;
  543 +}
  544 +
536 545 /* calculate DS3000 snr value in dB */
537 546 static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr)
538 547 {
... ... @@ -1102,6 +1111,7 @@
1102 1111 .i2c_gate_ctrl = ds3000_i2c_gate_ctrl,
1103 1112 .read_status = ds3000_read_status,
1104 1113 .read_ber = ds3000_read_ber,
  1114 + .read_signal_strength = ds3000_read_signal_strength,
1105 1115 .read_snr = ds3000_read_snr,
1106 1116 .read_ucblocks = ds3000_read_ucblocks,
1107 1117 .set_voltage = ds3000_set_voltage,
drivers/media/dvb-frontends/m88rs2000.c
... ... @@ -446,7 +446,9 @@
446 446 static int m88rs2000_read_signal_strength(struct dvb_frontend *fe,
447 447 u16 *strength)
448 448 {
449   - *strength = 0;
  449 + if (fe->ops.tuner_ops.get_rf_strength)
  450 + fe->ops.tuner_ops.get_rf_strength(fe, strength);
  451 +
450 452 return 0;
451 453 }
452 454  
drivers/media/dvb-frontends/ts2020.c
... ... @@ -363,7 +363,6 @@
363 363  
364 364 memcpy(&fe->ops.tuner_ops, &ts2020_tuner_ops,
365 365 sizeof(struct dvb_tuner_ops));
366   - fe->ops.read_signal_strength = fe->ops.tuner_ops.get_rf_strength;
367 366  
368 367 return fe;
369 368 }