[PATCH v4 1/4] fu540: prci: add request and free clock handlers
Bin Meng
bmeng.cn at gmail.com
Wed Jun 24 03:20:14 CEST 2020
Hi Sagar,
On Sun, Jun 21, 2020 at 9:10 PM Sagar Shrikant Kadam
<sagar.kadam at sifive.com> wrote:
>
> Add clk_request handler to check if a valid clock is requested.
> Here clk_free handler is added for debug purpose which will display
> details of clock passed to clk_free.
>
> Signed-off-by: Sagar Shrikant Kadam <sagar.kadam at sifive.com>
> Reviewed-by: Pragnesh Patel <Pragnesh.patel at sifive.com>
> ---
> drivers/clk/sifive/fu540-prci.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
> index fe6e0d4..9a9ff6b 100644
> --- a/drivers/clk/sifive/fu540-prci.c
> +++ b/drivers/clk/sifive/fu540-prci.c
> @@ -686,6 +686,25 @@ static ulong sifive_fu540_prci_set_rate(struct clk *clk, ulong rate)
> return rate;
> }
>
> +static int sifive_fu540_prci_clk_request(struct clk *clk)
> +{
> + debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev,
> + clk->id);
> +
> + if (clk->id >= ARRAY_SIZE(__prci_init_clocks))
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static int sifive_fu540_prci_clk_free(struct clk *clk)
> +{
> + debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev,
> + clk->id);
> +
> + return 0;
> +}
It seems these 2 routines do not actually do anything? Is this for
debugging purposes?
Regards,
Bin
More information about the U-Boot
mailing list