ARM: pxa: PalmZ72: Add OV9640 camera support
Subsystems (3)
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensor
---
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(-)
arch/arm/mach-pxa/include/mach/palmz72.h +5 -0
@@ -44,6 +44,11 @@#define GPIO_NR_PALMZ72_BT_POWER 17#define GPIO_NR_PALMZ72_BT_RESET 83 +/* Camera */ +#define GPIO_NR_PALMZ72_CAM_PWDN 56 +#define GPIO_NR_PALMZ72_CAM_RESET 57 +#define GPIO_NR_PALMZ72_CAM_POWER 91 +/** Initial values **/ /* Battery */
arch/arm/mach-pxa/palmz72.c +127 -0
157 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
Hi,
Quoted 15 lines · Marek Vasut
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensorSigned-off-by Marek Vasut <[email protected]>---
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(-)
arch/arm/mach-pxa/include/mach/palmz72.h +0
-0
[snip]
Quoted 5 lines
arch/arm/mach-pxa/include/mach/palmz72.h +5
-0+static int palmz72_camera_power (struct device *dev,int power) +{ + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power); + ? ? ? mdelay(50); + ? ? ? return 0;
arch/arm/mach-pxa/include/mach/palmz72.h
Quoted 10 lines
arch/arm/mach-pxa/include/mach/palmz72.h +10
-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?
[snip]
Best regards,
Bj?rn Forsman
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
Quoted 39 lines · Bj?rn Forsman
Hi,
Quoted 15 lines · Marek Vasut
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensorSigned-off-by Marek Vasut <[email protected]>---
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(-)
arch/arm/mach-pxa/include/mach/palmz72.h +0
-0[snip]
Quoted 5 lines
arch/arm/mach-pxa/include/mach/palmz72.h +5
-0+static int palmz72_camera_power (struct device *dev,int power) +{ + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power); + ? ? ? mdelay(50); + ? ? ? return 0;arch/arm/mach-pxa/include/mach/palmz72.h
Quoted 10 lines
arch/arm/mach-pxa/include/mach/palmz72.h +10
-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.)
Quoted 5 lines
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.
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
2011/1/15 Russell King - ARM Linux <[email protected]>:
Quoted 49 lines · Bj?rn Forsman
Quoted 39 lines
Hi,
Quoted 15 lines · Marek Vasut
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensorSigned-off-by Marek Vasut <[email protected]>---
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(-)
arch/arm/mach-pxa/include/mach/palmz72.h +0
-0[snip]
Quoted 5 lines
arch/arm/mach-pxa/include/mach/palmz72.h +5
-0+static int palmz72_camera_power (struct device *dev,int power) +{ + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power); + ? ? ? mdelay(50); + ? ? ? return 0;arch/arm/mach-pxa/include/mach/palmz72.h
Quoted 10 lines
arch/arm/mach-pxa/include/mach/palmz72.h +10
-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.)
Quoted 5 lines
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.
Quoted 6 lines
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
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
Quoted 56 lines · On Saturday 15 January 2011 18:49:16 Bj?rn Forsman wrote:
2011/1/15 Russell King - ARM Linux <[email protected]>:
Quoted 55 lines · Bj?rn Forsman
Quoted 41 lines
Hi,
Quoted 17 lines · Marek Vasut
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensorSigned-off-by Marek Vasut <[email protected]>---
v2: Use gpio_request_array()/gpio_free_array() arrayarch/arm/mach-pxa/include/mach/palmz72.h | 5 + arch/arm/mach-pxa/palmz72.c | 127++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 0 deletions(-)
(quoted diff) +0
-0
b/arch/arm/mach-pxa/include/mach/palmz72.hindex 2bbcf70..0d4700a 100644arch/arm/mach-pxa/include/mach/palmz72.h +0
-0[snip]
Quoted 5 lines
arch/arm/mach-pxa/include/mach/palmz72.h +5
-0+static int palmz72_camera_power (struct device *dev,int power) +{ +gpio_set_value (GPIO_NR_PALMZ72_CAM_PWDN , !power); +mdelay (50 ); +return 0 ;arch/arm/mach-pxa/include/mach/palmz72.h
Quoted 10 lines
arch/arm/mach-pxa/include/mach/palmz72.h +10
-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.)
Quoted 5 lines
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.)
Quoted 6 lines
Quoted 2 lines
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?
Let's keep it at mdelay() for now, can we? I'll send a subsequent patch once I can test with msleep() ... I don't have the hardware available now.
Cheers
Quoted 3 lines
Best regards,
Bj?rn Forsman
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
2011/1/15 Marek Vasut <[email protected]>:
Quoted 60 lines · On Saturday 15 January 2011 18:49:16 Bj?rn Forsman wrote:
Quoted 59 lines
2011/1/15 Russell King - ARM Linux <[email protected]>:
Quoted 57 lines · Bj?rn Forsman
Quoted 41 lines
Hi,
Quoted 17 lines · Marek Vasut
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensorSigned-off-by Marek Vasut <[email protected]>---
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(-)
(quoted diff) +0
-0
b/arch/arm/mach-pxa/include/mach/palmz72.hindex 2bbcf70..0d4700a 100644arch/arm/mach-pxa/include/mach/palmz72.h +0
-0[snip]
Quoted 5 lines
arch/arm/mach-pxa/include/mach/palmz72.h +5
-0+static int palmz72_camera_power (struct device *dev,int power) +{ + ? ? ? gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power); + ? ? ? mdelay(50); + ? ? ? return 0;arch/arm/mach-pxa/include/mach/palmz72.h
Quoted 10 lines
arch/arm/mach-pxa/include/mach/palmz72.h +10
-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.)
Quoted 5 lines
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.
Quoted 6 lines
Quoted 3 lines
Thanks for explaining!
Marek, care to try
msleep()so we avoid busy-waits?Let's keep it at
mdelay()for now, can we? I'll send a subsequent patch once I can test withmsleep()... I don't have the hardware available now.
Sure. It was only a suggestion :-)
Best regards,
Bj?rn Forsman
PATCH v2 1/1 ARM: pxa: PalmZ72: Add OV9640 camera support
Quoted 63 lines · On Saturday 15 January 2011 19:58:39 Bj?rn Forsman wrote:
2011/1/15 Marek Vasut <[email protected]>:
Quoted 62 lines · On Saturday 15 January 2011 18:49:16 Bj?rn Forsman wrote:
Quoted 61 lines
2011/1/15 Russell King - ARM Linux <[email protected]>:
Quoted 51 lines · Bj?rn Forsman
Quoted 41 lines
Hi,
Quoted 17 lines · Marek Vasut
Rework of patch from 2009:
PalmZ72: Add support for OV9640 camera sensorSigned-off-by Marek Vasut <[email protected]>---
v2: Use gpio_request_array()/gpio_free_array() arrayarch/arm/mach-pxa/include/mach/palmz72.h | 5 + arch/arm/mach-pxa/palmz72.c | 127++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 0 deletions(-)
(quoted diff) +0
-0
b/arch/arm/mach-pxa/include/mach/palmz72.hindex 2bbcf70..0d4700a 100644arch/arm/mach-pxa/include/mach/palmz72.h +0
-0[snip]
Quoted 5 lines
arch/arm/mach-pxa/include/mach/palmz72.h +5
-0+static int palmz72_camera_power (struct device *dev,int power) +{ +gpio_set_value (GPIO_NR_PALMZ72_CAM_PWDN , !power); +mdelay (50 ); +return 0 ;arch/arm/mach-pxa/include/mach/palmz72.h
Quoted 10 lines
arch/arm/mach-pxa/include/mach/palmz72.h +10
-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.)
Quoted 5 lines
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.Quoted 6 lines
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!
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Marek, care to try
msleep()so we avoid busy-waits?Let's keep it at
mdelay()for now, can we? I'll send a subsequent patch once I can test withmsleep()... I don't have the hardware available now.Sure. It was only a suggestion :-)
It's actually very valid, I'll keep that in mind :)
Quoted 3 lines
Best regards,
Bj?rn Forsman