From patchwork Tue Mar 1 09:38:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Chen X-Patchwork-Id: 256 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:15 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs130159qab; Tue, 1 Mar 2011 01:38:40 -0800 (PST) Received: by 10.227.63.130 with SMTP id b2mr5949082wbi.149.1298972319791; Tue, 01 Mar 2011 01:38:39 -0800 (PST) Received: from DB3EHSOBE004.bigfish.com (db3ehsobe004.messaging.microsoft.com [213.199.154.142]) by mx.google.com with ESMTPS id i63si8068370wej.87.2011.03.01.01.38.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2011 01:38:38 -0800 (PST) Received-SPF: neutral (google.com: 213.199.154.142 is neither permitted nor denied by best guess record for domain of b02280@freescale.com) client-ip=213.199.154.142; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.142 is neither permitted nor denied by best guess record for domain of b02280@freescale.com) smtp.mail=b02280@freescale.com Received: from mail75-db3-R.bigfish.com (10.3.81.243) by DB3EHSOBE004.bigfish.com (10.3.84.24) with Microsoft SMTP Server id 14.1.225.8; Tue, 1 Mar 2011 09:38:38 +0000 Received: from mail75-db3 (localhost.localdomain [127.0.0.1]) by mail75-db3-R.bigfish.com (Postfix) with ESMTP id CB391F8813C; Tue, 1 Mar 2011 09:38:37 +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:az33egw02.freescale.net; RD:az33egw02.freescale.net; EFVD:NLI Received: from mail75-db3 (localhost.localdomain [127.0.0.1]) by mail75-db3 (MessageSwitch) id 1298972317387178_9252; Tue, 1 Mar 2011 09:38:37 +0000 (UTC) Received: from DB3EHSMHS003.bigfish.com (unknown [10.3.81.249]) by mail75-db3.bigfish.com (Postfix) with ESMTP id 50D8C122004D; Tue, 1 Mar 2011 09:38:37 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by DB3EHSMHS003.bigfish.com (10.3.87.103) with Microsoft SMTP Server (TLS) id 14.1.225.8; Tue, 1 Mar 2011 09:38:34 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id p219cWCW017399; Tue, 1 Mar 2011 02:38:32 -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 p219cPAX013614; Tue, 1 Mar 2011 03:38:29 -0600 (CST) From: Jason Chen To: CC: , , Jason Chen Subject: [PATCH 2/2] ARM MX53_LOCO: add pwm backlight device Date: Tue, 1 Mar 2011 17:38:23 +0800 Message-ID: <1298972303-1010-2-git-send-email-b02280@freescale.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1298972303-1010-1-git-send-email-b02280@freescale.com> References: <1298972303-1010-1-git-send-email-b02280@freescale.com> 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..e9c5661 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) \ + imx_add_platform_device("pwm-backlight", id, NULL, \ + 0, pdata, sizeof(*pdata));