From: rnayak@ti•com (Rajendra Nayak)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 02/11] ARM: OMAP3: clock: add API to enable/disable autoidle for a single clock
Date: Mon, 21 Oct 2013 18:24:26 +0530 [thread overview]
Message-ID: <52652402.70906@ti.com> (raw)
In-Reply-To: <20131021122610.11944.71616@quantum>
On Monday 21 October 2013 05:56 PM, Mike Turquette wrote:
> Quoting Paul Walmsley (2013-10-19 10:16:50)
>> On Fri, 11 Oct 2013, Tero Kristo wrote:
>>
>>> Some drivers require direct access to the autoidle functionality of the
>>> interface clocks. Added clock APIs for these, so that the drivers do not
>>> need to access CM registers directly.
>>>
>>> Signed-off-by: Tero Kristo <t-kristo@ti•com>
>>
>> Thanks, queued. Please coordinate with Mike to get
>> allow_idle/deny_idle-type interfaces into the Common Clock Framework, so
>> these can be replaced with standard CCF-type allow_idle() & deny_idle()
>> functions. That interface should include use-counting so multiple callers
>> can use allow_idle() and deny_idle() without stomping on each other.
>
> Where and when are these functions called? IIRC these are only accessed
> at boot/init time, though I may be wrong. If they are a boot-time thing
> then the .init callback provided in struct clk may be sufficient.
deny_idle() gets called early during clock init to disable all hardware
level idling (during boot) and allow_idle() is called during late init
(after PM init) to allow hardware idling.
>
> Regards,
> Mike
>
>>
>>
>> - Paul
>>
>>> ---
>>> arch/arm/mach-omap2/clock.c | 38 ++++++++++++++++++++++++++++++++++++++
>>> arch/arm/mach-omap2/clock.h | 2 ++
>>> 2 files changed, 40 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
>>> index 0c38ca9..c7c5d31 100644
>>> --- a/arch/arm/mach-omap2/clock.c
>>> +++ b/arch/arm/mach-omap2/clock.c
>>> @@ -543,6 +543,44 @@ int omap2_clk_disable_autoidle_all(void)
>>> }
>>>
>>> /**
>>> + * omap2_clk_deny_idle - disable autoidle on an OMAP clock
>>> + * @clk: struct clk * to disable autoidle for
>>> + *
>>> + * Disable autoidle on an OMAP clock.
>>> + */
>>> +int omap2_clk_deny_idle(struct clk *clk)
>>> +{
>>> + struct clk_hw_omap *c;
>>> +
>>> + if (__clk_get_flags(clk) & CLK_IS_BASIC)
>>> + return -EINVAL;
>>> +
>>> + c = to_clk_hw_omap(__clk_get_hw(clk));
>>> + if (c->ops && c->ops->deny_idle)
>>> + c->ops->deny_idle(c);
>>> + return 0;
>>> +}
>>> +
>>> +/**
>>> + * omap2_clk_allow_idle - enable autoidle on an OMAP clock
>>> + * @clk: struct clk * to enable autoidle for
>>> + *
>>> + * Enable autoidle on an OMAP clock.
>>> + */
>>> +int omap2_clk_allow_idle(struct clk *clk)
>>> +{
>>> + struct clk_hw_omap *c;
>>> +
>>> + if (__clk_get_flags(clk) & CLK_IS_BASIC)
>>> + return -EINVAL;
>>> +
>>> + c = to_clk_hw_omap(__clk_get_hw(clk));
>>> + if (c->ops && c->ops->allow_idle)
>>> + c->ops->allow_idle(c);
>>> + return 0;
>>> +}
>>> +
>>> +/**
>>> * omap2_clk_enable_init_clocks - prepare & enable a list of clocks
>>> * @clk_names: ptr to an array of strings of clock names to enable
>>> * @num_clocks: number of clock names in @clk_names
>>> diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
>>> index 7aa32cd..82916cc 100644
>>> --- a/arch/arm/mach-omap2/clock.h
>>> +++ b/arch/arm/mach-omap2/clock.h
>>> @@ -411,6 +411,8 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
>>> void omap2_init_clk_hw_omap_clocks(struct clk *clk);
>>> int omap2_clk_enable_autoidle_all(void);
>>> int omap2_clk_disable_autoidle_all(void);
>>> +int omap2_clk_allow_idle(struct clk *clk);
>>> +int omap2_clk_deny_idle(struct clk *clk);
>>> void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
>>> int omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name);
>>> void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
>>> --
>>> 1.7.9.5
>>>
>>
>>
>> - Paul
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
next prev parent reply other threads:[~2013-10-21 12:54 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 16:15 [PATCH 00/11] ARM: OMAP2+: CM cleanup series Tero Kristo
2013-10-11 16:15 ` [PATCH 01/11] ARM: OMAP2: CM/PM: remove direct register accesses outside CM code Tero Kristo
2013-10-19 17:12 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 02/11] ARM: OMAP3: clock: add API to enable/disable autoidle for a single clock Tero Kristo
2013-10-19 17:16 ` Paul Walmsley
2013-10-21 12:26 ` Mike Turquette
2013-10-21 12:53 ` Paul Walmsley
2013-10-22 1:14 ` Paul Walmsley
2013-10-21 12:54 ` Rajendra Nayak [this message]
2013-10-11 16:15 ` [PATCH 03/11] ARM: OMAP3: McBSP: do not access CM register directly Tero Kristo
2013-10-19 17:17 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 04/11] ARM: OMAP3: CM/control: move CM scratchpad save to CM driver Tero Kristo
2013-10-19 17:17 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 05/11] ARM: OMAP3: CM/PM: add API for accessing module clock enable registers Tero Kristo
2013-10-19 17:40 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 06/11] ARM: OMAP3: CM/PM: add API for forcing IVA2 clk enable/disable Tero Kristo
2013-10-19 17:19 ` Paul Walmsley
2013-10-19 17:30 ` Paul Walmsley
2013-10-19 17:42 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 07/11] ARM: OMAP3: CM/PM: add new API for checking IVA2 idle status Tero Kristo
2013-10-19 17:41 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 08/11] ARM: OMAP3: control: add API for setting IVA bootmode Tero Kristo
2013-10-19 17:18 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 09/11] ARM: OMAP3: PRM: move iva2 force idle functionality to PRM driver Tero Kristo
2013-10-19 17:36 ` Paul Walmsley
2013-10-11 16:15 ` [PATCH 10/11] ARM: OMAP3: PRM: move PRCM interrupt handler helper " Tero Kristo
2013-10-11 16:15 ` [PATCH 11/11] ARM: OMAP2+: CM: move direct register write macros to internal header Tero Kristo
2013-10-19 17:36 ` Paul Walmsley
2013-10-12 0:09 ` [PATCH 00/11] ARM: OMAP2+: CM cleanup series Tony Lindgren
2013-10-12 0:18 ` Tony Lindgren
2013-10-12 2:19 ` Paul Walmsley
2013-10-12 10:18 ` Tero Kristo
2013-10-12 21:45 ` Paul Walmsley
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=52652402.70906@ti.com \
--to=rnayak@ti$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox