blob: 0ac0f949094500cf7eaedde25e5fd4027ca424b2 [file] [log] [blame]
developer0443cd32023-09-19 14:11:49 +08001From bf55d4819b6c12dd7c6e13a51f8ee28636265345 Mon Sep 17 00:00:00 2001
developer81ca9d62022-10-14 11:23:22 +08002From: Evelyn Tsai <evelyn.tsai@mediatek.com>
3Date: Fri, 14 Oct 2022 11:15:13 +0800
developer0443cd32023-09-19 14:11:49 +08004Subject: [PATCH 1024/1040] wifi: mt76: mt7915: support on off SW ACI through
developerc9233442023-04-04 06:06:17 +08005 debugfs
developer81ca9d62022-10-14 11:23:22 +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
developer0443cd32023-09-19 14:11:49 +080015index 3b5c58b..4925890 100644
developer81ca9d62022-10-14 11:23:22 +080016--- a/mt76_connac_mcu.h
17+++ b/mt76_connac_mcu.h
developer0443cd32023-09-19 14:11:49 +080018@@ -1217,6 +1217,7 @@ enum {
developer81ca9d62022-10-14 11:23:22 +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,
developer887da632022-10-28 09:35:38 +080024 MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
developer81ca9d62022-10-14 11:23:22 +080025 };
developer81ca9d62022-10-14 11:23:22 +080026diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
developer0443cd32023-09-19 14:11:49 +080027index b949ad7..ef5d581 100644
developer81ca9d62022-10-14 11:23:22 +080028--- a/mt7915/mtk_debugfs.c
29+++ b/mt7915/mtk_debugfs.c
developer0443cd32023-09-19 14:11:49 +080030@@ -3642,6 +3642,25 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)
developer29647af2022-11-15 18:09:16 +080031 return 0;
32 }
developer81ca9d62022-10-14 11:23:22 +080033
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;
developer0443cd32023-09-19 14:11:49 +080056@@ -3730,6 +3749,8 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
developer81ca9d62022-10-14 11:23:22 +080057
developer29647af2022-11-15 18:09:16 +080058 debugfs_create_devm_seqfile(dev->mt76.dev, "eeprom_mode", dir,
59 mt7915_show_eeprom_mode);
developer81ca9d62022-10-14 11:23:22 +080060+ debugfs_create_file("sw_aci", 0600, dir, dev,
61+ &fops_sw_aci);
62 return 0;
63 }
64 #endif
65--
developer0443cd32023-09-19 14:11:49 +0800662.18.0
developer81ca9d62022-10-14 11:23:22 +080067