diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-22 13:42:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:43 -0400 |
commit | ef6ad5c35ed7233e7aafcc5645a1470199b10cc7 (patch) | |
tree | b6a540d8e7ce973b65e139bd0185d8002a5ed36f | |
parent | b4333a3baecfeee35317c03cf08952cc04bd149a (diff) |
V4L/DVB (7218): Fix breakage in mt9m001 and mt9v022 driver if "CONFIG_GENERIC_GPIO is not set"
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>
-rw-r--r-- | drivers/media/video/Kconfig | 8 | ||||
-rw-r--r-- | drivers/media/video/mt9m001.c | 6 | ||||
-rw-r--r-- | drivers/media/video/mt9v022.c | 6 |
3 files changed, 8 insertions, 12 deletions
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 21f250b8cbb0..de6a6208e344 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -847,7 +847,7 @@ config SOC_CAMERA | |||
847 | 847 | ||
848 | config SOC_CAMERA_MT9M001 | 848 | config SOC_CAMERA_MT9M001 |
849 | tristate "mt9m001 support" | 849 | tristate "mt9m001 support" |
850 | depends on SOC_CAMERA && GENERIC_GPIO | 850 | depends on SOC_CAMERA |
851 | select GPIO_PCA953X if MT9M001_PCA9536_SWITCH | 851 | select GPIO_PCA953X if MT9M001_PCA9536_SWITCH |
852 | help | 852 | help |
853 | This driver supports MT9M001 cameras from Micron, monochrome | 853 | This driver supports MT9M001 cameras from Micron, monochrome |
@@ -855,21 +855,21 @@ config SOC_CAMERA_MT9M001 | |||
855 | 855 | ||
856 | config MT9M001_PCA9536_SWITCH | 856 | config MT9M001_PCA9536_SWITCH |
857 | bool "pca9536 datawidth switch for mt9m001" | 857 | bool "pca9536 datawidth switch for mt9m001" |
858 | depends on SOC_CAMERA_MT9M001 | 858 | depends on SOC_CAMERA_MT9M001 && GENERIC_GPIO |
859 | help | 859 | help |
860 | Select this if your MT9M001 camera uses a PCA9536 I2C GPIO | 860 | Select this if your MT9M001 camera uses a PCA9536 I2C GPIO |
861 | extender to switch between 8 and 10 bit datawidth modes | 861 | extender to switch between 8 and 10 bit datawidth modes |
862 | 862 | ||
863 | config SOC_CAMERA_MT9V022 | 863 | config SOC_CAMERA_MT9V022 |
864 | tristate "mt9v022 support" | 864 | tristate "mt9v022 support" |
865 | depends on SOC_CAMERA && GENERIC_GPIO | 865 | depends on SOC_CAMERA |
866 | select GPIO_PCA953X if MT9V022_PCA9536_SWITCH | 866 | select GPIO_PCA953X if MT9V022_PCA9536_SWITCH |
867 | help | 867 | help |
868 | This driver supports MT9V022 cameras from Micron | 868 | This driver supports MT9V022 cameras from Micron |
869 | 869 | ||
870 | config MT9V022_PCA9536_SWITCH | 870 | config MT9V022_PCA9536_SWITCH |
871 | bool "pca9536 datawidth switch for mt9v022" | 871 | bool "pca9536 datawidth switch for mt9v022" |
872 | depends on SOC_CAMERA_MT9V022 | 872 | depends on SOC_CAMERA_MT9V022 && GENERIC_GPIO |
873 | help | 873 | help |
874 | Select this if your MT9V022 camera uses a PCA9536 I2C GPIO | 874 | Select this if your MT9V022 camera uses a PCA9536 I2C GPIO |
875 | extender to switch between 8 and 10 bit datawidth modes | 875 | extender to switch between 8 and 10 bit datawidth modes |
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index b65ff7745b8d..e3afc82050af 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <media/v4l2-chip-ident.h> | 17 | #include <media/v4l2-chip-ident.h> |
18 | #include <media/soc_camera.h> | 18 | #include <media/soc_camera.h> |
19 | 19 | ||
20 | #ifdef CONFIG_MT9M001_PCA9536_SWITCH | ||
20 | #include <asm/gpio.h> | 21 | #include <asm/gpio.h> |
22 | #endif | ||
21 | 23 | ||
22 | /* mt9m001 i2c address 0x5d | 24 | /* mt9m001 i2c address 0x5d |
23 | * The platform has to define i2c_board_info | 25 | * The platform has to define i2c_board_info |
@@ -223,10 +225,6 @@ static int mt9m001_set_capture_format(struct soc_camera_device *icd, | |||
223 | if ((mt9m001->datawidth != 10 && (width_flag == IS_DATAWIDTH_10)) || | 225 | if ((mt9m001->datawidth != 10 && (width_flag == IS_DATAWIDTH_10)) || |
224 | (mt9m001->datawidth != 9 && (width_flag == IS_DATAWIDTH_9)) || | 226 | (mt9m001->datawidth != 9 && (width_flag == IS_DATAWIDTH_9)) || |
225 | (mt9m001->datawidth != 8 && (width_flag == IS_DATAWIDTH_8))) { | 227 | (mt9m001->datawidth != 8 && (width_flag == IS_DATAWIDTH_8))) { |
226 | /* data width switch requested */ | ||
227 | if (!gpio_is_valid(mt9m001->switch_gpio)) | ||
228 | return -EINVAL; | ||
229 | |||
230 | /* Well, we actually only can do 10 or 8 bits... */ | 228 | /* Well, we actually only can do 10 or 8 bits... */ |
231 | if (width_flag == IS_DATAWIDTH_9) | 229 | if (width_flag == IS_DATAWIDTH_9) |
232 | return -EINVAL; | 230 | return -EINVAL; |
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 5fbeaa305f35..468333946d57 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -18,7 +18,9 @@ | |||
18 | #include <media/v4l2-chip-ident.h> | 18 | #include <media/v4l2-chip-ident.h> |
19 | #include <media/soc_camera.h> | 19 | #include <media/soc_camera.h> |
20 | 20 | ||
21 | #ifdef CONFIG_MT9M001_PCA9536_SWITCH | ||
21 | #include <asm/gpio.h> | 22 | #include <asm/gpio.h> |
23 | #endif | ||
22 | 24 | ||
23 | /* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c | 25 | /* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c |
24 | * The platform has to define i2c_board_info | 26 | * The platform has to define i2c_board_info |
@@ -302,10 +304,6 @@ static int mt9v022_set_capture_format(struct soc_camera_device *icd, | |||
302 | if ((mt9v022->datawidth != 10 && (width_flag == IS_DATAWIDTH_10)) || | 304 | if ((mt9v022->datawidth != 10 && (width_flag == IS_DATAWIDTH_10)) || |
303 | (mt9v022->datawidth != 9 && (width_flag == IS_DATAWIDTH_9)) || | 305 | (mt9v022->datawidth != 9 && (width_flag == IS_DATAWIDTH_9)) || |
304 | (mt9v022->datawidth != 8 && (width_flag == IS_DATAWIDTH_8))) { | 306 | (mt9v022->datawidth != 8 && (width_flag == IS_DATAWIDTH_8))) { |
305 | /* data width switch requested */ | ||
306 | if (!gpio_is_valid(mt9v022->switch_gpio)) | ||
307 | return -EINVAL; | ||
308 | |||
309 | /* Well, we actually only can do 10 or 8 bits... */ | 307 | /* Well, we actually only can do 10 or 8 bits... */ |
310 | if (width_flag == IS_DATAWIDTH_9) | 308 | if (width_flag == IS_DATAWIDTH_9) |
311 | return -EINVAL; | 309 | return -EINVAL; |