msm: rpm: RPM stubs to return success on 8064

During initial bringup when RPM isn't available on Virtio the RPM driver
returns a success for 8064 devices

Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Change-Id: Ib1b093e02a3985bb16f1a2a1f0e3da74dbb8ad0d
diff --git a/arch/arm/mach-msm/rpm.c b/arch/arm/mach-msm/rpm.c
index ef2956a..a8d787a 100644
--- a/arch/arm/mach-msm/rpm.c
+++ b/arch/arm/mach-msm/rpm.c
@@ -30,6 +30,7 @@
 #include <asm/hardware/gic.h>
 #include <mach/msm_iomap.h>
 #include <mach/rpm.h>
+#include <mach/socinfo.h>
 
 /******************************************************************************
  * Data type and structure definitions
@@ -64,7 +65,6 @@
 static LIST_HEAD(msm_rpm_notifications);
 static struct msm_rpm_notif_config msm_rpm_notif_cfgs[MSM_RPM_CTX_SET_COUNT];
 static bool msm_rpm_init_notif_done;
-
 /******************************************************************************
  * Internal functions
  *****************************************************************************/
@@ -380,6 +380,7 @@
  *   -EINTR: interrupted
  *   -EINVAL: invalid <ctx> or invalid id in <req> array
  *   -ENOSPC: request rejected
+ *   -ENODEV: RPM driver not initialized
  */
 static int msm_rpm_set_common(
 	int ctx, struct msm_rpm_iv_pair *req, int count, bool noirq)
@@ -387,6 +388,13 @@
 	uint32_t sel_masks[MSM_RPM_SEL_MASK_SIZE] = {};
 	int rc;
 
+	if (!msm_rpm_platform) {
+		if (cpu_is_apq8064())
+			return 0;
+		else
+			return -ENODEV;
+	}
+
 	if (ctx >= MSM_RPM_CTX_SET_COUNT) {
 		rc = -EINVAL;
 		goto set_common_exit;
@@ -420,6 +428,7 @@
  *   0: success
  *   -EINTR: interrupted
  *   -EINVAL: invalid <ctx> or invalid id in <req> array
+ *   -ENODEV: RPM driver not initialized.
  */
 static int msm_rpm_clear_common(
 	int ctx, struct msm_rpm_iv_pair *req, int count, bool noirq)
@@ -429,6 +438,13 @@
 	int rc;
 	int i;
 
+	if (!msm_rpm_platform) {
+		if (cpu_is_apq8064())
+			return 0;
+		else
+			return -ENODEV;
+	}
+
 	if (ctx >= MSM_RPM_CTX_SET_COUNT) {
 		rc = -EINVAL;
 		goto clear_common_exit;
@@ -556,6 +572,7 @@
  *   -EBUSY: RPM is updating the status page; values across different registers
  *           may not be consistent
  *   -EINVAL: invalid id in <status> array
+ *   -ENODEV: RPM driver not initialized
  */
 int msm_rpm_get_status(struct msm_rpm_iv_pair *status, int count)
 {
@@ -564,6 +581,13 @@
 	int rc;
 	int i;
 
+	if (!msm_rpm_platform) {
+		if (cpu_is_apq8064())
+			return 0;
+		else
+			return -ENODEV;
+	}
+
 	seq_begin = msm_rpm_read(MSM_RPM_PAGE_STATUS,
 				MSM_RPM_STATUS_ID_SEQUENCE);
 
@@ -609,6 +633,7 @@
  *   -EINTR: interrupted
  *   -EINVAL: invalid <ctx> or invalid id in <req> array
  *   -ENOSPC: request rejected
+ *   -ENODEV: RPM driver not initialized
  */
 int msm_rpm_set(int ctx, struct msm_rpm_iv_pair *req, int count)
 {
@@ -693,6 +718,7 @@
  *   0: success
  *   -EINTR: interrupted
  *   -EINVAL: invalid id in <req> array
+ *   -ENODEV: RPM driver not initialized
  */
 int msm_rpm_register_notification(struct msm_rpm_notification *n,
 	struct msm_rpm_iv_pair *req, int count)
@@ -703,6 +729,13 @@
 	int rc;
 	int i;
 
+	if (!msm_rpm_platform) {
+		if (cpu_is_apq8064())
+			return 0;
+		else
+			return -ENODEV;
+	}
+
 	INIT_LIST_HEAD(&n->list);
 	rc = msm_rpm_fill_sel_masks(n->sel_masks, req, count);
 	if (rc)
@@ -745,6 +778,7 @@
  * Return value:
  *   0: success
  *   -EINTR: interrupted
+ *   -ENODEV: RPM driver not initialized
  */
 int msm_rpm_unregister_notification(struct msm_rpm_notification *n)
 {
@@ -754,6 +788,13 @@
 	int rc;
 	int i;
 
+	if (!msm_rpm_platform) {
+		if (cpu_is_apq8064())
+			return 0;
+		else
+			return -ENODEV;
+	}
+
 	rc = mutex_lock_interruptible(&msm_rpm_mutex);
 	if (rc)
 		goto unregister_notification_exit;
@@ -848,6 +889,9 @@
 	unsigned int irq;
 	int rc;
 
+	if (cpu_is_apq8064())
+		return 0;
+
 	msm_rpm_platform = data;
 
 	fw_major = msm_rpm_read(MSM_RPM_PAGE_STATUS,