From 68cfa7c453600b466ca93f47a03c5e6e33a7a135 Mon Sep 17 00:00:00 2001
From: Colin Cross <ccross@google.com>
Date: Sat, 21 Aug 2010 18:21:23 -0700
Subject: [PATCH] [ARM] tegra: Add pmu to common devices

Originally fixed by Will Deacon.

Change-Id: I504f8109bedd1eea4bf637395913726a98eb6bb8
Signed-off-by: Colin Cross <ccross@google.com>
---
 arch/arm/mach-tegra/devices.c | 23 ++++++++++++++++++++++-
 arch/arm/mach-tegra/devices.h |  2 +-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index 36a9a4864c0a..4e84e7dcea5d 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -1,4 +1,4 @@
-/*
+	/*
  * arch/arm/mach-tegra/devices.c
  *
  * Copyright (C) 2010 Google, Inc.
@@ -23,6 +23,7 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/fsl_devices.h>
+#include <asm/pmu.h>
 #include <mach/irqs.h>
 #include <mach/iomap.h>
 #include <mach/dma.h>
@@ -492,3 +493,23 @@ struct platform_device tegra_gart_device = {
 	.num_resources	= ARRAY_SIZE(tegra_gart_resources),
 	.resource	= tegra_gart_resources
 };
+
+static struct resource pmu_resources[] = {
+	[0] = {
+		.start	= INT_CPU0_PMU_INTR,
+		.end	= INT_CPU0_PMU_INTR,
+		.flags	= IORESOURCE_IRQ,
+	},
+	[1] = {
+		.start	= INT_CPU1_PMU_INTR,
+		.end	= INT_CPU1_PMU_INTR,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device pmu_device = {
+	.name		= "arm-pmu",
+	.id		= ARM_PMU_DEVICE_CPU,
+	.num_resources	= ARRAY_SIZE(pmu_resources),
+	.resource	= pmu_resources,
+};
diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h
index 2e63e0fb3639..7088eb961265 100644
--- a/arch/arm/mach-tegra/devices.h
+++ b/arch/arm/mach-tegra/devices.h
@@ -43,5 +43,5 @@ extern struct platform_device tegra_ehci3_device;
 extern struct platform_device tegra_i2s_device1;
 extern struct platform_device tegra_i2s_device2;
 extern struct platform_device tegra_gart_device;
-
+extern struct platform_device pmu_device;
 #endif
-- 
2.34.1