17 #include <linux/types.h>
33 #include <mach/hardware.h>
37 #include <asm/memory.h>
39 #include <asm/memblock.h>
40 #include <mach/common.h>
47 static int mx31_3ds_pins[] = {
167 #define MX31_3DS_CAMERA_BUF_SIZE SZ_8M
169 #define MX31_3DS_GPIO_CAMERA_PW IOMUX_TO_GPIO(MX31_PIN_CSI_D5)
170 #define MX31_3DS_GPIO_CAMERA_RST IOMUX_TO_GPIO(MX31_PIN_RI_DTE1)
172 static struct gpio mx31_3ds_camera_gpios[] = {
182 static int __init mx31_3ds_init_camera(
void)
189 return PTR_ERR(pdev);
191 if (!mx3_camera_base)
195 mx3_camera_base, mx3_camera_base,
210 static int mx31_3ds_camera_power(
struct device *
dev,
int on)
213 pr_debug(
"%s: %s the camera\n", __func__, on ?
"ENABLE" :
"DISABLE");
234 { .supply =
"cmos_vcore" },
235 { .supply =
"cmos_2v8" },
240 .board_info = &mx31_3ds_i2c_camera,
242 .power = mx31_3ds_camera_power,
243 .regulators = mx31_3ds_camera_regs,
244 .num_regulators =
ARRAY_SIZE(mx31_3ds_camera_regs),
248 .name =
"soc-camera-pdrv",
251 .platform_data = &iclink_ov2640,
292 #define MX31_3DS_GPIO_SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
293 #define MX31_3DS_GPIO_SDHC1_BE IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
295 static struct gpio mx31_3ds_sdhc1_gpios[] = {
300 static int mx31_3ds_sdhc1_init(
struct device *dev,
309 pr_warning(
"Unable to request the SD/MMC GPIOs.\n");
316 "sdhc1-detect", data);
318 pr_warning(
"Unable to request the SD/MMC card-detect IRQ.\n");
330 static void mx31_3ds_sdhc1_exit(
struct device *dev,
void *data)
337 static void mx31_3ds_sdhc1_setpower(
struct device *dev,
unsigned int vdd)
354 .init = mx31_3ds_sdhc1_init,
355 .exit = mx31_3ds_sdhc1_exit,
356 .setpower = mx31_3ds_sdhc1_setpower,
363 static const uint32_t mx31_3ds_keymap[] = {
376 .keymap = mx31_3ds_keymap,
406 .num_consumer_supplies =
ARRAY_SIZE(vmmc2_consumers),
407 .consumer_supplies = vmmc2_consumers,
423 .num_consumer_supplies =
ARRAY_SIZE(vmmc1_consumers),
424 .consumer_supplies = vmmc1_consumers,
439 .num_consumer_supplies =
ARRAY_SIZE(vgen_consumers),
440 .consumer_supplies = vgen_consumers,
455 .num_consumer_supplies =
ARRAY_SIZE(vvib_consumers),
456 .consumer_supplies = vvib_consumers,
462 .init_data = &pwgtx_init,
465 .init_data = &pwgtx_init,
469 .init_data = &gpo_init,
472 .init_data = &gpo_init,
475 .init_data = &vmmc2_init,
478 .init_data = &vmmc1_init,
481 .init_data = &vgen_init,
484 .init_data = &vvib_init,
496 .regulators = mx31_3ds_regulators,
497 .num_regulators =
ARRAY_SIZE(mx31_3ds_regulators),
499 .codec = &mx31_3ds_codec,
509 static int spi0_internal_chipselect[] = {
514 .chipselect = spi0_internal_chipselect,
515 .num_chipselect =
ARRAY_SIZE(spi0_internal_chipselect),
518 static int spi1_internal_chipselect[] = {
525 .num_chipselect =
ARRAY_SIZE(spi1_internal_chipselect),
530 .modalias =
"mc13783",
531 .max_speed_hz = 1000000,
534 .platform_data = &mc13783_pdata,
538 .modalias =
"l4f00242t03",
539 .max_speed_hz = 5000000,
542 .platform_data = &mx31_3ds_l4f00242t03_pdata,
550 mx31_3ds_nand_board_info __initconst = {
553 #ifdef CONFIG_MACH_MX31_3DS_MXC_NAND_USE_BBT
562 #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
563 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
565 #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR)
566 #define USBH2_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_BYP)
568 static int mx31_3ds_usbotg_init(
void)
587 pr_err(
"Failed to request the USB OTG reset gpio\n");
593 pr_err(
"Failed to drive the USB OTG reset gpio\n");
594 goto usbotg_free_reset;
630 pr_err(
"Failed to request the USB Host 2 reset gpio\n");
636 pr_err(
"Failed to drive the USB Host 2 reset gpio\n");
637 goto usbotg_free_reset;
653 .init = mx31_3ds_otg_init,
658 .
init = mx31_3ds_host2_init,
671 if (!
strcmp(options,
"host"))
672 otg_mode_host =
true;
673 else if (!
strcmp(options,
"device"))
674 otg_mode_host =
false;
676 pr_info(
"otg_mode neither \"host\" nor \"device\". "
677 "Defaulting to device\n");
680 __setup(
"otg_mode=", mx31_3ds_otg_mode);
694 static void __init mx31_3ds_init(
void)
718 mx31_3ds_usbotg_init();
735 "devices on the debug board are unusable.\n");
749 pr_err(
"Failed to request camera gpios");
753 mx31_3ds_init_camera();
757 imx_add_platform_device(
"imx_mc13783", 0,
NULL, 0,
NULL, 0);
760 static void __init mx31_3ds_timer_init(
void)
765 static struct sys_timer mx31_3ds_timer = {
766 .init = mx31_3ds_timer_init,
769 static void __init mx31_3ds_reserve(
void)
778 .atag_offset = 0x100,
783 .timer = &mx31_3ds_timer,
784 .init_machine = mx31_3ds_init,
785 .reserve = mx31_3ds_reserve,