linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dvb-usb-friio: return the correct DTV_DELIVERY_SYSTEM
@ 2009-10-01  5:08 Akihiro TSUKADA
  2009-10-01  5:19 ` [PATCH 2/2] dvb-usb-friio: cleaning up unnecessary functions Akihiro TSUKADA
  0 siblings, 1 reply; 2+ messages in thread
From: Akihiro TSUKADA @ 2009-10-01  5:08 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Mauro Carvalho Chehab

From: Akihiro Tsukada <tskd2@yahoo.co.jp>

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.

Priority: normal

Signed-off-by: Akihiro Tsukada <tskd2@yahoo.co.jp>
---
 friio-fe.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/linux/drivers/media/dvb/dvb-usb/friio-fe.c b/linux/drivers/media/dvb/dvb-usb/friio-fe.c
--- a/linux/drivers/media/dvb/dvb-usb/friio-fe.c
+++ b/linux/drivers/media/dvb/dvb-usb/friio-fe.c
@@ -286,6 +286,27 @@ static int jdvbt90502_get_tune_settings(
 	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(struc
 
 	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_fr
 		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 jdvbt9050
 	.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,


--------------------------------------
Yahoo! JAPAN - Internet Security for teenagers and parents.
http://pr.mail.yahoo.co.jp/security/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] dvb-usb-friio: cleaning up unnecessary functions
  2009-10-01  5:08 [PATCH 1/2] dvb-usb-friio: return the correct DTV_DELIVERY_SYSTEM Akihiro TSUKADA
@ 2009-10-01  5:19 ` Akihiro TSUKADA
  0 siblings, 0 replies; 2+ messages in thread
From: Akihiro TSUKADA @ 2009-10-01  5:19 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Mauro Carvalho Chehab

From: Akihiro Tsukada <tskd2@yahoo.co.jp>

This patch removes some fe->ops.X() functions which do nothing more useful than the default.

Priority: normal

Signed-off-by: Akihiro Tsukada <tskd2@yahoo.co.jp>
---
 friio-fe.c |   38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/linux/drivers/media/dvb/dvb-usb/friio-fe.c b/linux/drivers/media/dvb/dvb-usb/friio-fe.c
--- a/linux/drivers/media/dvb/dvb-usb/friio-fe.c
+++ b/linux/drivers/media/dvb/dvb-usb/friio-fe.c
@@ -232,12 +232,6 @@ static int jdvbt90502_read_status(struct
 	return 0;
 }
 
-static int jdvbt90502_read_ber(struct dvb_frontend *fe, u32 *ber)
-{
-	*ber = 0;
-	return 0;
-}
-
 static int jdvbt90502_read_signal_strength(struct dvb_frontend *fe,
 					   u16 *strength)
 {
@@ -264,27 +258,6 @@ static int jdvbt90502_read_signal_streng
 	return 0;
 }
 
-static int jdvbt90502_read_snr(struct dvb_frontend *fe, u16 *snr)
-{
-	*snr = 0x0101;
-	return 0;
-}
-
-static int jdvbt90502_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
-{
-	*ucblocks = 0;
-	return 0;
-}
-
-static int jdvbt90502_get_tune_settings(struct dvb_frontend *fe,
-					struct dvb_frontend_tune_settings *fs)
-{
-	fs->min_delay_ms = 500;
-	fs->step_size = 0;
-	fs->max_drift = 0;
-
-	return 0;
-}
 
 /* filter out un-supported properties to notify users */
 static int jdvbt90502_set_property(struct dvb_frontend *fe,
@@ -347,12 +320,6 @@ static int jdvbt90502_set_frontend(struc
 	return 0;
 }
 
-static int jdvbt90502_sleep(struct dvb_frontend *fe)
-{
-	deb_fe("%s called.\n", __func__);
-	return 0;
-}
-
 
 /**
  * (reg, val) commad list to initialize this module.
@@ -493,18 +460,13 @@ static struct dvb_frontend_ops jdvbt9050
 	.release = jdvbt90502_release,
 
 	.init = jdvbt90502_init,
-	.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,
 
 	.read_status = jdvbt90502_read_status,
-	.read_ber = jdvbt90502_read_ber,
 	.read_signal_strength = jdvbt90502_read_signal_strength,
-	.read_snr = jdvbt90502_read_snr,
-	.read_ucblocks = jdvbt90502_read_ucblocks,
 };

--------------------------------------
Yahoo! JAPAN - Internet Security for teenagers and parents.
http://pr.mail.yahoo.co.jp/security/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-01  5:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01  5:08 [PATCH 1/2] dvb-usb-friio: return the correct DTV_DELIVERY_SYSTEM Akihiro TSUKADA
2009-10-01  5:19 ` [PATCH 2/2] dvb-usb-friio: cleaning up unnecessary functions Akihiro TSUKADA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).