Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a463ea99 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[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: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 26c7e7bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -519,7 +519,7 @@ config VIDEO_SMIAPP_PLL


config VIDEO_OV2640
config VIDEO_OV2640
	tristate "OmniVision OV2640 sensor support"
	tristate "OmniVision OV2640 sensor support"
	depends on VIDEO_V4L2 && I2C && GPIOLIB
	depends on VIDEO_V4L2 && I2C
	depends on MEDIA_CAMERA_SUPPORT
	depends on MEDIA_CAMERA_SUPPORT
	help
	help
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  This is a Video4Linux2 sensor-level driver for the OmniVision
+4 −1
Original line number Original line Diff line number Diff line
@@ -743,6 +743,8 @@ static int ov2640_s_power(struct v4l2_subdev *sd, int on)
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	struct ov2640_priv *priv = to_ov2640(client);
	struct ov2640_priv *priv = to_ov2640(client);


#ifdef CONFIG_GPIOLIB
	if (priv->pwdn_gpio)
		gpiod_direction_output(priv->pwdn_gpio, !on);
		gpiod_direction_output(priv->pwdn_gpio, !on);
	if (on && priv->resetb_gpio) {
	if (on && priv->resetb_gpio) {
		/* Active the resetb pin to perform a reset pulse */
		/* Active the resetb pin to perform a reset pulse */
@@ -750,6 +752,7 @@ static int ov2640_s_power(struct v4l2_subdev *sd, int on)
		usleep_range(3000, 5000);
		usleep_range(3000, 5000);
		gpiod_direction_output(priv->resetb_gpio, 0);
		gpiod_direction_output(priv->resetb_gpio, 0);
	}
	}
#endif
	return 0;
	return 0;
}
}