-
Notifications
You must be signed in to change notification settings - Fork 342
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
FR: LED: add optional wifi\led\status
DT binding to omit LED creation
#810
Comments
&pcie?\wifi\led\status
to omit LED creation&pcie?\wifi\led\status
DT binding to omit LED creation
&pcie?\wifi\led\status
DT binding to omit LED creationwifi\led\status
DT binding to omit LED creation
Could you please test this patch https://pastebin.mozilla.org/SM0Vcpru/raw? |
Thanks, I will report back. |
These changes may break the LED support of some dbdc devices which don't have 'led' node. And using node name to find node is not a good idea. |
Should be this, i think
I'm also afraid if
Any alternative? |
I don't know but Linux upstream seems don't like this way. I've seen some developers suggest this in the mailing list. |
I see there is |
led_classdev_unregister would check IS_ERR_OR_NULL(), so you don't need to worry about this. Also, of_get_child_by_name has existed in mt76 for years, and this patch does not change the way it gets node, but maybe you can make a patch to change to of_find_node_by_type if that works better to you. Lastly, If you want to explicitly control LED creation via "status = disabled/okay" you must explicitly check sub-node, and this does break devices which don't have 'led' node not just DBDC since we currently create led_classdev regardless the DT node status. If you just want to explicitly disable it when LED node exists, then you can do "if (np && !of_device_is_available(np))" Does that make sense? |
Thanks. |
so please upgrade to 5.4+ |
When Created PR #811 |
Oh right, just add one more of_node_put(np) into !of_device_is_available(np) check. I think we can close this ticket. |
I think it should be done if PR will be accepted ... |
I think the proper way is upstream patch for public review. Felix will apply if there's no issue and then sync to openwrt/mt76. I've posted to linux-wireless including your changes. |
Thanks. |
Want to know your mention.
Feature Request: add optional
wifi\led\status
DT binding option to omit LED creation.Problem:
LED creation depends on
CONFIG_MT76_LEDS
build variable and can not be configured using DTS.It there is no LED connected and
CONFIG_MT76_LEDS
is set (which is by default in OpenWrt), it creates/sys/class/leds/mt76-*
by default. Changing build flags seem to be bad idea depending on such a minor device hardware difference.Proposed solution:
The
led
section already allowed formt76
in DT, but is designed in expectation that LED exists.It'll be good if
status = "disabled"
withinwifi\led
section could be processed bymt76
driver, and in case whenstatus
is notokay
, driver should omit/sys/class/leds/mt76-*
device creation.Example configuration of proposed solution:
The text was updated successfully, but these errors were encountered: