mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7921: add deep sleep control to runtime-pm knob
Add addtional the deep sleep control to runtime-pm knob to allow us to control driver switching between the full power mode and the deep sleep mode the firmware is able to support. Reviewed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -247,6 +247,9 @@ mt7921_pm_set(void *data, u64 val)
|
||||
ieee80211_iterate_active_interfaces(mphy->hw,
|
||||
IEEE80211_IFACE_ITER_RESUME_ALL,
|
||||
mt7921_pm_interface_iter, mphy->priv);
|
||||
|
||||
mt76_connac_mcu_set_deep_sleep(&dev->mt76, !!pm->enable);
|
||||
|
||||
mt7921_mutex_release(dev);
|
||||
|
||||
return 0;
|
||||
@@ -264,6 +267,20 @@ mt7921_pm_get(void *data, u64 *val)
|
||||
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(fops_pm, mt7921_pm_get, mt7921_pm_set, "%lld\n");
|
||||
|
||||
static int
|
||||
mt7921_deep_sleep_set(void *data, u64 val)
|
||||
{
|
||||
struct mt7921_dev *dev = data;
|
||||
|
||||
mt7921_mutex_acquire(dev);
|
||||
mt76_connac_mcu_set_deep_sleep(&dev->mt76, !!val);
|
||||
mt7921_mutex_release(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(fops_ds, NULL, mt7921_deep_sleep_set, "%lld\n");
|
||||
|
||||
static int
|
||||
mt7921_pm_stats(struct seq_file *s, void *data)
|
||||
{
|
||||
@@ -355,6 +372,7 @@ int mt7921_init_debugfs(struct mt7921_dev *dev)
|
||||
debugfs_create_file("chip_reset", 0600, dir, dev, &fops_reset);
|
||||
debugfs_create_devm_seqfile(dev->mt76.dev, "runtime_pm_stats", dir,
|
||||
mt7921_pm_stats);
|
||||
debugfs_create_file("deep-sleep", 0600, dir, dev, &fops_ds);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user