diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-25 05:58:15 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-03-01 08:19:59 -0500 |
commit | 2301dfa7be2cb3e6bdd07cc1cb349b5853c4d5ee (patch) | |
tree | 5360130c97dfdc2f602cee2bd2af72854ccc05ca /arch/arm/mach-mxs | |
parent | 78159566b7ec120a1020cfc9469ac526bdd05387 (diff) |
ARM: mxs: Add pwm clocks and device registration
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-mxs/clock-mx23.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-mxs/clock-mx28.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices-mx23.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices-mx28.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/platform-mxs-pwm.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/devices-common.h | 4 |
9 files changed, 49 insertions, 2 deletions
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 55bf075add9b..836cc81a63a1 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig | |||
@@ -8,10 +8,12 @@ config MXS_OCOTP | |||
8 | config SOC_IMX23 | 8 | config SOC_IMX23 |
9 | bool | 9 | bool |
10 | select CPU_ARM926T | 10 | select CPU_ARM926T |
11 | select HAVE_PWM | ||
11 | 12 | ||
12 | config SOC_IMX28 | 13 | config SOC_IMX28 |
13 | bool | 14 | bool |
14 | select CPU_ARM926T | 15 | select CPU_ARM926T |
16 | select HAVE_PWM | ||
15 | 17 | ||
16 | comment "MXS platforms:" | 18 | comment "MXS platforms:" |
17 | 19 | ||
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c index 7c5dace92b91..38ee1b17a27d 100644 --- a/arch/arm/mach-mxs/clock-mx23.c +++ b/arch/arm/mach-mxs/clock-mx23.c | |||
@@ -447,7 +447,11 @@ static struct clk_lookup lookups[] = { | |||
447 | _REGISTER_CLOCK(NULL, "hclk", hbus_clk) | 447 | _REGISTER_CLOCK(NULL, "hclk", hbus_clk) |
448 | _REGISTER_CLOCK(NULL, "usb", usb_clk) | 448 | _REGISTER_CLOCK(NULL, "usb", usb_clk) |
449 | _REGISTER_CLOCK(NULL, "audio", audio_clk) | 449 | _REGISTER_CLOCK(NULL, "audio", audio_clk) |
450 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | 450 | _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk) |
451 | _REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk) | ||
452 | _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk) | ||
453 | _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) | ||
454 | _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) | ||
451 | }; | 455 | }; |
452 | 456 | ||
453 | static int clk_misc_init(void) | 457 | static int clk_misc_init(void) |
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index febd787f054f..40726c70328f 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c | |||
@@ -622,7 +622,14 @@ static struct clk_lookup lookups[] = { | |||
622 | _REGISTER_CLOCK("flexcan.1", NULL, can1_clk) | 622 | _REGISTER_CLOCK("flexcan.1", NULL, can1_clk) |
623 | _REGISTER_CLOCK(NULL, "usb0", usb0_clk) | 623 | _REGISTER_CLOCK(NULL, "usb0", usb0_clk) |
624 | _REGISTER_CLOCK(NULL, "usb1", usb1_clk) | 624 | _REGISTER_CLOCK(NULL, "usb1", usb1_clk) |
625 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | 625 | _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk) |
626 | _REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk) | ||
627 | _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk) | ||
628 | _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) | ||
629 | _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) | ||
630 | _REGISTER_CLOCK("mxs-pwm.5", NULL, pwm_clk) | ||
631 | _REGISTER_CLOCK("mxs-pwm.6", NULL, pwm_clk) | ||
632 | _REGISTER_CLOCK("mxs-pwm.7", NULL, pwm_clk) | ||
626 | _REGISTER_CLOCK(NULL, "lradc", lradc_clk) | 633 | _REGISTER_CLOCK(NULL, "lradc", lradc_clk) |
627 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) | 634 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) |
628 | }; | 635 | }; |
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h index c4d4773d3e85..7fb27b12bea9 100644 --- a/arch/arm/mach-mxs/devices-mx23.h +++ b/arch/arm/mach-mxs/devices-mx23.h | |||
@@ -19,3 +19,5 @@ extern const struct mxs_auart_data mx23_auart_data[] __initconst; | |||
19 | #define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id]) | 19 | #define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id]) |
20 | #define mx23_add_auart0() mx23_add_auart(0) | 20 | #define mx23_add_auart0() mx23_add_auart(0) |
21 | #define mx23_add_auart1() mx23_add_auart(1) | 21 | #define mx23_add_auart1() mx23_add_auart(1) |
22 | |||
23 | #define mx23_add_mxs_pwm(id) mxs_add_mxs_pwm(MX23_PWM_BASE_ADDR, id) | ||
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h index 3b18304c5653..69d19ea19d4d 100644 --- a/arch/arm/mach-mxs/devices-mx28.h +++ b/arch/arm/mach-mxs/devices-mx28.h | |||
@@ -32,3 +32,5 @@ extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst; | |||
32 | mxs_add_flexcan(&mx28_flexcan_data[id], pdata) | 32 | mxs_add_flexcan(&mx28_flexcan_data[id], pdata) |
33 | #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) | 33 | #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) |
34 | #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) | 34 | #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) |
35 | |||
36 | #define mx28_add_mxs_pwm(id) mxs_add_mxs_pwm(MX28_PWM_BASE_ADDR, id) | ||
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index 6c65b6716cf7..3aeec246e746 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig | |||
@@ -11,3 +11,6 @@ config MXS_HAVE_PLATFORM_FEC | |||
11 | config MXS_HAVE_PLATFORM_FLEXCAN | 11 | config MXS_HAVE_PLATFORM_FLEXCAN |
12 | select HAVE_CAN_FLEXCAN if CAN | 12 | select HAVE_CAN_FLEXCAN if CAN |
13 | bool | 13 | bool |
14 | |||
15 | config MXS_HAVE_PLATFORM_MXS_PWM | ||
16 | bool | ||
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index a8dc8d5f6e1e..978310fcafd6 100644 --- a/arch/arm/mach-mxs/devices/Makefile +++ b/arch/arm/mach-mxs/devices/Makefile | |||
@@ -2,3 +2,4 @@ obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o | |||
2 | obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o | 2 | obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o |
3 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o | 3 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o |
4 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | 4 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o |
5 | obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o | ||
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-pwm.c b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c new file mode 100644 index 000000000000..680f5a902936 --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Sascha Hauer <s.hauer@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <asm/sizes.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | struct platform_device *__init mxs_add_mxs_pwm(resource_size_t iobase, int id) | ||
13 | { | ||
14 | struct resource res = { | ||
15 | .flags = IORESOURCE_MEM, | ||
16 | }; | ||
17 | |||
18 | res.start = iobase + 0x10 + 0x20 * id; | ||
19 | res.end = res.start + 0x1f; | ||
20 | |||
21 | return mxs_add_platform_device("mxs-pwm", id, &res, 1, NULL, 0); | ||
22 | } | ||
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index e7aefb467ab3..d460d3045555 100644 --- a/arch/arm/mach-mxs/include/mach/devices-common.h +++ b/arch/arm/mach-mxs/include/mach/devices-common.h | |||
@@ -63,3 +63,7 @@ struct mxs_flexcan_data { | |||
63 | struct platform_device *__init mxs_add_flexcan( | 63 | struct platform_device *__init mxs_add_flexcan( |
64 | const struct mxs_flexcan_data *data, | 64 | const struct mxs_flexcan_data *data, |
65 | const struct flexcan_platform_data *pdata); | 65 | const struct flexcan_platform_data *pdata); |
66 | |||
67 | /* pwm */ | ||
68 | struct platform_device *__init mxs_add_mxs_pwm( | ||
69 | resource_size_t iobase, int id); | ||