From 70c24111482775f1200e420355dc6bfc0651495f Mon Sep 17 00:00:00 2001 From: Ram Mohan Korukonda Date: Tue, 21 Feb 2012 16:56:47 +0530 Subject: [PATCH] msm: board-msm7627a-bt: Reduce the IO pad(VDD_PX2) leakage on 8x25 On 8x25 BT SYS RST pin is not based on GPIO Expander, due to which the API's which we are using are not configuring the GPIO properly while turning off Bahama. GPIOs from I/O expander being managed fully by apps proc, so they doesn't need tlmm config. CRs-fixed: 338053 Change-Id: Ia128855403cda26b68f2b749431d6c5d7419361e Signed-off-by: Ram Mohan Korukonda --- arch/arm/mach-msm/board-msm7627a-bt.c | 28 ++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-msm/board-msm7627a-bt.c b/arch/arm/mach-msm/board-msm7627a-bt.c index 644c085584f..a8ab81a233a 100644 --- a/arch/arm/mach-msm/board-msm7627a-bt.c +++ b/arch/arm/mach-msm/board-msm7627a-bt.c @@ -109,14 +109,36 @@ 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_direction_output(gpio_bt_sys_rest_en, 1); + + if (machine_is_msm7627a_evb()) { + 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); + } 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); + if (machine_is_msm7627a_evb()) { + 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); + } msleep(100); } }