diff options
author | Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> | 2010-10-01 19:37:00 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-10-01 19:37:00 -0400 |
commit | 1a96edd70c1f4b4a1904803f8a83900087f4d1da (patch) | |
tree | 899632b9589c8b8fe91b5e5891e5d4995e515650 | |
parent | 7ad0e386d46e9edff64705ab25337ad9130baf63 (diff) |
OMAP1: Add support for SoC camera interface
This patch adds a definition of the OMAP1 camera interface platform device,
and a function that allows for providing a board specific platform data.
The device will be used with the upcoming OMAP1 SoC camera interface driver.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap1/devices.c | 43 | ||||
-rw-r--r-- | arch/arm/mach-omap1/include/mach/camera.h | 11 |
2 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index aa0725608fb1..2c9a030c5595 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/dma-mapping.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
@@ -191,6 +192,48 @@ static inline void omap_init_spi100k(void) | |||
191 | } | 192 | } |
192 | #endif | 193 | #endif |
193 | 194 | ||
195 | |||
196 | #define OMAP1_CAMERA_BASE 0xfffb6800 | ||
197 | #define OMAP1_CAMERA_IOSIZE 0x1c | ||
198 | |||
199 | static struct resource omap1_camera_resources[] = { | ||
200 | [0] = { | ||
201 | .start = OMAP1_CAMERA_BASE, | ||
202 | .end = OMAP1_CAMERA_BASE + OMAP1_CAMERA_IOSIZE - 1, | ||
203 | .flags = IORESOURCE_MEM, | ||
204 | }, | ||
205 | [1] = { | ||
206 | .start = INT_CAMERA, | ||
207 | .flags = IORESOURCE_IRQ, | ||
208 | }, | ||
209 | }; | ||
210 | |||
211 | static u64 omap1_camera_dma_mask = DMA_BIT_MASK(32); | ||
212 | |||
213 | static struct platform_device omap1_camera_device = { | ||
214 | .name = "omap1-camera", | ||
215 | .id = 0, /* This is used to put cameras on this interface */ | ||
216 | .dev = { | ||
217 | .dma_mask = &omap1_camera_dma_mask, | ||
218 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
219 | }, | ||
220 | .num_resources = ARRAY_SIZE(omap1_camera_resources), | ||
221 | .resource = omap1_camera_resources, | ||
222 | }; | ||
223 | |||
224 | void __init omap1_camera_init(void *info) | ||
225 | { | ||
226 | struct platform_device *dev = &omap1_camera_device; | ||
227 | int ret; | ||
228 | |||
229 | dev->dev.platform_data = info; | ||
230 | |||
231 | ret = platform_device_register(dev); | ||
232 | if (ret) | ||
233 | dev_err(&dev->dev, "unable to register device: %d\n", ret); | ||
234 | } | ||
235 | |||
236 | |||
194 | /*-------------------------------------------------------------------------*/ | 237 | /*-------------------------------------------------------------------------*/ |
195 | 238 | ||
196 | static inline void omap_init_sti(void) {} | 239 | static inline void omap_init_sti(void) {} |
diff --git a/arch/arm/mach-omap1/include/mach/camera.h b/arch/arm/mach-omap1/include/mach/camera.h new file mode 100644 index 000000000000..fd54b452eb22 --- /dev/null +++ b/arch/arm/mach-omap1/include/mach/camera.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __ASM_ARCH_CAMERA_H_ | ||
2 | #define __ASM_ARCH_CAMERA_H_ | ||
3 | |||
4 | void omap1_camera_init(void *); | ||
5 | |||
6 | static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info) | ||
7 | { | ||
8 | omap1_camera_init(info); | ||
9 | } | ||
10 | |||
11 | #endif /* __ASM_ARCH_CAMERA_H_ */ | ||