msm: AVS: Refactor and clean up avs_hw.S to avs.c

Refactor AVS API to a cleaner C implementation. The new implementation
uses C assembly functions and provides a cleaner way for future targets
to add new AVS functionality.

Also fixed a possible issue with the earlier AVS_ENABLE and AVS_DISABLE
implementations. The earlier implementation did a get_cpu() and compared
it against the cpu for which AVS was to to be disabled, if the cpu's did
not match then it did not return an error and avs could have been left
enabled during the voltage change. In this new implementation, enable
and disable use smp_call_function_single() to ensure that the enable and
disable indeed happen on the core requested.

If acpuclock_set_rate() was called on the right core correctly during
cpufreq frequency change, there would have been no issue, but newer
implementation of mach-msm/cpufreq.c does not gaurantee that.

Change-Id: I94db3fc70341ceb79d747d54c7f525056b377755
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 077a002..f656aab 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -57,7 +57,7 @@
 endif
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 
-obj-$(CONFIG_MSM_AVS_HW) += avs_hw.o
+obj-$(CONFIG_MSM_AVS_HW) += avs.o
 obj-$(CONFIG_CPU_V6) += idle-v6.o
 obj-$(CONFIG_CPU_V7) += idle-v7.o
 obj-$(CONFIG_MSM_JTAG) += jtag.o