From patchwork Tue Aug 30 10:03:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jason.chen@freescale.com X-Patchwork-Id: 3792 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A6D9A23F18 for ; Tue, 30 Aug 2011 10:09:49 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 9C1D5A187CA for ; Tue, 30 Aug 2011 10:09:49 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 18so7702495fxd.11 for ; Tue, 30 Aug 2011 03:09:49 -0700 (PDT) Received: by 10.223.24.21 with SMTP id t21mr8702165fab.24.1314698989532; Tue, 30 Aug 2011 03:09:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs129389lab; Tue, 30 Aug 2011 03:09:49 -0700 (PDT) Received: by 10.227.175.77 with SMTP id w13mr4649760wbz.53.1314698988176; Tue, 30 Aug 2011 03:09:48 -0700 (PDT) Received: from DB3EHSOBE006.bigfish.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by mx.google.com with ESMTPS id fs4si7667262wbb.8.2011.08.30.03.09.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Aug 2011 03:09:48 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of B02280@freescale.com) client-ip=213.199.154.144; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of B02280@freescale.com) smtp.mail=B02280@freescale.com Received: from mail90-db3-R.bigfish.com (10.3.81.249) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.22; Tue, 30 Aug 2011 10:09:46 +0000 Received: from mail90-db3 (localhost.localdomain [127.0.0.1]) by mail90-db3-R.bigfish.com (Postfix) with ESMTP id 2251D7D0121; Tue, 30 Aug 2011 10:09:47 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail90-db3 (localhost.localdomain [127.0.0.1]) by mail90-db3 (MessageSwitch) id 1314698986816405_12001; Tue, 30 Aug 2011 10:09:46 +0000 (UTC) Received: from DB3EHSMHS006.bigfish.com (unknown [10.3.81.242]) by mail90-db3.bigfish.com (Postfix) with ESMTP id B71B718D804B; Tue, 30 Aug 2011 10:09:46 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS006.bigfish.com (10.3.87.106) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 30 Aug 2011 10:09:41 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.2; Tue, 30 Aug 2011 05:09:40 -0500 Received: from weitway.ap.freescale.net (weitway.ap.freescale.net [10.192.242.159]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p7UA9ZeJ021669; Tue, 30 Aug 2011 05:09:38 -0500 (CDT) From: To: CC: , , Jason Chen , Jason Chen Subject: [V2 2/2] ARM: mx53/loco: add pwm backlight device Date: Tue, 30 Aug 2011 18:03:08 +0800 Message-ID: <1314698588-22620-2-git-send-email-jason.chen@freescale.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314698588-22620-1-git-send-email-jason.chen@freescale.com> References: <1314698588-22620-1-git-send-email-jason.chen@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com From: Jason Chen Signed-off-by: Jason Chen Signed-off-by: Jason Chen --- arch/arm/mach-mx5/Kconfig | 1 + arch/arm/mach-mx5/board-mx53_loco.c | 11 +++++++++++ arch/arm/plat-mxc/include/mach/devices-common.h | 8 ++++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index b4e7c58..1463cd3 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -202,6 +202,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 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX select IMX_HAVE_PLATFORM_GPIO_KEYS select LEDS_GPIO_REGISTER diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c index 4e1d51d..ae96128 100644 --- a/arch/arm/mach-mx5/board-mx53_loco.c +++ b/arch/arm/mach-mx5/board-mx53_loco.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -257,6 +258,13 @@ static const struct gpio_led_platform_data mx53loco_leds_data __initconst = { .num_leds = ARRAY_SIZE(mx53loco_leds), }; +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) { imx53_soc_init(); @@ -273,6 +281,9 @@ static void __init mx53_loco_board_init(void) imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data); imx_add_gpio_keys(&loco_button_data); gpio_led_register_device(-1, &mx53loco_leds_data); + + imx53_add_mxc_pwm(1); + imx_add_pwm_backlight(0, &loco_pwm_backlight_data); } static void __init mx53_loco_timer_init(void) diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 524538a..4409406 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h @@ -301,3 +301,11 @@ struct platform_device *__init imx_add_spi_imx( struct platform_device *imx_add_imx_dma(void); struct platform_device *imx_add_imx_sdma(char *name, resource_size_t iobase, int irq, struct sdma_platform_data *pdata); + +#include +static inline struct platform_device *__init imx_add_pwm_backlight( + const int id, const struct platform_pwm_backlight_data *pdata) +{ + return platform_device_register_resndata(NULL, "pwm-backlight",\ + id, NULL, 0, pdata, sizeof(*pdata)); +}