clk: imx: gate2 add set rate
authorPeng Fan <peng.fan@nxp.com>
Wed, 31 Jul 2019 07:01:45 +0000 (07:01 +0000)
committerLukasz Majewski <lukma@denx.de>
Wed, 31 Jul 2019 07:20:51 +0000 (09:20 +0200)
Add set rate for imx clk-gate2

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/imx/clk-gate2.c

index 571be32088336a8097b66e03e46112a847311eb4..1b9db6e791f1ef9e8fff65638da1a331f008ef2c 100644 (file)
@@ -60,7 +60,18 @@ static int clk_gate2_disable(struct clk *clk)
        return 0;
 }
 
+static ulong clk_gate2_set_rate(struct clk *clk, ulong rate)
+{
+       struct clk *parent = clk_get_parent(clk);
+
+       if (parent)
+               return clk_set_rate(parent, rate);
+
+       return -ENODEV;
+}
+
 static const struct clk_ops clk_gate2_ops = {
+       .set_rate = clk_gate2_set_rate,
        .enable = clk_gate2_enable,
        .disable = clk_gate2_disable,
        .get_rate = clk_generic_get_rate,