From patchwork Wed Jul 18 05:57:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leela Krishna Amudala X-Patchwork-Id: 1208601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 3AFA5DFFFD for ; Wed, 18 Jul 2012 05:53:12 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SrN7e-0004pl-KF; Wed, 18 Jul 2012 05:48:35 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SrN2k-00047q-N2 for linux-arm-kernel@lists.infradead.org; Wed, 18 Jul 2012 05:43:27 +0000 Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7C00IWUD7M5640@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 18 Jul 2012 14:43:04 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-3e-50064ce8ae50 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 3B.7A.19326.8EC46005; Wed, 18 Jul 2012 14:43:04 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7C000CUD7GD990@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 18 Jul 2012 14:43:04 +0900 (KST) From: Leela Krishna Amudala To: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 2/7] ARM: EXYNOS5: add machine specific support for backlight Date: Wed, 18 Jul 2012 11:27:28 +0530 Message-id: <1342591053-7092-3-git-send-email-l.krishna@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1342591053-7092-1-git-send-email-l.krishna@samsung.com> References: <1342591053-7092-1-git-send-email-l.krishna@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd0XPmwBBt++m1lsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MF9v2shTcF6p4NecMawPjJf4uRk4OCQETiWX357FD2GISF+6t Z+ti5OIQEljEKPH73zFWCGcDk8Te9ntMIFVsAsYS9+duBrI5OEQEfCW+NfiD1DALrGGUWLt5 HjNIjbBAgMTLfe9ZQGwWAVWJ5ycXg23gFXCRuHTyIxPENgWJ1mWHwOKcAq4SjavOgMWFgGr2 Lt3IPIGRdwEjwypG0dSC5ILipPRcQ73ixNzi0rx0veT83E2MYJ8/k9rBuLLB4hCjAAejEg/v BSe2ACHWxLLiytxDjBIczEoivILPWQOEeFMSK6tSi/Lji0pzUosPMUpzsCiJ8xp7f/UXEkhP LEnNTk0tSC2CyTJxcEo1MNYv4jj0wL1ZLS90SYYu70n7K3uWLFLeGtm5z/jbhn85uixnnkjf WSx8sHfK5OxtLxU4dZKk2HxdH9p/yzdg27fo3EPjHzfspDtD3/y9djFunhnfgn9Ml1/M+Hoi nqtP1Ux8+d9NLtNefXg2sczfuFjgffKLMO/EX/YmRw4Y/qxsVni886DJKnclluKMREMt5qLi RAD/5PHg9QEAAA== X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, jg1.han@samsung.com, joshi@samsung.com, grant.likely@secretlab.ca, linux-samsung-soc@vger.kernel.org, thomas.ab@samsung.com, olofj@google.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Adds machine specific support for LCD backlight for SMDK board based on Exynos5 Signed-off-by: Leela Krishna Amudala --- arch/arm/mach-exynos/Kconfig | 1 + arch/arm/mach-exynos/mach-exynos5-dt.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index e698ca0..f0f41b7 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -416,6 +416,7 @@ config MACH_EXYNOS5_DT select SOC_EXYNOS5250 select USE_OF select ARM_AMBA + select SAMSUNG_DEV_BACKLIGHT help Machine support for Samsung Exynos4 machine with device tree enabled. Select this if a fdt blob is available for the EXYNOS4 SoC based board. diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index ef770bc..e7113cc 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -11,6 +11,8 @@ #include #include +#include +#include #include #include @@ -18,9 +20,33 @@ #include #include +#include +#include #include "common.h" +static int smdk5250_bl_notify(struct device *unused, int brightness) +{ + /* manage lcd_bl_en signal */ + if (brightness) + gpio_set_value(EXYNOS5_GPX3(0), 1); + else + gpio_set_value(EXYNOS5_GPX3(0), 0); + + return brightness; +} + +/* LCD Backlight data */ +static struct samsung_bl_gpio_info smdk5250_bl_gpio_info = { + .no = EXYNOS5_GPB2(0), + .func = S3C_GPIO_SFN(2), +}; + +static struct platform_pwm_backlight_data smdk5250_bl_data = { + .pwm_period_ns = 1000000, + .notify = smdk5250_bl_notify, +}; + /* * The following lookup table is used to override device names when devices * are registered from device tree. This is temporarily added to enable @@ -67,6 +93,7 @@ static void __init exynos5250_dt_map_io(void) static void __init exynos5250_dt_machine_init(void) { + samsung_bl_set(&smdk5250_bl_gpio_info, &smdk5250_bl_data); of_platform_populate(NULL, of_default_bus_match_table, exynos5250_auxdata_lookup, NULL); }