public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* DVB Update [PATCH 15/31] multiproto tree
@ 2008-09-04 18:38 Manu Abraham
  0 siblings, 0 replies; only message in thread
From: Manu Abraham @ 2008-09-04 18:38 UTC (permalink / raw)
  To: linux-kernel, v4l-dvb-maintainer, akpm; +Cc: Arvo Jarve

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

>From 8053f283eb95229023d30a431e76823acaf4a617 Mon Sep 17 00:00:00 2001
From: Manu Abraham <manu@linuxtv.org>
Date: Thu, 4 Sep 2008 13:50:56 +0200
Subject: [PATCH] DVB Add event only with changed status

The event list was updated continuously, add to the event list
only when the status has changed

From: Arvo Jarve <arvo@softshark.ee>
Signed-off-by: Arvo Jarve <arvo@softshark.ee>
Signed-off-by: Manu Abraham <manu@linuxtv.org>

 dvb_frontend.c |   35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

[-- Attachment #2: 15.patch --]
[-- Type: text/x-patch, Size: 2871 bytes --]

>From 8053f283eb95229023d30a431e76823acaf4a617 Mon Sep 17 00:00:00 2001
From: Manu Abraham <manu@linuxtv.org>
Date: Thu, 4 Sep 2008 13:50:56 +0200
Subject: [PATCH] DVB Add event only with changed status

The event list was updated continuously, add to the event list
only when the status has changed

From: Arvo Jarve <arvo@softshark.ee>
Signed-off-by: Arvo Jarve <arvo@softshark.ee>
Signed-off-by: Manu Abraham <manu@linuxtv.org>

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 3ca28d0..93b08fa 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -586,10 +586,13 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	e = &events->events[events->eventw];
 
-	if (fe->legacy)
+	if (fe->legacy) {
 		memcpy(&e->parameters, &fepriv->parameters, sizeof (struct dvb_frontend_parameters));
-	else
+		e->status = status;
+	} else {
 		memcpy(&e->fe_params, &fepriv->fe_params, sizeof (struct dvbfe_params));
+		e->fe_events.status = status;
+	}
 
 	if (fe->legacy) {
 		/* Legacy	*/
@@ -606,8 +609,6 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
 
 	mutex_unlock(&events->mtx);
 
-	e->status = status;
-
 	wake_up_interruptible (&events->wait_queue);
 }
 
@@ -1211,19 +1212,13 @@ restart:
 						/* We did do a search as was requested, the flags are
 						 * now unset as well and has the flags wrt to search.
 						 */
+					} else {
+						fepriv->algo_status &= ~DVBFE_ALGO_SEARCH_AGAIN;
 					}
-					fepriv->algo_status &= ~DVBFE_ALGO_SEARCH_AGAIN;
 				}
 				/* Track the carrier if the search was successful	*/
 				if (fepriv->algo_status == DVBFE_ALGO_SEARCH_SUCCESS) {
-					if (fepriv->algo_status & DVBFE_ALGO_SEARCH_SUCCESS)
-						dprintk("%s: status = DVBFE_ALGO_SEARCH_SUCCESS\n", __func__);
-					if (fepriv->algo_status & DVBFE_ALGO_SEARCH_FAILED)
-						fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
-
-					fe->ops.read_status(fe, &s);
-					dvb_frontend_add_event(fe, s); /* update event list	*/
-					fepriv->status = s;
+					dprintk("%s: STATUS = DVBFE_ALGO_SEARCH_SUCCESS\n", __func__);
 					if (fe->ops.track) {
 						dprintk("%s: TRACK callback exists at 0x%p\n", __func__, fe->ops.track);
 #if 0
@@ -1234,6 +1229,20 @@ restart:
 #endif
 						fe->ops.track(fe, fe_params, &fepriv->delay);
 					}
+				} else {
+					fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
+					fepriv->delay = HZ / 2;
+				}
+				fe->ops.read_status(fe, &s);
+				if (s != fepriv->status) {
+					dvb_frontend_add_event(fe, s); /* update event list */
+					fepriv->status = s;
+					if (!(s & FE_HAS_LOCK)) {
+						fepriv->delay = HZ / 10;
+						fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
+					} else {
+						fepriv->delay = 60 * HZ;
+					}
 				}
 				break;
 			default:

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-04 18:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04 18:38 DVB Update [PATCH 15/31] multiproto tree Manu Abraham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox