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

Commit 4fcaffed authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss2: Check for BT Enable GPIO in QCA6390"

parents eee4255a 21bb8090
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: