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

Commit 563e2884 authored by jge's avatar jge Committed by Gerrit - the friendly Code Review server
Browse files

wcnss: Fix getting iris id wrong for wcn3610 card



For wcn3610 and wcn3610v1, their IRIS card chip id are 0x9101
and 0x9110, so highest bit is 1. In wcnss_get_iris_name,
when iris_id shifts 16bits right, it can't match the right name
as the highest bit is filled up with 1.

Change type of iris_id from int to u32, and add mask for iris_id.

Change-Id: I3c17949fc327f9406326705191e4f5aedddfd3c4
CRs-Fixed: 2048990
Signed-off-by: default avatarJingxiang Ge <jge@codeaurora.org>
parent a3dbc7bd
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2015, 2017 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -39,6 +39,7 @@ static int is_power_on;

#define PRONTO_IRIS_REG_READ_OFFSET       0x1134
#define PRONTO_IRIS_REG_CHIP_ID           0x04
#define PRONTO_IRIS_REG_CHIP_ID_MASK      0xffff
/* IRIS card chip ID's */
#define WCN3660       0x0200
#define WCN3660A      0x0300
@@ -124,13 +125,13 @@ int xo_auto_detect(u32 reg)
int wcnss_get_iris_name(char *iris_name)
{
	struct wcnss_wlan_config *cfg = NULL;
	int iris_id;
	u32 iris_id;

	cfg = wcnss_get_wlan_config();

	if (cfg) {
		iris_id = cfg->iris_id;
		iris_id = iris_id >> 16;
		iris_id = PRONTO_IRIS_REG_CHIP_ID_MASK & (iris_id >> 16);
	} else {
		return 1;
	}
@@ -167,8 +168,9 @@ EXPORT_SYMBOL(wcnss_get_iris_name);

int validate_iris_chip_id(u32 reg)
{
	int iris_id;
	iris_id = reg >> 16;
	u32 iris_id;

	iris_id = PRONTO_IRIS_REG_CHIP_ID_MASK & (reg >> 16);

	switch (iris_id) {
	case WCN3660:
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ struct wcnss_wlan_config {
	int	is_pronto_vadc;
	int	is_pronto_v3;
	void __iomem	*msm_wcnss_base;
	int	iris_id;
	unsigned int iris_id;
	int	vbatt;
	struct vregs_level pronto_vlevel[PRONTO_REGULATORS];
	struct vregs_level iris_vlevel[IRIS_REGULATORS];