sh: ap325rxa: control camera power toggling.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Kuninori Morimoto 2009-01-22 00:33:21 +00:00 committed by Paul Mundt
parent 334d99072d
commit 86746284e2
1 changed files with 9 additions and 1 deletions

View File

@ -216,6 +216,12 @@ static struct platform_device lcdc_device = {
},
};
static void camera_power(int val)
{
gpio_set_value(GPIO_PTZ5, val); /* RST_CAM/RSTB */
mdelay(10);
}
#ifdef CONFIG_I2C
static unsigned char camera_ncm03j_magic[] =
{
@ -245,9 +251,11 @@ static int camera_set_capture(struct soc_camera_platform_info *info,
int ret = 0;
int i;
camera_power(0);
if (!enable)
return 0; /* no disable for now */
camera_power(1);
for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
u_int8_t buf[8];
@ -426,7 +434,7 @@ static int __init ap325rxa_devices_setup(void)
gpio_request(GPIO_PTZ6, NULL);
gpio_direction_output(GPIO_PTZ6, 0); /* STBY_CAM */
gpio_request(GPIO_PTZ5, NULL);
gpio_direction_output(GPIO_PTZ5, 1); /* RST_CAM */
gpio_direction_output(GPIO_PTZ5, 0); /* RST_CAM */
gpio_request(GPIO_PTZ4, NULL);
gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */