diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-19 07:43:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-19 07:49:15 -0400 |
commit | a463ea990d2138ca93027b006be96a0324b77fe4 (patch) | |
tree | 75dcca851bdfb33ee81505416e0477eb130a8a86 /drivers/media | |
parent | 26c7e7bc50b85465c934140a5009d61551e51057 (diff) |
[media] ov2640: make GPIOLIB an optional dependency
As warned by kbuild test robot:
warning: (VIDEO_EM28XX_V4L2) selects VIDEO_OV2640 which has unmet direct dependencies (MEDIA_SUPPORT && VIDEO_V4L2 && I2C && GPIOLIB && MEDIA_CAMERA_SUPPORT)
The em28xx driver can use ov2640, but it doesn't depend
(or use) the GPIOLIB in order to power off/on the sensor.
So, as we want to allow both usages with and without
GPIOLIB, make its dependency optional.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/i2c/ov2640.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index 40bb4bdc51da..fd181c99ce11 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig | |||
@@ -519,7 +519,7 @@ config VIDEO_SMIAPP_PLL | |||
519 | 519 | ||
520 | config VIDEO_OV2640 | 520 | config VIDEO_OV2640 |
521 | tristate "OmniVision OV2640 sensor support" | 521 | tristate "OmniVision OV2640 sensor support" |
522 | depends on VIDEO_V4L2 && I2C && GPIOLIB | 522 | depends on VIDEO_V4L2 && I2C |
523 | depends on MEDIA_CAMERA_SUPPORT | 523 | depends on MEDIA_CAMERA_SUPPORT |
524 | help | 524 | help |
525 | This is a Video4Linux2 sensor-level driver for the OmniVision | 525 | This is a Video4Linux2 sensor-level driver for the OmniVision |
diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index d55ca37dc12f..9c00ed3543f8 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c | |||
@@ -743,13 +743,16 @@ static int ov2640_s_power(struct v4l2_subdev *sd, int on) | |||
743 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 743 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
744 | struct ov2640_priv *priv = to_ov2640(client); | 744 | struct ov2640_priv *priv = to_ov2640(client); |
745 | 745 | ||
746 | gpiod_direction_output(priv->pwdn_gpio, !on); | 746 | #ifdef CONFIG_GPIOLIB |
747 | if (priv->pwdn_gpio) | ||
748 | gpiod_direction_output(priv->pwdn_gpio, !on); | ||
747 | if (on && priv->resetb_gpio) { | 749 | if (on && priv->resetb_gpio) { |
748 | /* Active the resetb pin to perform a reset pulse */ | 750 | /* Active the resetb pin to perform a reset pulse */ |
749 | gpiod_direction_output(priv->resetb_gpio, 1); | 751 | gpiod_direction_output(priv->resetb_gpio, 1); |
750 | usleep_range(3000, 5000); | 752 | usleep_range(3000, 5000); |
751 | gpiod_direction_output(priv->resetb_gpio, 0); | 753 | gpiod_direction_output(priv->resetb_gpio, 0); |
752 | } | 754 | } |
755 | #endif | ||
753 | return 0; | 756 | return 0; |
754 | } | 757 | } |
755 | 758 | ||