return div_u64(dividend + (divisor / 2), divisor);
}
-static int cxd2820r_set_frontend(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p)
+static int cxd2820r_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret;
ret = cxd2820r_init_t(fe);
if (ret < 0)
goto err;
- ret = cxd2820r_set_frontend_t(fe, p);
+ ret = cxd2820r_set_frontend_t(fe);
if (ret < 0)
goto err;
break;
ret = cxd2820r_init_t(fe);
if (ret < 0)
goto err;
- ret = cxd2820r_set_frontend_t2(fe, p);
+ ret = cxd2820r_set_frontend_t2(fe);
if (ret < 0)
goto err;
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_init_c(fe);
if (ret < 0)
goto err;
- ret = cxd2820r_set_frontend_c(fe, p);
+ ret = cxd2820r_set_frontend_c(fe);
if (ret < 0)
goto err;
break;
case SYS_DVBT2:
ret = cxd2820r_read_status_t2(fe, status);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_read_status_c(fe, status);
break;
default:
}
static int cxd2820r_get_frontend(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p)
+ struct dtv_frontend_properties *c)
{
int ret;
dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system);
switch (fe->dtv_property_cache.delivery_system) {
case SYS_DVBT:
- ret = cxd2820r_get_frontend_t(fe, p);
+ ret = cxd2820r_get_frontend_t(fe);
break;
case SYS_DVBT2:
- ret = cxd2820r_get_frontend_t2(fe, p);
+ ret = cxd2820r_get_frontend_t2(fe);
break;
- case SYS_DVBC_ANNEX_AC:
- ret = cxd2820r_get_frontend_c(fe, p);
+ case SYS_DVBC_ANNEX_A:
+ ret = cxd2820r_get_frontend_c(fe);
break;
default:
ret = -EINVAL;
case SYS_DVBT2:
ret = cxd2820r_read_ber_t2(fe, ber);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_read_ber_c(fe, ber);
break;
default:
case SYS_DVBT2:
ret = cxd2820r_read_signal_strength_t2(fe, strength);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_read_signal_strength_c(fe, strength);
break;
default:
case SYS_DVBT2:
ret = cxd2820r_read_snr_t2(fe, snr);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_read_snr_c(fe, snr);
break;
default:
case SYS_DVBT2:
ret = cxd2820r_read_ucblocks_t2(fe, ucblocks);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_read_ucblocks_c(fe, ucblocks);
break;
default:
case SYS_DVBT2:
ret = cxd2820r_sleep_t2(fe);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_sleep_c(fe);
break;
default:
case SYS_DVBT2:
ret = cxd2820r_get_tune_settings_t2(fe, s);
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
ret = cxd2820r_get_tune_settings_c(fe, s);
break;
default:
dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system);
/* switch between DVB-T and DVB-T2 when tune fails */
- if (priv->last_tune_failed && (priv->delivery_system != SYS_DVBC_ANNEX_AC)) {
+ if (priv->last_tune_failed && (priv->delivery_system != SYS_DVBC_ANNEX_A)) {
if (priv->delivery_system == SYS_DVBT)
c->delivery_system = SYS_DVBT2;
else
}
/* set frontend */
- ret = cxd2820r_set_frontend(fe, p);
+ ret = cxd2820r_set_frontend(fe);
if (ret)
goto error;
return cxd2820r_wr_reg_mask(priv, 0xdb, enable ? 1 : 0, 0x1);
}
-static int cxd2820r_get_property(struct dvb_frontend *fe, struct dtv_property *p)
-{
- dbg("%s()\n", __func__);
-
- switch (p->cmd) {
- case DTV_ENUM_DELSYS:
- p->u.buffer.data[0] = SYS_DVBT;
- p->u.buffer.data[1] = SYS_DVBT2;
- p->u.buffer.data[2] = SYS_DVBC_ANNEX_AC;
- p->u.buffer.len = 3;
- break;
- default:
- break;
- }
- return 0;
-}
-
static const struct dvb_frontend_ops cxd2820r_ops = {
+ .delsys = { SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A },
+
/* default: DVB-T/T2 */
.info = {
.name = "Sony CXD2820R (DVB-T/T2)",
.get_tune_settings = cxd2820r_get_tune_settings,
.i2c_gate_ctrl = cxd2820r_i2c_gate_ctrl,
- .get_frontend_legacy = cxd2820r_get_frontend,
+ .get_frontend = cxd2820r_get_frontend,
.get_frontend_algo = cxd2820r_get_frontend_algo,
.search = cxd2820r_search,
.read_ber = cxd2820r_read_ber,
.read_ucblocks = cxd2820r_read_ucblocks,
.read_signal_strength = cxd2820r_read_signal_strength,
-
- .get_property = cxd2820r_get_property,
};
struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
/* cxd2820r_c.c */
-int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p);
+int cxd2820r_get_frontend_c(struct dvb_frontend *fe);
-int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params);
+int cxd2820r_set_frontend_c(struct dvb_frontend *fe);
int cxd2820r_read_status_c(struct dvb_frontend *fe, fe_status_t *status);
/* cxd2820r_t.c */
-int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p);
+int cxd2820r_get_frontend_t(struct dvb_frontend *fe);
-int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params);
+int cxd2820r_set_frontend_t(struct dvb_frontend *fe);
int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status);
/* cxd2820r_t2.c */
-int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p);
+int cxd2820r_get_frontend_t2(struct dvb_frontend *fe);
-int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params);
+int cxd2820r_set_frontend_t2(struct dvb_frontend *fe);
int cxd2820r_read_status_t2(struct dvb_frontend *fe, fe_status_t *status);