static int cosmo_gps_gpio_probe(struct platform_device *pdev) { int retval = 0; printk(KERN_INFO "cosmo_gps_gpio_probe\n"); omap_mux_init_gpio(GPIO_GPS_PWR_ON, OMAP_PIN_OUTPUT); omap_mux_init_gpio(GPIO_GPS_RESET_N, OMAP_PIN_OUTPUT); omap_mux_init_gpio(GPIO_GPS_LNA_SD, OMAP_PIN_OUTPUT); retval = gpio_request(GPIO_GPS_PWR_ON, "GPS power on GPIO"); if (retval) { printk(KERN_ERR "cosmo_gps_gpio_probe: GPIO %d is already used!\n", GPIO_GPS_PWR_ON); return retval; } retval = gpio_request(GPIO_GPS_RESET_N, "GPS reset GPIO"); if (retval) { printk(KERN_ERR "cosmo_gps_gpio_probe: GPIO %d is already used!\n", GPIO_GPS_RESET_N); return retval; } retval = gpio_request(GPIO_GPS_LNA_SD, "GPS extend LNA GPIO"); if (retval) { printk(KERN_ERR "cosmo_gps_gpio_probe: GPIO %d is already used!\n", GPIO_GPS_LNA_SD); return retval; } retval = device_create_file(&pdev->dev, &dev_attr_reset); if (retval) goto error; retval = device_create_file(&pdev->dev, &dev_attr_poweron); if (retval) goto error; return 0; error: printk(KERN_ERR "cosmo_gps_gpio_probe: Cannot create file desc.!\n"); device_remove_file(&pdev->dev, &dev_attr_reset); device_remove_file(&pdev->dev, &dev_attr_poweron); return retval; }
static void config_mux_mcbsp3(void) { /*Mux setting for GPIO164 McBSP3 */ #ifdef CONFIG_MACH_OMAP_FST_OMAP3_127x omap_mux_init_gpio(McBSP3_BT_GPIO, OMAP_PIN_OUTPUT); #endif return; }
static void __init board_smc91x_init(void) { if (is_gpmc_muxed()) board_smc91x_data.flags |= GPMC_MUX_ADD_DATA; omap_mux_init_gpio(board_smc91x_data.gpio_irq, OMAP_PIN_INPUT); gpmc_smc91x_init(&board_smc91x_data); }
static void __init am3517_evm_display_init(void) { int r; omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP); omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN); omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN); r = gpio_request_array(am3517_evm_dss_gpios, ARRAY_SIZE(am3517_evm_dss_gpios)); if (r) { printk(KERN_ERR "failed to get DSS panel control GPIOs\n"); return; } printk(KERN_INFO "Display initialized successfully\n"); }
static int hub_gps_gpio_probe(struct platform_device *pdev) { int retval = 0; printk(KERN_INFO "hub_gps_gpio_probe\n"); omap_mux_init_gpio(GPIO_GPS_PWR_ON, OMAP_PIN_OUTPUT); omap_mux_init_gpio(GPIO_GPS_RESET_N, OMAP_PIN_OUTPUT); retval = gpio_request(GPIO_GPS_PWR_ON, "GPS power on GPIO"); if (retval) { printk(KERN_ERR "hub_gps_gpio_probe: GPIO %d is already used!\n", GPIO_GPS_PWR_ON); return retval; } retval = gpio_request(GPIO_GPS_RESET_N, "GPS reset GPIO"); if (retval) { printk(KERN_ERR "hub_gps_gpio_probe: GPIO %d is already used!\n", GPIO_GPS_RESET_N); return retval; } retval = device_create_file(&pdev->dev, &dev_attr_reset); if (retval) goto error; retval = device_create_file(&pdev->dev, &dev_attr_poweron); if (retval) goto error; /* LGE_CHANGE_S, [email protected], 2011-05-08, after root -> system, fix for first try dead */ gpio_direction_output(GPIO_GPS_PWR_ON, 0); gpio_direction_output(GPIO_GPS_RESET_N, 1); //gpio_direction_output(GPIO_GPS_RESET_N, 0); /* LGE_CHANGE_E, [email protected], 2011-05-08, after root -> system, fix for first try dead */ return 0; error: printk(KERN_ERR "hub_gps_gpio_probe: Cannot create file desc.!\n"); device_remove_file(&pdev->dev, &dev_attr_reset); device_remove_file(&pdev->dev, &dev_attr_poweron); return retval; }
static void __init am3517_evm_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); am3517_evm_i2c_init(); platform_add_devices(am3517_evm_devices, ARRAY_SIZE(am3517_evm_devices)); omap_serial_init(); /* Configure GPIO for EHCI port */ omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); usb_ehci_init(&ehci_pdata); am3517_evm_hecc_init(&am3517_evm_hecc_pdata); clk_add_alias("master", "dm644x_ccdc", "master", &vpfe_capture_dev.dev); clk_add_alias("slave", "dm644x_ccdc", "slave", &vpfe_capture_dev.dev); /* DSS */ am3517_evm_display_init(); /* RTC - S35390A */ am3517_evm_rtc_init(); i2c_register_board_info(1, am3517evm_i2c1_boardinfo, ARRAY_SIZE(am3517evm_i2c1_boardinfo)); /*Ethernet*/ am3517_evm_ethernet_init(&am3517_evm_emac_pdata); /* MUSB */ am3517_evm_musb_init(); /* TSC 2004 */ omap_mux_init_gpio(65, OMAP_PIN_INPUT_PULLUP); am3517evm_tsc_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_TSC2004_IRQ); i2c_register_board_info(1, am3517evm_tsc_i2c_boardinfo, ARRAY_SIZE(am3517evm_tsc_i2c_boardinfo)); /* Init TCA6416 keypad */ tca6416_keypad_init_irq(); /* MMC init function */ omap2_hsmmc_init(mmc); }
static void __init omap_h4_init(void) { omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); omap_board_config = h4_config; omap_board_config_size = ARRAY_SIZE(h4_config); /* * Make sure the serial ports are muxed on at this point. * You have to mux them off in device drivers later on * if not needed. */ #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP); omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP); omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP); omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); if (omap_has_menelaus()) { omap_mux_init_signal("sdrc_a14.gpio0", OMAP_PULL_ENA | OMAP_PULL_UP); omap_mux_init_signal("vlynq_rx0.gpio_15", 0); omap_mux_init_signal("gpio_98", 0); row_gpios[5] = 0; col_gpios[2] = 15; col_gpios[6] = 18; } else { omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP); omap_mux_init_signal("gpio_100", 0); omap_mux_init_signal("gpio_98", 0); } omap_mux_init_signal("gpio_90", 0); omap_mux_init_signal("gpio_91", 0); omap_mux_init_signal("gpio_36", 0); omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); omap_mux_init_signal("gpio_97", 0); #endif i2c_register_board_info(1, h4_i2c_board_info, ARRAY_SIZE(h4_i2c_board_info)); platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); omap2_usbfs_init(&h4_usb_config); omap_serial_init(); h4_init_flash(); }
static void __init omap3_beagle_init_rev(void) { int ret; u16 beagle_rev = 0; omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP); omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP); omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP); ret = gpio_request_array(omap3_beagle_rev_gpios, ARRAY_SIZE(omap3_beagle_rev_gpios)); if (ret < 0) { printk(KERN_ERR "Unable to get revision detection GPIO pins\n"); omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN; return; } beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1) | (gpio_get_value(173) << 2); gpio_free_array(omap3_beagle_rev_gpios, ARRAY_SIZE(omap3_beagle_rev_gpios)); switch (beagle_rev) { case 7: printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n"); omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX; break; case 6: printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n"); omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3; break; case 5: printk(KERN_INFO "OMAP3 Beagle Rev: C4\n"); omap3_beagle_version = OMAP3BEAGLE_BOARD_C4; break; case 0: printk(KERN_INFO "OMAP3 Beagle Rev: xM\n"); omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; break; default: printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev); omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN; } }
static void __init omap3_evm_init(void) { omap3_evm_get_revision(); omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_evm_i2c_init(); platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); spi_register_board_info(omap3evm_spi_board_info, ARRAY_SIZE(omap3evm_spi_board_info)); omap_serial_init(); if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { /* enable EHCI VBUS using GPIO22 */ omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS"); gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0); gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1); /* Select EHCI port on main board */ omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); /* setup EHCI phy reset config */ omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); ehci_pdata.reset_gpio_port[1] = 21; /* EVM REV >= E can supply 500mA with EXTVBUS programming */ musb_board_data.power = 500; musb_board_data.extvbus = 1; } else { /* setup EHCI phy reset on MDC */ omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); ehci_pdata.reset_gpio_port[1] = 135; } usb_musb_init(&musb_board_data); usb_ehci_init(&ehci_pdata); ads7846_dev_init(); omap3evm_init_smsc911x(); omap3_evm_display_init(); }
static void __init omap4_panda_display_init(void) { omap_display_init(&omap4_panda_dss_data); /* * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and * later have external pull up on the HDMI I2C lines */ if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2) omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP); else omap_hdmi_init(0); omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT); omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT); omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN); }
static int beagle_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { int r; if (beagle_config.mmc1_gpio_wp != -EINVAL) omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap2_hsmmc_init(mmc); /* link regulators to MMC adapters */ beagle_vmmc1_supply.dev = mmc[0].dev; beagle_vsim_supply.dev = mmc[0].dev; /* * 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__); } beagle_dvi_device.reset_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; }
// Anvoi, 2011/12/14, Porting Light sensor driver to ICS static void omap4_als_init(void) { #ifdef CONFIG_INPUT_MAX44007 /* max44007 gpio */ printk("MAX44007: Pulling up IRQ line\n"); omap_mux_init_gpio(GPIO_MAX44007_IRQ, \ OMAP_PIN_INPUT_PULLUP); #endif }
static void __init omap_zoom_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); zoom_peripherals_init(); zoom_debugboard_init(); omap_mux_init_gpio(64, OMAP_PIN_OUTPUT); usb_ehci_init(&ehci_pdata); }
static void __init omap3_evm_init(void) { omap3_evm_get_revision(); omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_evm_i2c_init(); platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); spi_register_board_info(omap3evm_spi_board_info, ARRAY_SIZE(omap3evm_spi_board_info)); omap_serial_init(); #ifdef CONFIG_NOP_USB_XCEIV /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ usb_nop_xceiv_register(); #endif if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { /* enable EHCI VBUS using GPIO22 */ omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS"); gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0); gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1); /* Select EHCI port on main board */ omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); /* setup EHCI phy reset config */ omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); ehci_pdata.reset_gpio_port[1] = 21; } else { /* setup EHCI phy reset on MDC */ omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); ehci_pdata.reset_gpio_port[1] = 135; } usb_musb_init(); usb_ehci_init(&ehci_pdata); ads7846_dev_init(); omap3evm_init_smsc911x(); }
static int tr16c0_archos_demux_i2c(int demux) { //int v = omap_readl(0x4a100604); pr_debug("%s:%d\n", __func__, demux); if (demux) { // disable irq pull up. omap_mux_init_gpio(irq_gpio, OMAP_PIN_INPUT); // switch back i2c lines to gpio mode gpio_request(i2c4_scl_gpio, "i2c4_scl_gpio"); gpio_request(i2c4_sda_gpio, "i2c4_sda_gpio"); omap_mux_init_gpio(i2c4_scl_gpio, OMAP_PIN_OUTPUT); omap_mux_init_gpio(i2c4_sda_gpio, OMAP_PIN_OUTPUT); gpio_direction_output(i2c4_scl_gpio, 0); gpio_direction_output(i2c4_sda_gpio, 0); // force low level. gpio_set_value(i2c4_scl_gpio, 0); gpio_set_value(i2c4_sda_gpio, 0); // disable omap internal pull ups // omap_writel(v & ~(1 << 28), 0x4a100604); } else { // enable omap internal pull ups // omap_writel(v | (1 << 28), 0x4a100604); // put back irq pull up. omap_mux_init_gpio(irq_gpio, OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); gpio_free(i2c4_scl_gpio); gpio_free(i2c4_sda_gpio); // mux back to i2c lines. omap_mux_init_signal("i2c4_scl.i2c4_scl", OMAP_PIN_INPUT); omap_mux_init_signal("i2c4_sda.i2c4_sda", OMAP_PIN_INPUT); } return 0; }
static void ctw6120_dev_init(void) { if (gpio_request(VAR_SOM_OM3X_TS_GPIO, "CTW6120 data") < 0) printk(KERN_ERR "can't get CTW6120 data GPIO\n"); omap_mux_init_gpio(VAR_SOM_OM3X_TS_GPIO, OMAP_PIN_INPUT); gpio_direction_input(VAR_SOM_OM3X_TS_GPIO); }
static void __init am3517_evm_display_init(void) { int r; omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP); omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN); omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN); /* * Enable GPIO 182 = LCD Backlight Power */ r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr"); if (r) { printk(KERN_ERR "failed to get lcd_backlight_pwr\n"); return; } gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1); /* * Enable GPIO 181 = LCD Panel PWM */ r = gpio_request(LCD_PANEL_PWM, "lcd_pwm"); if (r) { printk(KERN_ERR "failed to get lcd_pwm\n"); goto err_1; } gpio_direction_output(LCD_PANEL_PWM, 1); /* * Enable GPIO 176 = LCD Panel Power enable pin */ r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr"); if (r) { printk(KERN_ERR "failed to get lcd_panel_pwr\n"); goto err_2; } gpio_direction_output(LCD_PANEL_PWR, 1); printk(KERN_INFO "Display initialized successfully\n"); return; err_2: gpio_free(LCD_PANEL_PWM); err_1: gpio_free(LCD_PANEL_BKLIGHT_PWR); }
static void __init omap_msecure_init(void) { int err; /* setup msecure line as GPIO for RTC accesses */ omap_mux_init_gpio(GPIO_MSECURE, OMAP_PIN_OUTPUT); err = gpio_request_one(GPIO_MSECURE, GPIOF_OUT_INIT_HIGH, "msecure"); if (err < 0) pr_err("Failed to request GPIO %d, error %d\n", GPIO_MSECURE, err); }
void __init omap4_panda_display_init(void) { int r; r = omap4_panda_dvi_init(); if (r) pr_err("error initializing panda DVI\n"); omap_display_init(&omap4_panda_dss_data); if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2) omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP); else omap_hdmi_init(0); omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT); omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT); omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN); }
static void omap_4430sdp_display_init(void) { int r; /* Enable LCD2 by default (instead of Pico DLP) */ r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, "display_sel"); if (r) pr_err("%s: Could not get display_sel GPIO\n", __func__); sdp4430_lcd_init(); sdp4430_hdmi_mux_init(); sdp4430_picodlp_init(); omap_display_init(&sdp4430_dss_data); omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT); omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT); omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN); }
static void omap4_tablet_wifi_mux_init(void) { omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | OMAP_PIN_OFF_WAKEUPENABLE); omap_mux_init_gpio(GPIO_WIFI_PMENA, OMAP_PIN_OUTPUT); omap_mux_init_gpio(GPIO_WIFI_PWEN, OMAP_PIN_OUTPUT); omap_mux_init_signal("uart2_cts.sdmmc3_clk", OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("uart2_rts.sdmmc3_cmd", OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("uart2_rx.sdmmc3_dat0", OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("uart2_tx.sdmmc3_dat1", OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("abe_mcbsp1_dx.sdmmc3_dat2", OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("abe_mcbsp1_fsx.sdmmc3_dat3", OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP); }
static void __init rx51_init_tsc2005(void) { int r; omap_mux_init_gpio(RX51_TSC2005_RESET_GPIO, OMAP_PIN_OUTPUT); omap_mux_init_gpio(RX51_TSC2005_IRQ_GPIO, OMAP_PIN_INPUT_PULLUP); r = gpio_request_array(rx51_tsc2005_gpios, ARRAY_SIZE(rx51_tsc2005_gpios)); if (r < 0) { printk(KERN_ERR "tsc2005 board initialization failed\n"); tsc2005_pdata.esd_timeout_ms = 0; return; } tsc2005_pdata.set_reset = rx51_tsc2005_set_reset; rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq = gpio_to_irq(RX51_TSC2005_IRQ_GPIO); }
/** * @brief omap3stalkerdc_gpio_config - GPIO configuration for * GPIO 98 * * @return result of operation - 0 is success */ static int omap3stalkerdc_gpio_config(void) { omap_mux_init_gpio(GPIO_VID_DEC_RES, OMAP_PIN_OUTPUT); if (gpio_request(GPIO_VID_DEC_RES, "vid-dec reset") < 0) { printk(KERN_ERR "failed to get GPIO_VID_DEC_RES\n"); return -EINVAL; } gpio_direction_output(GPIO_VID_DEC_RES, 1); return 0; }
static void __init omap3_beagle_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_beagle_init_rev(); if (gpio_is_valid(beagle_config.mmc1_gpio_wp)) omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); mmc[0].caps = beagle_config.mmc_caps; omap_hsmmc_init(mmc); omap3_beagle_i2c_init(); gpio_buttons[0].gpio = beagle_config.usr_button_gpio; platform_add_devices(omap3_beagle_devices, ARRAY_SIZE(omap3_beagle_devices)); if (gpio_is_valid(beagle_config.dvi_pd_gpio)) omap_mux_init_gpio(beagle_config.dvi_pd_gpio, OMAP_PIN_OUTPUT); omap_display_init(&beagle_dss_data); omap_serial_init(); omap_sdrc_init(mt46h32m32lf6_sdrc_params, mt46h32m32lf6_sdrc_params); usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); usb_musb_init(NULL); usbhs_init(&usbhs_bdata); board_nand_init(omap3beagle_nand_partitions, ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, NAND_BUSWIDTH_16, NULL); omap_twl4030_audio_init("omap3beagle", NULL); /* Ensure msecure is mux'd to be able to set the RTC. */ omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); /* 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); pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); }
static void omap4_tablet_wifi_mux_init(void) { omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | OMAP_PIN_OFF_WAKEUPENABLE); omap_mux_init_gpio(GPIO_WIFI_PMENA, OMAP_PIN_OUTPUT); omap_mux_init_signal("sdmmc5_cmd.sdmmc5_cmd", OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk", OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0", OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1", OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2", OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3", OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); }
static void remux_regulator_gpio(int gpio) { switch (gpio) { default: omap_mux_init_gpio(gpio, OMAP_PIN_INPUT|OMAP_PIN_OUTPUT); break; case 104: omap_mux_init_signal("gpmc_ncs7.gpio_104", OMAP_PIN_INPUT|OMAP_PIN_OUTPUT); break; case GPIO_VCC_PWRON: case GPIO_1V8_PWRON: /* These signals control voltages that are needed after warm reset, make sure, they are pulled high */ omap_mux_init_gpio(gpio, OMAP_PIN_INPUT_PULLUP|OMAP_PIN_OUTPUT); break; } }
static void fidji_mmc_init(void) { u32 reg; /* MMC2 CD and CLKIN */ omap_mux_init_signal("sdmmc2_clkin", OMAP_PIN_INPUT); /* * MMC2 has been designed to be used with a level shifter * but we are NOT using anyone. */ reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1); reg |= OMAP2_MMCSDIO2ADPCLKISEL; omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1); /* MMC1 CD and WP */ omap_mux_init_gpio(GPIO_MMC1_CD, OMAP_PIN_INPUT); omap_mux_init_gpio(GPIO_MMC1_WP, OMAP_PIN_INPUT); omap2_hsmmc_init(mmc_rev2); }
static void __init rhino_init(void) { /* Initialize MUX overrides */ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); /* Initialize I2C lines */ rhino_i2c_init(); /* Add all platform devices */ platform_add_devices(rhino_devices, ARRAY_SIZE(rhino_devices)); /* Initialize the serial device */ omap_serial_init(); /* Configure GPIO for EHCI port */ omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); usb_ehci_init(&ehci_pdata); rhino_hecc_init(&rhino_hecc_pdata); /* Initialize the NAND flash */ board_nand_init(rhino_nand_partitions, ARRAY_SIZE(rhino_nand_partitions), 0, NAND_BUSWIDTH_16); /* Configure the RTC */ omap_mux_init_gpio(GPIO_RTCDS1390_IRQ, OMAP_PIN_INPUT_PULLDOWN); if (gpio_request(GPIO_RTCDS1390_IRQ, "rtcs35390a-irq") < 0) printk(KERN_WARNING "failed to request GPIO#%d\n", GPIO_RTCDS1390_IRQ); if (gpio_direction_input(GPIO_RTCDS1390_IRQ)) printk(KERN_WARNING "GPIO#%d cannot be configured as input\n", GPIO_RTCDS1390_IRQ); rhino_spi_board_info[0].irq = gpio_to_irq(GPIO_RTCDS1390_IRQ); /* Initialize SPI devices */ rhino_spi_init(); /* Initialize Ethernet */ rhino_ethernet_init(&rhino_emac_pdata); rhino_musb_init(); /* MMC init function */ omap2_hsmmc_init(mmc); }
/* Touchscreen */ static void omap_fidji_rohm_bu21023_init(void) { int ret; omap_mux_init_gpio(GPIO_TS_PENIRQ, OMAP_PIN_INPUT_PULLUP); ret = gpio_request(GPIO_TS_PENIRQ, "ROHM BU21023_pen_down"); if (ret < 0) { printk(KERN_ERR "Failed to request GPIO %d for ""ROHM BU21023 pen down IRQ\n", GPIO_TS_PENIRQ); return; } gpio_direction_input(GPIO_TS_PENIRQ); }
static void __init omap3_beagle_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_beagle_i2c_init(); printk(KERN_INFO "*************INIT I2C**************\n"); platform_add_devices(omap3_beagle_devices, ARRAY_SIZE(omap3_beagle_devices)); omap_serial_init(); // omap_mux_init_gpio(170, OMAP_PIN_INPUT); // gpio_request(170, "DVI_nPD"); // /* REVISIT leave DVI powered down until it's needed ... */ // gpio_direction_output(170, true); //added by haolong to fix reset io of smsc9514, 2012/04/10------- printk(KERN_ERR "#########pulldown gpio 40#######\n"); if(omap_mux_init_gpio(40, OMAP_PIN_OUTPUT) < 0) { printk(KERN_ERR "Unable to mux HUB_RST\n"); } if (gpio_request(40, "HUB_RST") < 0) { printk(KERN_ERR "Unable to get HUB_RST GPIO\n"); } gpio_direction_output(40, 0); //------------------------------------------------------- usb_musb_init(); usb_ehci_init(&ehci_pdata); omap3beagle_flash_init(); /* 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); //--------------------------20111121 modified by haolong--------------------- // if (gpio_request(129, "DVI reset") < 0) { // printk(KERN_ERR "Unable to get DVI reset GPIO\n"); // return; // } // gpio_direction_output(129, 1); //------------------------------------------------------------------------ //2012/04/17 modified by haolong omap_mux_set_gpio(OMAP_MUX_MODE4, 15); // if(omap_mux_init_gpio(15, OMAP_PIN_OUTPUT) < 0) // { // printk(KERN_ERR "Unable to mux GPIO15_IRQ\n"); // } // if (gpio_request(15, "GPIO15_IRQ") < 0) { // printk(KERN_ERR "Unable to get IRQ GPIO\n"); // } // gpio_direction_output(15, 1); //--------------------------- }