aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9m10g45ek.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/board-sam9m10g45ek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c80
1 files changed, 78 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index ea0d1b9c2b7..57497e2b887 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -24,11 +24,13 @@
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/leds.h> 26#include <linux/leds.h>
27#include <linux/clk.h>
28#include <linux/atmel-mci.h> 27#include <linux/atmel-mci.h>
28#include <linux/delay.h>
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <video/atmel_lcdc.h> 31#include <video/atmel_lcdc.h>
32#include <media/soc_camera.h>
33#include <media/atmel-isi.h>
32 34
33#include <asm/setup.h> 35#include <asm/setup.h>
34#include <asm/mach-types.h> 36#include <asm/mach-types.h>
@@ -185,6 +187,71 @@ static void __init ek_add_device_nand(void)
185 187
186 188
187/* 189/*
190 * ISI
191 */
192static struct isi_platform_data __initdata isi_data = {
193 .frate = ISI_CFG1_FRATE_CAPTURE_ALL,
194 /* to use codec and preview path simultaneously */
195 .full_mode = 1,
196 .data_width_flags = ISI_DATAWIDTH_8 | ISI_DATAWIDTH_10,
197 /* ISI_MCK is provided by programmable clock or external clock */
198 .mck_hz = 25000000,
199};
200
201
202/*
203 * soc-camera OV2640
204 */
205#if defined(CONFIG_SOC_CAMERA_OV2640) || \
206 defined(CONFIG_SOC_CAMERA_OV2640_MODULE)
207static unsigned long isi_camera_query_bus_param(struct soc_camera_link *link)
208{
209 /* ISI board for ek using default 8-bits connection */
210 return SOCAM_DATAWIDTH_8;
211}
212
213static int i2c_camera_power(struct device *dev, int on)
214{
215 /* enable or disable the camera */
216 pr_debug("%s: %s the camera\n", __func__, on ? "ENABLE" : "DISABLE");
217 at91_set_gpio_output(AT91_PIN_PD13, !on);
218
219 if (!on)
220 goto out;
221
222 /* If enabled, give a reset impulse */
223 at91_set_gpio_output(AT91_PIN_PD12, 0);
224 msleep(20);
225 at91_set_gpio_output(AT91_PIN_PD12, 1);
226 msleep(100);
227
228out:
229 return 0;
230}
231
232static struct i2c_board_info i2c_camera = {
233 I2C_BOARD_INFO("ov2640", 0x30),
234};
235
236static struct soc_camera_link iclink_ov2640 = {
237 .bus_id = 0,
238 .board_info = &i2c_camera,
239 .i2c_adapter_id = 0,
240 .power = i2c_camera_power,
241 .query_bus_param = isi_camera_query_bus_param,
242};
243
244static struct platform_device isi_ov2640 = {
245 .name = "soc-camera-pdrv",
246 .id = 0,
247 .dev = {
248 .platform_data = &iclink_ov2640,
249 },
250};
251#endif
252
253
254/*
188 * LCD Controller 255 * LCD Controller
189 */ 256 */
190#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 257#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
@@ -377,7 +444,12 @@ static struct gpio_led ek_pwm_led[] = {
377#endif 444#endif
378}; 445};
379 446
380 447static struct platform_device *devices[] __initdata = {
448#if defined(CONFIG_SOC_CAMERA_OV2640) || \
449 defined(CONFIG_SOC_CAMERA_OV2640_MODULE)
450 &isi_ov2640,
451#endif
452};
381 453
382static void __init ek_board_init(void) 454static void __init ek_board_init(void)
383{ 455{
@@ -399,6 +471,8 @@ static void __init ek_board_init(void)
399 ek_add_device_nand(); 471 ek_add_device_nand();
400 /* I2C */ 472 /* I2C */
401 at91_add_device_i2c(0, NULL, 0); 473 at91_add_device_i2c(0, NULL, 0);
474 /* ISI, using programmable clock as ISI_MCK */
475 at91_add_device_isi(&isi_data, true);
402 /* LCD Controller */ 476 /* LCD Controller */
403 at91_add_device_lcdc(&ek_lcdc_data); 477 at91_add_device_lcdc(&ek_lcdc_data);
404 /* Touch Screen */ 478 /* Touch Screen */
@@ -410,6 +484,8 @@ static void __init ek_board_init(void)
410 /* LEDs */ 484 /* LEDs */
411 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 485 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
412 at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); 486 at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led));
487 /* Other platform devices */
488 platform_add_devices(devices, ARRAY_SIZE(devices));
413} 489}
414 490
415MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") 491MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")