OSDN Git Service

clk: bcm281xx: define CCU clock data statically
authorAlex Elder <elder@linaro.org>
Mon, 21 Apr 2014 21:11:41 +0000 (16:11 -0500)
committerMike Turquette <mturquette@linaro.org>
Wed, 30 Apr 2014 18:51:35 +0000 (11:51 -0700)
commit03548ec06ad3ec75d5b212fa832e4e617334ea09
tree3746d54ef058113437fea44065947de4aa05a47f
parentb12151ca5cd76e5ed9c75ef02b2f5d2aa5b45808
clk: bcm281xx: define CCU clock data statically

Rather than "manually" setting up each CCU's clock entries at run
time, define a flexible array of generic Kona clock structures
within the CCU structure itself.  Each of these entries contains
generic kona clock information (like its CCU pointer and clock
framework initialization data).  Each also has a pointer to a
structure contianing clock type-dependent initialization data
(like register definitions).

Since we'll iterate over these arrays we need to be sure they have
slots for all potential clock index values.  (E.g. for the root CCU
we must have at least BCM281XX_ROOT_CCU_CLOCK_COUNT slots.)  To
ensure this we always define an extra entry and fill it using the
special initializer LAST_KONA_CLK.

Just about everything we need to know about a clock can be defined
statically.  As a result, kona_clk_setup() can be changed to take
just a kona_clk structure as its argument, and peri_clk_setup() can
be simplified.  With the information pre-defined we are also able
to handle most clock setup genericially.  We can do away with the
CCU-specific callback functions that previously were needed to set
up the entries in CCU's clock array.

Move the definition of the ccu_data structure down in "clk-kona.h"
to avoid a forward dependency.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/bcm/clk-bcm281xx.c
drivers/clk/bcm/clk-kona-setup.c
drivers/clk/bcm/clk-kona.h