Skip to contentSkip to conversation

OV3640: Make camera sensor goto standby.

PATCH New Dominic Curran 1 participant 1 message Mar 16, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OV3640: Make camera sensor goto standby.

From: Dominic Curran <[email protected]>
Subject: [OMAPZOOM][PATCH] OV3640: Make camera sensor goto standby.

This patch ensures that the OV3640 goes/comes back from standby when the kernel requests the appropriate power state.

This also seems to fix an issue where ECC errors are seen at STREAMON time. This could possibly be because the sensor is probably still streaming when the receiver is being setup. Putting the sensor into standby would stop it streaming until setup of reciever is complete.

---
 arch/arm/mach-omap2/board-3430sdp.c |    4 +++-
 arch/arm/mach-omap2/board-ldp.c     |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +3 -1
Index: omapzoom04/arch/arm/mach-omap2/board-3430sdp.c
===================================================================
@@ -908,7 +908,8 @@ static int ov3640_sensor_power_set(enum 
 			mdelay(10);
 			enable_fpga_vio_1v8(1);
 			udelay(100);
-		}
+		} else
+			omap_set_gpio_dataout(OV3640_STANDBY_GPIO, 0);
 		break;
 	case V4L2_POWER_OFF:
 		printk(KERN_DEBUG "ov3640_sensor_power_set(OFF)\n");
@@ -932,6 +933,7 @@ static int ov3640_sensor_power_set(enum 
 		break;
 	case V4L2_POWER_STANDBY:
 		printk(KERN_DEBUG "ov3640_sensor_power_set(STANDBY)\n");
+		omap_set_gpio_dataout(OV3640_STANDBY_GPIO, 1);
 		break;
 	}
 	previous_power = power;
arch/arm/mach-omap2/board-ldp.c +3 -1
Index: omapzoom04/arch/arm/mach-omap2/board-ldp.c
===================================================================
@@ -742,7 +742,8 @@ static int ov3640_sensor_power_set(enum 
 			omap_set_gpio_dataout(OV3640_RESET_GPIO, 0);
 			udelay(100);
 			omap_set_gpio_dataout(OV3640_RESET_GPIO, 1);
-		}
+		} else
+			omap_set_gpio_dataout(OV3640_STANDBY_GPIO, 0);
 		break;
 	case V4L2_POWER_OFF:
 		printk(KERN_DEBUG "ov3640_sensor_power_set(OFF)\n");
@@ -764,6 +765,7 @@ static int ov3640_sensor_power_set(enum 
 		break;
 	case V4L2_POWER_STANDBY:
 		printk(KERN_DEBUG "ov3640_sensor_power_set(STANDBY)\n");
+		omap_set_gpio_dataout(OV3640_STANDBY_GPIO, 1);
 		break;
 	}
 	previous_power = power;