Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+124 −105
Original line number Diff line number Diff line
@@ -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 smsdvb_client_t *client =
		container_of(fe, struct smsdvb_client_t, frontend);
	struct smscore_device_t *coredev = client->coredev;
	struct TRANSMISSION_STATISTICS_S *td =
		&client->sms_stat_dvb.TransmissionData;

	switch (smscore_get_device_mode(coredev)) {
	case DEVICE_MODE_DVBT:
	case DEVICE_MODE_DVBT_BDA:
	fep->frequency = td->Frequency;

	switch (td->Bandwidth) {
@@ -976,18 +972,41 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe)
	}

	fep->inversion = INVERSION_AUTO;
		break;
	case DEVICE_MODE_ISDBT:
	case DEVICE_MODE_ISDBT_BDA:

	return 0;
}

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->bandwidth_hz = 6000000;
	/* 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:
		return -EINVAL;
	}

	return 0;
}

static int smsdvb_init(struct dvb_frontend *fe)