b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 79c9d7aabae1d1da9eea97d83b61e1517a8a2221 Mon Sep 17 00:00:00 2001 |
| 2 | From: Mathias Kresin <dev@kresin.me> |
| 3 | Date: Fri, 22 Jun 2018 18:59:44 +0200 |
| 4 | Subject: [PATCH] ath10k: use tpt LED trigger by default |
| 5 | |
| 6 | Use the tpt LED trigger for each created phy led. Ths way LEDs attached |
| 7 | to the ath10k GPIO pins are indicating the phy status and blink on |
| 8 | traffic. |
| 9 | |
| 10 | Signed-off-by: Mathias Kresin <dev@kresin.me> |
| 11 | --- |
| 12 | drivers/net/wireless/ath/ath10k/core.h | 4 ++++ |
| 13 | drivers/net/wireless/ath/ath10k/leds.c | 4 +--- |
| 14 | drivers/net/wireless/ath/ath10k/mac.c | 2 +- |
| 15 | 3 files changed, 6 insertions(+), 4 deletions(-) |
| 16 | |
| 17 | --- a/drivers/net/wireless/ath/ath10k/core.h |
| 18 | +++ b/drivers/net/wireless/ath/ath10k/core.h |
| 19 | @@ -1290,6 +1290,10 @@ struct ath10k { |
| 20 | bool coex_support; |
| 21 | int coex_gpio_pin; |
| 22 | |
| 23 | +#ifdef CPTCFG_MAC80211_LEDS |
| 24 | + const char *led_default_trigger; |
| 25 | +#endif |
| 26 | + |
| 27 | /* must be last */ |
| 28 | u8 drv_priv[] __aligned(sizeof(void *)); |
| 29 | }; |
| 30 | --- a/drivers/net/wireless/ath/ath10k/leds.c |
| 31 | +++ b/drivers/net/wireless/ath/ath10k/leds.c |
| 32 | @@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k * |
| 33 | |
| 34 | ar->leds.cdev.name = ar->leds.label; |
| 35 | ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; |
| 36 | - |
| 37 | - /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ |
| 38 | - ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; |
| 39 | + ar->leds.cdev.default_trigger = ar->led_default_trigger; |
| 40 | |
| 41 | ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); |
| 42 | if (ret) |
| 43 | --- a/drivers/net/wireless/ath/ath10k/mac.c |
| 44 | +++ b/drivers/net/wireless/ath/ath10k/mac.c |
| 45 | @@ -10118,7 +10118,7 @@ int ath10k_mac_register(struct ath10k *a |
| 46 | ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; |
| 47 | |
| 48 | #ifdef CPTCFG_MAC80211_LEDS |
| 49 | - ieee80211_create_tpt_led_trigger(ar->hw, |
| 50 | + ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw, |
| 51 | IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink, |
| 52 | ARRAY_SIZE(ath10k_tpt_blink)); |
| 53 | #endif |