msm: clock: Split up struct clock_init_data's init() functions
clock_init_data's init() function was called at the start of
msm_clock_init(), before looping through the clocks to set up parents
and perform handoff operations. This meant that performing certain
operations (ex. clk_set_rate()) in init() could interfere with the
handoff process by modifying the clock's registers before the handoff
code had a chance to examine them. It also meant that operations
done in init() would not take into account clock parent relationships,
making it an inappropriate place to set the rates of voter clocks or
enable clocks with parents.
Address this problem by splitting the init() function into two optional
parts: a pre_init() function that executes before clock driver
initialization, and a post_init() function that executes after driver
initialization.
pre_init() is the appropriate place to perform any register or system
configuration that should be done before clock driver initializes or
handoff if performed. Clock APIs should not be called from within it.
post_init() is the appropriate place to perform any additional
configuration that requires the clock driver already be initialized.
Clock APIs can be called within it.
Change-Id: I4b6de87eeee02a86717f53fd42d22e811b10b3f7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
7 files changed