]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: mediatek: add support for APMIXED parent in infra MUX
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 28 Jun 2024 17:40:57 +0000 (19:40 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 1 Aug 2024 21:32:18 +0000 (15:32 -0600)
Add support for APMIXED parent in infra MUX. This is the case for mt7622
that reference APMIXED parents for the MUX1_SEL clock.

We assume the second level parent is always APMIXED.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
drivers/clk/mediatek/clk-mtk.c

index cdc00837bab81b233477cbc3dc86ed220567ca1c..231102b76219c6d8d7aa7180dc3523d79d607db0 100644 (file)
@@ -489,6 +489,10 @@ static ulong mtk_find_parent_rate(struct mtk_clk_priv *priv, struct clk *clk,
        switch (flags & CLK_PARENT_MASK) {
        case CLK_PARENT_XTAL:
                return priv->tree->xtal_rate;
+       /* Assume the second level parent is always APMIXED */
+       case CLK_PARENT_APMIXED:
+               priv = dev_get_priv(priv->parent);
+               fallthrough;
        case CLK_PARENT_TOPCKGEN:
                return mtk_clk_find_parent_rate(clk, parent, priv->parent);
        default: