V4L/DVB (7925): cx18: ensure that the xceive pin is always asserted on init.
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 20 May 2008 01:13:02 +0000 (22:13 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 5 Jun 2008 09:35:44 +0000 (06:35 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx18/cx18-gpio.c

index bb8bc86086d0925c3a693bdce698524a48245265..1e0d32b992f98e12052cec74ee7e860decc6eb62 100644 (file)
@@ -62,12 +62,14 @@ void cx18_gpio_init(struct cx18 *cx)
        gpio_dir = cx->card->gpio_init.direction;
        gpio_val = cx->card->gpio_init.initial_value;
 
+       if (cx->card->xceive_pin) {
+               gpio_dir |= 1 << cx->card->xceive_pin;
+               gpio_val |= 1 << cx->card->xceive_pin;
+       }
+
        if (gpio_dir == 0)
                return;
 
-       gpio_dir |= 1 << cx->card->xceive_pin;
-       gpio_val |= 1 << cx->card->xceive_pin;
-
        CX18_DEBUG_INFO("GPIO initial dir: %08x/%08x out: %08x/%08x\n",
                   read_reg(CX18_REG_GPIO_DIR1), read_reg(CX18_REG_GPIO_DIR2),
                   read_reg(CX18_REG_GPIO_OUT1), read_reg(CX18_REG_GPIO_OUT2));