diff options
author | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2009-04-03 09:34:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:43:58 -0400 |
commit | 6acc81c394393b853e731cc67f17ef277d521123 (patch) | |
tree | 62d2c852d4a8a63be7c552339774e5df2443ebb2 /arch | |
parent | b71df97a3ffdb2bfc286c3fa0c2b1a0aa3a6bf88 (diff) |
V4L/DVB (11350): Add camera (CSI) driver for MX1
Add support for CMOS Sensor Interface on i.MX1 and i.MXL SoCs.
create mode 100644 arch/arm/mach-mx1/ksym_mx1.c
create mode 100644 arch/arm/mach-mx1/mx1_camera_fiq.S
create mode 100644 arch/arm/plat-mxc/include/mach/mx1_camera.h
create mode 100644 drivers/media/video/mx1_camera.c
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mx1/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-mx1/devices.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx1/ksym_mx1.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-mx1/mx1_camera_fiq.S | 35 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/memory.h | 8 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx1_camera.h | 35 |
6 files changed, 100 insertions, 1 deletions
diff --git a/arch/arm/mach-mx1/Makefile b/arch/arm/mach-mx1/Makefile index 82f1309568ef..7f86fe073ec6 100644 --- a/arch/arm/mach-mx1/Makefile +++ b/arch/arm/mach-mx1/Makefile | |||
@@ -6,6 +6,9 @@ | |||
6 | 6 | ||
7 | obj-y += generic.o clock.o devices.o | 7 | obj-y += generic.o clock.o devices.o |
8 | 8 | ||
9 | # Support for CMOS sensor interface | ||
10 | obj-$(CONFIG_MX1_VIDEO) += ksym_mx1.o mx1_camera_fiq.o | ||
11 | |||
9 | # Specific board support | 12 | # Specific board support |
10 | obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o | 13 | obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o |
11 | obj-$(CONFIG_MACH_SCB9328) += scb9328.o \ No newline at end of file | 14 | obj-$(CONFIG_MACH_SCB9328) += scb9328.o \ No newline at end of file |
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c index 97f42d96d7a1..76d1ffb48079 100644 --- a/arch/arm/mach-mx1/devices.c +++ b/arch/arm/mach-mx1/devices.c | |||
@@ -44,7 +44,7 @@ static struct resource imx_csi_resources[] = { | |||
44 | static u64 imx_csi_dmamask = 0xffffffffUL; | 44 | static u64 imx_csi_dmamask = 0xffffffffUL; |
45 | 45 | ||
46 | struct platform_device imx_csi_device = { | 46 | struct platform_device imx_csi_device = { |
47 | .name = "imx-csi", | 47 | .name = "mx1-camera", |
48 | .id = 0, /* This is used to put cameras on this interface */ | 48 | .id = 0, /* This is used to put cameras on this interface */ |
49 | .dev = { | 49 | .dev = { |
50 | .dma_mask = &imx_csi_dmamask, | 50 | .dma_mask = &imx_csi_dmamask, |
diff --git a/arch/arm/mach-mx1/ksym_mx1.c b/arch/arm/mach-mx1/ksym_mx1.c new file mode 100644 index 000000000000..b09ee12a4ff0 --- /dev/null +++ b/arch/arm/mach-mx1/ksym_mx1.c | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Exported ksyms of ARCH_MX1 | ||
3 | * | ||
4 | * Copyright (C) 2008, Darius Augulis <augulis.darius@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/module.h> | ||
13 | |||
14 | #include <mach/mx1_camera.h> | ||
15 | |||
16 | /* IMX camera FIQ handler */ | ||
17 | EXPORT_SYMBOL(mx1_camera_sof_fiq_start); | ||
18 | EXPORT_SYMBOL(mx1_camera_sof_fiq_end); | ||
diff --git a/arch/arm/mach-mx1/mx1_camera_fiq.S b/arch/arm/mach-mx1/mx1_camera_fiq.S new file mode 100644 index 000000000000..9c69aa65bf17 --- /dev/null +++ b/arch/arm/mach-mx1/mx1_camera_fiq.S | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
3 | * | ||
4 | * Based on linux/arch/arm/lib/floppydma.S | ||
5 | * Copyright (C) 1995, 1996 Russell King | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/linkage.h> | ||
12 | #include <asm/assembler.h> | ||
13 | |||
14 | .text | ||
15 | .global mx1_camera_sof_fiq_end | ||
16 | .global mx1_camera_sof_fiq_start | ||
17 | mx1_camera_sof_fiq_start: | ||
18 | @ enable dma | ||
19 | ldr r12, [r9] | ||
20 | orr r12, r12, #0x00000001 | ||
21 | str r12, [r9] | ||
22 | @ unmask DMA interrupt | ||
23 | ldr r12, [r8] | ||
24 | bic r12, r12, r13 | ||
25 | str r12, [r8] | ||
26 | @ disable SOF interrupt | ||
27 | ldr r12, [r10] | ||
28 | bic r12, r12, #0x00010000 | ||
29 | str r12, [r10] | ||
30 | @ clear SOF flag | ||
31 | mov r12, #0x00010000 | ||
32 | str r12, [r11] | ||
33 | @ return from FIQ | ||
34 | subs pc, lr, #4 | ||
35 | mx1_camera_sof_fiq_end: | ||
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h index e0783e619580..eca37d09f3f8 100644 --- a/arch/arm/plat-mxc/include/mach/memory.h +++ b/arch/arm/plat-mxc/include/mach/memory.h | |||
@@ -24,4 +24,12 @@ | |||
24 | #define PHYS_OFFSET UL(0x80000000) | 24 | #define PHYS_OFFSET UL(0x80000000) |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #if defined(CONFIG_MX1_VIDEO) | ||
28 | /* | ||
29 | * Increase size of DMA-consistent memory region. | ||
30 | * This is required for i.MX camera driver to capture at least four VGA frames. | ||
31 | */ | ||
32 | #define CONSISTENT_DMA_SIZE SZ_4M | ||
33 | #endif /* CONFIG_MX1_VIDEO */ | ||
34 | |||
27 | #endif /* __ASM_ARCH_MXC_MEMORY_H__ */ | 35 | #endif /* __ASM_ARCH_MXC_MEMORY_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx1_camera.h b/arch/arm/plat-mxc/include/mach/mx1_camera.h new file mode 100644 index 000000000000..4fd6c70314b4 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx1_camera.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * mx1_camera.h - i.MX1/i.MXL camera driver header file | ||
3 | * | ||
4 | * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
5 | * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com> | ||
6 | * | ||
7 | * Based on PXA camera.h file: | ||
8 | * Copyright (C) 2003, Intel Corporation | ||
9 | * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_CAMERA_H_ | ||
17 | #define __ASM_ARCH_CAMERA_H_ | ||
18 | |||
19 | #define MX1_CAMERA_DATA_HIGH 1 | ||
20 | #define MX1_CAMERA_PCLK_RISING 2 | ||
21 | #define MX1_CAMERA_VSYNC_HIGH 4 | ||
22 | |||
23 | extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end; | ||
24 | |||
25 | /** | ||
26 | * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data | ||
27 | * @mclk_10khz: master clock frequency in 10kHz units | ||
28 | * @flags: MX1 camera platform flags | ||
29 | */ | ||
30 | struct mx1_camera_pdata { | ||
31 | unsigned long mclk_10khz; | ||
32 | unsigned long flags; | ||
33 | }; | ||
34 | |||
35 | #endif /* __ASM_ARCH_CAMERA_H_ */ | ||