]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
V4L/DVB (7218): Fix breakage in mt9m001 and mt9v022 driver if "CONFIG_GENERIC_GPIO...
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Tue, 22 Apr 2008 17:42:08 +0000 (14:42 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:07:43 +0000 (14:07 -0300)
Both camera drivers can function without GPIO support, in which case they
will only support the 10 bit data width mode. But the two respective switch
have to depend on CONFIG_GENERIC_GPIO. Additionally remove redundant
gpio_is_valid tests - they are repeated in bus_switch_request() functions.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/Kconfig
drivers/media/video/mt9m001.c
drivers/media/video/mt9v022.c

index 21f250b8cbb0f76bbb58d407e9b3ee100b725337..de6a6208e3442f8a3916f4e40c2c455f2e2aa91a 100644 (file)
@@ -847,7 +847,7 @@ config SOC_CAMERA
 
 config SOC_CAMERA_MT9M001
        tristate "mt9m001 support"
-       depends on SOC_CAMERA && GENERIC_GPIO
+       depends on SOC_CAMERA
        select GPIO_PCA953X if MT9M001_PCA9536_SWITCH
        help
          This driver supports MT9M001 cameras from Micron, monochrome
@@ -855,21 +855,21 @@ config SOC_CAMERA_MT9M001
 
 config MT9M001_PCA9536_SWITCH
        bool "pca9536 datawidth switch for mt9m001"
-       depends on SOC_CAMERA_MT9M001
+       depends on SOC_CAMERA_MT9M001 && GENERIC_GPIO
        help
          Select this if your MT9M001 camera uses a PCA9536 I2C GPIO
          extender to switch between 8 and 10 bit datawidth modes
 
 config SOC_CAMERA_MT9V022
        tristate "mt9v022 support"
-       depends on SOC_CAMERA && GENERIC_GPIO
+       depends on SOC_CAMERA
        select GPIO_PCA953X if MT9V022_PCA9536_SWITCH
        help
          This driver supports MT9V022 cameras from Micron
 
 config MT9V022_PCA9536_SWITCH
        bool "pca9536 datawidth switch for mt9v022"
-       depends on SOC_CAMERA_MT9V022
+       depends on SOC_CAMERA_MT9V022 && GENERIC_GPIO
        help
          Select this if your MT9V022 camera uses a PCA9536 I2C GPIO
          extender to switch between 8 and 10 bit datawidth modes
index b65ff7745b8d779640ef737329f1e371b6fb2d4d..e3afc82050af97d0bcef304dc4d942705b9afe91 100644 (file)
@@ -17,7 +17,9 @@
 #include <media/v4l2-chip-ident.h>
 #include <media/soc_camera.h>
 
+#ifdef CONFIG_MT9M001_PCA9536_SWITCH
 #include <asm/gpio.h>
+#endif
 
 /* mt9m001 i2c address 0x5d
  * The platform has to define i2c_board_info
@@ -223,10 +225,6 @@ static int mt9m001_set_capture_format(struct soc_camera_device *icd,
        if ((mt9m001->datawidth != 10 && (width_flag == IS_DATAWIDTH_10)) ||
            (mt9m001->datawidth != 9  && (width_flag == IS_DATAWIDTH_9)) ||
            (mt9m001->datawidth != 8  && (width_flag == IS_DATAWIDTH_8))) {
-               /* data width switch requested */
-               if (!gpio_is_valid(mt9m001->switch_gpio))
-                       return -EINVAL;
-
                /* Well, we actually only can do 10 or 8 bits... */
                if (width_flag == IS_DATAWIDTH_9)
                        return -EINVAL;
index 5fbeaa305f35114e607865a04dd8e4762edd996b..468333946d574dfdfd9dea4416b5457b90e97d30 100644 (file)
@@ -18,7 +18,9 @@
 #include <media/v4l2-chip-ident.h>
 #include <media/soc_camera.h>
 
+#ifdef CONFIG_MT9M001_PCA9536_SWITCH
 #include <asm/gpio.h>
+#endif
 
 /* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c
  * The platform has to define i2c_board_info
@@ -302,10 +304,6 @@ static int mt9v022_set_capture_format(struct soc_camera_device *icd,
        if ((mt9v022->datawidth != 10 && (width_flag == IS_DATAWIDTH_10)) ||
            (mt9v022->datawidth != 9  && (width_flag == IS_DATAWIDTH_9)) ||
            (mt9v022->datawidth != 8  && (width_flag == IS_DATAWIDTH_8))) {
-               /* data width switch requested */
-               if (!gpio_is_valid(mt9v022->switch_gpio))
-                       return -EINVAL;
-
                /* Well, we actually only can do 10 or 8 bits... */
                if (width_flag == IS_DATAWIDTH_9)
                        return -EINVAL;