Wifi:Bt: add wifi & bt resources into rk3288 dts.
authorgwl <gwl@rock-chips.com>
Wed, 19 Mar 2014 03:23:53 +0000 (11:23 +0800)
committergwl <gwl@rock-chips.com>
Wed, 19 Mar 2014 03:24:04 +0000 (11:24 +0800)
arch/arm/boot/dts/rk3188-tb.dts
arch/arm/boot/dts/rk3288-tb.dts
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_gpio.c
include/linux/rfkill-wlan.h
net/rfkill/rfkill-wlan.c

index a9b5be87f7d3d5ed2f86eec05f2dff9eb62376e6..50592699705f0e1978827aef0beceec2b1df90dd 100755 (executable)
                
        supports-highspeed;             
        supports-sdio;
-       cap-sdio-irq;
+       //cap-sdio-irq;
        status = "okay";
 };
 
index 5a761dff88e822a9cc16381d00443c6e14a812eb..da2b20bf991c63937fcdb515f8085bc0f60519f3 100755 (executable)
@@ -8,6 +8,39 @@
                status = "okay";
        };
 
+    wireless-wlan {
+        compatible = "wlan-platdata";
+
+        wifi_chip_type = "";
+        sdio_vref = <28000>;
+
+        //power_ctrl_by_pmu;
+        pmu_regulator = "act_ldo3";
+        pmu_enable_level = <1>; //1->HIGH, 0->LOW
+
+        WIFI,poweren_gpio = <&gpio4 GPIO_D4 GPIO_ACTIVE_HIGH>;
+        WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
+        //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
+
+        status = "okay";
+    };
+
+    wireless-bluetooth {
+        compatible = "bluetooth-platdata";
+
+        uart_rts_gpios = <&gpio4 GPIO_C3 GPIO_ACTIVE_LOW>;
+        pinctrl-names = "default","rts_gpio";
+        pinctrl-0 = <&uart0_rts>;
+        pinctrl-1 = <&uart0_rts_gpio>;
+
+        BT,power_gpio = <&gpio4 GPIO_D3 GPIO_ACTIVE_HIGH>;
+        BT,reset_gpio = <&gpio4 GPIO_D5 GPIO_ACTIVE_HIGH>;
+        BT,wake_gpio = <&gpio4 GPIO_D2 GPIO_ACTIVE_HIGH>;
+        BT,wake_host_irq = <&gpio4 GPIO_D7 GPIO_ACTIVE_LOW>;
+
+        status = "okay";
+    };
+
        backlight {
                compatible = "pwm-backlight";
                pwms = <&pwm0 0 25000>;
                
        supports-highspeed;             
        supports-sdio;
-       cap-sdio-irq;
+       //cap-sdio-irq;
 
        status = "diabled";
 };
index 79103d69761cf9eff42f8c63eeb351a69ab4cc88..e9c09604c26b6a43d67cbfc089a1dc9e2acbd115 100644 (file)
 #ifdef CUSTOMER_OOB
 int bcm_wlan_get_oob_irq(void)
 {
-       int host_oob_irq = 0;
-
-
-       return host_oob_irq;
+    return rockchip_wifi_get_oob_irq();
 }
 #endif
 
index 7d80cee25d375a48422372a471012fb9280ae29d..2c1849b284488096fed3bd79b61c6b0a02807253 100755 (executable)
@@ -41,6 +41,7 @@ struct rksdmmc_gpio_wifi_moudle {
 void *rockchip_mem_prealloc(int section, unsigned long size);
 int rockchip_wifi_power(int on);
 int rockchip_wifi_set_carddetect(void);
+int rockchip_wifi_get_oob_irq(void);
 int rockchip_wifi_reset(int on);
 int rockchip_wifi_mac_addr(unsigned char *buf);
 void *rockchip_wifi_country_code(char *ccode);
index 49789bca1fe5e4d999b537ea2de40804ef585189..0b449fb9733bd5af535a33df3e6fd8075e3d3571 100755 (executable)
@@ -275,6 +275,35 @@ int rockchip_wifi_set_carddetect(void)
 }
 EXPORT_SYMBOL(rockchip_wifi_set_carddetect);
 
+/**************************************************************************
+ *
+ * Wifi Get Interrupt irq Func
+ *
+ *************************************************************************/
+int rockchip_wifi_get_oob_irq(void)
+{
+    struct rfkill_wlan_data *mrfkill = g_rfkill;
+    struct rksdmmc_gpio *wifi_int_irq;
+
+    LOG("%s: Enter\n", __func__);
+
+    if (mrfkill == NULL) {
+        LOG("%s: rfkill-wlan driver has not Successful initialized\n", __func__);
+        return -1;
+    }
+    
+    wifi_int_irq = &mrfkill->pdata->wifi_int_b;
+    if (gpio_is_valid(wifi_int_irq->io)) {
+        return gpio_to_irq(wifi_int_irq->io);
+        //return wifi_int_irq->io;
+    } else {
+        LOG("%s: wifi OOB pin isn't defined.\n", __func__);
+    }
+    
+    return -1;
+}
+EXPORT_SYMBOL(rockchip_wifi_get_oob_irq);
+
 /**************************************************************************
  *
  * Wifi Reset Func