1 bcma: register bcma as device tree driver
3 This driver is used by the bcm53xx ARM SoC code.Now it is possible to
4 give the address of the chipcommon core in device tree.
6 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 drivers/bcma/host_soc.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++
9 1 file changed, 73 insertions(+)
11 --- a/drivers/bcma/host_soc.c
12 +++ b/drivers/bcma/host_soc.c
15 #include "bcma_private.h"
17 +#include <linux/slab.h>
18 +#include <linux/module.h>
19 +#include <linux/of_address.h>
20 #include <linux/bcma/bcma.h>
21 #include <linux/bcma/bcma_soc.h>
23 @@ -181,3 +184,73 @@ int __init bcma_host_soc_register(struct
29 +static int bcma_host_soc_probe(struct platform_device *pdev)
31 + struct device *dev = &pdev->dev;
32 + struct device_node *np = dev->of_node;
33 + struct bcma_bus *bus;
37 + bus = kzalloc(sizeof(*bus), GFP_KERNEL);
43 + bus->mmio = of_iomap(np, 0);
48 + bus->hosttype = BCMA_HOSTTYPE_SOC;
49 + bus->ops = &bcma_host_soc_ops;
53 + err = bcma_bus_register(bus);
55 + goto err_unmap_mmio;
57 + platform_set_drvdata(pdev, bus);
68 +static int bcma_host_soc_remove(struct platform_device *pdev)
70 + struct bcma_bus *bus = platform_get_drvdata(pdev);
72 + bcma_bus_unregister(bus);
75 + platform_set_drvdata(pdev, NULL);
80 +static const struct of_device_id bcma_host_soc_of_match[] = {
81 + { .compatible = "brcm,bus-aix", },
84 +MODULE_DEVICE_TABLE(of, bcma_host_soc_of_match);
86 +static struct platform_driver bcma_host_soc_driver = {
88 + .name = "bcma-host-soc",
89 + .owner = THIS_MODULE,
90 + .of_match_table = bcma_host_soc_of_match,
92 + .probe = bcma_host_soc_probe,
93 + .remove = bcma_host_soc_remove,
95 +module_platform_driver(bcma_host_soc_driver);
96 +#endif /* CONFIG_OF */