msm: clock-debug.c: Display clock vdd fmax values

Display the voltage level a clock votes for debugging.
The currently selected level is shown in square brackets.

Change-Id: I5062c5ea05408c94b63a1eeb376c42da9b7e5908
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
msm: clock: Move voltage scaling to prepare/unprepare

Move the voltage calls to a sleepable context so we can avoid
spinning for hundreds of microseconds with interrupts disabled
waiting for a regulator to increase. This change also paves the
way to making the clock driver into a real regulator consumer
that uses the proper regulator APIs instead of the MSM specific
rpm_vreg API.

Doing this also requires us to make clk_set_rate() a sleeping
call so that concurrent clk_prepare() and clk_set_rate() calls
are synchronized. Making clk_set_rate() sleepable also
necessitates moving the clk_set_rate() call in clock-voter.c to a
sleepable context. Do that by having clock-voter aggregate and
update the rate in prepare/unprepare instead of enable/disable
(note that enable/disable of voter clocks implicitly calls
enable/disable on the parent via generic clock code).

Now that clk_set_rate() is sleeping, call clk_prepare() and
clk_unprepare() in the clock-local code when a rate change
requires reparenting the clock. This cleans up a problem we have
where sources may be left unprepared by a clock rate switch
(hence the default true warned flag for PLLs and crystals).

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit d86d1f2d968f194e3db46bb683e370a9fa3a6037)

Conflicts:

	arch/arm/mach-msm/clock-local2.c

Change-Id: Ie5bbb17537d5b33de92f8ea1c2da6070b18c14f1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: clock: Return error upon invalid call to clk_set_rate.

Calls to clk_set_rate should only change the voltage vote if the clock
is prepared. However, they need to check if the rate is valid even if
the clock is not prepared.

Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
(cherry picked from commit c009d9efe966f1f2ac300d43895bb448a9d27cc0)

Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
(cherry picked from commit 8b5d9d1b3b75cf42df5cf1faeda029ebfbdd308e)

Change-Id: I3a80401dcf76314441ad7624c69433c0ea1d1efe
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: acpuclock-8974: Update performance level data for hardware bringup

Update the performance levels per the latest clock plan. Voltages
remain conservatively high until hardware characterization is done.
For similar reasons, the max frequency for the CPUs is limited to
1036.8MHz, and the max for the L2 cache to 806.4MHz.

Change-Id: I0909a8c0e060715c4c8eaa0ec43bbe9dd7eaf72f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: acpuclock-8974: Increase max CPU and L2 frequencies to 1.5GHz

Devices appear stable at these increased rates, even on early
hardware. Raise the frequency limit from 1.0GHz to 1.5GHz.

Change-Id: Ic0b5e8193a94d39c53721350b966656d5f734e33
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: clock: Remove warned flag

Now that all clock consumers have moved over to using the
clk_prepare/unprepare APIs we can remove the warned flag that
used to indicate that we had already warned about improper usage
of the clock APIs. In particular, we used this flag to avoid
printing warnings for "source" clocks such as PLLs and
crystals that no consumer directly controls but that the clock
driver calls clk_enable() on during clk_set_rate().

Let's use a local variable for clk->dbg_name too because we use
it many times and it makes lines too long.

Change-Id: I0cb3052fd3dec2e46788fbf039ac73f65551e9f9
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/clock-8974.c
msm: clock-debug: Update debug_suspend feature for prepared state

If a clock is prepared and not enabled we don't print information
about that clock in the debug_suspend feature. Fix the code to
consider unprepared as the only case to bail out early and also
update the printk to display the prepare count and enable count.

Change-Id: Ie7b5527c17339e48b93dd6354fed132679351d18
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 9d96ae5c2bd779f0590565d137030eb4c367a28f)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: clock.h: Fix compile with CONFIG_DEBUG_FS=n

The prototypes for clock_debug_init() differ between the debugfs
on and off case in the type of argument passed. Make them the
same to fix a compile error.

Change-Id: I905b9f1c752e3b419d0a1646b51a6ac1e54cfecc
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>