]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clk: introduce optional disable_unused callback
authorMike Turquette <mturquette@linaro.org>
Tue, 4 Dec 2012 19:00:35 +0000 (11:00 -0800)
committerMike Turquette <mturquette@linaro.org>
Tue, 11 Dec 2012 06:35:02 +0000 (22:35 -0800)
commit7c045a55c97fb83a2e5e9c6c857162c4866cc602
treee8c5a171b9b9085e86541aaccf9b85e3ec52298e
parent2630b17b6ee47ac79b4f5120ac49105027f644ea
clk: introduce optional disable_unused callback

Some gate clocks have special needs which must be handled during the
disable-unused clocks sequence.  These needs might be driven by software
due to the fact that we're disabling a clock outside of the normal
clk_disable path and a clk's enable_count will not be accurate.  On the
other hand a specific hardware programming sequence might need to be
followed for this corner case.

This change is needed for the upcoming OMAP port to the common clock
framework.  Specifically, it is undesirable to treat the disable-unused
path identically to the normal clk_disable path since other software
layers are involved.  In this case OMAP's clockdomain code throws WARNs
and bails early due to the clock's enable_count being set to zero.  A
custom callback mitigates this problem nicely.

Cc: Paul Walmsley <paul@pwsan.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk.c
include/linux/clk-provider.h