Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mt76: mac80211: Enable to specify LED name in Device Tree #694

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ static int mt76_led_init(struct mt76_phy *phy)
struct mt76_dev *dev = phy->dev;
struct ieee80211_hw *hw = phy->hw;
struct device_node *np = dev->dev->of_node;
struct led_init_data init_data;

if (!phy->leds.cdev.brightness_set && !phy->leds.cdev.blink_set)
return 0;
Expand All @@ -212,6 +213,11 @@ static int mt76_led_init(struct mt76_phy *phy)
return 0;
}

init_data.fwnode = &np->fwnode;
init_data.default_label = NULL;
init_data.devicename = NULL;
init_data.devname_mandatory = false;

if (phy == &dev->phy) {
int led_pin;

Expand All @@ -238,7 +244,7 @@ static int mt76_led_init(struct mt76_phy *phy)
dev_info(dev->dev,
"registering led '%s'\n", phy->leds.name);

return led_classdev_register(dev->dev, &phy->leds.cdev);
return led_classdev_register_ext(dev->dev, &phy->leds.cdev, np ? &init_data : NULL);
}

static void mt76_led_cleanup(struct mt76_phy *phy)
Expand Down