static int msm_bahama_setup_pcm_i2s(int mode) { int fm_state = 0, bt_state = 0; int rc = 0; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; fm_state = marimba_get_fm_status(&config); bt_state = marimba_get_bt_status(&config); switch (mode) { case BT_PCM_ON: case BT_PCM_OFF: if (!fm_state) rc = config_pcm(mode); break; case FM_I2S_ON: rc = config_i2s(mode); break; case FM_I2S_OFF: if (bt_state) rc = config_pcm(BT_PCM_ON); else rc = config_i2s(mode); break; default: rc = -EIO; pr_err("%s:Unsupported mode", __func__); } return rc; }
//Cellon modify start, Eagle.Yin, 2012/12/27 for debug WCN2243 code static int bt_set_gpio(int on) { int rc = 0; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; pr_debug("%s: Setting SYS_RST_PIN(%d) to %d\n", __func__, gpio_bt_sys_rest_en, on); if (on) { rc = gpio_tlmm_config(GPIO_CFG(gpio_bt_sys_rest_en, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_set_value(gpio_bt_sys_rest_en, 1); rc = gpio_direction_output(gpio_bt_sys_rest_en, 1); msleep(100); //Cellon modify end, Eagle.Yin, 2012/12/27 for debug WCN2243 code } else { if (!marimba_get_fm_status(&config) && !marimba_get_bt_status(&config)) { gpio_set_value_cansleep(gpio_bt_sys_rest_en, 0); rc = gpio_direction_input(gpio_bt_sys_rest_en); msleep(100); } } if (rc) pr_err("%s: BT sys_reset_en GPIO : Error", __func__); return rc; }
static int bt_set_gpio(int on) { int rc = 0; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; pr_debug("%s: Setting SYS_RST_PIN(%d) to %d\n", __func__, gpio_bt_sys_rest_en, on); if (on) { #if defined(CONFIG_QCT2243_V21) && defined(CONFIG_CPLD) cpld_gpio_write(gpio_bt_sys_rest_en, 1); #else if (machine_is_msm7627a_evb() || machine_is_msm8625_qrd7()) { rc = gpio_tlmm_config(GPIO_CFG(gpio_bt_sys_rest_en, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_set_value(gpio_bt_sys_rest_en, 1); } else { rc = gpio_direction_output(gpio_bt_sys_rest_en, 1); } #endif msleep(100); } else { if (!marimba_get_fm_status(&config) && !marimba_get_bt_status(&config)) { #if defined(CONFIG_QCT2243_V21) && defined(CONFIG_CPLD) cpld_gpio_write(gpio_bt_sys_rest_en, 0); #else if (machine_is_msm7627a_evb() || machine_is_msm8625_qrd7()) { gpio_set_value(gpio_bt_sys_rest_en, 0); rc = gpio_tlmm_config(GPIO_CFG( gpio_bt_sys_rest_en, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_ENABLE); } else { gpio_set_value_cansleep(gpio_bt_sys_rest_en, 0); rc = gpio_direction_input(gpio_bt_sys_rest_en); } #endif msleep(100); } } if (rc) pr_err("%s: BT sys_reset_en GPIO : Error", __func__); return rc; }
static int bt_set_gpio(int on) { int rc = 0; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; printk("%s : [dm] on=%d gpio_bt_sys_rest_en =%d \n",__func__,on,gpio_bt_sys_rest_en); if (on) { rc = gpio_direction_output(gpio_bt_sys_rest_en, 1); msleep(100); } else { if (!marimba_get_fm_status(&config) && !marimba_get_bt_status(&config)) { gpio_set_value_cansleep(gpio_bt_sys_rest_en, 0); rc = gpio_direction_input(gpio_bt_sys_rest_en); msleep(100); } } if (rc) pr_err("%s: BT sys_reset_en GPIO : Error", __func__); return rc; }
static int bt_set_gpio(int on) { int rc = 0; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; if (on) { rc = gpio_direction_output(BT_SYS_REST_EN, 1); msleep(100); } else { if (!marimba_get_fm_status(&config) && !marimba_get_bt_status(&config)) { gpio_set_value_cansleep(BT_SYS_REST_EN, 0); rc = gpio_direction_input(BT_SYS_REST_EN); msleep(100); } } if (rc) pr_err("%s: BT sys_reset_en GPIO : Error", __func__); return rc; }
static int bt_set_gpio(int on) { int rc = 0; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; #if defined (CONFIG_ARIMA_BT_DBG_INFO) if (on) { printk(KERN_INFO "[BT_DBG] - bt_set_gpio(), on, %d \n", on); } else { printk(KERN_INFO "[BT_DBG] - bt_set_gpio(), off, %d \n", on); } #endif if (on) { if (machine_is_msm7627a_evb() || machine_is_msm8625_qrd7()) { //+ murphy 2011.09.19 #if 1 //re-configure GPIO setting in case AMSS part is not executed okay printk(KERN_INFO "[BT_DBG] - bt_set_gpio(), on = %d, if cond exec \n", on); rc = gpio_tlmm_config(GPIO_CFG(gpio_bt_sys_rest_en, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_ENABLE); if (rc < 0) { printk(KERN_INFO "[BT_DBG] - GPIO 12 enable fail \n"); } else { printk(KERN_INFO "[BT_DBG] - GPIO 12 enable OK \n"); } gpio_set_value(gpio_bt_sys_rest_en, 1); #endif //- murphy 2011.09.19 } else { rc = gpio_direction_output(gpio_bt_sys_rest_en, 1); } #if defined (CONFIG_ARIMA_BT_DBG_INFO) printk(KERN_INFO "[BT_DBG] - bt_set_gpio(), msleep(%d) \n", 150); #endif msleep(150); //murphy 2011.11.07 } else { if (!marimba_get_fm_status(&config) && !marimba_get_bt_status(&config)) { if (machine_is_msm7627a_evb() || machine_is_msm8625_qrd7()) { gpio_set_value(gpio_bt_sys_rest_en, 0); rc = gpio_tlmm_config(GPIO_CFG( gpio_bt_sys_rest_en, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_ENABLE); } else { gpio_set_value_cansleep(gpio_bt_sys_rest_en, 0); rc = gpio_direction_input(gpio_bt_sys_rest_en); } //+ murphy 2012.08.14 //Fixed for BT CTS failed case - test_enableDisable //restore back to original sleep time to avoid unvisitable side effect at 2012.10.22 msleep(100); //msleep(75); //- murphy 2012.08.14 } } if (rc) pr_err("%s: BT sys_reset_en GPIO : Error", __func__); return rc; }