summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0038-board-am335xevm.c-Beaglebone-expose-all-pwms-through.patch
blob: 3615878fc3c740de2445123bef47bf1d0c0d7cfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 3bfb8f832b4fb3685755ba893a464865ba1cb824 Mon Sep 17 00:00:00 2001
From: Rob Kellett <r-kellett@ti.com>
Date: Mon, 14 May 2012 09:35:35 +0100
Subject: [PATCH 38/79] board-am335xevm.c: Beaglebone - expose all pwms
 through sysfs

---
 arch/arm/mach-omap2/board-am335xevm.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index 7dbeac6..c9ee0a2 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -1509,6 +1509,16 @@ static struct pwmss_platform_data  pwm_pdata[3] = {
 	},
 };
 
+static void register_all_pwms(void)
+{
+	am33xx_register_ehrpwm(0, &pwm_pdata[0]);
+	am33xx_register_ehrpwm(1, &pwm_pdata[1]);
+	am33xx_register_ehrpwm(2, &pwm_pdata[2]);
+	am33xx_register_ecap(0, &pwm_pdata[0]);
+	am33xx_register_ecap(1, &pwm_pdata[1]);
+	am33xx_register_ecap(2, &pwm_pdata[2]);
+}
+
 static int __init ecap0_init(void)
 {
 	int status = 0;
@@ -1524,7 +1534,10 @@ late_initcall(ecap0_init);
 static void enable_ehrpwm1(int evm_id, int profile)
 {
 	ehrpwm_backlight_enable = true;
-	am33xx_register_ehrpwm(1, &pwm_pdata[1]);
+	/*am33xx_register_ehrpwm(1, &pwm_pdata[1]);
+	 *TODO:no longer required as we are registering 
+	 *all pwms for the beaglebone
+	 */
 }
 
 /* Setup pwm-backlight for bbtoys7lcd */
@@ -2883,6 +2896,11 @@ static void setup_beaglebone(void)
 
 	/* Fill up global evmid */
 	am33xx_evmid_fillup(BEAGLE_BONE_A3);
+
+	/*TODO:We are registering all pwms for the beaglebone here
+	 *this may effect power management in the future
+	 */
+	register_all_pwms();
 }
 
 
-- 
1.7.10