aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/tuner-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common/tuners/tuner-simple.c')
-rw-r--r--drivers/media/common/tuners/tuner-simple.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index e6342dbb2cf..1dad5fbb4de 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -884,7 +884,6 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
884} 884}
885 885
886static int simple_dvb_calc_regs(struct dvb_frontend *fe, 886static int simple_dvb_calc_regs(struct dvb_frontend *fe,
887 struct dvb_frontend_parameters *params,
888 u8 *buf, int buf_len) 887 u8 *buf, int buf_len)
889{ 888{
890 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 889 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -896,28 +895,14 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
896 if (buf_len < 5) 895 if (buf_len < 5)
897 return -EINVAL; 896 return -EINVAL;
898 897
899 switch (delsys) { 898 frequency = simple_dvb_configure(fe, buf+1, delsys, c->frequency, bw);
900 case SYS_DVBT:
901 case SYS_DVBT2:
902 if (params->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
903 bw = 6000000;
904 if (params->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
905 bw = 7000000;
906 if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
907 bw = 8000000;
908 break;
909 default:
910 break;
911 }
912 frequency = simple_dvb_configure(fe, buf+1, delsys, params->frequency, bw);
913 if (frequency == 0) 899 if (frequency == 0)
914 return -EINVAL; 900 return -EINVAL;
915 901
916 buf[0] = priv->i2c_props.addr; 902 buf[0] = priv->i2c_props.addr;
917 903
918 priv->frequency = frequency; 904 priv->frequency = frequency;
919 priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? 905 priv->bandwidth = c->bandwidth_hz;
920 params->u.ofdm.bandwidth : 0;
921 906
922 return 5; 907 return 5;
923} 908}
@@ -1044,7 +1029,17 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency)
1044static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) 1029static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
1045{ 1030{
1046 struct tuner_simple_priv *priv = fe->tuner_priv; 1031 struct tuner_simple_priv *priv = fe->tuner_priv;
1047 *bandwidth = priv->bandwidth; 1032 switch (priv->bandwidth) {
1033 case 6000000:
1034 *bandwidth = BANDWIDTH_6_MHZ;
1035 break;
1036 case 7000000:
1037 *bandwidth = BANDWIDTH_7_MHZ;
1038 break;
1039 case 8000000:
1040 *bandwidth = BANDWIDTH_8_MHZ;
1041 break;
1042 }
1048 return 0; 1043 return 0;
1049} 1044}
1050 1045