Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: qcom-qmp: Expose provided clocks to DT

Register a simple clock provider for the PHY pipe clock sources so that
device tree users can point at these clocks via phandles to the lane
nodes.

Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Evan Green and committed by
Kishon Vijay Abraham I
2e38c2e7 d21aafe9

+22 -1
+22 -1
drivers/phy/qualcomm/phy-qcom-qmp.c
··· 1542 1542 return devm_clk_bulk_get(dev, num, qmp->clks); 1543 1543 } 1544 1544 1545 + static void phy_pipe_clk_release_provider(void *res) 1546 + { 1547 + of_clk_del_provider(res); 1548 + } 1549 + 1545 1550 /* 1546 1551 * Register a fixed rate pipe clock. 1547 1552 * ··· 1593 1588 fixed->fixed_rate = 125000000; 1594 1589 fixed->hw.init = &init; 1595 1590 1596 - return devm_clk_hw_register(qmp->dev, &fixed->hw); 1591 + ret = devm_clk_hw_register(qmp->dev, &fixed->hw); 1592 + if (ret) 1593 + return ret; 1594 + 1595 + ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw); 1596 + if (ret) 1597 + return ret; 1598 + 1599 + /* 1600 + * Roll a devm action because the clock provider is the child node, but 1601 + * the child node is not actually a device. 1602 + */ 1603 + ret = devm_add_action(qmp->dev, phy_pipe_clk_release_provider, np); 1604 + if (ret) 1605 + phy_pipe_clk_release_provider(np); 1606 + 1607 + return ret; 1597 1608 } 1598 1609 1599 1610 static const struct phy_ops qcom_qmp_phy_gen_ops = {