From: emilio@elopez.com.ar (Emilio López)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] sunxi: make gate clock getable by name
Date: Wed, 30 Apr 2014 05:39:53 -0300 [thread overview]
Message-ID: <5360B6D9.7070409@elopez.com.ar> (raw)
In-Reply-To: <fa26ae07-b4ee-4730-b626-9724a51e7122@googlegroups.com>
Hi,
El 30/04/14 05:25, ????????? ???????? escribi?:
> This patch enables to use devm_clk_get function to get gate clocks by name.
> Signed-off-by: Alexander Bersenev <bay@hackerdom.ru>
>
> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
> index 31584ee..3617681 100644
> --- a/drivers/clk/sunxi/clk-sunxi.c
> +++ b/drivers/clk/sunxi/clk-sunxi.c
> @@ -1048,6 +1048,8 @@ static void __init sunxi_gates_clk_setup(struct
> device_node *node,
> reg + 4 * (i/32), i % 32,
> 0, &clk_lock);
> WARN_ON(IS_ERR(clk_data->clks[i]));
> +if (!IS_ERR(clk_data->clks[i]))
> +clk_register_clkdev(clk_data->clks[i], clk_name, NULL);
> j++;
> }
What are you trying to achieve here? Do you want to use devm_clk_get on
your driver? If so, you just need to list the clock your device needs on
its device tree node, like for example
device: blah at 0f0.... {
....
clocks = <&gate 12>, <&clock>, <&whatever>;
clock-names = "module", "ref", "sample";
}
And then you can pass "module", "ref" or "sample" to devm_clk_get to get
the respective clock.
Cheers,
Emilio
WARNING: multiple messages have this Message-ID (diff)
From: "Emilio López" <emilio@elopez.com.ar>
To: "Александр Берсенев" <bay@hackerdom.ru>
Cc: linux-sunxi@googlegroups.com, mturquette@linaro.org,
maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] sunxi: make gate clock getable by name
Date: Wed, 30 Apr 2014 05:39:53 -0300 [thread overview]
Message-ID: <5360B6D9.7070409@elopez.com.ar> (raw)
In-Reply-To: <fa26ae07-b4ee-4730-b626-9724a51e7122@googlegroups.com>
Hi,
El 30/04/14 05:25, Александр Берсенев escribió:
> This patch enables to use devm_clk_get function to get gate clocks by name.
> Signed-off-by: Alexander Bersenev <bay@hackerdom.ru>
>
> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
> index 31584ee..3617681 100644
> --- a/drivers/clk/sunxi/clk-sunxi.c
> +++ b/drivers/clk/sunxi/clk-sunxi.c
> @@ -1048,6 +1048,8 @@ static void __init sunxi_gates_clk_setup(struct
> device_node *node,
> reg + 4 * (i/32), i % 32,
> 0, &clk_lock);
> WARN_ON(IS_ERR(clk_data->clks[i]));
> +if (!IS_ERR(clk_data->clks[i]))
> +clk_register_clkdev(clk_data->clks[i], clk_name, NULL);
> j++;
> }
What are you trying to achieve here? Do you want to use devm_clk_get on
your driver? If so, you just need to list the clock your device needs on
its device tree node, like for example
device: blah@0f0.... {
....
clocks = <&gate 12>, <&clock>, <&whatever>;
clock-names = "module", "ref", "sample";
}
And then you can pass "module", "ref" or "sample" to devm_clk_get to get
the respective clock.
Cheers,
Emilio
next parent reply other threads:[~2014-04-30 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa26ae07-b4ee-4730-b626-9724a51e7122@googlegroups.com>
2014-04-30 8:39 ` Emilio López [this message]
2014-04-30 8:39 ` [PATCH] sunxi: make gate clock getable by name Emilio López
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5360B6D9.7070409@elopez.com.ar \
--to=emilio@elopez.com.ar \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.