summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/i2c/imx/vcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/media/atomisp/i2c/imx/vcm.c')
-rw-r--r--drivers/staging/media/atomisp/i2c/imx/vcm.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/i2c/imx/vcm.c b/drivers/staging/media/atomisp/i2c/imx/vcm.c
new file mode 100644
index 0000000..2d2df04
--- /dev/null
+++ b/drivers/staging/media/atomisp/i2c/imx/vcm.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <media/v4l2-device.h>
+#include "../../include/linux/atomisp_platform.h"
+
+int vcm_power_up(struct v4l2_subdev *sd)
+{
+ const struct camera_af_platform_data *vcm_platform_data;
+
+ vcm_platform_data = camera_get_af_platform_data();
+ if (NULL == vcm_platform_data)
+ return -ENODEV;
+ /* Enable power */
+ return vcm_platform_data->power_ctrl(sd, 1);
+}
+
+int vcm_power_down(struct v4l2_subdev *sd)
+{
+ const struct camera_af_platform_data *vcm_platform_data;
+
+ vcm_platform_data = camera_get_af_platform_data();
+ if (NULL == vcm_platform_data)
+ return -ENODEV;
+ return vcm_platform_data->power_ctrl(sd, 0);
+}
+
OpenPOWER on IntegriCloud