Browse Source

btfm: set sw_cntrl gpiois during poweron sequence.

Change-Id: I641c4a480bccfdb282e17f3489ec7c4481d84256
satish kumar sugasi 2 years ago
parent
commit
11cd6d25d5
2 changed files with 15 additions and 0 deletions
  1. 1 0
      include/btpower.h
  2. 14 0
      pwr/btpower.c

+ 1 - 0
include/btpower.h

@@ -64,6 +64,7 @@ struct btpower_platform_data {
 	int bt_gpio_host_wake;                 /* Bluetooth bt_host_wake */
 	int irq;                               /* Bluetooth host_wake IRQ */
 #endif
+	int sw_cntrl_gpio;
 	int xo_gpio_clk;                       /* XO clock gpio*/
 	struct device *slim_dev;
 	struct bt_power_vreg_data *vreg_info;  /* VDDIO voltage regulator */

+ 14 - 0
pwr/btpower.c

@@ -25,6 +25,7 @@
 #include <linux/uaccess.h>
 #include <linux/of_device.h>
 #include <soc/qcom/cmd-db.h>
+#include <linux/pinctrl/qcom-pinctrl.h>
 #include "btpower.h"
 #if (defined CONFIG_BT_SLIM)
 #include "btfm_slim.h"
@@ -545,6 +546,14 @@ static int bt_configure_gpios(int on)
 		if (bt_sw_ctrl_gpio >= 0) {
 			bt_power_src_status[BT_SW_CTRL_GPIO] =
 			gpio_get_value(bt_sw_ctrl_gpio);
+			rc = msm_gpio_mpm_wake_set(bt_power_pdata->sw_cntrl_gpio, 1);
+			if (rc < 0) {
+				pr_err("Failed to set msm_gpio_mpm_wake_set for sw_cntrl gpio, ret: %d\n",
+						rc);
+				return rc;
+			} else {
+				pr_info("Set msm_gpio_mpm_wake_set for sw_cntrl gpio successful\n");
+			}
 			pr_info("BTON:Turn Bt OFF bt-sw-ctrl-gpio(%d) value(%d)\n",
 				bt_sw_ctrl_gpio,
 				bt_power_src_status[BT_SW_CTRL_GPIO]);
@@ -1011,6 +1020,11 @@ static int bt_power_populate_dt_pinfo(struct platform_device *pdev)
 		if (bt_power_pdata->bt_gpio_sw_ctrl < 0)
 			pr_warn("bt-sw-ctrl-gpio not provided in devicetree\n");
 
+		rc = of_property_read_u32(pdev->dev.of_node,
+			 "mpm_wake_set_gpios",&bt_power_pdata->sw_cntrl_gpio);
+		if (rc)
+			pr_warn("sw_cntrl-gpio not provided in devicetree\n");
+
 		bt_power_pdata->bt_gpio_debug  =
 			of_get_named_gpio(pdev->dev.of_node,
 						"qcom,bt-debug-gpio",  0);