a310d90f92213a07865a475ad868ec7600bd9fde
[openwrt.git] / target / linux / generic / patches-3.0 / 020-ssb_update.patch
1 --- a/drivers/ssb/driver_chipcommon_pmu.c
2 +++ b/drivers/ssb/driver_chipcommon_pmu.c
3 @@ -417,9 +417,9 @@ static void ssb_pmu_resources_init(struc
4         u32 min_msk = 0, max_msk = 0;
5         unsigned int i;
6         const struct pmu_res_updown_tab_entry *updown_tab = NULL;
7 -       unsigned int updown_tab_size;
8 +       unsigned int updown_tab_size = 0;
9         const struct pmu_res_depend_tab_entry *depend_tab = NULL;
10 -       unsigned int depend_tab_size;
11 +       unsigned int depend_tab_size = 0;
12  
13         switch (bus->chip_id) {
14         case 0x4312:
15 --- a/drivers/ssb/driver_gige.c
16 +++ b/drivers/ssb/driver_gige.c
17 @@ -106,8 +106,9 @@ void gige_pcicfg_write32(struct ssb_gige
18         gige_write32(dev, SSB_GIGE_PCICFG + offset, value);
19  }
20  
21 -static int ssb_gige_pci_read_config(struct pci_bus *bus, unsigned int devfn,
22 -                                   int reg, int size, u32 *val)
23 +static int __devinit ssb_gige_pci_read_config(struct pci_bus *bus,
24 +                                             unsigned int devfn, int reg,
25 +                                             int size, u32 *val)
26  {
27         struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
28         unsigned long flags;
29 @@ -136,8 +137,9 @@ static int ssb_gige_pci_read_config(stru
30         return PCIBIOS_SUCCESSFUL;
31  }
32  
33 -static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn,
34 -                                    int reg, int size, u32 val)
35 +static int __devinit ssb_gige_pci_write_config(struct pci_bus *bus,
36 +                                              unsigned int devfn, int reg,
37 +                                              int size, u32 val)
38  {
39         struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
40         unsigned long flags;
41 @@ -166,7 +168,8 @@ static int ssb_gige_pci_write_config(str
42         return PCIBIOS_SUCCESSFUL;
43  }
44  
45 -static int ssb_gige_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
46 +static int __devinit ssb_gige_probe(struct ssb_device *sdev,
47 +                                   const struct ssb_device_id *id)
48  {
49         struct ssb_gige *dev;
50         u32 base, tmslow, tmshigh;
51 --- a/drivers/ssb/driver_pcicore.c
52 +++ b/drivers/ssb/driver_pcicore.c
53 @@ -314,7 +314,7 @@ int ssb_pcicore_pcibios_map_irq(const st
54         return ssb_mips_irq(extpci_core->dev) + 2;
55  }
56  
57 -static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
58 +static void __devinit ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
59  {
60         u32 val;
61  
62 @@ -379,7 +379,7 @@ static void ssb_pcicore_init_hostmode(st
63         register_pci_controller(&ssb_pcicore_controller);
64  }
65  
66 -static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
67 +static int __devinit pcicore_is_in_hostmode(struct ssb_pcicore *pc)
68  {
69         struct ssb_bus *bus = pc->dev->bus;
70         u16 chipid_top;
71 @@ -412,7 +412,7 @@ static int pcicore_is_in_hostmode(struct
72   * Workarounds.
73   **************************************************/
74  
75 -static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
76 +static void __devinit ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
77  {
78         u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0));
79         if (((tmp & 0xF000) >> 12) != pc->dev->core_index) {
80 @@ -514,13 +514,13 @@ static void ssb_pcicore_pcie_setup_worka
81   * Generic and Clientmode operation code.
82   **************************************************/
83  
84 -static void ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
85 +static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
86  {
87         /* Disable PCI interrupts. */
88         ssb_write32(pc->dev, SSB_INTVEC, 0);
89  }
90  
91 -void ssb_pcicore_init(struct ssb_pcicore *pc)
92 +void __devinit ssb_pcicore_init(struct ssb_pcicore *pc)
93  {
94         struct ssb_device *dev = pc->dev;
95  
96 --- a/drivers/ssb/main.c
97 +++ b/drivers/ssb/main.c
98 @@ -557,7 +557,7 @@ error:
99  }
100  
101  /* Needs ssb_buses_lock() */
102 -static int ssb_attach_queued_buses(void)
103 +static int __devinit ssb_attach_queued_buses(void)
104  {
105         struct ssb_bus *bus, *n;
106         int err = 0;
107 @@ -768,9 +768,9 @@ out:
108         return err;
109  }
110  
111 -static int ssb_bus_register(struct ssb_bus *bus,
112 -                           ssb_invariants_func_t get_invariants,
113 -                           unsigned long baseaddr)
114 +static int __devinit ssb_bus_register(struct ssb_bus *bus,
115 +                                     ssb_invariants_func_t get_invariants,
116 +                                     unsigned long baseaddr)
117  {
118         int err;
119  
120 @@ -851,8 +851,8 @@ err_disable_xtal:
121  }
122  
123  #ifdef CONFIG_SSB_PCIHOST
124 -int ssb_bus_pcibus_register(struct ssb_bus *bus,
125 -                           struct pci_dev *host_pci)
126 +int __devinit ssb_bus_pcibus_register(struct ssb_bus *bus,
127 +                                     struct pci_dev *host_pci)
128  {
129         int err;
130  
131 @@ -875,9 +875,9 @@ EXPORT_SYMBOL(ssb_bus_pcibus_register);
132  #endif /* CONFIG_SSB_PCIHOST */
133  
134  #ifdef CONFIG_SSB_PCMCIAHOST
135 -int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
136 -                              struct pcmcia_device *pcmcia_dev,
137 -                              unsigned long baseaddr)
138 +int __devinit ssb_bus_pcmciabus_register(struct ssb_bus *bus,
139 +                                        struct pcmcia_device *pcmcia_dev,
140 +                                        unsigned long baseaddr)
141  {
142         int err;
143  
144 @@ -897,8 +897,9 @@ EXPORT_SYMBOL(ssb_bus_pcmciabus_register
145  #endif /* CONFIG_SSB_PCMCIAHOST */
146  
147  #ifdef CONFIG_SSB_SDIOHOST
148 -int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
149 -                            unsigned int quirks)
150 +int __devinit ssb_bus_sdiobus_register(struct ssb_bus *bus,
151 +                                      struct sdio_func *func,
152 +                                      unsigned int quirks)
153  {
154         int err;
155  
156 @@ -918,9 +919,9 @@ int ssb_bus_sdiobus_register(struct ssb_
157  EXPORT_SYMBOL(ssb_bus_sdiobus_register);
158  #endif /* CONFIG_SSB_PCMCIAHOST */
159  
160 -int ssb_bus_ssbbus_register(struct ssb_bus *bus,
161 -                           unsigned long baseaddr,
162 -                           ssb_invariants_func_t get_invariants)
163 +int __devinit ssb_bus_ssbbus_register(struct ssb_bus *bus,
164 +                                     unsigned long baseaddr,
165 +                                     ssb_invariants_func_t get_invariants)
166  {
167         int err;
168  
169 @@ -1001,8 +1002,8 @@ u32 ssb_calc_clock_rate(u32 plltype, u32
170         switch (plltype) {
171         case SSB_PLLTYPE_6: /* 100/200 or 120/240 only */
172                 if (m & SSB_CHIPCO_CLK_T6_MMASK)
173 -                       return SSB_CHIPCO_CLK_T6_M0;
174 -               return SSB_CHIPCO_CLK_T6_M1;
175 +                       return SSB_CHIPCO_CLK_T6_M1;
176 +               return SSB_CHIPCO_CLK_T6_M0;
177         case SSB_PLLTYPE_1: /* 48Mhz base, 3 dividers */
178         case SSB_PLLTYPE_3: /* 25Mhz, 2 dividers */
179         case SSB_PLLTYPE_4: /* 48Mhz, 4 dividers */
180 --- a/drivers/ssb/pcihost_wrapper.c
181 +++ b/drivers/ssb/pcihost_wrapper.c
182 @@ -53,8 +53,8 @@ static int ssb_pcihost_resume(struct pci
183  # define ssb_pcihost_resume    NULL
184  #endif /* CONFIG_PM */
185  
186 -static int ssb_pcihost_probe(struct pci_dev *dev,
187 -                            const struct pci_device_id *id)
188 +static int __devinit ssb_pcihost_probe(struct pci_dev *dev,
189 +                                      const struct pci_device_id *id)
190  {
191         struct ssb_bus *ssb;
192         int err = -ENOMEM;
193 @@ -110,7 +110,7 @@ static void ssb_pcihost_remove(struct pc
194         pci_set_drvdata(dev, NULL);
195  }
196  
197 -int ssb_pcihost_register(struct pci_driver *driver)
198 +int __devinit ssb_pcihost_register(struct pci_driver *driver)
199  {
200         driver->probe = ssb_pcihost_probe;
201         driver->remove = ssb_pcihost_remove;
202 --- a/drivers/ssb/scan.c
203 +++ b/drivers/ssb/scan.c
204 @@ -310,8 +310,7 @@ int ssb_bus_scan(struct ssb_bus *bus,
205         } else {
206                 if (bus->bustype == SSB_BUSTYPE_PCI) {
207                         bus->chip_id = pcidev_to_chipid(bus->host_pci);
208 -                       pci_read_config_byte(bus->host_pci, PCI_REVISION_ID,
209 -                                            &bus->chip_rev);
210 +                       bus->chip_rev = bus->host_pci->revision;
211                         bus->chip_package = 0;
212                 } else {
213                         bus->chip_id = 0x4710;