diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2012-07-10 17:45:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-12 15:27:17 -0400 |
commit | 6d5cfc9f7df4956f7958df1b2e425145793d9f4d (patch) | |
tree | 4fb2f68f9a6a110fe6d6ab27d6688b0a4e3f396e /drivers/bcma | |
parent | 644e8c07391c0190b806d5001cbee82ebe2615b3 (diff) |
bcma: support alternative (BCM4706) ChipCommon core id
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r-- | drivers/bcma/main.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 7ff4bac6f9e1..151bddc57e16 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c | |||
@@ -61,6 +61,13 @@ static struct bus_type bcma_bus_type = { | |||
61 | .dev_attrs = bcma_device_attrs, | 61 | .dev_attrs = bcma_device_attrs, |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static u16 bcma_cc_core_id(struct bcma_bus *bus) | ||
65 | { | ||
66 | if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) | ||
67 | return BCMA_CORE_4706_CHIPCOMMON; | ||
68 | return BCMA_CORE_CHIPCOMMON; | ||
69 | } | ||
70 | |||
64 | struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid) | 71 | struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid) |
65 | { | 72 | { |
66 | struct bcma_device *core; | 73 | struct bcma_device *core; |
@@ -91,6 +98,7 @@ static int bcma_register_cores(struct bcma_bus *bus) | |||
91 | list_for_each_entry(core, &bus->cores, list) { | 98 | list_for_each_entry(core, &bus->cores, list) { |
92 | /* We support that cores ourself */ | 99 | /* We support that cores ourself */ |
93 | switch (core->id.id) { | 100 | switch (core->id.id) { |
101 | case BCMA_CORE_4706_CHIPCOMMON: | ||
94 | case BCMA_CORE_CHIPCOMMON: | 102 | case BCMA_CORE_CHIPCOMMON: |
95 | case BCMA_CORE_PCI: | 103 | case BCMA_CORE_PCI: |
96 | case BCMA_CORE_PCIE: | 104 | case BCMA_CORE_PCIE: |
@@ -157,7 +165,7 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) | |||
157 | } | 165 | } |
158 | 166 | ||
159 | /* Init CC core */ | 167 | /* Init CC core */ |
160 | core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON); | 168 | core = bcma_find_core(bus, bcma_cc_core_id(bus)); |
161 | if (core) { | 169 | if (core) { |
162 | bus->drv_cc.core = core; | 170 | bus->drv_cc.core = core; |
163 | bcma_core_chipcommon_init(&bus->drv_cc); | 171 | bcma_core_chipcommon_init(&bus->drv_cc); |
@@ -208,7 +216,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus, | |||
208 | bcma_init_bus(bus); | 216 | bcma_init_bus(bus); |
209 | 217 | ||
210 | match.manuf = BCMA_MANUF_BCM; | 218 | match.manuf = BCMA_MANUF_BCM; |
211 | match.id = BCMA_CORE_CHIPCOMMON; | 219 | match.id = bcma_cc_core_id(bus); |
212 | match.class = BCMA_CL_SIM; | 220 | match.class = BCMA_CL_SIM; |
213 | match.rev = BCMA_ANY_REV; | 221 | match.rev = BCMA_ANY_REV; |
214 | 222 | ||
@@ -232,7 +240,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus, | |||
232 | } | 240 | } |
233 | 241 | ||
234 | /* Init CC core */ | 242 | /* Init CC core */ |
235 | core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON); | 243 | core = bcma_find_core(bus, bcma_cc_core_id(bus)); |
236 | if (core) { | 244 | if (core) { |
237 | bus->drv_cc.core = core; | 245 | bus->drv_cc.core = core; |
238 | bcma_core_chipcommon_init(&bus->drv_cc); | 246 | bcma_core_chipcommon_init(&bus->drv_cc); |
@@ -271,8 +279,7 @@ int bcma_bus_resume(struct bcma_bus *bus) | |||
271 | struct bcma_device *core; | 279 | struct bcma_device *core; |
272 | 280 | ||
273 | /* Init CC core */ | 281 | /* Init CC core */ |
274 | core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON); | 282 | if (bus->drv_cc.core) { |
275 | if (core) { | ||
276 | bus->drv_cc.setup_done = false; | 283 | bus->drv_cc.setup_done = false; |
277 | bcma_core_chipcommon_init(&bus->drv_cc); | 284 | bcma_core_chipcommon_init(&bus->drv_cc); |
278 | } | 285 | } |