diff options
Diffstat (limited to 'drivers/bcma')
| -rw-r--r-- | drivers/bcma/Kconfig | 3 | ||||
| -rw-r--r-- | drivers/bcma/bcma_private.h | 11 | ||||
| -rw-r--r-- | drivers/bcma/driver_chipcommon_nflash.c | 2 | ||||
| -rw-r--r-- | drivers/bcma/driver_chipcommon_sflash.c | 2 | ||||
| -rw-r--r-- | drivers/bcma/driver_gmac_cmn.c | 2 | ||||
| -rw-r--r-- | drivers/bcma/driver_gpio.c | 5 | ||||
| -rw-r--r-- | drivers/bcma/driver_pci.c | 4 | ||||
| -rw-r--r-- | drivers/bcma/driver_pci_host.c | 13 | ||||
| -rw-r--r-- | drivers/bcma/host_pci.c | 8 | ||||
| -rw-r--r-- | drivers/bcma/main.c | 9 |
10 files changed, 37 insertions, 22 deletions
diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig index d7b56a88c9f4..8b4221cfd118 100644 --- a/drivers/bcma/Kconfig +++ b/drivers/bcma/Kconfig | |||
| @@ -67,8 +67,7 @@ config BCMA_DRIVER_GMAC_CMN | |||
| 67 | 67 | ||
| 68 | config BCMA_DRIVER_GPIO | 68 | config BCMA_DRIVER_GPIO |
| 69 | bool "BCMA GPIO driver" | 69 | bool "BCMA GPIO driver" |
| 70 | depends on BCMA | 70 | depends on BCMA && GPIOLIB |
| 71 | select GPIOLIB | ||
| 72 | help | 71 | help |
| 73 | Driver to provide access to the GPIO pins of the bcma bus. | 72 | Driver to provide access to the GPIO pins of the bcma bus. |
| 74 | 73 | ||
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index 4a2d72ec6d43..cb0c45488572 100644 --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | struct bcma_bus; | 22 | struct bcma_bus; |
| 23 | 23 | ||
| 24 | /* main.c */ | 24 | /* main.c */ |
| 25 | int __devinit bcma_bus_register(struct bcma_bus *bus); | 25 | int bcma_bus_register(struct bcma_bus *bus); |
| 26 | void bcma_bus_unregister(struct bcma_bus *bus); | 26 | void bcma_bus_unregister(struct bcma_bus *bus); |
| 27 | int __init bcma_bus_early_register(struct bcma_bus *bus, | 27 | int __init bcma_bus_early_register(struct bcma_bus *bus, |
| 28 | struct bcma_device *core_cc, | 28 | struct bcma_device *core_cc, |
| @@ -87,18 +87,23 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address); | |||
| 87 | extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc); | 87 | extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc); |
| 88 | 88 | ||
| 89 | #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE | 89 | #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE |
| 90 | bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc); | 90 | bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc); |
| 91 | void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc); | 91 | void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc); |
| 92 | #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */ | 92 | #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */ |
| 93 | 93 | ||
| 94 | #ifdef CONFIG_BCMA_DRIVER_GPIO | 94 | #ifdef CONFIG_BCMA_DRIVER_GPIO |
| 95 | /* driver_gpio.c */ | 95 | /* driver_gpio.c */ |
| 96 | int bcma_gpio_init(struct bcma_drv_cc *cc); | 96 | int bcma_gpio_init(struct bcma_drv_cc *cc); |
| 97 | int bcma_gpio_unregister(struct bcma_drv_cc *cc); | ||
| 97 | #else | 98 | #else |
| 98 | static inline int bcma_gpio_init(struct bcma_drv_cc *cc) | 99 | static inline int bcma_gpio_init(struct bcma_drv_cc *cc) |
| 99 | { | 100 | { |
| 100 | return -ENOTSUPP; | 101 | return -ENOTSUPP; |
| 101 | } | 102 | } |
| 103 | static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc) | ||
| 104 | { | ||
| 105 | return 0; | ||
| 106 | } | ||
| 102 | #endif /* CONFIG_BCMA_DRIVER_GPIO */ | 107 | #endif /* CONFIG_BCMA_DRIVER_GPIO */ |
| 103 | 108 | ||
| 104 | #endif | 109 | #endif |
diff --git a/drivers/bcma/driver_chipcommon_nflash.c b/drivers/bcma/driver_chipcommon_nflash.c index dbda91e4dff5..1f0b83e18f68 100644 --- a/drivers/bcma/driver_chipcommon_nflash.c +++ b/drivers/bcma/driver_chipcommon_nflash.c | |||
| @@ -21,7 +21,7 @@ int bcma_nflash_init(struct bcma_drv_cc *cc) | |||
| 21 | struct bcma_bus *bus = cc->core->bus; | 21 | struct bcma_bus *bus = cc->core->bus; |
| 22 | 22 | ||
| 23 | if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 && | 23 | if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 && |
| 24 | cc->core->id.rev != 0x38) { | 24 | cc->core->id.rev != 38) { |
| 25 | bcma_err(bus, "NAND flash on unsupported board!\n"); | 25 | bcma_err(bus, "NAND flash on unsupported board!\n"); |
| 26 | return -ENOTSUPP; | 26 | return -ENOTSUPP; |
| 27 | } | 27 | } |
diff --git a/drivers/bcma/driver_chipcommon_sflash.c b/drivers/bcma/driver_chipcommon_sflash.c index 63e688393825..1e694db4532d 100644 --- a/drivers/bcma/driver_chipcommon_sflash.c +++ b/drivers/bcma/driver_chipcommon_sflash.c | |||
| @@ -35,7 +35,7 @@ static struct bcma_sflash_tbl_e bcma_sflash_st_tbl[] = { | |||
| 35 | { "M25P40", 0x12, 0x10000, 8, }, | 35 | { "M25P40", 0x12, 0x10000, 8, }, |
| 36 | 36 | ||
| 37 | { "M25P16", 0x14, 0x10000, 32, }, | 37 | { "M25P16", 0x14, 0x10000, 32, }, |
| 38 | { "M25P32", 0x14, 0x10000, 64, }, | 38 | { "M25P32", 0x15, 0x10000, 64, }, |
| 39 | { "M25P64", 0x16, 0x10000, 128, }, | 39 | { "M25P64", 0x16, 0x10000, 128, }, |
| 40 | { "M25FL128", 0x17, 0x10000, 256, }, | 40 | { "M25FL128", 0x17, 0x10000, 256, }, |
| 41 | { 0 }, | 41 | { 0 }, |
diff --git a/drivers/bcma/driver_gmac_cmn.c b/drivers/bcma/driver_gmac_cmn.c index 834225f65e8f..dcb137926d31 100644 --- a/drivers/bcma/driver_gmac_cmn.c +++ b/drivers/bcma/driver_gmac_cmn.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "bcma_private.h" | 8 | #include "bcma_private.h" |
| 9 | #include <linux/bcma/bcma.h> | 9 | #include <linux/bcma/bcma.h> |
| 10 | 10 | ||
| 11 | void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) | 11 | void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) |
| 12 | { | 12 | { |
| 13 | mutex_init(&gc->phy_mutex); | 13 | mutex_init(&gc->phy_mutex); |
| 14 | } | 14 | } |
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index 9a6f585da2d9..71f755c06fc6 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c | |||
| @@ -96,3 +96,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) | |||
| 96 | 96 | ||
| 97 | return gpiochip_add(chip); | 97 | return gpiochip_add(chip); |
| 98 | } | 98 | } |
| 99 | |||
| 100 | int bcma_gpio_unregister(struct bcma_drv_cc *cc) | ||
| 101 | { | ||
| 102 | return gpiochip_remove(&cc->gpio); | ||
| 103 | } | ||
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index c39ee6d45850..cf7a476a519f 100644 --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c | |||
| @@ -207,14 +207,14 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) | |||
| 207 | * Init. | 207 | * Init. |
| 208 | **************************************************/ | 208 | **************************************************/ |
| 209 | 209 | ||
| 210 | static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc) | 210 | static void bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc) |
| 211 | { | 211 | { |
| 212 | bcma_core_pci_fixcfg(pc); | 212 | bcma_core_pci_fixcfg(pc); |
| 213 | bcma_pcicore_serdes_workaround(pc); | 213 | bcma_pcicore_serdes_workaround(pc); |
| 214 | bcma_core_pci_config_fixup(pc); | 214 | bcma_core_pci_config_fixup(pc); |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc) | 217 | void bcma_core_pci_init(struct bcma_drv_pci *pc) |
| 218 | { | 218 | { |
| 219 | if (pc->setup_done) | 219 | if (pc->setup_done) |
| 220 | return; | 220 | return; |
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c index e6b5c89469dc..af0c9fabee54 100644 --- a/drivers/bcma/driver_pci_host.c +++ b/drivers/bcma/driver_pci_host.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | #define BCMA_PCI_SLOT_MAX 16 | 24 | #define BCMA_PCI_SLOT_MAX 16 |
| 25 | #define PCI_CONFIG_SPACE_SIZE 256 | 25 | #define PCI_CONFIG_SPACE_SIZE 256 |
| 26 | 26 | ||
| 27 | bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) | 27 | bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) |
| 28 | { | 28 | { |
| 29 | struct bcma_bus *bus = pc->core->bus; | 29 | struct bcma_bus *bus = pc->core->bus; |
| 30 | u16 chipid_top; | 30 | u16 chipid_top; |
| @@ -264,10 +264,9 @@ static int bcma_core_pci_hostmode_write_config(struct pci_bus *bus, | |||
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | /* return cap_offset if requested capability exists in the PCI config space */ | 266 | /* return cap_offset if requested capability exists in the PCI config space */ |
| 267 | static u8 __devinit bcma_find_pci_capability(struct bcma_drv_pci *pc, | 267 | static u8 bcma_find_pci_capability(struct bcma_drv_pci *pc, unsigned int dev, |
| 268 | unsigned int dev, | 268 | unsigned int func, u8 req_cap_id, |
| 269 | unsigned int func, u8 req_cap_id, | 269 | unsigned char *buf, u32 *buflen) |
| 270 | unsigned char *buf, u32 *buflen) | ||
| 271 | { | 270 | { |
| 272 | u8 cap_id; | 271 | u8 cap_id; |
| 273 | u8 cap_ptr = 0; | 272 | u8 cap_ptr = 0; |
| @@ -334,7 +333,7 @@ static u8 __devinit bcma_find_pci_capability(struct bcma_drv_pci *pc, | |||
| 334 | * Retry Status (CRS) Completion Status to software then | 333 | * Retry Status (CRS) Completion Status to software then |
| 335 | * enable the feature. | 334 | * enable the feature. |
| 336 | */ | 335 | */ |
| 337 | static void __devinit bcma_core_pci_enable_crs(struct bcma_drv_pci *pc) | 336 | static void bcma_core_pci_enable_crs(struct bcma_drv_pci *pc) |
| 338 | { | 337 | { |
| 339 | struct bcma_bus *bus = pc->core->bus; | 338 | struct bcma_bus *bus = pc->core->bus; |
| 340 | u8 cap_ptr, root_ctrl, root_cap, dev; | 339 | u8 cap_ptr, root_ctrl, root_cap, dev; |
| @@ -381,7 +380,7 @@ static void __devinit bcma_core_pci_enable_crs(struct bcma_drv_pci *pc) | |||
| 381 | } | 380 | } |
| 382 | } | 381 | } |
| 383 | 382 | ||
| 384 | void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) | 383 | void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) |
| 385 | { | 384 | { |
| 386 | struct bcma_bus *bus = pc->core->bus; | 385 | struct bcma_bus *bus = pc->core->bus; |
| 387 | struct bcma_drv_pci_host *pc_host; | 386 | struct bcma_drv_pci_host *pc_host; |
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c index 98fdc3e014e7..fbf2759e7e4e 100644 --- a/drivers/bcma/host_pci.c +++ b/drivers/bcma/host_pci.c | |||
| @@ -155,8 +155,8 @@ static const struct bcma_host_ops bcma_host_pci_ops = { | |||
| 155 | .awrite32 = bcma_host_pci_awrite32, | 155 | .awrite32 = bcma_host_pci_awrite32, |
| 156 | }; | 156 | }; |
| 157 | 157 | ||
| 158 | static int __devinit bcma_host_pci_probe(struct pci_dev *dev, | 158 | static int bcma_host_pci_probe(struct pci_dev *dev, |
| 159 | const struct pci_device_id *id) | 159 | const struct pci_device_id *id) |
| 160 | { | 160 | { |
| 161 | struct bcma_bus *bus; | 161 | struct bcma_bus *bus; |
| 162 | int err = -ENOMEM; | 162 | int err = -ENOMEM; |
| @@ -226,7 +226,7 @@ err_kfree_bus: | |||
| 226 | return err; | 226 | return err; |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | static void __devexit bcma_host_pci_remove(struct pci_dev *dev) | 229 | static void bcma_host_pci_remove(struct pci_dev *dev) |
| 230 | { | 230 | { |
| 231 | struct bcma_bus *bus = pci_get_drvdata(dev); | 231 | struct bcma_bus *bus = pci_get_drvdata(dev); |
| 232 | 232 | ||
| @@ -284,7 +284,7 @@ static struct pci_driver bcma_pci_bridge_driver = { | |||
| 284 | .name = "bcma-pci-bridge", | 284 | .name = "bcma-pci-bridge", |
| 285 | .id_table = bcma_pci_bridge_tbl, | 285 | .id_table = bcma_pci_bridge_tbl, |
| 286 | .probe = bcma_host_pci_probe, | 286 | .probe = bcma_host_pci_probe, |
| 287 | .remove = __devexit_p(bcma_host_pci_remove), | 287 | .remove = bcma_host_pci_remove, |
| 288 | .driver.pm = BCMA_PM_OPS, | 288 | .driver.pm = BCMA_PM_OPS, |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 53ba20ca17e0..324f9debda88 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c | |||
| @@ -192,7 +192,7 @@ static void bcma_unregister_cores(struct bcma_bus *bus) | |||
| 192 | platform_device_unregister(bus->drv_cc.watchdog); | 192 | platform_device_unregister(bus->drv_cc.watchdog); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | int __devinit bcma_bus_register(struct bcma_bus *bus) | 195 | int bcma_bus_register(struct bcma_bus *bus) |
| 196 | { | 196 | { |
| 197 | int err; | 197 | int err; |
| 198 | struct bcma_device *core; | 198 | struct bcma_device *core; |
| @@ -268,6 +268,13 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) | |||
| 268 | void bcma_bus_unregister(struct bcma_bus *bus) | 268 | void bcma_bus_unregister(struct bcma_bus *bus) |
| 269 | { | 269 | { |
| 270 | struct bcma_device *cores[3]; | 270 | struct bcma_device *cores[3]; |
| 271 | int err; | ||
| 272 | |||
| 273 | err = bcma_gpio_unregister(&bus->drv_cc); | ||
| 274 | if (err == -EBUSY) | ||
| 275 | bcma_err(bus, "Some GPIOs are still in use.\n"); | ||
| 276 | else if (err) | ||
| 277 | bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); | ||
| 271 | 278 | ||
| 272 | cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); | 279 | cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); |
| 273 | cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); | 280 | cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); |
