static int cpcap_audio_probe(struct platform_device *pdev) { int rc; pr_debug("%s\n", __func__); cpcap = platform_get_drvdata(pdev); BUG_ON(!cpcap); pdata = pdev->dev.platform_data; BUG_ON(!pdata); if (pdata->speaker_gpio >= 0) { tegra_gpio_enable(pdata->speaker_gpio); rc = gpio_request(pdata->speaker_gpio, "speaker"); if (rc) { pr_err("%s: could not get speaker GPIO %d: %d\n", __func__, pdata->speaker_gpio, rc); goto fail1; } } if (pdata->headset_gpio >= 0) { tegra_gpio_enable(pdata->headset_gpio); rc = gpio_request(pdata->headset_gpio, "headset"); if (rc) { pr_err("%s: could not get headset GPIO %d: %d\n", __func__, pdata->headset_gpio, rc); goto fail2; } } pdata->state->cpcap = cpcap; if (cpcap_audio_init(pdata->state, pdata->regulator)) goto fail3; cpcap->h2w_new_state = &cpcap_audio_callback; rc = misc_register(&cpcap_audio_ctl); if (rc < 0) { pr_err("%s: failed to register misc device: %d\n", __func__, rc); goto fail3; } return rc; fail3: if (pdata->headset_gpio >= 0) gpio_free(pdata->headset_gpio); fail2: if (pdata->headset_gpio >= 0) tegra_gpio_disable(pdata->headset_gpio); if (pdata->speaker_gpio >= 0) gpio_free(pdata->speaker_gpio); fail1: if (pdata->speaker_gpio >= 0) tegra_gpio_disable(pdata->speaker_gpio); return rc; }
static int cardhu_dsi_panel_disable(void) { int err; err = 0; if (is_panel_219) { gpio_free(cardhu_dsi_219_pnl_reset); gpio_free(cardhu_bl_enb); gpio_free(cardhu_bl_pwm); gpio_free(cardhu_lvds_shutdown); } else if (is_panel_218) { gpio_free(cardhu_dsi_pnl_reset); } else if (is_panel_1506) { tegra_gpio_disable(e1506_bl_enb); gpio_free(e1506_bl_enb); tegra_gpio_disable(cardhu_dsi_pnl_reset); gpio_free(cardhu_dsi_pnl_reset); tegra_gpio_disable(e1506_panel_enb); gpio_free(e1506_panel_enb); tegra_gpio_disable(e1506_dsi_vddio); gpio_free(e1506_dsi_vddio); } return err; }
static void tegra_sdhci_pltfm_exit(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc)); struct tegra_sdhci_platform_data *plat; plat = pdev->dev.platform_data; if (gpio_is_valid(plat->wp_gpio)) { tegra_gpio_disable(plat->wp_gpio); gpio_free(plat->wp_gpio); } if (gpio_is_valid(plat->cd_gpio)) { free_irq(gpio_to_irq(plat->cd_gpio), host); tegra_gpio_disable(plat->cd_gpio); gpio_free(plat->cd_gpio); } if (gpio_is_valid(plat->power_gpio)) { tegra_gpio_disable(plat->power_gpio); gpio_free(plat->power_gpio); } clk_disable(pltfm_host->clk); clk_put(pltfm_host->clk); }
static int cardhu_dsi_panel_disable(void) { int err; err = 0; printk(KERN_INFO "DSI panel disable\n"); #if DSI_PANEL_219 tegra_gpio_disable(TEGRA_GPIO_PU2); gpio_free(TEGRA_GPIO_PU2); tegra_gpio_disable(TEGRA_GPIO_PH2); gpio_free(TEGRA_GPIO_PH2); tegra_gpio_disable(TEGRA_GPIO_PH0); gpio_free(TEGRA_GPIO_PH0); tegra_gpio_disable(TEGRA_GPIO_PL2); gpio_free(TEGRA_GPIO_PL2); #endif #if DSI_PANEL_218 tegra_gpio_disable(TEGRA_GPIO_PD2); gpio_free(TEGRA_GPIO_PD2); #endif return err; }
static int __devexit sdhci_tegra_remove(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_tegra *tegra_host = pltfm_host->priv; const struct tegra_sdhci_platform_data *plat = tegra_host->plat; int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); sdhci_remove_host(host, dead); if (gpio_is_valid(plat->wp_gpio)) { tegra_gpio_disable(plat->wp_gpio); gpio_free(plat->wp_gpio); } if (gpio_is_valid(plat->cd_gpio)) { free_irq(gpio_to_irq(plat->cd_gpio), host); tegra_gpio_disable(plat->cd_gpio); gpio_free(plat->cd_gpio); } if (gpio_is_valid(plat->power_gpio)) { tegra_gpio_disable(plat->power_gpio); gpio_free(plat->power_gpio); } clk_disable(pltfm_host->clk); clk_put(pltfm_host->clk); sdhci_pltfm_free(pdev); return 0; }
static void n1_panel_reconfig_pins(void) { /* LCD_nCS */ tegra_gpio_disable(TEGRA_GPIO_PN4); /* LCD_SCLK */ tegra_gpio_disable(TEGRA_GPIO_PZ4); }
void blue_pincfg_uartc_resume(void) { tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UART3_CTS_N, TEGRA_PUPD_NORMAL); tegra_gpio_disable(TEGRA_GPIO_PA1); tegra_gpio_disable(TEGRA_GPIO_PC0); tegra_gpio_disable(TEGRA_GPIO_PW6); tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UART3_RXD, TEGRA_PUPD_NORMAL); tegra_gpio_disable(TEGRA_GPIO_PW7); }
static int endeavor_s5k6a1gx03_power_on(void) { int ret; gpio_direction_output(FRONT_CAM_RST, 0); gpio_direction_output(CAM_SEL, 0); tegra_gpio_disable(CAM_I2C_SCL); tegra_gpio_disable(CAM_I2C_SDA); tegra_gpio_disable(CAM_MCLK); /* analog */ ret = regulator_enable(cam_a2v85_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_a2v85_en\n"); regulator_put(cam_a2v85_en); cam_a2v85_en = NULL; return ret; } ENR_usleep(200); /* vcm */ ret = regulator_enable(cam_vcm_2v85_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_vcm_2v85_en\n"); regulator_put(cam_vcm_2v85_en); cam_vcm_2v85_en = NULL; return ret; } ENR_usleep(200); /* IO */ ret = regulator_enable(cam_vddio_1v8_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_vddio_1v8_en\n"); regulator_put(cam_vddio_1v8_en); cam_vddio_1v8_en = NULL; return ret; } ENR_usleep(200); /* RSTN */ gpio_direction_output(FRONT_CAM_RST, 1); /* digital */ ret = regulator_enable(cam2_d1v2_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_d1v2_en\n"); regulator_put(cam_d1v2_en); cam_d1v2_en = NULL; return ret; } /* CAM SEL */ gpio_direction_output(CAM_SEL, 1); ENR_msleep(1); /* SPI send command to configure RAWCHIP here! */ rawchip_spi_clock_control(1); yushan_spi_write(0x0008, 0x7f); return 0; }
static void ventana_ssl3250a_exit(void) { gpio_set_value(CAMERA_FLASH_STRB_GPIO, 0); gpio_free(CAMERA_FLASH_STRB_GPIO); tegra_gpio_disable(CAMERA_FLASH_STRB_GPIO); gpio_set_value(CAMERA_FLASH_ACT_GPIO, 0); gpio_free(CAMERA_FLASH_ACT_GPIO); tegra_gpio_disable(CAMERA_FLASH_ACT_GPIO); }
static int endeavor_s5k6a1gx03_power_on(void) { int ret; gpio_direction_output(FRONT_CAM_RST_GPIO, 0); gpio_direction_output(CAM_SEL_GPIO, 0); tegra_gpio_disable(CAM_I2C_SCL_GPIO); tegra_gpio_disable(CAM_I2C_SDA_GPIO); tegra_gpio_disable(CAM_MCLK_GPIO); /* analog */ ret = regulator_enable(cam_a2v85_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_a2v85_en\n"); regulator_put(cam_a2v85_en); cam_a2v85_en = NULL; return ret; } ENR_usleep(200); /* vcm */ ret = regulator_enable(cam_vcm_2v85_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_vcm_2v85_en\n"); regulator_put(cam_vcm_2v85_en); cam_vcm_2v85_en = NULL; return ret; } ENR_usleep(200); /* IO */ ret = regulator_enable(cam_vddio_1v8_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_vddio_1v8_en\n"); regulator_put(cam_vddio_1v8_en); cam_vddio_1v8_en = NULL; return ret; } ENR_usleep(200); /* RSTN */ gpio_direction_output(FRONT_CAM_RST_GPIO, 1); /* digital */ ret = regulator_enable(cam2_d1v2_en); if (ret < 0) { pr_err("[CAM] couldn't enable regulator cam_d1v2_en\n"); regulator_put(cam_d1v2_en); cam_d1v2_en = NULL; return ret; } /* CAM SEL */ gpio_direction_output(CAM_SEL_GPIO, 1); ENR_msleep(1); return 0; }
static int enterprise_dsi_panel_disable(void) { tegra_gpio_disable(enterprise_dsi_panel_bl); gpio_free(enterprise_dsi_panel_bl); #if DSI_PANEL_RESET tegra_gpio_disable(enterprise_dsi_panel_reset); gpio_free(enterprise_dsi_panel_reset); #endif return 0; }
/*disable one-wire GPIO setting*/ static void disable_1wire() { int ret; tegra_gpio_disable(hi->pdata.rx_1wire_gpio); tegra_gpio_disable(hi->pdata.tx_1wire_gpio); ret = gpio_direction_output(hi->pdata.level_1wire_gpio,1); if (ret < 0) { printk(KERN_WARNING "[HS_UART_GPIO] %s: gpio_direction_input failed %d\n", __func__, ret); gpio_free(hi->pdata.level_1wire_gpio); return; } return; }
static int flounder_camera_init(void) { pr_debug("%s: ++\n", __func__); tegra_io_dpd_enable(&csia_io); tegra_io_dpd_enable(&csib_io); tegra_io_dpd_enable(&csie_io); tegra_gpio_disable(TEGRA_GPIO_PBB0); tegra_gpio_disable(TEGRA_GPIO_PCC0); #if IS_ENABLED(CONFIG_SOC_CAMERA_PLATFORM) platform_device_register(&flounder_soc_camera_device); #endif return 0; }
static int acer_backlight_init(struct device *dev) { /* TBR: disable gpio to change function pin */ tegra_gpio_disable(BL_PWM); INIT_DELAYED_WORK(&bl_en_gpio,acer_backlight_work_queue); return 0; }
static void sdhc_pinmux_config_gpio_disable(struct tegra_sdhci_host *host) { int i = 0; for (i = 0; i < host->nr_gpio_pins; i++) { tegra_gpio_disable(host->gpio_pins[i]); } }
static int star_cam_pmic_remove(struct platform_device *pdev) { // #if defined (CONFIG_KS1001) || defined (CONFIG_KS1103) //Main 8M //20111108 [email protected] if(regulator_vddio_mipi>0) regulator_put(regulator_vddio_mipi); if(cam_regulator_avdd_2v8>0) regulator_put(cam_regulator_avdd_2v8); if(cam_regulator_lvdd_2v8>0) regulator_put(cam_regulator_lvdd_2v8); if(cam_regulator_iovdd_1v8>0) regulator_put(cam_regulator_iovdd_1v8); //VGA if(cam_regulator_vt_avdd_2v8>0) regulator_put(cam_regulator_vt_avdd_2v8); if(cam_regulator_vt_iovdd_1v8>0) regulator_put(cam_regulator_vt_iovdd_1v8); #elif defined (CONFIG_LU6500) || defined (CONFIG_SU880) || defined (CONFIG_KU8800) || defined (CONFIG_LU8800) gpio_set_value(CAMERA_SUBPMIC_EN,0); tegra_gpio_disable(CAMERA_SUBPMIC_EN); // gpio_free(CAMERA_SUBPMIC_EN); // #endif // return 0; }
static int grouper_backlight_init(struct device *dev) { int ret = 0; bl_output = grouper_bl_output_measured; if (WARN_ON(ARRAY_SIZE(grouper_bl_output_measured) != 256)) pr_err("bl_output array does not have 256 elements\n"); tegra_gpio_disable(grouper_bl_pwm); /* ret = gpio_request(grouper_bl_enb, "backlight_enb"); if (ret < 0) return ret; ret = gpio_direction_output(grouper_bl_enb, 1); if (ret < 0) gpio_free(grouper_bl_enb); else tegra_gpio_enable(grouper_bl_enb); */ return ret; };
int __init star_vibrator_init(void) { tegra_gpio_enable(TEGRA_GPIO_PU4); tegra_gpio_disable(TEGRA_GPIO_PU3); platform_device_register(&star_vib_device); return 0; }
int enrc2u_wifi_sdclk (int enable){ printk("set sdio clk:%d\n",enable); if(enable) { tegra_gpio_disable(WIFI_SDIO_CLK); }else{ tegra_gpio_enable(WIFI_SDIO_CLK); gpio_direction_output(WIFI_SDIO_CLK, 0); } }
void ssd2825_bridge_enable_spi_pins_to_nomal(void) { int i; for (i = 0; i < ARRAY_SIZE(rgb_bridge_gpios_for_spi); i++) { tegra_pinmux_set_tristate( gpio_to_pingroup[rgb_bridge_gpios_for_spi[i].gpio], TEGRA_TRI_NORMAL); tegra_gpio_disable(rgb_bridge_gpios_for_spi[i].gpio); } }
static void __exit simdet_switch_exit(void) { printk(KERN_INFO "simdet_switch driver unregister\n"); platform_driver_unregister(&simdet_switch_driver); #if defined(CONFIG_ARCH_ACER_T30) // disable 3G_DISABLE PIN (TEGRA_GPIO_PI7) tegra_gpio_disable(TEGRA_GPIO_PI7); #endif }
static int enable_wifi_sdio_func(void) { int i = 0; for (i = 0; i < ARRAY_SIZE(wifi_sdio_gpio); i++) { tegra_gpio_disable(wifi_sdio_gpio[i]); gpio_free(wifi_sdio_gpio[i]); } return 0; }
static void ast_panel_early_suspend(struct early_suspend *h) { /* power down LCD, add use a black screen for HDMI */ if (num_registered_fb > 0) fb_blank(registered_fb[0], FB_BLANK_POWERDOWN); if (num_registered_fb > 1) fb_blank(registered_fb[1], FB_BLANK_NORMAL); tegra_gpio_disable(AST_HDMI_HPD); }
static void tegra_gpio_config(struct tegra_gpio_table* tab, int size) { int i; for (i = 0; i < size; i++) { if (tab[i].enable) { tegra_gpio_enable(tab[i].gpio); } else { tegra_gpio_disable(tab[i].gpio); } } }
static int enterprise_dsi_panel_disable(void) { #if DSI_PANEL_RESET if (kernel_1st_panel_init != true) { tegra_gpio_disable(enterprise_dsi_panel_reset); gpio_free(enterprise_dsi_panel_reset); } else kernel_1st_panel_init = false; #endif return 0; }
static void kai_backlight_exit(struct device *dev) { /* int ret; */ /*ret = gpio_request(kai_vdd_bl_enb, "backlight_enb");*/ gpio_set_value(kai_vdd_bl_enb, 0); #if 0 //Kai, 20120607, JimmySu remove unsed setting gpio_free(kai_vdd_bl_enb); tegra_gpio_disable(kai_vdd_bl_enb); #endif return; }
static int wm8994_i2c_remove(struct i2c_client *i2c) { struct wm8994 *wm8994 = i2c_get_clientdata(i2c); #if defined(CONFIG_ARCH_TEGRA) tegra_gpio_disable(GPIO_WM8994_LDO_EN); gpio_free(GPIO_WM8994_LDO_EN); #endif /* defined(CONFIG_ARCH_TEGRA) */ wm8994_device_exit(wm8994); return 0; }
static int vibrator_resume(struct platform_device *pdev) { struct vibrator *vib = platform_get_drvdata(pdev); D("vibrator_resume +++\n"); if(vib->pdata->pwm_gpio >= 0) { tegra_gpio_disable(vib->pdata->pwm_gpio); vib->pwm_duty = PLAYBACK_DUTY_US; } D("vibrator_resume ---\n"); return 0; }
int get_pin_value(unsigned int gpio, char *name) { int pin_value = 0; tegra_gpio_enable(gpio); gpio_request(gpio, name); gpio_direction_input(gpio); pin_value = gpio_get_value(gpio); gpio_free(gpio); tegra_gpio_disable(gpio); return pin_value; }
static void endeavortd_config_bt_on(void) { printk(KERN_INFO "[BT]== R ON ==\n"); tegra_gpio_disable(ENDEAVORTD_GPIO_BT_UART3_CTS); tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UART3_CTS_N, TEGRA_PUPD_NORMAL); tegra_gpio_disable(ENDEAVORTD_GPIO_BT_UART3_RTS); tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UART3_RTS_N, TEGRA_PUPD_NORMAL); tegra_gpio_disable(ENDEAVORTD_GPIO_BT_UART3_TX); tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UART3_TXD, TEGRA_PUPD_NORMAL); tegra_gpio_disable(ENDEAVORTD_GPIO_BT_UART3_RX); tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_UART3_RXD, TEGRA_PUPD_NORMAL); /* BT_RTS */ /* BT_CTS */ /* BT_TX */ /* BT_RX */ /* BT_HOST_WAKE */ tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_ULPI_DATA4, TEGRA_PUPD_PULL_UP); /* BT_CHIP_WAKE */ gpio_set_value(ENDEAVORTD_GPIO_BT_WAKE, 1); /* BT_SHUTDOWN_N */ gpio_set_value(ENDEAVORTD_GPIO_BT_SHUTDOWN_N, 0); mdelay(5); /* BT_SHUTDOWN_N */ gpio_set_value(ENDEAVORTD_GPIO_BT_SHUTDOWN_N, 1); mdelay(1); }