From patchwork Mon Jul 26 08:30:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Lin <00601wayne@gmail.com> X-Patchwork-Id: 114223 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6Q8XEhB032210 for ; Mon, 26 Jul 2010 08:33:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870Ab0GZIdO (ORCPT ); Mon, 26 Jul 2010 04:33:14 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:46745 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737Ab0GZIdN (ORCPT ); Mon, 26 Jul 2010 04:33:13 -0400 Received: by mail-pv0-f174.google.com with SMTP id 7so4321238pvc.19 for ; Mon, 26 Jul 2010 01:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=I7Q+gzcmoXpXdmcqe3MvrrDjfK3OJwy1TUtsf+8K8B4=; b=VrGruJxGsSEDuGHnFptFRePjt+CstJUNSETc8ZTE8CwruRi3gECwd2RsBMAhV4L9sy ltJWqcBC8BPH4tTqvK9c4jC0GZd+Wgs8ajbKoVZp+UuUSKvyLJLJkH6kC7oBel8JWUk7 /LpZCg/+zSo76xOsM5tkk8fCJsgGtFVuPh6OE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=tWfEw3fsGBvbfPTb9ofpRZgqMCHnLO0qIQbNTXjOqJSiYtAqtnw3uasQoWc7cUhtEW e0VVB97/g172rGmVEXpq7/dhNE2QpF1dAwBxRUv2xigL4tDVWG080aUIV7TGUD24IsSb VeXzBUhXjapxa1w54VbNVefPkpOBLL0x2sXa8= Received: by 10.142.154.5 with SMTP id b5mr4851432wfe.209.1280133193440; Mon, 26 Jul 2010 01:33:13 -0700 (PDT) Received: from localhost.localdomain (60-250-56-66.HINET-IP.hinet.net [60.250.56.66]) by mx.google.com with ESMTPS id w27sm3846304wfd.5.2010.07.26.01.33.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Jul 2010 01:33:13 -0700 (PDT) From: Wayne Lin <00601wayne@gmail.com> To: linux-input@vger.kernel.org Cc: wayne Subject: [RFC 18/36] [Driver][Qualcomm 1070][WIFI] Turn on the Athros WIFI power Date: Mon, 26 Jul 2010 16:30:27 +0800 Message-Id: <1280133045-25945-18-git-send-email-wayne.lin@quantatw.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1280133045-25945-1-git-send-email-wayne.lin@quantatw.com> References: <1280133045-25945-1-git-send-email-wayne.lin@quantatw.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 26 Jul 2010 08:33:15 +0000 (UTC) diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c index 633514a..0d44c2d 100644 --- a/arch/arm/mach-msm/board-qsd8x50.c +++ b/arch/arm/mach-msm/board-qsd8x50.c @@ -1811,6 +1811,262 @@ exit: return; } +static void set_st15_voltage(void) +{ + struct vreg *vreg_pa; + struct vreg *vreg_gp1; + struct vreg *vreg_gp2; + struct vreg *vreg_ruim; + struct vreg *vreg_gp5; + struct vreg *vreg_rfrx2; + struct vreg *vreg_synth; + struct vreg *vreg_gp4; + int rc; + + vreg_pa = vreg_get(NULL, "pa"); + if (IS_ERR(vreg_pa)) { + printk(KERN_ERR "%s: vreg pa get failed (%ld)\n", + __func__, PTR_ERR(vreg_pa)); + return; + } + rc = vreg_set_level(vreg_pa, 2100); + if (rc) { + printk(KERN_ERR "%s: vreg pa set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_pa); + if (rc) { + printk(KERN_ERR "%s: vreg pa enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_gp1 = vreg_get(NULL, "gp1"); + if (IS_ERR(vreg_gp1)) { + printk(KERN_ERR "%s: vreg gp1 get failed (%ld)\n", + __func__, PTR_ERR(vreg_gp1)); + return; + } + rc = vreg_set_level(vreg_gp1, 1800); + if (rc) { + printk(KERN_ERR "%s: vreg gp1 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_gp1); + if (rc) { + printk(KERN_ERR "%s: vreg gp1 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_gp2 = vreg_get(NULL, "gp2"); + if (IS_ERR(vreg_gp2)) { + printk(KERN_ERR "%s: vreg gp2 get failed (%ld)\n", + __func__, PTR_ERR(vreg_gp2)); + return; + } + rc = vreg_set_level(vreg_gp2, 2850); + if (rc) { + printk(KERN_ERR "%s: vreg gp2 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_gp2); + if (rc) { + printk(KERN_ERR "%s: vreg gp2 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_ruim = vreg_get(NULL, "ruim"); + if (IS_ERR(vreg_ruim)) { + printk(KERN_ERR "%s: vreg ruim get failed (%ld)\n", + __func__, PTR_ERR(vreg_ruim)); + return; + } + rc = vreg_set_level(vreg_ruim, 2850); + if (rc) { + printk(KERN_ERR "%s: vreg ruim set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_ruim); + if (rc) { + printk(KERN_ERR "%s: vreg ruim enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_gp5 = vreg_get(NULL, "gp5"); + if (IS_ERR(vreg_gp5)) { + printk(KERN_ERR "%s: vreg gp5 get failed (%ld)\n", + __func__, PTR_ERR(vreg_gp5)); + return; + } + rc = vreg_set_level(vreg_gp5, 1800); + if (rc) { + printk(KERN_ERR "%s: vreg gp5 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_gp5); + if (rc) { + printk(KERN_ERR "%s: vreg gp5 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_rfrx2 = vreg_get(NULL, "rfrx2"); + if (IS_ERR(vreg_rfrx2)) { + printk(KERN_ERR "%s: vreg rfrx2 get failed (%ld)\n", + __func__, PTR_ERR(vreg_rfrx2)); + return; + } + rc = vreg_set_level(vreg_rfrx2, 2100); + if (rc) { + printk(KERN_ERR "%s: vreg rfrx2 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_rfrx2); + if (rc) { + printk(KERN_ERR "%s: vreg rfrx2 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_synth = vreg_get(NULL, "synt"); + if (IS_ERR(vreg_synth)) { + printk(KERN_ERR "%s: vreg synth get failed (%ld)\n", + __func__, PTR_ERR(vreg_synth)); + return; + } + rc = vreg_set_level(vreg_synth, 2850); + if (rc) { + printk(KERN_ERR "%s: vreg synth set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_synth); + if (rc) { + printk(KERN_ERR "%s: vreg synth enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_gp4 = vreg_get(NULL, "gp4"); + if (IS_ERR(vreg_gp4)) { + printk(KERN_ERR "%s: vreg gp4 get failed (%ld)\n", + __func__, PTR_ERR(vreg_gp4)); + return; + } + rc = vreg_set_level(vreg_gp4, 2850); + if (rc) { + printk(KERN_ERR "%s: vreg gp4 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_gp4); + if (rc) { + printk(KERN_ERR "%s: vreg gp4 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); +} + +static void enable_wlan_bt(void) +{ + struct vreg *vreg_gp6; + struct vreg *vreg_wlan; + struct vreg *vreg_gp3; + int rc; + + vreg_gp3 = vreg_get(NULL, "gp3"); + if (IS_ERR(vreg_gp3)) { + printk(KERN_ERR "%s: vreg gp3 get failed (%ld)\n", + __func__, PTR_ERR(vreg_gp3)); + return; + } + rc = vreg_set_level(vreg_gp3, 2600); + if (rc) { + printk(KERN_ERR "%s: vreg gp3 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_gp3); + if (rc) { + printk(KERN_ERR "%s: vreg gp3 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + vreg_wlan = vreg_get(NULL, "wlan"); + if (IS_ERR(vreg_wlan)) { + printk(KERN_ERR "%s: vreg wlan get failed (%ld)\n", + __func__, PTR_ERR(vreg_wlan)); + return; + } + rc = vreg_set_level(vreg_wlan, 2850); + if (rc) { + printk(KERN_ERR "%s: vreg wlan set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_wlan); + if (rc) { + printk(KERN_ERR "%s: vreg wlan enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + + gpio_tlmm_config(GPIO_CFG(26, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), GPIO_ENABLE); + gpio_set_value(26, 1); + msleep(100); + + vreg_gp6 = vreg_get(NULL, "gp6"); + if (IS_ERR(vreg_gp6)) { + printk(KERN_ERR "%s: vreg get failed (%ld)\n", + __func__, PTR_ERR(vreg_gp6)); + return; + } + rc = vreg_disable(vreg_gp6); + if (rc) { + printk(KERN_ERR "%s: vreg gp6 enable failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_set_level(vreg_gp6, 1800); + if (rc) { + printk(KERN_ERR "%s: vreg gp6 set level failed (%d)\n", + __func__, rc); + return; + } + rc = vreg_enable(vreg_gp6); + if (rc) { + printk(KERN_ERR "%s: vreg gp6 enable failed (%d)\n", + __func__, rc); + return; + } + msleep(100); + gpio_tlmm_config(GPIO_CFG(41, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), GPIO_ENABLE); + + gpio_set_value(41, 0); + msleep(100); + gpio_set_value(41, 1); +} + static void __attribute__((unused)) __init bt_power_init_st_1_5(void) { int rc; @@ -3245,7 +3501,11 @@ static void __init qsd8x50_init(void) qsd8x50_init_host(); qsd8x50_init_mmc(); if (machine_is_qsd8x50a_st1_5()) + { bt_power_init_st_1_5(); + /* power on wlan_bt module(AR6000) */ + enable_wlan_bt(); + } else bt_power_init(); audio_gpio_init(); @@ -3285,6 +3545,9 @@ static void __init qsd8x50_init(void) else platform_device_register(&keypad_device_surf); #endif + /* set regulator voltage */ + if (machine_is_qsd8x50a_st1_5()) + set_st15_voltage(); } static void __init qsd8x50_allocate_memory_regions(void)