[PATCH v2] ARM: pxa: PalmZ72: Add OV9640 camera support
flat view
STALE5749d
From: Bjørn Forsman <hidden>
Date: 2011-01-15 17:49:16
2011/1/15 Russell King - ARM Linux [off-list ref]:
On Sat, Jan 15, 2011 at 05:37:08PM +0100, Bj?rn Forsman wrote:quoted
Hi, On 15 January 2011 02:17, Marek Vasut [off-list ref] wrote:quoted
Rework of patch from 2009: PalmZ72: Add support for OV9640 camera sensor Signed-off-by: Marek Vasut <redacted> --- v2: Use gpio_request_array()/gpio_free_array() array ?arch/arm/mach-pxa/include/mach/palmz72.h | ? ?5 + ?arch/arm/mach-pxa/palmz72.c ? ? ? ? ? ? ?| ?127 ++++++++++++++++++++++++++++++ ?2 files changed, 132 insertions(+), 0 deletions(-)diff --git a/arch/arm/mach-pxa/include/mach/palmz72.h b/arch/arm/mach-pxa/include/mach/palmz72.h index 2bbcf70..0d4700a 100644 --- a/arch/arm/mach-pxa/include/mach/palmz72.h +++ b/arch/arm/mach-pxa/include/mach/palmz72.h[snip]quoted
+static int palmz72_camera_power(struct device *dev, int power) +{ + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power); + ? ? ? mdelay(50); + ? ? ? return 0; +} + +static int palmz72_camera_reset(struct device *dev) +{ + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_RESET, 1); + ? ? ? mdelay(50); + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_RESET, 0); + ? ? ? mdelay(50); + ? ? ? return 0; +}(Sorry if these are stupid newbie-questions.) Is the entire kernel blocked during the above mdelay()s or just some kernel thread? (Or: will this add like 100ms or 150ms to boot time?) Can mdelay() be replaced with something non-blocking?mdelay() is a spinning delay - it doesn't voluntarily relinquish the CPU to another task. If you have preempt enabled and the region is preemptable, you can be preempted in the middle of the delay (in which case it becomes delay time + time away from the thread.) msleep() can be used for places where you can sleep, but is limited to the jiffy granularity for !HIRES kernels.
Thanks for explaining! Marek, care to try msleep() so we avoid busy-waits? Best regards, Bj?rn Forsman