blob: f42e269d8ee50efd5d971e2a772921e84f581a0f [file] [log] [blame]
developerc8796032023-08-09 10:28:15 +08001From ea7179a6774f9ca965731738b4e171f26767ae4e 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
developerf9b00212023-07-31 12:27:06 +08004Subject: [PATCH 1024/1034] 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
developerc8796032023-08-09 10:28:15 +080015index daeec01f..8228bbb1 100644
developere2cfb522022-12-08 18:09:45 +080016--- a/mt76_connac_mcu.h
17+++ b/mt76_connac_mcu.h
developer47efbdb2023-06-29 20:33:22 +080018@@ -1206,6 +1206,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
developerc8796032023-08-09 10:28:15 +080027index bc683db8..48e2edcf 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;
developer47efbdb2023-06-29 20:33:22 +080056@@ -3732,6 +3751,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--
developerc8796032023-08-09 10:28:15 +0800662.39.2
developere2cfb522022-12-08 18:09:45 +080067