Skip to contentSkip to conversation

ARM: mx53/loco: add pwm backlight device

PATCH New Jason Chen 3 participants 3 messages Mar 4, 2011 – Apr 12, 2011

Subsystems (3)
lore
Share & tools
lore

Jason Chen

author
#0 lore raw

PATCH 1/1 ARM: mx53/loco: add pwm backlight device

---
 arch/arm/mach-mx5/Kconfig           |    1 +
 arch/arm/mach-mx5/board-mx53_loco.c |   11 +++++++++++
 arch/arm/mach-mx5/devices-imx53.h   |    4 ++++
 3 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index f065a0d..baf5223 100644
@@ -162,6 +162,7 @@ config MACH_MX53_LOCO
 	select IMX_HAVE_PLATFORM_IMX2_WDT
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_PWM
 	help
 	  Include support for MX53 LOCO platform. This includes specific
 	  configurations for the board and its peripherals.
arch/arm/mach-mx5/board-mx53_loco.c +11 -0
index 160899e..3b0b200 100644
@@ -23,6 +23,7 @@
 #include <linux/fec.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/pwm_backlight.h>
 
 #include <mach/common.h>
 #include <mach/hardware.h>
@@ -203,6 +204,13 @@ static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
 	.bitrate = 100000,
 };
 
+static struct platform_pwm_backlight_data loco_pwm_backlight_data = {
+	.pwm_id = 1,
+	.max_brightness = 255,
+	.dft_brightness = 128,
+	.pwm_period_ns = 50000,
+};
+
 static void __init mx53_loco_board_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
@@ -213,6 +221,9 @@ static void __init mx53_loco_board_init(void)
 	imx53_add_imx2_wdt(0, NULL);
 	imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
 	imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
+
+	imx53_add_mxc_pwm(1);
+	imx53_add_mxc_pwm_backlight(0, &loco_pwm_backlight_data);
 }
 
 static void __init mx53_loco_timer_init(void)
arch/arm/mach-mx5/devices-imx53.h +4 -0
index 5a1d6c9..a2dc8b6 100644
@@ -37,3 +37,7 @@ extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst;
 extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[] __initconst;
 #define imx53_add_mxc_pwm(id)	\
 	imx_add_mxc_pwm(&imx53_mxc_pwm_data[id])
+
+#define imx53_add_mxc_pwm_backlight(id, pdata)			\
+	platform_device_register_resndata(NULL, "pwm-backlight",\
+			id, NULL, 0, pdata, sizeof(*pdata));
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 ARM: mx53/loco: add pwm backlight device

Quoted 46 lines · Jason Chen
---
 arch/arm/mach-mx5/Kconfig           |    1 +
 arch/arm/mach-mx5/board-mx53_loco.c |   11 +++++++++++
 arch/arm/mach-mx5/devices-imx53.h   |    4 ++++
 3 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index f065a0d..baf5223 100644
@@ -162,6 +162,7 @@ config MACH_MX53_LOCO
 	select IMX_HAVE_PLATFORM_IMX2_WDT
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_PWM
 	help
 	  Include support for MX53 LOCO platform. This includes specific
 	  configurations for the board and its peripherals.
arch/arm/mach-mx5/board-mx53_loco.c +8 -0
index 160899e..3b0b200 100644
@@ -23,6 +23,7 @@
 #include <linux/fec.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/pwm_backlight.h>
 
 #include <mach/common.h>
 #include <mach/hardware.h>
@@ -203,6 +204,13 @@ static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
 	.bitrate = 100000,
 };
 
+static struct platform_pwm_backlight_data loco_pwm_backlight_data = {
+	.pwm_id = 1,
+	.max_brightness = 255,
+	.dft_brightness = 128,
+	.pwm_period_ns = 50000,
+};
+
 static void __init mx53_loco_board_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,

arch/arm/mach-mx5/board-mx53_loco.c static void __init mx53_loco_board_init(void) · line 225

Quoted 5 lines
arch/arm/mach-mx5/board-mx53_loco.c +2 -0
@@ -213,6 +221,9 @@ static void __init mx53_loco_board_init(void)
 	imx53_add_imx2_wdt(0, NULL);
 	imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
 	imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
+
+	imx53_add_mxc_pwm(1);

can you please resend this with the series adding this function when addressing the comments I just gave.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#2 lore raw

PATCH 1/1 ARM: mx53/loco: add pwm backlight device

hi, Uwe,

Thanks for your comments, I will resend this series patches.

2011/4/5 Uwe Kleine-K?nig <[email protected]>:

Quoted 67 lines · Jason Chen
Quoted 46 lines

---

?arch/arm/mach-mx5/Kconfig ? ? ? ? ? | ? ?1 +
?arch/arm/mach-mx5/board-mx53_loco.c | ? 11 +++++++++++
?arch/arm/mach-mx5/devices-imx53.h ? | ? ?4 ++++

?3 files changed, 16 insertions(+), 0 deletions(-)

arch/arm/mach-mx5/Kconfig +0 -0
index f065a0d..baf5223 100644
@@ -162,6 +162,7 @@ config MACH_MX53_LOCO

? ? ? select IMX_HAVE_PLATFORM_IMX2_WDT
? ? ? select IMX_HAVE_PLATFORM_IMX_I2C
? ? ? select IMX_HAVE_PLATFORM_IMX_UART
+ ? ? select IMX_HAVE_PLATFORM_MXC_PWM
? ? ? help
? ? ? ? Include support for MX53 LOCO platform. This includes specific ? ? ? ? configurations for the board and its peripherals.

arch/arm/mach-mx5/board-mx53_loco.c +0 -0
index 160899e..3b0b200 100644
@@ -23,6 +23,7 @@

?#include <linux/fec.h>
?#include <linux/delay.h>
?#include <linux/gpio.h>
+#include <linux/pwm_backlight.h>

?#include <mach/common.h>
?#include <mach/hardware.h>

arch/arm/mach-mx5/board-mx53_loco.c +7 -0
@@ -203,6 +204,13 @@ static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
 ? ? ? .bitrate = 100000,
 ?};
 
+static struct platform_pwm_backlight_data loco_pwm_backlight_data = {
+ ? ? .pwm_id = 1,
+ ? ? .max_brightness = 255,
+ ? ? .dft_brightness = 128,
+ ? ? .pwm_period_ns = 50000,
+};
+
 ?static void __init mx53_loco_board_init(void)
 ?{
 ? ? ? mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,

arch/arm/mach-mx5/board-mx53_loco.c static void __init mx53_loco_board_init(void) · line 225

Quoted 5 lines
arch/arm/mach-mx5/board-mx53_loco.c +2 -0
@@ -213,6 +221,9 @@ static void __init mx53_loco_board_init(void)
 ? ? ? imx53_add_imx2_wdt(0, NULL);
 ? ? ? imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
 ? ? ? imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
+
+ ? ? imx53_add_mxc_pwm(1);

can you please resend this with the series adding this function when addressing the comments I just gave.

Best regards
Uwe

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Uwe Kleine-K?nig ? ? ? ? ? ?|
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel