static int devkit8500_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* Regulators Linkage Done in _twldata */ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[1].gpio = gpio + TWL4030_GPIO_MAX + 1; gpio_leds[2].gpio = gpio + 2; gpio_leds[3].gpio = gpio + 15; DVI_PUP_GPIO = gpio + 7; /* if (gpio_request_one(DVI_PUP_GPIO, GPIOF_OUT_INIT_LOW, "DVI_PUP")) printk(KERN_ERR "DVI: unable to configure DVI_PUP %d\n", DVI_PUP_GPIO); else devkit8500_tfp410_pdata.power_down_gpio = DVI_PUP_GPIO; */ devkit8500_tfp410_pdata.power_down_gpio = DVI_PUP_GPIO; /* Register HDMI Transmitter */ platform_device_register(&devkit8500_tfp410_device); /* Register DVI Connector */ platform_device_register(&devkit8500_dvi_connector_device); /* Register TV Connector */ platform_device_register(&devkit8500_tv_connector_device); return 0; }
static int omap3stalker_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* * Most GPIOs are for USB OTG. Some are mostly sent to * the P2 connector; notably LEDA for the LCD backlight. */ /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, "EN_LCD_BKL"); /* gpio + 7 == DVI Enable */ gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI"); /* TWL4030_GPIO_MAX + 1 == ledB (out, mmc0) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; /* GPIO + 13 == ledsync (out, heartbeat) */ gpio_leds[3].gpio = gpio + 13; platform_device_register(&leds_gpio); return 0; }
static int omap3evm_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int r, lcd_bl_en; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* * Most GPIOs are for USB OTG. Some are mostly sent to * the P2 connector; notably LEDA for the LCD backlight. */ /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ lcd_bl_en = get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2 ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; r = gpio_request_one(gpio + TWL4030_GPIO_MAX, lcd_bl_en, "EN_LCD_BKL"); if (r) printk(KERN_ERR "failed to get/set lcd_bkl gpio\n"); /* gpio + 7 == DVI Enable */ gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI"); /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1; platform_device_register(&leds_gpio); return 0; }
static int devkit8000_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int ret; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */ devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0; ret = gpio_request_one(devkit8000_lcd_device.reset_gpio, GPIOF_OUT_INIT_LOW, "LCD_PWREN"); if (ret < 0) { devkit8000_lcd_device.reset_gpio = -EINVAL; printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n"); } /* gpio + 7 is "DVI_PD" (out, active low) */ dvi_panel.power_down_gpio = gpio + 7; return 0; }
static void __init omap3_pandora_legacy_init(void) { platform_device_register(&pandora_backlight); platform_device_register(&pandora_vwlan_device); omap_hsmmc_init(pandora_mmc3); omap_hsmmc_late_init(pandora_mmc3); pandora_wl1251_init(); }
static int beagle_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int r; mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active * high / others active low) * DVI reset GPIO is different between beagle revisions */ /* Valid for all -xM revisions */ if (cpu_is_omap3630()) { /* * gpio + 1 on Xm controls the TFP410's enable line (active low) * gpio + 2 control varies depending on the board rev as below: * P7/P8 revisions(prototype): Camera EN * A2+ revisions (production): LDO (DVI, serial, led blocks) */ r = gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW, "nDVI_PWR_EN"); if (r) pr_err("%s: unable to configure nDVI_PWR_EN\n", __func__); beagle_config.dvi_pd_gpio = gpio + 2; } else { /* * REVISIT: need ehci-omap hooks for external VBUS * power switch and overcurrent detect */ if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC")) pr_err("%s: unable to configure EHCI_nOC\n", __func__); } beagle_tfp410_pdata.power_down_gpio = beagle_config.dvi_pd_gpio; platform_device_register(&beagle_tfp410_device); platform_device_register(&beagle_dvi_connector_device); platform_device_register(&beagle_tv_connector_device); /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */ phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX; phy_data[0].vcc_polarity = beagle_config.usb_pwr_level; usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); return 0; }
static int zoom_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* Audio setup */ omap_twl4030_audio_data.jack_detect = gpio + 2; omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data); return 0; }
static int beagle_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int r; mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active * high / others active low) * DVI reset GPIO is different between beagle revisions */ /* Valid for all -xM revisions */ if (cpu_is_omap3630()) { /* * gpio + 1 on Xm controls the TFP410's enable line (active low) * gpio + 2 control varies depending on the board rev as below: * P7/P8 revisions(prototype): Camera EN * A2+ revisions (production): LDO (DVI, serial, led blocks) */ r = gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW, "nDVI_PWR_EN"); if (r) pr_err("%s: unable to configure nDVI_PWR_EN\n", __func__); r = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, "DVI_LDO_EN"); if (r) pr_err("%s: unable to configure DVI_LDO_EN\n", __func__); } else { /* * REVISIT: need ehci-omap hooks for external VBUS * power switch and overcurrent detect */ if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC")) pr_err("%s: unable to configure EHCI_nOC\n", __func__); } dvi_panel.power_down_gpio = beagle_config.reset_gpio; gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, "nEN_USB_PWR"); /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; return 0; }
static int zoom_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int ret; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable"); if (ret) pr_err("Failed to get LCD_PANEL_ENABLE_GPIO (gpio%d).\n", LCD_PANEL_ENABLE_GPIO); return ret; }
static int devkit8000_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */ devkit8000_lcd_pdata.enable_gpio = gpio + TWL4030_GPIO_MAX + 0; /* gpio + 7 is "DVI_PD" (out, active low) */ devkit8000_tfp410_pdata.power_down_gpio = gpio + 7; return 0; }
static int sdp3430_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { /* gpio + 0 is "mmc0_cd" (input/IRQ), * gpio + 1 is "mmc1_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; mmc[1].gpio_cd = gpio + 1; omap_hsmmc_late_init(mmc); /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "sub_lcd_en_bkl"); /* gpio + 15 is "sub_lcd_nRST" (output) */ gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST"); return 0; }
static int omap3evm_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int r, lcd_bl_en; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* * Most GPIOs are for USB OTG. Some are mostly sent to * the P2 connector; notably LEDA for the LCD backlight. */ /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ lcd_bl_en = get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2 ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; r = gpio_request_one(gpio + TWL4030_GPIO_MAX, lcd_bl_en, "EN_LCD_BKL"); if (r) printk(KERN_ERR "failed to get/set lcd_bkl gpio\n"); /* gpio + 7 == DVI Enable */ gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI"); /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1; platform_device_register(&leds_gpio); /* Enable VBUS switch by setting TWL4030.GPIO2DIR as output * for starting USB tranceiver */ #ifdef CONFIG_TWL4030_CORE if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { u8 val; twl_i2c_read_u8(TWL4030_MODULE_GPIO, &val, REG_GPIODATADIR1); val |= 0x04; /* TWL4030.GPIO2DIR BIT at GPIODATADIR1(0x9B) */ twl_i2c_write_u8(TWL4030_MODULE_GPIO, val, REG_GPIODATADIR1); } #endif return 0; }
static int omap3pandora_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int ret, gpio_32khz; /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ omap3pandora_mmc[0].gpio_cd = gpio + 0; omap3pandora_mmc[1].gpio_cd = gpio + 1; omap_hsmmc_late_init(omap3pandora_mmc); /* gpio + 13 drives 32kHz buffer for wifi module */ gpio_32khz = gpio + 13; ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz"); if (ret < 0) { pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); return -ENODEV; } return 0; }
static int omap3pandora_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int ret, gpio_32khz; omap3pandora_mmc[0].gpio_cd = gpio + 0; omap3pandora_mmc[1].gpio_cd = gpio + 1; omap_hsmmc_late_init(omap3pandora_mmc); gpio_32khz = gpio + 13; ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz"); if (ret < 0) { pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); return -ENODEV; } return 0; }
static int touchbook_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* REVISIT: need ehci-omap hooks for external VBUS * power switch and overcurrent detect */ gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"); /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ gpio_request_one(gpio + TWL4030_GPIO_MAX, GPIOF_OUT_INIT_LOW, "nEN_USB_PWR"); /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; return 0; }
static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int wlan_rst = gpio + 2; if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) { gpio_export(wlan_rst, 0); udelay(10); gpio_set_value_cansleep(wlan_rst, 0); udelay(10); gpio_set_value_cansleep(wlan_rst, 1); } else { pr_err("CM-T35: could not obtain gpio for WiFi reset\n"); } /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); return 0; }
static int igep_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int ret; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE) ret = gpio_request_one(gpio + TWL4030_GPIO_MAX + 1, GPIOF_OUT_INIT_HIGH, "gpio-led:green:d1"); if (ret == 0) gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0); else pr_warning("IGEP: Could not obtain gpio GPIO_LED1_GREEN\n"); #else igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; #endif if (machine_is_igep0030()) return 0; /* * REVISIT: need ehci-omap hooks for external VBUS * power switch and overcurrent detect */ igep2_twl_gpios[0].gpio = gpio + 1; /* TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN (out, active low) */ igep2_twl_gpios[1].gpio = gpio + TWL4030_GPIO_MAX; ret = gpio_request_array(igep2_twl_gpios, ARRAY_SIZE(igep2_twl_gpios)); if (ret < 0) pr_err("IGEP2: Could not obtain gpio for USBH_CPEN"); return 0; };