debugfs.c (1d8efc741df80be940e1584b5ac613dc03d58bd6) debugfs.c (0da3c795d07bf005d4b0be8d6cdc4714aa51a988)
1// SPDX-License-Identifier: ISC
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#include "mt7921.h"
5#include "eeprom.h"
6
7static int
8mt7921_fw_debug_set(void *data, u64 val)

--- 199 unchanged lines hidden (view full) ---

208 *val = jiffies_to_msecs(dev->pm.idle_timeout);
209
210 return 0;
211}
212
213DEFINE_DEBUGFS_ATTRIBUTE(fops_pm_idle_timeout, mt7921_pm_idle_timeout_get,
214 mt7921_pm_idle_timeout_set, "%lld\n");
215
1// SPDX-License-Identifier: ISC
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#include "mt7921.h"
5#include "eeprom.h"
6
7static int
8mt7921_fw_debug_set(void *data, u64 val)

--- 199 unchanged lines hidden (view full) ---

208 *val = jiffies_to_msecs(dev->pm.idle_timeout);
209
210 return 0;
211}
212
213DEFINE_DEBUGFS_ATTRIBUTE(fops_pm_idle_timeout, mt7921_pm_idle_timeout_get,
214 mt7921_pm_idle_timeout_set, "%lld\n");
215
216static int mt7921_config(void *data, u64 val)
217{
218 struct mt7921_dev *dev = data;
219 int ret;
220
221 mt7921_mutex_acquire(dev);
222 ret = mt76_connac_mcu_chip_config(&dev->mt76);
223 mt7921_mutex_release(dev);
224
225 return ret;
226}
227
228DEFINE_DEBUGFS_ATTRIBUTE(fops_config, NULL, mt7921_config, "%lld\n");
229
216int mt7921_init_debugfs(struct mt7921_dev *dev)
217{
218 struct dentry *dir;
219
220 dir = mt76_register_debugfs(&dev->mt76);
221 if (!dir)
222 return -ENOMEM;
223
224 debugfs_create_devm_seqfile(dev->mt76.dev, "queues", dir,
225 mt7921_queues_read);
226 debugfs_create_devm_seqfile(dev->mt76.dev, "acq", dir,
227 mt7921_queues_acq);
228 debugfs_create_file("tx_stats", 0400, dir, dev, &fops_tx_stats);
229 debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
230 debugfs_create_file("runtime-pm", 0600, dir, dev, &fops_pm);
231 debugfs_create_file("idle-timeout", 0600, dir, dev,
232 &fops_pm_idle_timeout);
230int mt7921_init_debugfs(struct mt7921_dev *dev)
231{
232 struct dentry *dir;
233
234 dir = mt76_register_debugfs(&dev->mt76);
235 if (!dir)
236 return -ENOMEM;
237
238 debugfs_create_devm_seqfile(dev->mt76.dev, "queues", dir,
239 mt7921_queues_read);
240 debugfs_create_devm_seqfile(dev->mt76.dev, "acq", dir,
241 mt7921_queues_acq);
242 debugfs_create_file("tx_stats", 0400, dir, dev, &fops_tx_stats);
243 debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
244 debugfs_create_file("runtime-pm", 0600, dir, dev, &fops_pm);
245 debugfs_create_file("idle-timeout", 0600, dir, dev,
246 &fops_pm_idle_timeout);
247 debugfs_create_file("chip_config", 0600, dir, dev, &fops_config);
233
234 return 0;
235}
248
249 return 0;
250}