blob: 99dfad36bc7955b03122cfa2cf4c160d39e40b41 [file] [log] [blame]
developer7af0f762023-05-22 15:16:16 +08001From 4127f1f3a388e72e8271f032dc081301a79bfba5 Mon Sep 17 00:00:00 2001
developere2cfb522022-12-08 18:09:45 +08002From: Evelyn Tsai <evelyn.tsai@mediatek.com>
3Date: Fri, 14 Oct 2022 11:15:13 +0800
developer7af0f762023-05-22 15:16:16 +08004Subject: [PATCH 1026/1033] wifi: mt76: mt7915: support on off SW ACI through
developerda18a742023-04-06 13:44:00 +08005 debugfs
developere2cfb522022-12-08 18:09:45 +08006
7Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
8Change-Id: I8a9c277c41d1ba76f9737d8af6f42e5e8f00ba64
9---
10 mt76_connac_mcu.h | 1 +
11 mt7915/mtk_debugfs.c | 21 +++++++++++++++++++++
12 2 files changed, 22 insertions(+)
13
14diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
developer7af0f762023-05-22 15:16:16 +080015index 661d790..1fdbc1c 100644
developere2cfb522022-12-08 18:09:45 +080016--- a/mt76_connac_mcu.h
17+++ b/mt76_connac_mcu.h
developerbb6ddff2023-03-08 17:22:32 +080018@@ -1203,6 +1203,7 @@ enum {
developere2cfb522022-12-08 18:09:45 +080019 MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
20 MCU_EXT_CMD_SET_CFG = 0xb7,
21 MCU_EXT_CMD_EDCCA = 0xba,
22+ MCU_EXT_CMD_SWLNA_ACI_CTRL = 0xc0,
23 MCU_EXT_CMD_CSI_CTRL = 0xc2,
24 MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
25 };
26diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
developer7af0f762023-05-22 15:16:16 +080027index 2cccebe..acff7ce 100644
developere2cfb522022-12-08 18:09:45 +080028--- a/mt7915/mtk_debugfs.c
29+++ b/mt7915/mtk_debugfs.c
developer7af0f762023-05-22 15:16:16 +080030@@ -3644,6 +3644,25 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)
developere2cfb522022-12-08 18:09:45 +080031 return 0;
32 }
33
34+static int
35+mt7915_sw_aci_set(void *data, u64 val)
36+{
37+#define SWLNA_ENABLE 6
38+ struct mt7915_dev *dev = data;
39+ struct {
40+ u32 subcmd;
41+ u8 enable;
42+ } req = {
43+ .subcmd = SWLNA_ENABLE,
44+ .enable = (u8) val,
45+ };
46+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req, sizeof(req), NULL);
47+}
48+
49+
50+DEFINE_DEBUGFS_ATTRIBUTE(fops_sw_aci, NULL,
51+ mt7915_sw_aci_set, "%llx\n");
52+
53 int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
54 {
55 struct mt7915_dev *dev = phy->dev;
developer7af0f762023-05-22 15:16:16 +080056@@ -3733,6 +3752,8 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
developere2cfb522022-12-08 18:09:45 +080057
58 debugfs_create_devm_seqfile(dev->mt76.dev, "eeprom_mode", dir,
59 mt7915_show_eeprom_mode);
60+ debugfs_create_file("sw_aci", 0600, dir, dev,
61+ &fops_sw_aci);
62 return 0;
63 }
64 #endif
65--
developer8effbd32023-04-17 15:57:28 +0800662.18.0
developere2cfb522022-12-08 18:09:45 +080067