V4L/DVB (8067): cx18: Fix firmware load for case when digital capture happens first

Previous thread: V4L/DVB (8063): cx18: Fix unintended auto configurations in cx18-av-core by Linux Kernel Mailing List on Sunday, June 29, 2008 - 1:04 pm. (1 message)

Next thread: V4L/DVB (8068): cx18: Add I2C slave reset via GPIO upon initialization by Linux Kernel Mailing List on Sunday, June 29, 2008 - 1:05 pm. (1 message)
From: Linux Kernel Mailing List
Date: Sunday, June 29, 2008 - 1:04 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=08cf7b...
Commit:     08cf7b2ed172cc83f3d2f44b712b3d54e6cc4ae6
Parent:     46195b555aa3edd265b4e765e4edff59b253b55e
Author:     Andy Walls <awalls@radix.net>
AuthorDate: Sun Jun 22 00:04:21 2008 -0300
Committer:  Mauro Carvalho Chehab <mchehab@infradead.org>
CommitDate: Thu Jun 26 15:58:54 2008 -0300

    V4L/DVB (8067): cx18: Fix firmware load for case when digital capture happens first
    
    This is a fix for the case when a digital capture from dvr0 happens first after
    modprobe, before access to any cx18 v4l2 device nodes.  The initial dvb feed
    start has been changed to load the firmware if not already loaded.  Also fixed a
    use counter to correct dvb feed accounting if starting the transport DMA fails.
    
    Signed-off-by: Andy Walls <awalls@radix.net>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---
 drivers/media/video/cx18/cx18-dvb.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c
index c974417..cae3898 100644
--- a/drivers/media/video/cx18/cx18-dvb.c
+++ b/drivers/media/video/cx18/cx18-dvb.c
@@ -69,11 +69,21 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed)
 	struct dvb_demux *demux = feed->demux;
 	struct cx18_stream *stream = (struct cx18_stream *) demux->priv;
 	struct cx18 *cx = stream->cx;
-	int ret = -EINVAL;
+	int ret;
 	u32 v;
 
 	CX18_DEBUG_INFO("Start feed: pid = 0x%x index = %d\n",
 			feed->pid, feed->index);
+
+	mutex_lock(&cx->serialize_lock);
+	ret = cx18_init_on_first_open(cx);
+	mutex_unlock(&cx->serialize_lock);
+	if (ret) {
+		CX18_ERR("Failed to initialize firmware starting DVB feed\n");
+		return ret;
+	}
+	ret = -EINVAL;
+
 	switch (cx->card->type) {
 	case CX18_CARD_HVR_1600_ESMT:
 	case CX18_CARD_HVR_1600_SAMSUNG:
@@ -101,6 +111,11 @@ static int ...
Previous thread: V4L/DVB (8063): cx18: Fix unintended auto configurations in cx18-av-core by Linux Kernel Mailing List on Sunday, June 29, 2008 - 1:04 pm. (1 message)

Next thread: V4L/DVB (8068): cx18: Add I2C slave reset via GPIO upon initialization by Linux Kernel Mailing List on Sunday, June 29, 2008 - 1:05 pm. (1 message)