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

Commit aa8cfc03 authored by Anand N Sunkad's avatar Anand N Sunkad Committed by Hardik Kantilal Patel
Browse files

wcnss: Add API to send IRIS name



As per requirement, user need to check WLAN RF card
preset on device at run time. WLAN host driver use
this API to get the IRIS card name.

CRs-Fixed: 831585
Change-Id: I8bd71cab7f998cde01bd43068b8dfbfc5817fb7f
Signed-off-by: default avatarAnand N Sunkad <asunka@codeaurora.org>
parent d4bc64ea
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
@@ -186,6 +186,50 @@ int xo_auto_detect(u32 reg)
	}
}

int wcnss_get_iris_name(char *iris_name)
{
	struct wcnss_wlan_config *cfg = NULL;
	int iris_id;

	cfg = wcnss_get_wlan_config();

	if (cfg) {
		iris_id = cfg->iris_id;
		iris_id = iris_id >> 16;
	} else {
		return 1;
	}

	switch (iris_id) {
	case WCN3660:
		memcpy(iris_name, "WCN3660", sizeof("WCN3660"));
		break;
	case WCN3660A:
		memcpy(iris_name, "WCN3660A", sizeof("WCN3660A"));
		break;
	case WCN3660B:
		memcpy(iris_name, "WCN3660B", sizeof("WCN3660B"));
		break;
	case WCN3620:
		memcpy(iris_name, "WCN3620", sizeof("WCN3620"));
		break;
	case WCN3620A:
		memcpy(iris_name, "WCN3620A", sizeof("WCN3620A"));
		break;
	case WCN3610:
		memcpy(iris_name, "WCN3610", sizeof("WCN3610"));
		break;
	case WCN3610V1:
		memcpy(iris_name, "WCN3610V1", sizeof("WCN3610V1"));
		break;
	default:
		return 1;
	}

	return 0;
}
EXPORT_SYMBOL(wcnss_get_iris_name);

int validate_iris_chip_id(u32 reg)
{
	int iris_id;
@@ -346,6 +390,8 @@ configure_iris_xo(struct device *dev,
		else
			auto_detect = WCNSS_XO_INVALID;

		cfg->iris_id = iris_reg;

		/* Clear XO_MODE[b2:b1] bits. Clear implies 19.2 MHz TCXO */
		reg &= ~(WCNSS_PMU_CFG_IRIS_XO_MODE);

+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ struct wcnss_wlan_config {
	int	is_pronto_vt;
	int	is_pronto_v3;
	void __iomem	*msm_wcnss_base;
	int	iris_id;
};

enum {
@@ -112,6 +113,7 @@ u32 wcnss_get_wlan_rx_buff_count(void);
int wcnss_wlan_iris_xo_mode(void);
void wcnss_flush_work(struct work_struct *work);
void wcnss_flush_delayed_work(struct delayed_work *dwork);
int wcnss_get_iris_name(char *iris_version);

#ifdef CONFIG_WCNSS_REGISTER_DUMP_ON_BITE
void wcnss_log_debug_regs_on_bite(void);