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

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

408 break;
409 }
410
411 return ret;
412}
413
414DEFINE_DEBUGFS_ATTRIBUTE(fops_reset, NULL, mt7921_chip_reset, "%lld\n");
415
1// SPDX-License-Identifier: ISC
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#include "mt7921.h"
5#include "eeprom.h"
6
7static int
8mt7921_reg_set(void *data, u64 val)

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

408 break;
409 }
410
411 return ret;
412}
413
414DEFINE_DEBUGFS_ATTRIBUTE(fops_reset, NULL, mt7921_chip_reset, "%lld\n");
415
416static int
417mt7921s_sched_quota_read(struct seq_file *s, void *data)
418{
419 struct mt7921_dev *dev = dev_get_drvdata(s->private);
420 struct mt76_sdio *sdio = &dev->mt76.sdio;
421
422 seq_printf(s, "pse_data_quota\t%d\n", sdio->sched.pse_data_quota);
423 seq_printf(s, "ple_data_quota\t%d\n", sdio->sched.ple_data_quota);
424 seq_printf(s, "pse_mcu_quota\t%d\n", sdio->sched.pse_mcu_quota);
425 seq_printf(s, "sched_deficit\t%d\n", sdio->sched.deficit);
426
427 return 0;
428}
429
416int mt7921_init_debugfs(struct mt7921_dev *dev)
417{
418 struct dentry *dir;
419
420 dir = mt76_register_debugfs_fops(&dev->mphy, &fops_regval);
421 if (!dir)
422 return -ENOMEM;
423

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

431 debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
432 debugfs_create_file("runtime-pm", 0600, dir, dev, &fops_pm);
433 debugfs_create_file("idle-timeout", 0600, dir, dev,
434 &fops_pm_idle_timeout);
435 debugfs_create_file("chip_reset", 0600, dir, dev, &fops_reset);
436 debugfs_create_devm_seqfile(dev->mt76.dev, "runtime_pm_stats", dir,
437 mt7921_pm_stats);
438 debugfs_create_file("deep-sleep", 0600, dir, dev, &fops_ds);
430int mt7921_init_debugfs(struct mt7921_dev *dev)
431{
432 struct dentry *dir;
433
434 dir = mt76_register_debugfs_fops(&dev->mphy, &fops_regval);
435 if (!dir)
436 return -ENOMEM;
437

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

445 debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
446 debugfs_create_file("runtime-pm", 0600, dir, dev, &fops_pm);
447 debugfs_create_file("idle-timeout", 0600, dir, dev,
448 &fops_pm_idle_timeout);
449 debugfs_create_file("chip_reset", 0600, dir, dev, &fops_reset);
450 debugfs_create_devm_seqfile(dev->mt76.dev, "runtime_pm_stats", dir,
451 mt7921_pm_stats);
452 debugfs_create_file("deep-sleep", 0600, dir, dev, &fops_ds);
439
453 if (mt76_is_sdio(&dev->mt76))
454 debugfs_create_devm_seqfile(dev->mt76.dev, "sched-quota", dir,
455 mt7921s_sched_quota_read);
440 return 0;
441}
456 return 0;
457}