summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxs
diff options
context:
space:
mode:
authorFred Fan <r01011@freescale.com>2010-02-01 17:59:21 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:13:36 +0200
commit98ad73d7a7f0feda04bb6f08bcb3e52d3371e291 (patch)
tree9681810d575c2e5c1c043168827119e673ccbdce /arch/arm/plat-mxs
parenta60bb4552efe784d8ebde51c34965c1119ac537c (diff)
ENGR00120621-2 i.MX28 LED support
1. Add platform support 2. Changed LED to control brightness by inactve couter Signed-off-by: Yao Jeremy <r65161@freescale.com> Signed-off-by: Fred.fan <r01011@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/plat-mxs')
-rw-r--r--arch/arm/plat-mxs/Kconfig6
-rw-r--r--arch/arm/plat-mxs/device.c28
-rw-r--r--arch/arm/plat-mxs/include/mach/device.h12
3 files changed, 41 insertions, 5 deletions
diff --git a/arch/arm/plat-mxs/Kconfig b/arch/arm/plat-mxs/Kconfig
index 6c02d308f173..befd404a3f11 100644
--- a/arch/arm/plat-mxs/Kconfig
+++ b/arch/arm/plat-mxs/Kconfig
@@ -52,6 +52,12 @@ config MXS_LRADC
help
Enable LRADC support
+config MXS_PWM_CHANNELS
+ int
+ default 8
+ help
+ The number of pwm channel on Freescale MXS platform.
+
menu "Freescale Application UART:"
config MXS_AUART_DMA_SUPPORT
diff --git a/arch/arm/plat-mxs/device.c b/arch/arm/plat-mxs/device.c
index 165d3e0ad462..ae42a711057f 100644
--- a/arch/arm/plat-mxs/device.c
+++ b/arch/arm/plat-mxs/device.c
@@ -118,7 +118,7 @@ static struct platform_device mxs_i2c[] = {
.name = "mxs-i2c",
.id = 0,
.dev = {
- .dma_mask = &common_dmamask,
+ .dma_mask = &common_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.release = mxs_nop_release,
},
@@ -129,7 +129,7 @@ static struct platform_device mxs_i2c[] = {
.name = "mxs-i2c",
.id = 1,
.dev = {
- .dma_mask = &common_dmamask,
+ .dma_mask = &common_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.release = mxs_nop_release,
},
@@ -145,7 +145,7 @@ static struct platform_device mxs_mmc[] = {
.name = "mxs-mmc",
.id = 0,
.dev = {
- .dma_mask = &common_dmamask,
+ .dma_mask = &common_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.release = mxs_nop_release,
},
@@ -154,7 +154,7 @@ static struct platform_device mxs_mmc[] = {
.name = "mxs-mmc",
.id = 1,
.dev = {
- .dma_mask = &common_dmamask,
+ .dma_mask = &common_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.release = mxs_nop_release,
},
@@ -190,7 +190,7 @@ static struct platform_device mxs_fb = {
.name = "mxs-fb",
.id = 0,
.dev = {
- .dma_mask = &common_dmamask,
+ .dma_mask = &common_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.release = mxs_nop_release,
},
@@ -308,6 +308,16 @@ static struct platform_device mxs_auart[] = {
};
#endif
+#if defined(CONFIG_LEDS_MXS) || defined(CONFIG_LEDS_MXS_MODULE)
+static struct platform_device mxs_led = {
+ .name = "mxs-leds",
+ .id = 0,
+ .dev = {
+ .release = mxs_nop_release,
+ },
+};
+#endif
+
static struct mxs_dev_lookup dev_lookup[] = {
#if defined(CONFIG_SERIAL_MXS_DUART) || \
defined(CONFIG_SERIAL_MXS_DUART_MODULE)
@@ -413,6 +423,14 @@ static struct mxs_dev_lookup dev_lookup[] = {
.pdev = mxs_auart,
},
#endif
+
+#if defined(CONFIG_LEDS_MXS) || defined(CONFIG_LEDS_MXS_MODULE)
+ {
+ .name = "mxs-leds",
+ .size = 1,
+ .pdev = &mxs_led,
+ },
+#endif
};
struct platform_device *mxs_get_device(char *name, int id)
diff --git a/arch/arm/plat-mxs/include/mach/device.h b/arch/arm/plat-mxs/include/mach/device.h
index a8b59a3a6c81..aaf61bfe067a 100644
--- a/arch/arm/plat-mxs/include/mach/device.h
+++ b/arch/arm/plat-mxs/include/mach/device.h
@@ -23,6 +23,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
+#include <linux/leds.h>
#include <asm/mach/time.h>
@@ -94,6 +95,17 @@ struct mxs_auart_plat_data {
const char *clk;
};
+struct mxs_pwm_led {
+ struct led_classdev dev;
+ const char *name;
+ unsigned int pwm;
+};
+
+struct mxs_pwm_leds_plat_data {
+ unsigned int num;
+ struct mxs_pwm_led *leds;
+};
+
extern void mxs_timer_init(struct mxs_sys_timer *timer);
extern void mxs_nop_release(struct device *dev);