Ignore:
Timestamp:
2011-05-05T16:05:21+02:00 (5 years ago)
Author:
hauke
Message:

brcm47xx: when detecting a ssb pci device without an own sprom write the sprom data from the platform device to the correct pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-2.6.38/031-ssb-add-callback-for-sprom.patch

    r26801 r26829  
    66 }; 
    77+ 
    8 +int bcm63xx_get_fallback_sprom(struct ssb_bus *bus) 
     8+int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
    99+{ 
    1010+       if (bus->bustype == SSB_BUSTYPE_PCI) { 
    11 +               memcpy(&bus->sprom, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
     11+               memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom)); 
    1212+               return 0; 
    1313+       } else { 
     
    5151+                        * Now we ask the arch code if there is some sprom 
    5252+                        * avaliable for this device in some other storage */ 
    53 +                       err = ssb_fill_sprom_with_fallback(bus); 
     53+                       err = ssb_fill_sprom_with_fallback(bus, sprom); 
    5454+                       if (err) { 
    5555+                               ssb_printk(KERN_WARNING PFX "WARNING: Using" 
     
    6767  
    6868-static const struct ssb_sprom *fallback_sprom; 
    69 +static int(*get_fallback_sprom)(struct ssb_bus *dev); 
     69+static int(*get_fallback_sprom)(struct ssb_bus *dev, struct ssb_sprom *out); 
    7070  
    7171  
     
    9696  */ 
    9797-int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom) 
    98 +int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus)) 
     98+int ssb_arch_register_fallback_sprom(int (*sprom_callback)(struct ssb_bus *bus, struct ssb_sprom *out)) 
    9999 { 
    100100-       if (fallback_sprom) 
     
    108108  
    109109-const struct ssb_sprom *ssb_get_fallback_sprom(void) 
    110 +int ssb_fill_sprom_with_fallback(struct ssb_bus *bus) 
     110+int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out) 
    111111 { 
    112112-       return fallback_sprom; 
     
    114114+               return -ENOENT; 
    115115+ 
    116 +       return get_fallback_sprom(bus); 
     116+       return get_fallback_sprom(bus, out); 
    117117 } 
    118118  
     
    125125                             int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom)); 
    126126-extern const struct ssb_sprom *ssb_get_fallback_sprom(void); 
    127 +extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus); 
     127+extern int ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out); 
    128128  
    129129  
     
    131131--- a/include/linux/ssb/ssb.h 
    132132+++ b/include/linux/ssb/ssb.h 
    133 @@ -404,7 +404,8 @@ extern bool ssb_is_sprom_available(struc 
     133@@ -404,7 +404,9 @@ extern bool ssb_is_sprom_available(struc 
    134134  
    135135 /* Set a fallback SPROM. 
     
    137137-extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); 
    138138+extern int ssb_arch_register_fallback_sprom( 
    139 +               int (*sprom_callback)(struct ssb_bus *bus)); 
     139+               int (*sprom_callback)(struct ssb_bus *bus, 
     140+               struct ssb_sprom *out)); 
    140141  
    141142 /* Suspend a SSB bus. 
Note: See TracChangeset for help on using the changeset viewer.