All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wayne Lin <00601wayne@gmail.com>
To: linux-input@vger.kernel.org
Cc: wayne <wayne.lin@quantatw.com>
Subject: [RFC 18/36]  [Driver][Qualcomm 1070][WIFI] Turn on the Athros WIFI power
Date: Mon, 26 Jul 2010 16:30:27 +0800	[thread overview]
Message-ID: <1280133045-25945-18-git-send-email-wayne.lin@quantatw.com> (raw)
In-Reply-To: <1280133045-25945-1-git-send-email-wayne.lin@quantatw.com>

From: wayne <wayne.lin@quantatw.com>

---
 arch/arm/mach-msm/board-qsd8x50.c |  263 +++++++++++++++++++++++++++++++++++++
 1 files changed, 263 insertions(+), 0 deletions(-)

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)
-- 
1.7.0.4


  parent reply	other threads:[~2010-07-26  8:33 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26  8:30 [RFC 01/36] [Driver][Qualcomm 1070][LCD] Resolve the booting to Chromium issue Wayne Lin
2010-07-26  8:30 ` [RFC 02/36] [Driver][Qualcomm 1070][USB] Register GPIO#109 for USB analog switch configuration Wayne Lin
2010-07-26  8:30 ` [RFC 04/36] [Driver][Qualcomm 1070][EC_KB] Adding new qci keyboard driver Wayne Lin
2010-07-26  8:55   ` Dmitry Torokhov
2010-07-26 11:16     ` Trilok Soni
2010-07-26  8:59   ` Datta, Shubhrajyoti
2010-07-26  8:30 ` [RFC 05/36] [Driver][Qualcomm 1070][TPM] Enable TPM module Wayne Lin
2010-07-26  8:30 ` [RFC 06/36] [Driver][Qualcomm 1070][EC_BRG] EC Bridge driver porting Wayne Lin
2010-07-26  8:30 ` [RFC 07/36] [Driver][Qualcomm 1070][EC_BRG] Enable EC Bridge Wayne Lin
2010-07-26  8:30 ` [RFC 08/36] [Driver][Qualcomm 1070][EC_BAT] EC battery driver porting Wayne Lin
2010-07-26  8:30 ` [RFC 09/36] [Driver][Qualcomm 1070][EC_BAT] Enable EC battery Wayne Lin
2010-07-26  8:30 ` [RFC 11/36] [Driver][Qualcomm 1070][EC_G_SENSOR] Enable EC gravitation sensor Wayne Lin
2010-07-26  8:30 ` [RFC 12/36] [Driver][Qualcomm 1070][EC_C_SENSOR] EC compass sensor driver porting Wayne Lin
2010-07-26  8:30 ` [RFC 13/36] [Driver][Qualcomm 1070][EC_C_SENSOR] Enable EC compass sensor driver Wayne Lin
2010-07-26  8:30 ` [RFC 14/36] [Driver][Qualcomm 1070][CLOCK] Modify the AXI bus speed Wayne Lin
2010-07-26  8:30 ` [RFC 15/36] [Driver][Qualcomm 1070][VERSION] Adding version definition Wayne Lin
2010-07-26  8:30 ` [RFC 17/36] [Driver][Qualcomm 1070][WIFI/BT] Enable Athros WIFI driver Wayne Lin
2010-07-26  8:30 ` Wayne Lin [this message]
2010-07-26  8:30 ` [RFC 19/36] [Driver][Qualcomm 1070][BT] Enable Athros BT driver Wayne Lin
2010-07-26  8:30 ` [RFC 20/36] [Driver][Qualcomm 1070][WIFI/BT] Enable MMC1 dummy send read and configure Athros WIFI build-in driver Wayne Lin
2010-07-26  8:30 ` [RFC 21/36] Revert " [Driver][Qualcomm 1070][CLOCK] Modify the AXI bus speed" Wayne Lin
2010-07-26  8:46   ` Dmitry Torokhov
2010-07-26  8:30 ` [RFC 22/36] [Driver][Qualcomm 1070][CLOCK] Modify the AXI bus maximum speed Wayne Lin
2010-07-26  8:30 ` [RFC 23/36] [Driver][Qualcomm 1065][AT_COMMAND]retrieve message Wayne Lin
2010-07-26  8:30 ` [RFC 24/36] [Driver][Qualcomm 1070][CLOCK] Modify the AXI clock for 1.2Ghz Wayne Lin
2010-07-26  8:30 ` [RFC 25/36] [Driver][Qualcomm 1070][EC_BRG] Adding new EC bridge driver Wayne Lin
2010-07-26  8:30 ` [RFC 26/36] [Driver][Qualcomm 1070][EC_BL] New EC backlight driver porting Wayne Lin
2010-07-26  8:30 ` [RFC 27/36] [Driver][Qualcomm 1070][EC_BRG] Enable NuvoTon WPCE775X driver and disable WinBond WPCE775X driver Wayne Lin
2010-07-26  8:30 ` [RFC 28/36] [Driver][Qualcomm 1070][EC_BL] Enable QCI backlight driver Wayne Lin
2010-07-26  8:30 ` [RFC 29/36] [Driver][Qualcomm 1070][EC_BRG] Correct new EC bridge driver Makefile and Kconfig Wayne Lin
2010-07-26  8:30 ` [RFC 30/36] [Driver][Qualcomm 1070][EC_G_SENSOR] Enable EC gravitation sensor Wayne Lin
2010-07-26  8:30 ` [RFC 31/36] [Driver][Qualcomm 1070][VERSION] 0.1.1 Wayne Lin
2010-07-26  8:30 ` [RFC 32/36] [Driver][Qualcomm 1070][MMC] Enable MMC1 HW detection Wayne Lin
2010-07-26  8:30 ` [RFC 33/36] [Driver][Qualcomm 1070][VERSION] 0.1.2 Wayne Lin
2010-07-26  8:30 ` [RFC 34/36] [Driver][Qualcomm 1070][EC_BAT] Adding newer version battery driver Wayne Lin
2010-07-26  8:30 ` [RFC 35/36] [Driver][Qualcomm 1070][EC_BAT] Enable EC battery Wayne Lin
2010-07-26  8:30 ` [RFC 36/36] [Driver][Qualcomm 1070][VERSION] 0.2.0 Wayne Lin
2010-07-26  8:40   ` Premi, Sanjeev
2010-07-26  8:47   ` Premi, Sanjeev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280133045-25945-18-git-send-email-wayne.lin@quantatw.com \
    --to=00601wayne@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=wayne.lin@quantatw.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.