On Wed, 2008-06-04 at 09:48 -0700, Michael wrote:

> > The "videodev:" messages bug me.  Can you check to make sure you don't
> > have duplicate tuner, tveeprom, videodev, etc., modules lying around for
> > the same kernel under /lib/modules/(kernelver)/?
> > 
> I'm looking around in the folder, however, I'm not sure how to tell if there 
> are multiple modules... I've never did this before.  Kernel is 2.6.22.17

In a terminal window:

$ find /lib/modules/2.6.23.15-80.fc7 -type f -exec basename {} \; | sort | uniq 
-c

If any module name has a number >1 in front of it, there is a second
version installed.


> Someone did state awhile back that possibly re-installing the device onto of 
> a previous install could cause this.
> > 
> > 
> > Regards,
> > Andy
> 
> 
> 
> > Michael,
> > 
> > One more thing to try with the gpio reset patch:
> > 
> > Can you change these lines in cx18-gpio.c:
> > 
> > To both call "schedule_timeout_uninterruptible()" instead?  And then
> > test again.
> >
> Starting at line 71, correct?  I just want to make sure I changed the right 
> part.
> 
> With that change, I cannot seem to compile:

Sorry, I should have been more explicit.  Here's what I meant in this
new patch.  You can back out the old patch, and apply this one to avoid
any compile errors (or you can do the edit by hand, if that's easier).


If this doesn't work, I only have one more idea (until I can get a copy
of the CX23418 datasheet).  That is upping the "mdelay(10)" statements
to "mdelay(10)" and "mdelay(40)" in the cx18-i2c.c file.

Regards,
Andy


diff -r 1e71c0c79b3a linux/drivers/media/video/cx18/cx18-cards.c
--- a/linux/drivers/media/video/cx18/cx18-cards.c	Tue Jun 03 19:12:00 2008 -0300
+++ b/linux/drivers/media/video/cx18/cx18-cards.c	Thu Jun 05 06:25:33 2008 -0400
@@ -81,6 +81,10 @@ static const struct cx18_card cx18_card_
 	},
 	.gpio_init.initial_value = 0x3001,
 	.gpio_init.direction = 0x3001,
+	.gpio_i2c_slave_reset.active_lo_mask = 0x3001,
+	.gpio_i2c_slave_reset.active_hi_mask = 0,
+	.gpio_i2c_slave_reset.msecs_asserted = 10,
+	.gpio_i2c_slave_reset.msecs_recovery = 40,
 	.i2c = &cx18_i2c_std,
 };
 
@@ -121,6 +125,10 @@ static const struct cx18_card cx18_card_
 	},
 	.gpio_init.initial_value = 0x3001,
 	.gpio_init.direction = 0x3001,
+	.gpio_i2c_slave_reset.active_lo_mask = 0x3001,
+	.gpio_i2c_slave_reset.active_hi_mask = 0,
+	.gpio_i2c_slave_reset.msecs_asserted = 10,
+	.gpio_i2c_slave_reset.msecs_recovery = 40,
 	.i2c = &cx18_i2c_std,
 };
 
diff -r 1e71c0c79b3a linux/drivers/media/video/cx18/cx18-cards.h
--- a/linux/drivers/media/video/cx18/cx18-cards.h	Tue Jun 03 19:12:00 2008 -0300
+++ b/linux/drivers/media/video/cx18/cx18-cards.h	Thu Jun 05 06:25:33 2008 -0400
@@ -118,6 +118,13 @@ struct cx18_gpio_init { /* set initial G
 	u32 initial_value;
 };
 
+struct cx18_gpio_i2c_slave_reset {
+	u32 active_lo_mask; /* GPIO outputs that reset i2c chips when low */
+	u32 active_hi_mask; /* GPIO outputs that reset i2c chips when high */
+	int msecs_asserted; /* time period reset must remain asserted */
+	int msecs_recovery; /* time after deassert for chips to be ready */
+};
+
 struct cx18_card_tuner {
 	v4l2_std_id std; 	/* standard for which the tuner is suitable */
 	int 	    tuner; 	/* tuner ID (from tuner.h) */
@@ -154,7 +161,8 @@ struct cx18_card {
 
 	/* GPIO card-specific settings */
 	u8 xceive_pin; 		/* XCeive tuner GPIO reset pin */
-	struct cx18_gpio_init 		gpio_init;
+	struct cx18_gpio_init 		 gpio_init;
+	struct cx18_gpio_i2c_slave_reset gpio_i2c_slave_reset;
 
 	struct cx18_card_tuner tuners[CX18_CARD_MAX_TUNERS];
 	struct cx18_card_tuner_i2c *i2c;
diff -r 1e71c0c79b3a linux/drivers/media/video/cx18/cx18-gpio.c
--- a/linux/drivers/media/video/cx18/cx18-gpio.c	Tue Jun 03 19:12:00 2008 -0300
+++ b/linux/drivers/media/video/cx18/cx18-gpio.c	Thu Jun 05 06:25:33 2008 -0400
@@ -57,6 +57,30 @@ static void gpio_write(struct cx18 *cx)
 			CX18_REG_GPIO_OUT2);
 }
 
+static void cx18_gpio_i2c_slave_reset(struct cx18 *cx)
+{
+	const struct cx18_gpio_i2c_slave_reset *p;
+
+	p = &cx->card->gpio_i2c_slave_reset;
+
+	if ((p->active_lo_mask | p->active_hi_mask) == 0)
+		return;
+
+	/* Assuming that the masks are a subset of the bits in gpio_dir */
+
+	/* Assert */
+	cx->gpio_val =
+		(cx->gpio_val | p->active_hi_mask) & ~(p->active_lo_mask);
+	gpio_write(cx);
+	schedule_timeout_uninterruptible(msecs_to_jiffies(p->msecs_asserted));
+
+	/* Deassert */
+	cx->gpio_val =
+		(cx->gpio_val | p->active_lo_mask) & ~(p->active_hi_mask);
+	gpio_write(cx);
+	schedule_timeout_uninterruptible(msecs_to_jiffies(p->msecs_recovery));
+}
+
 void cx18_gpio_init(struct cx18 *cx)
 {
 	cx->gpio_dir = cx->card->gpio_init.direction;
@@ -75,6 +99,8 @@ void cx18_gpio_init(struct cx18 *cx)
 		   read_reg(CX18_REG_GPIO_OUT1), read_reg(CX18_REG_GPIO_OUT2));
 
 	gpio_write(cx);
+
+	cx18_gpio_i2c_slave_reset(cx);
 }
 
 /* Xceive tuner reset function */
_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users

Reply via email to