Changeset 37698


Ignore:
Timestamp:
2013-08-05T11:09:41+02:00 (5 years ago)
Author:
juhosg
Message:

mac80211: rt2x00: fix LED polarity patch

The patch causes compiler warning ...

<...>/drivers/net/wireless/rt2x00/rt2800lib.c: In function 'rt2800_init_eeprom':
<...>/drivers/net/wireless/rt2x00/rt2800lib.c:5971:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

... and runtime errors on PCI/USB devices:

[ 11.810000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3071, rev 021c detected
[ 11.830000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0001 detected
[ 11.880000] rt2x00mmio_regbusy_read() Indirect register access failed: offset=0x00007010, value=0x01ff0001
[ 12.080000] usb 1-1: reset high-speed USB device number 2 using ehci-platform
[ 12.250000] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detecte
[ 12.300000] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 000f detected
[ 12.350000] ieee80211 phy1: rt2x00usb_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x1a93b47
[ 12.430000] ieee80211 phy1: rt2x00usb_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x11a93b47
[ 12.480000] ieee80211 phy1: rt2x00usb_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x11a93b47

Signed-off-by: Gabor Juhos <juhosg@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch

    r37618 r37698  
    99 #include "rt2x00.h" 
    1010 #include "rt2800lib.h" 
    11 @@ -5966,6 +5967,13 @@ static int rt2800_init_eeprom(struct rt2 
     11@@ -5966,6 +5967,17 @@ static int rt2800_init_eeprom(struct rt2 
    1212        rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); 
    1313        rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); 
    1414  
    15 +       /* Allow overriding polarity from OF */ 
    16 +       struct device_node *np = rt2x00dev->dev->of_node; 
    17 +       unsigned int led_polarity; 
     15+       { 
     16+               struct device_node *np = rt2x00dev->dev->of_node; 
     17+               unsigned int led_polarity; 
    1818+ 
    19 +       if (!of_property_read_u32(np, "ralink,led-polarity", &led_polarity)) 
    20 +               rt2x00_set_field16(&eeprom, EEPROM_FREQ_LED_POLARITY, led_polarity); 
     19+               /* Allow overriding polarity from OF */ 
     20+               if (!of_property_read_u32(np, "ralink,led-polarity", 
     21+                                         &led_polarity)) 
     22+                       rt2x00_set_field16(&eeprom, EEPROM_FREQ_LED_POLARITY, 
     23+                                          led_polarity); 
     24+       } 
    2125+ 
    2226        rt2x00dev->led_mcu_reg = eeprom; 
     
    2529--- a/drivers/net/wireless/rt2x00/rt2x00leds.c 
    2630+++ b/drivers/net/wireless/rt2x00/rt2x00leds.c 
    27 @@ -110,6 +110,7 @@ static int rt2x00leds_register_led(struc 
    28   
     31@@ -111,6 +111,9 @@ static int rt2x00leds_register_led(struc 
    2932        led->led_dev.name = name; 
    3033        led->led_dev.brightness = LED_OFF; 
    31 +       led->led_dev.brightness_set(&led->led_dev, LED_OFF); 
    3234  
     35+       if (rt2x00_is_soc(rt2x00dev)) 
     36+               led->led_dev.brightness_set(&led->led_dev, LED_OFF); 
     37+ 
    3338        retval = led_classdev_register(device, &led->led_dev); 
    3439        if (retval) { 
     40                rt2x00_err(rt2x00dev, "Failed to register led handler\n"); 
Note: See TracChangeset for help on using the changeset viewer.