]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - sitara-epos/sitara-epos-kernel.git/commitdiff
ARM: OMAP2+: pwm: Register PWM devices
authorPhilip, Avinash <avinashphilip@ti.com>
Thu, 8 Mar 2012 07:13:28 +0000 (12:43 +0530)
committerPhilip, Avinash <avinashphilip@ti.com>
Tue, 13 Mar 2012 13:20:02 +0000 (18:50 +0530)
This patch registers PWM devices on selective profiles by using new API's
provided for registering PWM devices.
1. EHRPWM.2 on profile #4
2. ECAP.0 device on profile #0, 1, 2 and 7

Also update platform data for HAPTICS with Max frequency of operation set
to 250 Hz as per Haptics specification (Haptic Motors Max RPM is 15000
RPM).

Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
arch/arm/mach-omap2/board-am335xevm.c

index ced0cc9536ef2c0bb5b7084e31d90690dea70329..0d5fa7b75c89c039b86e979e2ac7cbbc860bf7c1 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/pwm_backlight.h>
 #include <linux/input/ti_tscadc.h>
 #include <linux/reboot.h>
+#include <linux/pwm/pwm.h>
 
 /* LCD controller is similar to DA850 */
 #include <video/da8xx-fb.h>
@@ -912,11 +913,24 @@ static struct platform_device am335x_backlight = {
        }
 };
 
+static struct pwmss_platform_data  pwm_pdata[3] = {
+       {
+               .version = PWM_VERSION_1,
+       },
+       {
+               .version = PWM_VERSION_1,
+       },
+       {
+               .version = PWM_VERSION_1,
+       },
+};
+
 static int __init ecap0_init(void)
 {
        int status = 0;
 
        if (backlight_enable) {
+               am33xx_register_ecap(0, &pwm_pdata[0]);
                platform_device_register(&am335x_backlight);
        }
        return status;
@@ -1025,12 +1039,12 @@ static void uart2_init(int evm_id, int profile)
 }
 
 /* setup haptics */
-#define HAPTICS_MAX_FREQ (250)
-
+#define HAPTICS_MAX_FREQ 250
 static void haptics_init(int evm_id, int profile)
 {
        setup_pin_mux(haptics_pin_mux);
-       return;
+       pwm_pdata[2].chan_attrib[1].max_freq = HAPTICS_MAX_FREQ;
+       am33xx_register_ehrpwm(2, &pwm_pdata[2]);
 }
 
 /* NAND partition information */