1 From d16de2a4ffeaf62fb3d838365a29b80f330bffe0 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Thu, 4 Jul 2013 22:26:58 +0200
4 Subject: [PATCH 09/17] bcma: register bcma as device tree driver
6 This driver is used by the bcm53xx ARM SoC code.Now it is possible to
7 give the address of the chipcommon core in device tree.
9 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 drivers/bcma/host_soc.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++
12 1 file changed, 73 insertions(+)
14 --- a/drivers/bcma/host_soc.c
15 +++ b/drivers/bcma/host_soc.c
18 #include "bcma_private.h"
20 +#include <linux/slab.h>
21 +#include <linux/module.h>
22 +#include <linux/of_address.h>
23 #include <linux/bcma/bcma.h>
24 #include <linux/bcma/bcma_soc.h>
26 @@ -181,3 +184,73 @@ int __init bcma_host_soc_register(struct
32 +static int bcma_host_soc_probe(struct platform_device *pdev)
34 + struct device *dev = &pdev->dev;
35 + struct device_node *np = dev->of_node;
36 + struct bcma_bus *bus;
40 + bus = kzalloc(sizeof(*bus), GFP_KERNEL);
46 + bus->mmio = of_iomap(np, 0);
51 + bus->hosttype = BCMA_HOSTTYPE_SOC;
52 + bus->ops = &bcma_host_soc_ops;
56 + err = bcma_bus_register(bus);
58 + goto err_unmap_mmio;
60 + platform_set_drvdata(pdev, bus);
71 +static int bcma_host_soc_remove(struct platform_device *pdev)
73 + struct bcma_bus *bus = platform_get_drvdata(pdev);
75 + bcma_bus_unregister(bus);
78 + platform_set_drvdata(pdev, NULL);
83 +static const struct of_device_id bcma_host_soc_of_match[] = {
84 + { .compatible = "brcm,bus-aix", },
87 +MODULE_DEVICE_TABLE(of, bcma_host_soc_of_match);
89 +static struct platform_driver bcma_host_soc_driver = {
91 + .name = "bcma-host-soc",
92 + .owner = THIS_MODULE,
93 + .of_match_table = bcma_host_soc_of_match,
95 + .probe = bcma_host_soc_probe,
96 + .remove = bcma_host_soc_remove,
98 +module_platform_driver(bcma_host_soc_driver);
99 +#endif /* CONFIG_OF */