msm: Add platform driver entry for avtimer
Register avtimer platform driver
Change-Id: I8211cd7c58845389676c5f96b48c6dd68793890c
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8960.c b/arch/arm/mach-msm/board-8960.c
index c017be9..aacf760 100644
--- a/arch/arm/mach-msm/board-8960.c
+++ b/arch/arm/mach-msm/board-8960.c
@@ -3090,6 +3090,12 @@
int len;
};
+/* AVTimer */
+static struct platform_device msm_dev_avtimer_device = {
+ .name = "dev_avtimer",
+ .dev = { .platform_data = &dev_avtimer_pdata },
+};
+
/* Sensors DSPS platform data */
#ifdef CONFIG_MSM_DSPS
#define DSPS_PIL_GENERIC_NAME "dsps"
@@ -3462,6 +3468,10 @@
mdm_sglte_device.dev.platform_data = &sglte_platform_data;
platform_device_register(&mdm_sglte_device);
}
+ if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
+ machine_is_msm8960_cdp()) {
+ platform_device_register(&msm_dev_avtimer_device);
+ }
}
MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
diff --git a/arch/arm/mach-msm/devices-8960.c b/arch/arm/mach-msm/devices-8960.c
index 968a25e..7d4f3b3 100644
--- a/arch/arm/mach-msm/devices-8960.c
+++ b/arch/arm/mach-msm/devices-8960.c
@@ -18,6 +18,7 @@
#include <linux/msm_ion.h>
#include <linux/gpio.h>
#include <linux/coresight.h>
+#include <linux/avtimer.h>
#include <asm/clkdev.h>
#include <mach/kgsl.h>
#include <linux/android_pmem.h>
@@ -111,6 +112,10 @@
#define MSM8960_PC_CNTR_PHYS (MSM8960_IMEM_PHYS + 0x664)
#define MSM8960_PC_CNTR_SIZE 0x40
+/* avtimer */
+#define AVTIMER_MSW_PHYSICAL_ADDRESS 0x2800900C
+#define AVTIMER_LSW_PHYSICAL_ADDRESS 0x28009008
+
static struct resource msm8960_resources_pccntr[] = {
{
.start = MSM8960_PC_CNTR_PHYS,
@@ -4495,6 +4500,11 @@
},
};
+struct dev_avtimer_data dev_avtimer_pdata = {
+ .avtimer_msw_phy_addr = AVTIMER_MSW_PHYSICAL_ADDRESS,
+ .avtimer_lsw_phy_addr = AVTIMER_LSW_PHYSICAL_ADDRESS,
+};
+
#define MDM2AP_ERRFATAL 40
#define AP2MDM_ERRFATAL 80
#define MDM2AP_STATUS 24
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 5eb71ee..f981bb2 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -472,3 +472,5 @@
extern struct platform_device sglte_mdm_8064_device;
extern struct platform_device sglte2_qsc_8064_device;
+
+extern struct dev_avtimer_data dev_avtimer_pdata;