Commit eab0fa0f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] siano: split get_frontend into per-std functions

Instead of handling both DVB-T and ISDB-T at the same get_frontend
function, break it intow one function per-delivery system.
That makes the code clearer as we start to add support for DVBv5
statistics, and for ISDB-T get frontend stuff.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 80ccb51a
...@@ -863,18 +863,14 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe) ...@@ -863,18 +863,14 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe)
} }
} }
static int smsdvb_get_frontend(struct dvb_frontend *fe) static int smsdvb_get_frontend_dvb(struct dvb_frontend *fe)
{ {
struct dtv_frontend_properties *fep = &fe->dtv_property_cache; struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
struct smsdvb_client_t *client = struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend); container_of(fe, struct smsdvb_client_t, frontend);
struct smscore_device_t *coredev = client->coredev;
struct TRANSMISSION_STATISTICS_S *td = struct TRANSMISSION_STATISTICS_S *td =
&client->sms_stat_dvb.TransmissionData; &client->sms_stat_dvb.TransmissionData;
switch (smscore_get_device_mode(coredev)) {
case DEVICE_MODE_DVBT:
case DEVICE_MODE_DVBT_BDA:
fep->frequency = td->Frequency; fep->frequency = td->Frequency;
switch (td->Bandwidth) { switch (td->Bandwidth) {
...@@ -976,18 +972,41 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe) ...@@ -976,18 +972,41 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe)
} }
fep->inversion = INVERSION_AUTO; fep->inversion = INVERSION_AUTO;
break;
case DEVICE_MODE_ISDBT: return 0;
case DEVICE_MODE_ISDBT_BDA: }
static int smsdvb_get_frontend_isdb(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
struct TRANSMISSION_STATISTICS_S *td =
&client->sms_stat_dvb.TransmissionData;
fep->frequency = td->Frequency; fep->frequency = td->Frequency;
fep->bandwidth_hz = 6000000; fep->bandwidth_hz = 6000000;
/* todo: retrive the other parameters */ /* todo: retrive the other parameters */
break;
return 0;
}
static int smsdvb_get_frontend(struct dvb_frontend *fe)
{
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
struct smscore_device_t *coredev = client->coredev;
switch (smscore_get_device_mode(coredev)) {
case DEVICE_MODE_DVBT:
case DEVICE_MODE_DVBT_BDA:
return smsdvb_get_frontend_dvb(fe);
case DEVICE_MODE_ISDBT:
case DEVICE_MODE_ISDBT_BDA:
return smsdvb_get_frontend_isdb(fe);
default: default:
return -EINVAL; return -EINVAL;
} }
return 0;
} }
static int smsdvb_init(struct dvb_frontend *fe) static int smsdvb_init(struct dvb_frontend *fe)
......
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