From patchwork Fri Mar 4 02:51:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Chen X-Patchwork-Id: 304 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:35 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs1099qah; Thu, 3 Mar 2011 18:51:36 -0800 (PST) Received: by 10.224.126.13 with SMTP id a13mr54037qas.110.1299207096808; Thu, 03 Mar 2011 18:51:36 -0800 (PST) Received: from ch1outboundpool.messaging.microsoft.com (ch1outboundpool.messaging.microsoft.com [216.32.181.186]) by mx.google.com with ESMTPS id 12si3471304qcd.22.2011.03.03.18.51.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 18:51:36 -0800 (PST) Received-SPF: neutral (google.com: 216.32.181.186 is neither permitted nor denied by best guess record for domain of b02280@freescale.com) client-ip=216.32.181.186; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.186 is neither permitted nor denied by best guess record for domain of b02280@freescale.com) smtp.mail=b02280@freescale.com Received: from mail47-ch1-R.bigfish.com (216.32.181.174) by CH1EHSOBE012.bigfish.com (10.43.70.62) with Microsoft SMTP Server id 14.1.225.8; Fri, 4 Mar 2011 02:51:36 +0000 Received: from mail47-ch1 (localhost.localdomain [127.0.0.1]) by mail47-ch1-R.bigfish.com (Postfix) with ESMTP id 0FC0A10F04AE; Fri, 4 Mar 2011 02:51:36 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzbb2cKzz1202h1082kzz8275bhz2dh2a8h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:de01egw01.freescale.net; RD:de01egw01.freescale.net; EFVD:NLI Received: from mail47-ch1 (localhost.localdomain [127.0.0.1]) by mail47-ch1 (MessageSwitch) id 1299207095832732_24324; Fri, 4 Mar 2011 02:51:35 +0000 (UTC) Received: from CH1EHSMHS024.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.247]) by mail47-ch1.bigfish.com (Postfix) with ESMTP id B133A1A28052; Fri, 4 Mar 2011 02:51:35 +0000 (UTC) Received: from de01egw01.freescale.net (192.88.165.102) by CH1EHSMHS024.bigfish.com (10.43.70.24) with Microsoft SMTP Server (TLS) id 14.1.225.8; Fri, 4 Mar 2011 02:51:34 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by de01egw01.freescale.net (8.14.3/8.14.3) with ESMTP id p242pXBg020941; Thu, 3 Mar 2011 19:51:33 -0700 (MST) Received: from weitway.ap.freescale.net (weitway.ap.freescale.net [10.192.242.83]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p242pSHZ019014; Thu, 3 Mar 2011 20:51:29 -0600 (CST) From: Jason Chen To: CC: , , Jason Chen Subject: [PATCH] ARM: mx53/loco: add pwm backlight device Date: Fri, 4 Mar 2011 10:51:26 +0800 Message-ID: <1299207086-11000-1-git-send-email-b02280@freescale.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Signed-off-by: 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(-) diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index f065a0d..baf5223 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -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. diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c index 160899e..3b0b200 100644 --- a/arch/arm/mach-mx5/board-mx53_loco.c +++ b/arch/arm/mach-mx5/board-mx53_loco.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -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) diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h index 5a1d6c9..a2dc8b6 100644 --- a/arch/arm/mach-mx5/devices-imx53.h +++ b/arch/arm/mach-mx5/devices-imx53.h @@ -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));