developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 1 | From 3fb208eb0a314a489cd0f0c74d22cc01e6d99822 Mon Sep 17 00:00:00 2001 |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 2 | From: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| 3 | Date: Fri, 14 Oct 2022 11:15:13 +0800 |
developer | bcc85ca | 2022-12-05 11:29:56 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1128/1128] mt76: mt7915: support on off SW ACI through debugfs |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 5 | |
| 6 | Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| 7 | Change-Id: I8a9c277c41d1ba76f9737d8af6f42e5e8f00ba64 |
| 8 | --- |
| 9 | mt76_connac_mcu.h | 1 + |
| 10 | mt7915/mtk_debugfs.c | 21 +++++++++++++++++++++ |
| 11 | 2 files changed, 22 insertions(+) |
| 12 | |
| 13 | diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 14 | index 5cff1a45..98b00747 100644 |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 15 | --- a/mt76_connac_mcu.h |
| 16 | +++ b/mt76_connac_mcu.h |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 17 | @@ -1201,6 +1201,7 @@ enum { |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 18 | 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, |
developer | b81e95d | 2022-11-08 10:16:29 +0800 | [diff] [blame] | 23 | MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5, |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 24 | }; |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 25 | diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 26 | index 376e5f89..846dc5e3 100644 |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 27 | --- a/mt7915/mtk_debugfs.c |
| 28 | +++ b/mt7915/mtk_debugfs.c |
developer | 3d5faf2 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 29 | @@ -2932,6 +2932,25 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data) |
developer | 9bc8ec1 | 2022-11-18 16:01:14 +0800 | [diff] [blame] | 30 | return 0; |
| 31 | } |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 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; |
developer | 3d5faf2 | 2022-11-29 18:07:22 +0800 | [diff] [blame] | 55 | @@ -3014,6 +3033,8 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir) |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 56 | |
developer | 9bc8ec1 | 2022-11-18 16:01:14 +0800 | [diff] [blame] | 57 | debugfs_create_devm_seqfile(dev->mt76.dev, "eeprom_mode", dir, |
| 58 | mt7915_show_eeprom_mode); |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 59 | + debugfs_create_file("sw_aci", 0600, dir, dev, |
| 60 | + &fops_sw_aci); |
| 61 | return 0; |
| 62 | } |
| 63 | #endif |
| 64 | -- |
developer | 2458e70 | 2022-12-13 15:52:04 +0800 | [diff] [blame^] | 65 | 2.25.1 |
developer | 29344f1 | 2022-10-17 12:01:44 +0800 | [diff] [blame] | 66 | |