V4L/DVB (11035): mt9t031 bugfix
authorPhilippe Rétornaz <philippe.retornaz@epfl.ch>
Fri, 13 Mar 2009 12:42:32 +0000 (09:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:22 +0000 (12:43 -0300)
- The video device is not allocated when mt9t031_init() is called, don't use
it in debug printk.

- The clock polarity is inverted in mt9t031_set_bus_param(), use the correct
one.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/mt9t031.c

index 677be18..23f9ce9 100644 (file)
@@ -144,8 +144,6 @@ static int mt9t031_init(struct soc_camera_device *icd)
        int ret;
 
        /* Disable chip output, synchronous option update */
        int ret;
 
        /* Disable chip output, synchronous option update */
-       dev_dbg(icd->vdev->parent, "%s\n", __func__);
-
        ret = reg_write(icd, MT9T031_RESET, 1);
        if (ret >= 0)
                ret = reg_write(icd, MT9T031_RESET, 0);
        ret = reg_write(icd, MT9T031_RESET, 1);
        if (ret >= 0)
                ret = reg_write(icd, MT9T031_RESET, 0);
@@ -186,9 +184,9 @@ static int mt9t031_set_bus_param(struct soc_camera_device *icd,
                return -EINVAL;
 
        if (flags & SOCAM_PCLK_SAMPLE_FALLING)
                return -EINVAL;
 
        if (flags & SOCAM_PCLK_SAMPLE_FALLING)
-               reg_set(icd, MT9T031_PIXEL_CLOCK_CONTROL, 0x8000);
-       else
                reg_clear(icd, MT9T031_PIXEL_CLOCK_CONTROL, 0x8000);
                reg_clear(icd, MT9T031_PIXEL_CLOCK_CONTROL, 0x8000);
+       else
+               reg_set(icd, MT9T031_PIXEL_CLOCK_CONTROL, 0x8000);
 
        return 0;
 }
 
        return 0;
 }