// SPDX-License-Identifier: GPL-2.0 /* * Simple Power-Managed Bus Driver * * Copyright (C) 2014-2015 Glider bvba * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details.
*/
/* * Allow user to use driver_override to bind this driver to a * transparent bus device which has a different compatible string * that's not listed in simple_pm_bus_of_match. We don't want to do any * of the simple-pm-bus tasks for these devices, so return early.
*/ if (pdev->driver_override) return 0;
match = of_match_device(dev->driver->of_match_table, dev); /* * These are transparent bus devices (not simple-pm-bus matches) that * have their child nodes populated automatically. So, don't need to * do anything more. We only match with the device if this driver is * the most specific match because we don't want to incorrectly bind to * a device that has a more specific driver.
*/ if (match && match->data) { if (of_property_match_string(np, "compatible", match->compatible) == 0) return 0; else return -ENODEV;
}
bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); if (!bus) return -ENOMEM;
bus->num_clks = devm_clk_bulk_get_all(&pdev->dev, &bus->clks); if (bus->num_clks < 0) return dev_err_probe(&pdev->dev, bus->num_clks, "failed to get clocks\n");
dev_set_drvdata(&pdev->dev, bus);
dev_dbg(&pdev->dev, "%s\n", __func__);
pm_runtime_enable(&pdev->dev);
if (np)
of_platform_populate(np, NULL, lookup, &pdev->dev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.