ath9k: ignore led_pin if ath9k GPIO controller is used with DT
Don't setup the default led pin if the ath9k GPIO controller is used via device tree to prevent collision. In case any of the pins exposed by the ath9k is used, the phyNtpt trigger needs to be set in userspace. Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
parent
20b45df7eb
commit
b06559e5b7
2 changed files with 8 additions and 6 deletions
|
@ -221,21 +221,23 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
char led_name[32];
|
char led_name[32];
|
||||||
const char *trigger;
|
const char *trigger;
|
||||||
int i;
|
int i;
|
||||||
@@ -156,6 +291,13 @@ void ath_init_leds(struct ath_softc *sc)
|
@@ -156,6 +291,15 @@ void ath_init_leds(struct ath_softc *sc)
|
||||||
if (AR_SREV_9100(sc->sc_ah))
|
if (AR_SREV_9100(sc->sc_ah))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
+ if (!np)
|
+ if (!np)
|
||||||
+ ath9k_register_gpio_chip(sc);
|
+ ath9k_register_gpio_chip(sc);
|
||||||
+
|
+
|
||||||
+ /* setup gpio controller only if requested */
|
+ /* setup gpio controller only if requested and skip the led_pin setup */
|
||||||
+ if (of_property_read_bool(np, "gpio-controller"))
|
+ if (of_property_read_bool(np, "gpio-controller")) {
|
||||||
+ ath9k_register_gpio_chip(sc);
|
+ ath9k_register_gpio_chip(sc);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
ath_fill_led_pin(sc);
|
ath_fill_led_pin(sc);
|
||||||
|
|
||||||
if (pdata && pdata->leds && pdata->num_leds)
|
if (pdata && pdata->leds && pdata->num_leds)
|
||||||
@@ -183,6 +325,7 @@ void ath_init_leds(struct ath_softc *sc)
|
@@ -183,6 +327,7 @@ void ath_init_leds(struct ath_softc *sc)
|
||||||
ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
|
ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
|
||||||
!sc->sc_ah->config.led_active_high);
|
!sc->sc_ah->config.led_active_high);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,8 +117,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
while (!list_empty(&sc->leds)) {
|
while (!list_empty(&sc->leds)) {
|
||||||
led = list_first_entry(&sc->leds, struct ath_led, list);
|
led = list_first_entry(&sc->leds, struct ath_led, list);
|
||||||
#ifdef CONFIG_GPIOLIB
|
#ifdef CONFIG_GPIOLIB
|
||||||
@@ -299,6 +368,7 @@ void ath_init_leds(struct ath_softc *sc)
|
@@ -301,6 +370,7 @@ void ath_init_leds(struct ath_softc *sc)
|
||||||
ath9k_register_gpio_chip(sc);
|
}
|
||||||
|
|
||||||
ath_fill_led_pin(sc);
|
ath_fill_led_pin(sc);
|
||||||
+ ath9k_init_buttons(sc);
|
+ ath9k_init_buttons(sc);
|
||||||
|
|
Loading…
Reference in a new issue