24 #ifdef CONFIG_P54_LEDS
35 int err,
i,
tmp, blink_delay = 400;
43 if (priv->leds[i].toggled) {
46 tmp = 70 + 200 / (priv->leds[
i].toggled);
47 if (tmp < blink_delay)
50 if (priv->leds[i].led_dev.brightness ==
LED_OFF)
53 priv->leds[
i].toggled =
54 !!priv->leds[
i].led_dev.brightness;
61 "failed to update LEDs (%d).\n", err);
68 static void p54_led_brightness_set(
struct led_classdev *led_dev,
79 if ((brightness) && (led->registered)) {
85 static int p54_register_led(
struct p54_common *priv,
86 unsigned int led_index,
89 struct p54_led_dev *led = &priv->leds[led_index];
95 snprintf(led->name,
sizeof(led->name),
"p54-%s::%s",
96 wiphy_name(priv->
hw->wiphy), name);
97 led->hw_dev = priv->
hw;
98 led->index = led_index;
99 led->led_dev.name = led->name;
100 led->led_dev.default_trigger =
trigger;
101 led->led_dev.brightness_set = p54_led_brightness_set;
106 "Failed to register %s LED.\n", name);
125 err = p54_register_led(priv, 0,
"assoc",
126 ieee80211_get_assoc_led_name(priv->
hw));
130 err = p54_register_led(priv, 1,
"tx",
131 ieee80211_get_tx_led_name(priv->
hw));
135 err = p54_register_led(priv, 2,
"rx",
136 ieee80211_get_rx_led_name(priv->
hw));
140 err = p54_register_led(priv, 3,
"radio",
141 ieee80211_get_radio_led_name(priv->
hw));
153 for (i = 0; i <
ARRAY_SIZE(priv->leds); i++) {
156 priv->leds[
i].toggled = 0;