Commit 2827e1ff authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] tlg2300: convert set_fontend to use DVBv5 parameters

Instead of using dvb_frontend_parameters struct, that were
designed for a subset of the supported standards, use the DVBv5
cache information.

Also, fill the supported delivery systems at dvb_frontend_ops
struct.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f159451c
...@@ -140,7 +140,7 @@ struct pd_dvb_adapter { ...@@ -140,7 +140,7 @@ struct pd_dvb_adapter {
u8 reserved[3]; u8 reserved[3];
/* data for power resume*/ /* data for power resume*/
struct dvb_frontend_parameters fe_param; struct dtv_frontend_properties fe_param;
/* for channel scanning */ /* for channel scanning */
int prev_freq; int prev_freq;
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
static void dvb_urb_cleanup(struct pd_dvb_adapter *pd_dvb); static void dvb_urb_cleanup(struct pd_dvb_adapter *pd_dvb);
static int dvb_bandwidth[][2] = { static int dvb_bandwidth[][2] = {
{ TLG_BW_8, BANDWIDTH_8_MHZ }, { TLG_BW_8, 8000000 },
{ TLG_BW_7, BANDWIDTH_7_MHZ }, { TLG_BW_7, 7000000 },
{ TLG_BW_6, BANDWIDTH_6_MHZ } { TLG_BW_6, 6000000 }
}; };
static int dvb_bandwidth_length = ARRAY_SIZE(dvb_bandwidth); static int dvb_bandwidth_length = ARRAY_SIZE(dvb_bandwidth);
...@@ -146,9 +146,9 @@ static int fw_delay_overflow(struct pd_dvb_adapter *adapter) ...@@ -146,9 +146,9 @@ static int fw_delay_overflow(struct pd_dvb_adapter *adapter)
return msec > 800 ? true : false; return msec > 800 ? true : false;
} }
static int poseidon_set_fe(struct dvb_frontend *fe, static int poseidon_set_fe(struct dvb_frontend *fe)
struct dvb_frontend_parameters *fep)
{ {
struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
s32 ret = 0, cmd_status = 0; s32 ret = 0, cmd_status = 0;
s32 i, bandwidth = -1; s32 i, bandwidth = -1;
struct poseidon *pd = fe->demodulator_priv; struct poseidon *pd = fe->demodulator_priv;
...@@ -159,7 +159,7 @@ static int poseidon_set_fe(struct dvb_frontend *fe, ...@@ -159,7 +159,7 @@ static int poseidon_set_fe(struct dvb_frontend *fe,
mutex_lock(&pd->lock); mutex_lock(&pd->lock);
for (i = 0; i < dvb_bandwidth_length; i++) for (i = 0; i < dvb_bandwidth_length; i++)
if (fep->u.ofdm.bandwidth == dvb_bandwidth[i][1]) if (fep->bandwidth_hz == dvb_bandwidth[i][1])
bandwidth = dvb_bandwidth[i][0]; bandwidth = dvb_bandwidth[i][0];
if (check_scan_ok(fep->frequency, bandwidth, pd_dvb)) { if (check_scan_ok(fep->frequency, bandwidth, pd_dvb)) {
...@@ -210,7 +210,7 @@ static int pm_dvb_resume(struct poseidon *pd) ...@@ -210,7 +210,7 @@ static int pm_dvb_resume(struct poseidon *pd)
poseidon_check_mode_dvbt(pd); poseidon_check_mode_dvbt(pd);
msleep(300); msleep(300);
poseidon_set_fe(&pd_dvb->dvb_fe, &pd_dvb->fe_param); poseidon_set_fe(&pd_dvb->dvb_fe);
dvb_start_streaming(pd_dvb); dvb_start_streaming(pd_dvb);
return 0; return 0;
...@@ -227,12 +227,12 @@ static s32 poseidon_fe_init(struct dvb_frontend *fe) ...@@ -227,12 +227,12 @@ static s32 poseidon_fe_init(struct dvb_frontend *fe)
pd->pm_resume = pm_dvb_resume; pd->pm_resume = pm_dvb_resume;
#endif #endif
memset(&pd_dvb->fe_param, 0, memset(&pd_dvb->fe_param, 0,
sizeof(struct dvb_frontend_parameters)); sizeof(struct dtv_frontend_properties));
return 0; return 0;
} }
static int poseidon_get_fe(struct dvb_frontend *fe, static int poseidon_get_fe(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep) struct dtv_frontend_properties *fep)
{ {
struct poseidon *pd = fe->demodulator_priv; struct poseidon *pd = fe->demodulator_priv;
struct pd_dvb_adapter *pd_dvb = &pd->dvb_data; struct pd_dvb_adapter *pd_dvb = &pd->dvb_data;
...@@ -332,6 +332,7 @@ static int poseidon_read_unc_blocks(struct dvb_frontend *fe, u32 *unc) ...@@ -332,6 +332,7 @@ static int poseidon_read_unc_blocks(struct dvb_frontend *fe, u32 *unc)
} }
static struct dvb_frontend_ops poseidon_frontend_ops = { static struct dvb_frontend_ops poseidon_frontend_ops = {
.delsys = { SYS_DVBT },
.info = { .info = {
.name = "Poseidon DVB-T", .name = "Poseidon DVB-T",
.type = FE_OFDM, .type = FE_OFDM,
...@@ -353,8 +354,8 @@ static struct dvb_frontend_ops poseidon_frontend_ops = { ...@@ -353,8 +354,8 @@ static struct dvb_frontend_ops poseidon_frontend_ops = {
.init = poseidon_fe_init, .init = poseidon_fe_init,
.sleep = poseidon_fe_sleep, .sleep = poseidon_fe_sleep,
.set_frontend_legacy = poseidon_set_fe, .set_frontend = poseidon_set_fe,
.get_frontend_legacy = poseidon_get_fe, .get_frontend = poseidon_get_fe,
.get_tune_settings = poseidon_fe_get_tune_settings, .get_tune_settings = poseidon_fe_get_tune_settings,
.read_status = poseidon_read_status, .read_status = poseidon_read_status,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment