blob: 94cf85cb1719eb9cb6540f3db066c5c541ba40a2 [file] [log] [blame]
developer9bc8ec12022-11-18 16:01:14 +08001From 03db7df14e4b8fcf9cf69725ee3baf74656293dc Mon Sep 17 00:00:00 2001
developer29344f12022-10-17 12:01:44 +08002From: Evelyn Tsai <evelyn.tsai@mediatek.com>
3Date: Fri, 14 Oct 2022 11:15:13 +0800
developerb81e95d2022-11-08 10:16:29 +08004Subject: [PATCH 1128/1128] mt76: support on off SW ACI through debugfs
developer29344f12022-10-17 12:01:44 +08005
6Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
7Change-Id: I8a9c277c41d1ba76f9737d8af6f42e5e8f00ba64
8---
9 mt76_connac_mcu.h | 1 +
10 mt7915/mtk_debugfs.c | 21 +++++++++++++++++++++
11 2 files changed, 22 insertions(+)
12
13diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
developer9bc8ec12022-11-18 16:01:14 +080014index 86a8688..a368b65 100644
developer29344f12022-10-17 12:01:44 +080015--- a/mt76_connac_mcu.h
16+++ b/mt76_connac_mcu.h
developer2cbf2fb2022-11-16 12:20:48 +080017@@ -1164,6 +1164,7 @@ enum {
developer29344f12022-10-17 12:01:44 +080018 MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
19 MCU_EXT_CMD_SET_CFG = 0xb7,
20 MCU_EXT_CMD_EDCCA = 0xba,
21+ MCU_EXT_CMD_SWLNA_ACI_CTRL = 0xc0,
22 MCU_EXT_CMD_CSI_CTRL = 0xc2,
developerb81e95d2022-11-08 10:16:29 +080023 MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
developer29344f12022-10-17 12:01:44 +080024 };
developer29344f12022-10-17 12:01:44 +080025diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
developer9bc8ec12022-11-18 16:01:14 +080026index 36cb6f0..facdd69 100644
developer29344f12022-10-17 12:01:44 +080027--- a/mt7915/mtk_debugfs.c
28+++ b/mt7915/mtk_debugfs.c
developer9bc8ec12022-11-18 16:01:14 +080029@@ -2927,6 +2927,25 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)
30 return 0;
31 }
developer29344f12022-10-17 12:01:44 +080032
33+static int
34+mt7915_sw_aci_set(void *data, u64 val)
35+{
36+#define SWLNA_ENABLE 6
37+ struct mt7915_dev *dev = data;
38+ struct {
39+ u32 subcmd;
40+ u8 enable;
41+ } req = {
42+ .subcmd = SWLNA_ENABLE,
43+ .enable = (u8) val,
44+ };
45+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req, sizeof(req), NULL);
46+}
47+
48+
49+DEFINE_DEBUGFS_ATTRIBUTE(fops_sw_aci, NULL,
50+ mt7915_sw_aci_set, "%llx\n");
51+
52 int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
53 {
54 struct mt7915_dev *dev = phy->dev;
developer9bc8ec12022-11-18 16:01:14 +080055@@ -3009,6 +3028,8 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
developer29344f12022-10-17 12:01:44 +080056
developer9bc8ec12022-11-18 16:01:14 +080057 debugfs_create_devm_seqfile(dev->mt76.dev, "eeprom_mode", dir,
58 mt7915_show_eeprom_mode);
developer29344f12022-10-17 12:01:44 +080059+ debugfs_create_file("sw_aci", 0600, dir, dev,
60+ &fops_sw_aci);
61 return 0;
62 }
63 #endif
64--
developerb81e95d2022-11-08 10:16:29 +0800652.18.0
developer29344f12022-10-17 12:01:44 +080066