aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2009-04-13 06:51:31 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-06-04 22:32:03 -0400
commita757ad8b391adb2129f8357545aaa678099df473 (patch)
tree42bf36574d6bf3d29cffa3d74e3b203422a01346 /arch/arm
parent3d2a98cd5e17052f461390c72efe1076c18fd62d (diff)
[ARM] pxa: allow PWM ID base number to be specified in pwm_id_table
PWMs on PXA168/910 start at number 1 instead of 0, (i.e. PWM1/2/3/4 instead of PWM0/1/2/3 on PXA25x/PXA27x/PXA3xx). Allow this number to be specified in pwm_id_table. Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-pxa/pwm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/pwm.c b/arch/arm/mach-pxa/pwm.c
index dec6f2c8dbf9..5513c51ff984 100644
--- a/arch/arm/mach-pxa/pwm.c
+++ b/arch/arm/mach-pxa/pwm.c
@@ -22,11 +22,12 @@
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
24#define HAS_SECONDARY_PWM 0x10 24#define HAS_SECONDARY_PWM 0x10
25#define PWM_ID_BASE(d) ((d) & 0xf)
25 26
26static const struct platform_device_id pwm_id_table[] = { 27static const struct platform_device_id pwm_id_table[] = {
27 /* PWM has_secondary_pwm? */ 28 /* PWM has_secondary_pwm? */
28 { "pxa25x-pwm", 0 }, 29 { "pxa25x-pwm", 0 },
29 { "pxa27x-pwm", HAS_SECONDARY_PWM }, 30 { "pxa27x-pwm", 0 | HAS_SECONDARY_PWM },
30 { }, 31 { },
31}; 32};
32MODULE_DEVICE_TABLE(platform, pwm_id_table); 33MODULE_DEVICE_TABLE(platform, pwm_id_table);
@@ -191,7 +192,7 @@ static int __devinit pwm_probe(struct platform_device *pdev)
191 pwm->clk_enabled = 0; 192 pwm->clk_enabled = 0;
192 193
193 pwm->use_count = 0; 194 pwm->use_count = 0;
194 pwm->pwm_id = pdev->id; 195 pwm->pwm_id = PWM_ID_BASE(id->driver_data) + pdev->id;
195 pwm->pdev = pdev; 196 pwm->pdev = pdev;
196 197
197 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 198 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);