Lines Matching +full:operating +full:- +full:points +full:- +full:v2 +full:- +full:qcom +full:- +full:level

1 // SPDX-License-Identifier: GPL-2.0+
16 #include <linux/dma-mapping.h>
28 { .compatible = "simple-bus", },
29 { .compatible = "simple-mfd", },
32 { .compatible = "arm,amba-bus", },
38 * of_find_device_by_node - Find the platform_device associated with a node
57 BUG_ON(ofdev->dev.of_node == NULL); in of_device_add()
61 ofdev->name = dev_name(&ofdev->dev); in of_device_add()
62 ofdev->id = PLATFORM_DEVID_NONE; in of_device_add()
69 set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->dev.of_node)); in of_device_add()
71 return device_add(&ofdev->dev); in of_device_add()
76 device_initialize(&pdev->dev); in of_device_register()
83 device_unregister(&ofdev->dev); in of_device_unregister()
89 { .compatible = "operating-points-v2", },
102 * of_device_alloc - Allocate and initialize an of_device
130 dev->num_resources = num_reg; in of_device_alloc()
131 dev->resource = res; in of_device_alloc()
139 device_set_node(&dev->dev, of_fwnode_handle(of_node_get(np))); in of_device_alloc()
140 dev->dev.parent = parent ? : &platform_bus; in of_device_alloc()
143 dev_set_name(&dev->dev, "%s", bus_id); in of_device_alloc()
145 of_device_make_bus_id(&dev->dev); in of_device_alloc()
152 * of_platform_device_create_pdata - Alloc, initialize and register an of_device
179 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); in of_platform_device_create_pdata()
180 if (!dev->dev.dma_mask) in of_platform_device_create_pdata()
181 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; in of_platform_device_create_pdata()
182 dev->dev.bus = &platform_bus_type; in of_platform_device_create_pdata()
183 dev->dev.platform_data = platform_data; in of_platform_device_create_pdata()
184 of_msi_configure(&dev->dev, dev->dev.of_node); in of_platform_device_create_pdata()
199 * of_platform_device_create - Alloc, initialize and register an of_device
235 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); in of_amba_device_create()
236 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; in of_amba_device_create()
239 device_set_node(&dev->dev, of_fwnode_handle(node)); in of_amba_device_create()
240 dev->dev.parent = parent ? : &platform_bus; in of_amba_device_create()
241 dev->dev.platform_data = platform_data; in of_amba_device_create()
243 dev_set_name(&dev->dev, "%s", bus_id); in of_amba_device_create()
245 of_device_make_bus_id(&dev->dev); in of_amba_device_create()
248 of_property_read_u32(node, "arm,primecell-periphid", &dev->periphid); in of_amba_device_create()
250 ret = of_address_to_resource(node, 0, &dev->res); in of_amba_device_create()
283 * of_dev_lookup() - Given a device node, lookup the preferred Linux name
296 for (; auxdata->compatible; auxdata++) { in of_dev_lookup()
297 if (!of_device_is_compatible(np, auxdata->compatible)) in of_dev_lookup()
301 if (res.start != auxdata->phys_addr) in of_dev_lookup()
303 pr_debug("%pOF: devname=%s\n", np, auxdata->name); in of_dev_lookup()
312 for (; auxdata->compatible; auxdata++) { in of_dev_lookup()
313 if (!of_device_is_compatible(np, auxdata->compatible)) in of_dev_lookup()
315 if (!auxdata->phys_addr && !auxdata->name) { in of_dev_lookup()
325 * of_platform_bus_create() - Create a device for a node and its children.
329 * @parent: parent for new device, or NULL for top level.
348 pr_debug("%s() - skipping %pOF, no compatible prop\n", in of_platform_bus_create()
355 pr_debug("%s() - skipping %pOF node\n", __func__, bus); in of_platform_bus_create()
360 pr_debug("%s() - skipping %pOF, already populated\n", in of_platform_bus_create()
367 bus_id = auxdata->name; in of_platform_bus_create()
368 platform_data = auxdata->platform_data; in of_platform_bus_create()
386 rc = of_platform_bus_create(child, matches, lookup, &dev->dev, strict); in of_platform_bus_create()
395 * of_platform_bus_probe() - Probe the device-tree for platform buses
396 * @root: parent of the first level to probe or NULL for the root of the tree
412 return -EINVAL; in of_platform_bus_probe()
436 * of_platform_populate() - Populate platform_devices from device tree data
437 * @root: parent of the first level to probe or NULL for the root of the tree
463 return -EINVAL; in of_platform_populate()
494 { .compatible = "qcom,rmtfs-mem" },
495 { .compatible = "qcom,cmd-db" },
496 { .compatible = "qcom,smem" },
498 { .compatible = "nvmem-rmem" },
499 { .compatible = "google,open-dice" },
516 if (of_property_present(of_chosen, "linux,bootx-noscreen")) { in of_platform_default_populate_init()
524 dev = platform_device_alloc("bootx-noscreen", 0); in of_platform_default_populate_init()
526 return -ENOMEM; in of_platform_default_populate_init()
541 !of_get_property(node, "linux,boot-display", NULL)) in of_platform_default_populate_init()
543 dev = of_platform_device_create(node, "of-display", NULL); in of_platform_default_populate_init()
546 return -ENOMEM; in of_platform_default_populate_init()
553 const char *of_display_format = "of-display.%d"; in of_platform_default_populate_init()
565 * platform_devices for every node in /reserved-memory with a in of_platform_default_populate_init()
577 node = of_get_compatible_child(of_chosen, "simple-framebuffer"); in of_platform_default_populate_init()
580 * Since a "simple-framebuffer" device is already added in of_platform_default_populate_init()
612 if (!dev->of_node || !of_node_check_flag(dev->of_node, OF_POPULATED)) in of_platform_device_destroy()
616 if (of_node_check_flag(dev->of_node, OF_POPULATED_BUS)) in of_platform_device_destroy()
619 of_node_clear_flag(dev->of_node, OF_POPULATED); in of_platform_device_destroy()
620 of_node_clear_flag(dev->of_node, OF_POPULATED_BUS); in of_platform_device_destroy()
622 if (dev->bus == &platform_bus_type) in of_platform_device_destroy()
625 else if (dev->bus == &amba_bustype) in of_platform_device_destroy()
634 * of_platform_depopulate() - Remove devices populated from device tree
640 * leaving others - eg. manually created - unharmed).
644 if (parent->of_node && of_node_check_flag(parent->of_node, OF_POPULATED_BUS)) { in of_platform_depopulate()
646 of_node_clear_flag(parent->of_node, OF_POPULATED_BUS); in of_platform_depopulate()
657 * devm_of_platform_populate() - Populate platform_devices from device tree data
671 return -EINVAL; in devm_of_platform_populate()
676 return -ENOMEM; in devm_of_platform_populate()
678 ret = of_platform_populate(dev->of_node, NULL, NULL, dev); in devm_of_platform_populate()
703 * devm_of_platform_depopulate() - Remove devices populated from device tree
709 * leaving others - eg. manually created - unharmed).
733 parent = rd->dn->parent; in of_platform_notify()
740 if (of_node_check_flag(rd->dn, OF_POPULATED)) in of_platform_notify()
747 rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE; in of_platform_notify()
750 pdev = of_platform_device_create(rd->dn, NULL, in of_platform_notify()
751 pdev_parent ? &pdev_parent->dev : NULL); in of_platform_notify()
756 __func__, rd->dn); in of_platform_notify()
758 return notifier_from_errno(-EINVAL); in of_platform_notify()
765 if (!of_node_check_flag(rd->dn, OF_POPULATED)) in of_platform_notify()
769 pdev = of_find_device_by_node(rd->dn); in of_platform_notify()
774 of_platform_device_destroy(&pdev->dev, &children_left); in of_platform_notify()