mpq8064: Add support for GSBI6 UARTDM for Bluetooth feature
On MPQ8064 Hybrid and DTV variant with ASIC 1.0/1.1, Bluetooth is
connected to MSM externally through GSBI6 UARTDM interface. Hence
add GSBI6 UART device and required resources (its GPIOs, ADM
(Channel/CRCI), clocks ) and its configuration.
CRs-Fixed: 386832
Change-Id: Ib1ba5efe04ed10067ac0e3f7326f4820ef800645
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index 1221df3..81f989d 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -69,6 +69,7 @@
#include <linux/msm_tsens.h>
#include <mach/msm_xo.h>
#include <mach/msm_rtb.h>
+#include <mach/msm_serial_hs.h>
#include <sound/cs8427.h>
#include <media/gpio-ir-recv.h>
#include <linux/fmem.h>
@@ -2603,6 +2604,40 @@
}
late_initcall(rf4ce_gpio_init);
+#ifdef CONFIG_SERIAL_MSM_HS
+static int configure_uart_gpios(int on)
+{
+ int ret = 0, i;
+ int uart_gpios[] = {14, 15, 16, 17};
+
+ for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) {
+ if (on) {
+ ret = gpio_request(uart_gpios[i], NULL);
+ if (ret) {
+ pr_err("%s:unable to request uart gpio[%d]\n",
+ __func__, uart_gpios[i]);
+ break;
+ }
+ } else {
+ gpio_free(uart_gpios[i]);
+ }
+ }
+
+ if (ret && on && i)
+ for (; i >= 0; i--)
+ gpio_free(uart_gpios[i]);
+ return ret;
+}
+
+static struct msm_serial_hs_platform_data mpq8064_gsbi6_uartdm_pdata = {
+ .inject_rx_on_wakeup = 1,
+ .rx_to_inject = 0xFD,
+ .gpio_config = configure_uart_gpios,
+};
+#else
+static struct msm_serial_hs_platform_data msm_uart_dm9_pdata;
+#endif
+
static struct platform_device *mpq_devices[] __initdata = {
&msm_device_sps_apq8064,
&mpq8064_device_qup_i2c_gsbi5,
@@ -3375,6 +3410,16 @@
apq8064_init_cam();
#endif
+ if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) {
+#ifdef CONFIG_SERIAL_MSM_HS
+ /* GSBI6(2) - UARTDM_RX */
+ mpq8064_gsbi6_uartdm_pdata.wakeup_irq = gpio_to_irq(15);
+ mpq8064_device_uartdm_gsbi6.dev.platform_data =
+ &mpq8064_gsbi6_uartdm_pdata;
+#endif
+ platform_device_register(&mpq8064_device_uartdm_gsbi6);
+ }
+
if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
platform_device_register(&cdp_kp_pdev);