aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/i2c/imx/vcm.c
blob: 2d2df04c800a228841d30b4ff91e96e60a14f53f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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);
}