msm: clock: backport updates from CAF msm-3.4 - part
______________
msm: clock-local: Fold unused reset-only amp_clk into amp_p_clk

The amp_p_clk is the only clock that goes to the DSI AHB bus
arbiter. The amp_clk existed in software for reset purposes only.
Combine these together so one clock can be used by software to
do all this.

Change-Id: I0e5f7a1489245d979b5460497d0a14d62ddcb68e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
_____________________

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>
______________________

msm: clock-local: Move GFX3D core reset from reg_init() to post_init()

reg_init() is called from the clock driver's pre_init() function, which
runs too early for clock APIs to be safely called. Move the GFX3D reset
operation that was performed there into post_init() where clock APIs
are allowed.

Change-Id: I63f6e9eec508f111ddf4211c63fc317bbe128a27
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
_____________________

msm: Consolidate set-up of 'children' lists in msm_clock_init()

Calling clk_set_parent(clk, clk_get_parent(clk)) worked but is confusing
to read since it's not obvious why it's necessary to re-set a parent to
something that already appears to be the parent.

Make this clear by moving the similar implementations for associating
children with their parent from clock-voter.c and clock-local.c into
msm_clock_init(), since there is no reason this code can't be
generic.

Change-Id: Ibb064fd1f1dfd0696cfa8e3e3056ebc461c90540
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>