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

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

Merge "Bluetooth: Disable ASD for HSP"

parents 9ec56ccf fec9be13
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@


#if defined CONFIG_BT_SLIM_QCA6390 || defined CONFIG_BTFM_SLIM_WCN3990
#if defined CONFIG_BT_SLIM_QCA6390 || defined CONFIG_BTFM_SLIM_WCN3990
#include "btfm_slim.h"
#include "btfm_slim.h"
#include "btfm_slim_slave.h"
#endif
#endif
#include <linux/fs.h>
#include <linux/fs.h>


@@ -847,6 +848,18 @@ int get_chipset_version(void)
	return soc_id;
	return soc_id;
}
}


int bt_disable_asd(void)
{
	int rc = 0;
	if (bt_power_pdata->bt_vdd_asd) {
		BT_PWR_INFO("Disabling ASD regulator");
		rc = bt_vreg_disable(bt_power_pdata->bt_vdd_asd);
	} else {
		BT_PWR_INFO("ASD regulator is not configured");
	}
	return rc;
}

static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
{
	int ret = 0, pwr_cntrl = 0;
	int ret = 0, pwr_cntrl = 0;
@@ -883,6 +896,11 @@ static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
		BT_PWR_ERR("BT_CMD_CHIP_VERS soc_version:%x", chipset_version);
		BT_PWR_ERR("BT_CMD_CHIP_VERS soc_version:%x", chipset_version);
		if (chipset_version) {
		if (chipset_version) {
			soc_id = chipset_version;
			soc_id = chipset_version;
			if (soc_id == QCA_HSP_SOC_ID_0100 ||
				soc_id == QCA_HSP_SOC_ID_0110 ||
				soc_id == QCA_HSP_SOC_ID_0200) {
				ret = bt_disable_asd();
			}
		} else {
		} else {
			BT_PWR_ERR("got invalid soc version");
			BT_PWR_ERR("got invalid soc version");
			soc_id = 0;
			soc_id = 0;