/* * Device will be instantiated as child of PMU device without its own * device node. Therefore match compatibles against parent.
*/ staticint exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask)
{ conststruct exynos_clkout_variant *variant; conststruct of_device_id *match;
if (!dev->parent) {
dev_err(dev, "not instantiated from MFD\n"); return -EINVAL;
}
/* * 'exynos_clkout_ids' arrays is not the ids array matched by * the dev->parent driver, so of_device_get_match_data() or * device_get_match_data() cannot be used here.
*/
match = of_match_device(exynos_clkout_ids, dev->parent); if (!match) {
dev_err(dev, "cannot match parent device\n"); return -EINVAL;
}
variant = match->data;
ret = exynos_clkout_match_parent_dev(&pdev->dev, &mux_mask); if (ret) return ret;
clkout->np = pdev->dev.of_node; if (!clkout->np) { /* * pdev->dev.parent was checked by exynos_clkout_match_parent_dev() * so it is not NULL.
*/
clkout->np = pdev->dev.parent->of_node;
}
platform_set_drvdata(pdev, clkout);
spin_lock_init(&clkout->slock);
parent_count = 0; for (i = 0; i < EXYNOS_CLKOUT_PARENTS; ++i) { char name[] = "clkoutXX";
clkout->data.num = EXYNOS_CLKOUT_NR_CLKS;
ret = of_clk_add_hw_provider(clkout->np, of_clk_hw_onecell_get, &clkout->data); if (ret) goto err_clk_unreg;
return 0;
err_clk_unreg:
clk_hw_unregister(clkout->data.hws[0]);
err_unmap:
iounmap(clkout->reg);
clks_put: for (i = 0; i < EXYNOS_CLKOUT_PARENTS; ++i) if (!IS_ERR(parents[i]))
clk_put(parents[i]);
dev_err(&pdev->dev, "failed to register clkout clock\n");
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.