1 // SPDX-License-Identifier: ISC
3 * Copyright (c) 2014 Broadcom Corporation
5 #include <linux/init.h>
7 #include <linux/of_irq.h>
15 void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
16 struct brcmf_mp_device *settings)
18 struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
19 struct device_node *root, *np = dev->of_node;
20 struct property *prop;
25 /* Set board-type to the first string of the machine compatible prop */
26 root = of_find_node_by_path("/");
28 prop = of_find_property(root, "compatible", NULL);
29 settings->board_type = of_prop_next_string(prop, NULL);
33 if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
34 !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
37 if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
38 sdio->drive_strength = val;
40 /* make sure there are interrupts defined in the node */
41 if (!of_find_property(np, "interrupts", NULL))
44 irq = irq_of_parse_and_map(np, 0);
46 brcmf_err("interrupt could not be mapped\n");
49 irqf = irqd_get_trigger_type(irq_get_irq_data(irq));
51 sdio->oob_irq_supported = true;
52 sdio->oob_irq_nr = irq;
53 sdio->oob_irq_flags = irqf;