16 #include <linux/kernel.h>
18 #include <linux/input.h>
26 #include <linux/export.h>
27 #include <linux/omapfb.h>
33 #include <asm/serial.h>
42 #include <mach/hardware.h>
50 static const unsigned int ams_delta_keymap[] = {
128 #define LATCH1_PHYS 0x01000000
129 #define LATCH1_VIRT 0xEA000000
130 #define MODEM_PHYS 0x04000000
131 #define MODEM_VIRT 0xEB000000
132 #define LATCH2_PHYS 0x08000000
133 #define LATCH2_VIRT 0xEC000000
140 .length = 0x01000000,
147 .length = 0x01000000,
154 .length = 0x01000000,
160 .ctrl_name =
"internal",
169 #define LATCH1_GPIO_BASE 232
170 #define LATCH1_NGPIO 8
172 static struct resource latch1_resources[] = {
187 .
name =
"basic-mmio-gpio",
189 .resource = latch1_resources,
190 .num_resources =
ARRAY_SIZE(latch1_resources),
192 .platform_data = &latch1_pdata,
196 static struct resource latch2_resources[] = {
200 .end =
LATCH2_PHYS + (AMS_DELTA_LATCH2_NGPIO - 1) / 8,
206 .
base = AMS_DELTA_LATCH2_GPIO_BASE,
207 .ngpio = AMS_DELTA_LATCH2_NGPIO,
211 .
name =
"basic-mmio-gpio",
213 .resource = latch2_resources,
214 .num_resources =
ARRAY_SIZE(latch2_resources),
216 .platform_data = &latch2_pdata,
220 static const struct gpio latch_gpios[] __initconst = {
232 .gpio = AMS_DELTA_GPIO_PIN_SCARD_RSTIN,
234 .label =
"scard_rstin",
237 .gpio = AMS_DELTA_GPIO_PIN_SCARD_CMDVCC,
239 .label =
"scard_cmdvcc",
242 .gpio = AMS_DELTA_GPIO_PIN_MODEM_CODEC,
244 .label =
"modem_codec",
247 .gpio = AMS_DELTA_LATCH2_GPIO_BASE + 14,
249 .label =
"hookflash1",
252 .gpio = AMS_DELTA_LATCH2_GPIO_BASE + 15,
254 .label =
"hookflash2",
268 .num_consumer_supplies =
ARRAY_SIZE(modem_nreset_consumers),
269 .consumer_supplies = modem_nreset_consumers,
274 .microvolts = 3300000,
275 .gpio = AMS_DELTA_GPIO_PIN_MODEM_NRESET,
276 .startup_delay = 25000,
278 .enabled_at_boot = 1,
279 .init_data = &modem_nreset_data,
283 .
name =
"reg-fixed-voltage",
286 .platform_data = &modem_nreset_config,
301 for (; bit < ngpio; bit++, bitpos = bitpos << 1) {
302 if (!(mask & bitpos))
310 static struct resource ams_delta_nand_resources[] = {
320 .name =
"ams-delta-nand",
322 .num_resources =
ARRAY_SIZE(ams_delta_nand_resources),
323 .resource = ams_delta_nand_resources,
326 static struct resource ams_delta_kp_resources[] = {
335 .keymap = ams_delta_keymap,
342 .keymap_data = &ams_delta_keymap_data,
347 .name =
"omap-keypad",
350 .platform_data = &ams_delta_kp_data,
352 .num_resources =
ARRAY_SIZE(ams_delta_kp_resources),
353 .resource = ams_delta_kp_resources,
357 .name =
"lcd_ams_delta",
361 static const struct gpio_led gpio_leds[] __initconst = {
366 #ifdef CONFIG_LEDS_TRIGGERS
367 .default_trigger =
"ams_delta_camera",
408 #ifdef CONFIG_LEDS_TRIGGERS
423 #define ams_delta_camera_power NULL
429 .board_info = &ams_delta_camera_board_info[0],
430 .module_name =
"ov6650",
435 .name =
"soc-camera-pdrv",
438 .platform_data = &ams_delta_iclink,
443 .camexclk_khz = 12000,
444 .lclk_khz_max = 1334,
448 .name =
"ams-delta-audio",
453 .name =
"cx20442-codec",
460 &ams_delta_kp_device,
461 &ams_delta_camera_device,
462 &ams_delta_audio_device,
466 &ams_delta_nand_device,
467 &ams_delta_lcd_device,
468 &cx20442_codec_device,
471 static void __init ams_delta_init(
void)
495 omap1_set_camera_info(&ams_delta_camera_platform_data);
496 #ifdef CONFIG_LEDS_TRIGGERS
498 &ams_delta_camera_led_trigger);
537 .private_data = &modem_priv,
543 .name =
"serial8250",
546 .platform_data = ams_delta_modem_ports,
550 static int __init late_init(
void)
554 if (!machine_is_ams_delta())
559 pr_err(
"Couldn't take over latch1/latch2 GPIO pins\n");
567 pr_err(
"Couldn't register the modem regulator device\n");
572 ams_delta_modem_ports[0].
irq =
575 err =
gpio_request(AMS_DELTA_GPIO_PIN_MODEM_IRQ,
"modem");
577 pr_err(
"Couldn't request gpio pin for modem\n");
583 modem_priv.regulator = ERR_PTR(-
ENODEV);
585 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,
586 AMS_DELTA_LATCH2_MODEM_CODEC);
598 if (IS_ERR(modem_priv.regulator)) {
599 err = PTR_ERR(modem_priv.regulator);
611 static void __init ams_delta_init_late(
void)
617 static void __init ams_delta_map_io(
void)
625 .atag_offset = 0x100,
626 .map_io = ams_delta_map_io,
630 .init_machine = ams_delta_init,
631 .init_late = ams_delta_init_late,