Thread (3 messages) 3 messages, 2 authors, 2019-02-20

Re: [PATCH 1/1] clk: imx: scu: add set parent support

From: Stephen Boyd <sboyd@kernel.org>
Date: 2019-02-20 21:01:58
Also in: linux-clk

Quoting Aisheng Dong (2019-01-30 05:39:15)
Add clk scu set parents support.

Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <redacted>
Cc: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Applied to clk-next + below
quoted hunk ↗ jump to hunk
@@ -173,6 +208,49 @@ static int clk_scu_set_rate(struct clk_hw *hw, unsigned long rate,
        return imx_scu_call_rpc(ccm_ipc_handle, &msg, true);
 }
 
+static u8 clk_scu_get_parent(struct clk_hw *hw)
+{
+       struct clk_scu *clk = to_clk_scu(hw);
+       struct imx_sc_msg_get_clock_parent msg;
+       struct imx_sc_rpc_msg *hdr = &msg.hdr;
+       int ret;
+
+       hdr->ver = IMX_SC_RPC_VERSION;
+       hdr->svc = IMX_SC_RPC_SVC_PM;
+       hdr->func = IMX_SC_PM_FUNC_GET_CLOCK_PARENT;
+       hdr->size = 2;
+
+       msg.data.req.resource = cpu_to_le16(clk->rsrc_id);
+       msg.data.req.clk = clk->clk_type;
+
+       ret = imx_scu_call_rpc(ccm_ipc_handle, &msg, true);
+       if (ret) {
+               pr_err("%s: failed to get clock parent %d\n",
+                      clk_hw_get_name(hw), ret);
+               return 0;
+       }
+
+       return le32_to_cpu(msg.data.resp.parent);
Sparse complains about this line because it's a u8 not an __le32 that's
being converted. I removed the le32_to_cpu() to fix this.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help