aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 6352ebe8cb43..a64b62b20051 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -291,17 +291,16 @@ static void rt2500usb_led_brightness(struct led_classdev *led_cdev,
291 unsigned int enabled = brightness != LED_OFF; 291 unsigned int enabled = brightness != LED_OFF;
292 unsigned int activity = 292 unsigned int activity =
293 led->rt2x00dev->led_flags & LED_SUPPORT_ACTIVITY; 293 led->rt2x00dev->led_flags & LED_SUPPORT_ACTIVITY;
294 u16 reg;
295
296 rt2500usb_register_read(led->rt2x00dev, MAC_CSR20, &reg);
297 294
298 if (led->type == LED_TYPE_RADIO || led->type == LED_TYPE_ASSOC) { 295 if (led->type == LED_TYPE_RADIO || led->type == LED_TYPE_ASSOC) {
299 rt2x00_set_field16(&reg, MAC_CSR20_LINK, enabled); 296 rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
300 rt2x00_set_field16(&reg, MAC_CSR20_ACTIVITY, 297 MAC_CSR20_LINK, enabled);
301 enabled && activity); 298 rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
299 MAC_CSR20_ACTIVITY, enabled && activity);
302 } 300 }
303 301
304 rt2500usb_register_write(led->rt2x00dev, MAC_CSR20, reg); 302 rt2x00usb_vendor_request_async(led->rt2x00dev, USB_SINGLE_WRITE,
303 MAC_CSR20, led->rt2x00dev->led_mcu_reg);
305} 304}
306#else 305#else
307#define rt2500usb_led_brightness NULL 306#define rt2500usb_led_brightness NULL
@@ -1377,6 +1376,13 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1377 rt2x00dev->led_flags = LED_SUPPORT_RADIO; 1376 rt2x00dev->led_flags = LED_SUPPORT_RADIO;
1378 break; 1377 break;
1379 } 1378 }
1379
1380 /*
1381 * Store the current led register value, we need it later
1382 * in set_brightness but that is called in irq context which
1383 * means we can't use rt2500usb_register_read() at that time.
1384 */
1385 rt2500usb_register_read(rt2x00dev, MAC_CSR20, &rt2x00dev->led_mcu_reg);
1380#endif /* CONFIG_RT2500USB_LEDS */ 1386#endif /* CONFIG_RT2500USB_LEDS */
1381 1387
1382 /* 1388 /*