Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21bb8090 authored by Mohammed Siddiq's avatar Mohammed Siddiq
Browse files

cnss2: Check for BT Enable GPIO in QCA6390



QCA6390 requires synchronization between BT and WLAN enable gpio
to avoid power up issue. Add support for QCA6390 in gpio sync
code.

Change-Id: Id2183ff324c9c3059ea81e9137fa49c803feb183
Signed-off-by: default avatarMohammed Siddiq <msiddiq@codeaurora.org>
parent 423b7b2f
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */

#include <linux/clk.h>
#include <linux/delay.h>
@@ -789,10 +789,17 @@ static int cnss_select_pinctrl_enable(struct cnss_plat_data *plat_priv)
	int ret = 0, bt_en_gpio = plat_priv->pinctrl_info.bt_en_gpio;
	u8 wlan_en_state = 0;

	if (bt_en_gpio < 0 || plat_priv->device_id != QCA6490_DEVICE_ID ||
	    plat_priv->device_id != QCA6390_DEVICE_ID)
	if (bt_en_gpio < 0)
		goto set_wlan_en;

	switch (plat_priv->device_id) {
	case QCA6390_DEVICE_ID:
	case QCA6490_DEVICE_ID:
		break;
	default:
		goto set_wlan_en;
	}

	if (gpio_get_value(bt_en_gpio)) {
		cnss_pr_dbg("BT_EN_GPIO State: On\n");
		ret = cnss_select_pinctrl_state(plat_priv, true);
@@ -808,7 +815,9 @@ static int cnss_select_pinctrl_enable(struct cnss_plat_data *plat_priv)
			cnss_select_pinctrl_state(plat_priv, false);
			wlan_en_state = 0;
		}
		/* 100 ms delay for BT_EN and WLAN_EN QCA6490 PMU sequencing */
		/* 100 ms delay for BT_EN and WLAN_EN QCA6490/QCA6390 PMU
		 * sequencing.
		 */
		msleep(100);
	}
set_wlan_en: