|
@@ -372,3 +372,185 @@ static struct gpio_keys_platform_data gpio_keys_pdata = {
|
|
|
|
|
|
static struct platform_device gpio_keys_device = {
|
|
|
.name = "gpio-keys",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &gpio_keys_pdata,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static void __init overo_init_keys(void)
|
|
|
+{
|
|
|
+ platform_device_register(&gpio_keys_device);
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+static inline void __init overo_init_keys(void) { return; }
|
|
|
+#endif
|
|
|
+
|
|
|
+static int overo_twl_gpio_setup(struct device *dev,
|
|
|
+ unsigned gpio, unsigned ngpio)
|
|
|
+{
|
|
|
+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
|
|
|
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
|
|
|
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
|
|
|
+#endif
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static struct twl4030_gpio_platform_data overo_gpio_data = {
|
|
|
+ .use_leds = true,
|
|
|
+ .setup = overo_twl_gpio_setup,
|
|
|
+};
|
|
|
+
|
|
|
+static struct regulator_init_data overo_vmmc1 = {
|
|
|
+ .constraints = {
|
|
|
+ .min_uV = 1850000,
|
|
|
+ .max_uV = 3150000,
|
|
|
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
|
|
|
+ | REGULATOR_MODE_STANDBY,
|
|
|
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
|
|
|
+ | REGULATOR_CHANGE_MODE
|
|
|
+ | REGULATOR_CHANGE_STATUS,
|
|
|
+ },
|
|
|
+ .num_consumer_supplies = ARRAY_SIZE(overo_vmmc1_supply),
|
|
|
+ .consumer_supplies = overo_vmmc1_supply,
|
|
|
+};
|
|
|
+
|
|
|
+static struct twl4030_platform_data overo_twldata = {
|
|
|
+ .gpio = &overo_gpio_data,
|
|
|
+ .vmmc1 = &overo_vmmc1,
|
|
|
+};
|
|
|
+
|
|
|
+static int __init overo_i2c_init(void)
|
|
|
+{
|
|
|
+ omap3_pmic_get_config(&overo_twldata,
|
|
|
+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
|
|
|
+ TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
|
|
|
+
|
|
|
+ overo_twldata.vpll2->constraints.name = "VDVI";
|
|
|
+
|
|
|
+ omap3_pmic_init("tps65950", &overo_twldata);
|
|
|
+ /* i2c2 pins are used for gpio */
|
|
|
+ omap_register_i2c_bus(3, 400, NULL, 0);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static struct spi_board_info overo_spi_board_info[] __initdata = {
|
|
|
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
|
|
|
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
|
|
|
+ {
|
|
|
+ .modalias = "lgphilips_lb035q02_panel-spi",
|
|
|
+ .bus_num = 1,
|
|
|
+ .chip_select = 1,
|
|
|
+ .max_speed_hz = 500000,
|
|
|
+ .mode = SPI_MODE_3,
|
|
|
+ },
|
|
|
+#endif
|
|
|
+};
|
|
|
+
|
|
|
+static int __init overo_spi_init(void)
|
|
|
+{
|
|
|
+ overo_ads7846_init();
|
|
|
+ spi_register_board_info(overo_spi_board_info,
|
|
|
+ ARRAY_SIZE(overo_spi_board_info));
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
|
|
|
+ .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
|
|
+ .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
|
|
+ .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
|
|
+ .phy_reset = true,
|
|
|
+ .reset_gpio_port[0] = -EINVAL,
|
|
|
+ .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
|
|
|
+ .reset_gpio_port[2] = -EINVAL
|
|
|
+};
|
|
|
+
|
|
|
+#ifdef CONFIG_OMAP_MUX
|
|
|
+static struct omap_board_mux board_mux[] __initdata = {
|
|
|
+ { .reg_offset = OMAP_MUX_TERMINATOR },
|
|
|
+};
|
|
|
+#endif
|
|
|
+
|
|
|
+static struct gpio overo_bt_gpios[] __initdata = {
|
|
|
+ { OVERO_GPIO_BT_XGATE, GPIOF_OUT_INIT_LOW, "lcd enable" },
|
|
|
+ { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH, "lcd bl enable" },
|
|
|
+};
|
|
|
+
|
|
|
+static struct regulator_consumer_supply dummy_supplies[] = {
|
|
|
+ REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
|
|
|
+ REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
|
|
|
+ REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
|
|
|
+ REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
|
|
|
+};
|
|
|
+
|
|
|
+static void __init overo_init(void)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
|
|
|
+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
|
|
|
+ overo_i2c_init();
|
|
|
+ omap_hsmmc_init(mmc);
|
|
|
+ omap_display_init(&overo_dss_data);
|
|
|
+ omap_serial_init();
|
|
|
+ omap_sdrc_init(mt46h32m32lf6_sdrc_params,
|
|
|
+ mt46h32m32lf6_sdrc_params);
|
|
|
+ board_nand_init(overo_nand_partitions,
|
|
|
+ ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
|
|
|
+ usb_musb_init(NULL);
|
|
|
+ usbhs_init(&usbhs_bdata);
|
|
|
+ overo_spi_init();
|
|
|
+ overo_init_smsc911x();
|
|
|
+ overo_display_init();
|
|
|
+ overo_init_led();
|
|
|
+ overo_init_keys();
|
|
|
+ omap_twl4030_audio_init("overo");
|
|
|
+
|
|
|
+ /* Ensure SDRC pins are mux'd for self-refresh */
|
|
|
+ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
|
|
|
+ omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
|
|
|
+
|
|
|
+ ret = gpio_request_one(OVERO_GPIO_W2W_NRESET, GPIOF_OUT_INIT_HIGH,
|
|
|
+ "OVERO_GPIO_W2W_NRESET");
|
|
|
+ if (ret == 0) {
|
|
|
+ gpio_export(OVERO_GPIO_W2W_NRESET, 0);
|
|
|
+ gpio_set_value(OVERO_GPIO_W2W_NRESET, 0);
|
|
|
+ udelay(10);
|
|
|
+ gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
|
|
|
+ } else {
|
|
|
+ pr_err("could not obtain gpio for OVERO_GPIO_W2W_NRESET\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios));
|
|
|
+ if (ret) {
|
|
|
+ pr_err("%s: could not obtain BT gpios\n", __func__);
|
|
|
+ } else {
|
|
|
+ gpio_export(OVERO_GPIO_BT_XGATE, 0);
|
|
|
+ gpio_export(OVERO_GPIO_BT_NRESET, 0);
|
|
|
+ gpio_set_value(OVERO_GPIO_BT_NRESET, 0);
|
|
|
+ mdelay(6);
|
|
|
+ gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = gpio_request_one(OVERO_GPIO_USBH_CPEN, GPIOF_OUT_INIT_HIGH,
|
|
|
+ "OVERO_GPIO_USBH_CPEN");
|
|
|
+ if (ret == 0)
|
|
|
+ gpio_export(OVERO_GPIO_USBH_CPEN, 0);
|
|
|
+ else
|
|
|
+ pr_err("could not obtain gpio for OVERO_GPIO_USBH_CPEN\n");
|
|
|
+}
|
|
|
+
|
|
|
+MACHINE_START(OVERO, "Gumstix Overo")
|
|
|
+ .atag_offset = 0x100,
|
|
|
+ .reserve = omap_reserve,
|
|
|
+ .map_io = omap3_map_io,
|
|
|
+ .init_early = omap35xx_init_early,
|
|
|
+ .init_irq = omap3_init_irq,
|
|
|
+ .handle_irq = omap3_intc_handle_irq,
|
|
|
+ .init_machine = overo_init,
|
|
|
+ .init_late = omap35xx_init_late,
|
|
|
+ .timer = &omap3_timer,
|
|
|
+ .restart = omap3xxx_restart,
|
|
|
+MACHINE_END
|