blob: 11f05a7c482d49b30bc959b3e3bebdf7b91d2cbd [file] [log] [blame]
developera20cdc22024-05-31 18:57:31 +08001From 615af047639896e1d92edf7c18322a1a6d993e92 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
developera20cdc22024-05-31 18:57:31 +08004Subject: [PATCH 1021/1051] 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>
developere2cfb522022-12-08 18:09:45 +08008---
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
developera20cdc22024-05-31 18:57:31 +080014index 7e12c05..94fcf32 100644
developere2cfb522022-12-08 18:09:45 +080015--- a/mt76_connac_mcu.h
16+++ b/mt76_connac_mcu.h
developera20cdc22024-05-31 18:57:31 +080017@@ -1253,6 +1253,7 @@ enum {
18 MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
developere2cfb522022-12-08 18:09:45 +080019 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,
23 MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
24 };
25diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
developera20cdc22024-05-31 18:57:31 +080026index 17577fd..8f2f496 100644
developere2cfb522022-12-08 18:09:45 +080027--- a/mt7915/mtk_debugfs.c
28+++ b/mt7915/mtk_debugfs.c
developera46f6132024-03-26 14:09:54 +080029@@ -3770,6 +3770,25 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)
developere2cfb522022-12-08 18:09:45 +080030 return 0;
31 }
32
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;
developera46f6132024-03-26 14:09:54 +080055@@ -3858,6 +3877,8 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
developere2cfb522022-12-08 18:09:45 +080056
57 debugfs_create_devm_seqfile(dev->mt76.dev, "eeprom_mode", dir,
58 mt7915_show_eeprom_mode);
59+ debugfs_create_file("sw_aci", 0600, dir, dev,
60+ &fops_sw_aci);
61 return 0;
62 }
63 #endif
64--
developerbd9fa1e2023-10-16 11:04:00 +0800652.18.0
developere2cfb522022-12-08 18:09:45 +080066