From: Akihiro Tsukada Date: Wed, 4 Nov 2009 18:39:31 +0000 (-0300) Subject: V4L/DVB (13293): dvb-usb-friio: return the correct DTV_DELIVERY_SYSTEM X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad12f07bf21e8d98e6042c8ed795d2d041e26934;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git V4L/DVB (13293): dvb-usb-friio: return the correct DTV_DELIVERY_SYSTEM This patch makes the driver return the correct DTV_DELIVERY_SYSTEM. The driver previously returned SYS_UNDEFINED for DTV_DELIVERY_SYSTEM property, as it lacked any driver specific S2API support. Signed-off-by: Akihiro Tsukada Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-usb/friio-fe.c b/drivers/media/dvb/dvb-usb/friio-fe.c index c4dfe25cf60d..8b489d11eb37 100644 --- a/drivers/media/dvb/dvb-usb/friio-fe.c +++ b/drivers/media/dvb/dvb-usb/friio-fe.c @@ -286,6 +286,27 @@ static int jdvbt90502_get_tune_settings(struct dvb_frontend *fe, return 0; } +/* filter out un-supported properties to notify users */ +static int jdvbt90502_set_property(struct dvb_frontend *fe, + struct dtv_property *tvp) +{ + int r = 0; + + switch (tvp->cmd) { + case DTV_DELIVERY_SYSTEM: + if (tvp->u.data != SYS_ISDBT) + r = -EINVAL; + break; + case DTV_CLEAR: + case DTV_TUNE: + case DTV_FREQUENCY: + break; + default: + r = -EINVAL; + } + return r; +} + static int jdvbt90502_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) { @@ -314,6 +335,9 @@ static int jdvbt90502_set_frontend(struct dvb_frontend *fe, deb_fe("%s: Freq:%d\n", __func__, p->frequency); + /* for recovery from DTV_CLEAN */ + fe->dtv_property_cache.delivery_system = SYS_ISDBT; + ret = jdvbt90502_pll_set_freq(state, p->frequency); if (ret) { deb_fe("%s:ret == %d\n", __func__, ret); @@ -394,6 +418,7 @@ static int jdvbt90502_init(struct dvb_frontend *fe) if (ret != 1) goto error; } + fe->dtv_property_cache.delivery_system = SYS_ISDBT; msleep(100); return 0; @@ -471,6 +496,8 @@ static struct dvb_frontend_ops jdvbt90502_ops = { .sleep = jdvbt90502_sleep, .write = _jdvbt90502_write, + .set_property = jdvbt90502_set_property, + .set_frontend = jdvbt90502_set_frontend, .get_frontend = jdvbt90502_get_frontend, .get_tune_settings = jdvbt90502_get_tune_settings,