]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] cx23885: Cleanup MPEG encoder GPIO handling
authorSteven Toth <stoth@kernellabs.com>
Wed, 4 Jan 2012 13:52:26 +0000 (10:52 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 4 Jan 2012 22:48:09 +0000 (20:48 -0200)
During initialization the prior GPIO's were not being preserved
and restore correctly. Small cleanups to configure the GPIO's
for the HVR1700, HVR1800 and HVR1850.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx23885/cx23885-417.c

index 67c4a59bd8825800cda0bd1e657c92673ab4c944..c5ddcac96cb177555bcd28e0afb8bc7efbbf3bf0 100644 (file)
@@ -900,6 +900,7 @@ static int cx23885_load_firmware(struct cx23885_dev *dev)
        int i, retval = 0;
        u32 value = 0;
        u32 gpio_output = 0;
+       u32 gpio_value;
        u32 checksum = 0;
        u32 *dataptr;
 
@@ -907,7 +908,7 @@ static int cx23885_load_firmware(struct cx23885_dev *dev)
 
        /* Save GPIO settings before reset of APU */
        retval |= mc417_memory_read(dev, 0x9020, &gpio_output);
-       retval |= mc417_memory_read(dev, 0x900C, &value);
+       retval |= mc417_memory_read(dev, 0x900C, &gpio_value);
 
        retval  = mc417_register_write(dev,
                IVTV_REG_VPU, 0xFFFFFFED);
@@ -991,11 +992,18 @@ static int cx23885_load_firmware(struct cx23885_dev *dev)
 
        /* F/W power up disturbs the GPIOs, restore state */
        retval |= mc417_register_write(dev, 0x9020, gpio_output);
-       retval |= mc417_register_write(dev, 0x900C, value);
+       retval |= mc417_register_write(dev, 0x900C, gpio_value);
 
        retval |= mc417_register_read(dev, IVTV_REG_VPU, &value);
        retval |= mc417_register_write(dev, IVTV_REG_VPU, value & 0xFFFFFFE8);
 
+       /* Hardcoded GPIO's here */
+       retval |= mc417_register_write(dev, 0x9020, 0x4000);
+       retval |= mc417_register_write(dev, 0x900C, 0x4000);
+
+       mc417_register_read(dev, 0x9020, &gpio_output);
+       mc417_register_read(dev, 0x900C, &gpio_value);
+
        if (retval < 0)
                printk(KERN_ERR "%s: Error with mc417_register_write\n",
                        __func__);