From e5d1e03a1aa4501e052a5174b804f00c12f231ff Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 7 Nov 2013 00:37:45 +0100 Subject: [PATCH] backports: remove soc_camera_power_{on,off}() backports already exports these functions in drivers/media/platform/soc_camera/soc_camera.c Signed-off-by: Hauke Mehrtens --- .../uapi/linux/v4l2-mediabus.h | 43 --------- backport/compat/compat-3.4.c | 91 ------------------- 2 files changed, 134 deletions(-) delete mode 100644 backport/backport-include/uapi/linux/v4l2-mediabus.h diff --git a/backport/backport-include/uapi/linux/v4l2-mediabus.h b/backport/backport-include/uapi/linux/v4l2-mediabus.h deleted file mode 100644 index 962f044f0604..000000000000 --- a/backport/backport-include/uapi/linux/v4l2-mediabus.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __BACKPORT_LINUX_V4L2_MEDIABUS_H -#define __BACKPORT_LINUX_V4L2_MEDIABUS_H -#include - -/* - * SOC_CAMERA is only enabled on 3.4 as it depends on some - * newer regulator functionality, however there are some SOC - * cameras that can rely on the 3.3 regulatory built-in core - * and the 3.3 SOC_CAMERA module however two routines are - * not exported in that version of SOC_CAMERA that newer - * SOC cameras do require. Backport that functionality. - * - * Technically this should go into - * given that is where its where its exported on linux-next - * but in practice only placing it here actually fixes linking - * errors for 3.3 for all SOC camera drivers we make available - * for 3.3. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -#if defined(CPTCFG_VIDEO_DEV_MODULE) - -#include - -struct soc_camera_subdev_desc; - -#define soc_camera_power_on LINUX_BACKPORT(soc_camera_power_on) -int soc_camera_power_on(struct device *dev, - struct soc_camera_subdev_desc *ssdd, - struct v4l2_clk *clk); - -#define soc_camera_power_off LINUX_BACKPORT(soc_camera_power_off) -int soc_camera_power_off(struct device *dev, - struct soc_camera_subdev_desc *ssdd, - struct v4l2_clk *clk); - -#endif /* defined(CPTCFG_VIDEO_DEV_MODULE) */ -#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */ -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) */ - -#include_next - -#endif /* __BACKPORT_LINUX_V4L2_MEDIABUS_H */ diff --git a/backport/compat/compat-3.4.c b/backport/compat/compat-3.4.c index f1d617858ef9..fafe0dfd87ae 100644 --- a/backport/compat/compat-3.4.c +++ b/backport/compat/compat-3.4.c @@ -16,101 +16,10 @@ #include #include #include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -#if defined(CPTCFG_VIDEO_DEV_MODULE) -#include -#include -#include -#include -#include -#include -#include -#include -#endif /* defined(CPTCFG_VIDEO_DEV_MODULE) */ -#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */ -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) */ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) - -#if defined(CPTCFG_VIDEO_V4L2_MODULE) -#include -int soc_camera_power_on(struct device *dev, - struct soc_camera_subdev_desc *ssdd, - struct v4l2_clk *clk) -{ - int ret = clk ? v4l2_clk_enable(clk) : 0; - if (ret < 0) { - dev_err(dev, "Cannot enable clock: %d\n", ret); - return ret; - } - ret = regulator_bulk_enable(ssdd->num_regulators, - ssdd->regulators); - if (ret < 0) { - dev_err(dev, "Cannot enable regulators\n"); - goto eregenable; - } - - if (ssdd->power) { - ret = ssdd->power(dev, 1); - if (ret < 0) { - dev_err(dev, - "Platform failed to power-on the camera.\n"); - goto epwron; - } - } - - return 0; - -epwron: - regulator_bulk_disable(ssdd->num_regulators, - ssdd->regulators); -eregenable: - if (clk) - v4l2_clk_disable(clk); - - return ret; -} -EXPORT_SYMBOL_GPL(soc_camera_power_on); - -int soc_camera_power_off(struct device *dev, - struct soc_camera_subdev_desc *ssdd, - struct v4l2_clk *clk) -{ - int ret = 0; - int err; - - if (ssdd->power) { - err = ssdd->power(dev, 0); - if (err < 0) { - dev_err(dev, - "Platform failed to power-off the camera.\n"); - ret = err; - } - } - - err = regulator_bulk_disable(ssdd->num_regulators, - ssdd->regulators); - if (err < 0) { - dev_err(dev, "Cannot disable regulators\n"); - ret = ret ? : err; - } - - if (clk) - v4l2_clk_disable(clk); - - return ret; -} -EXPORT_SYMBOL_GPL(soc_camera_power_off); -#endif /* defined(CPTCFG_VIDEO_V4L2_MODULE) */ - -#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */ -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) */ - #if defined(CONFIG_REGMAP) static void devm_regmap_release(struct device *dev, void *res) { -- 2.30.2