devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leela Krishna Amudala <l.krishna@samsung.com>
To: devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org, grant.likely@secretlab.ca,
	olofj@google.com, thomas.ab@samsung.com, kgene.kim@samsung.com,
	joshi@samsung.com, jg1.han@samsung.com
Subject: [PATCH V2 2/7] ARM: EXYNOS5: add machine specific support for backlight
Date: Wed, 18 Jul 2012 11:27:28 +0530	[thread overview]
Message-ID: <1342591053-7092-3-git-send-email-l.krishna@samsung.com> (raw)
In-Reply-To: <1342591053-7092-1-git-send-email-l.krishna@samsung.com>

Adds machine specific support for LCD backlight for SMDK board based
on Exynos5

Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
---
 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 <linux/of_platform.h>
 #include <linux/serial_core.h>
+#include <linux/pwm_backlight.h>
+#include <linux/gpio.h>
 
 #include <asm/mach/arch.h>
 #include <asm/hardware/gic.h>
@@ -18,9 +20,33 @@
 
 #include <plat/cpu.h>
 #include <plat/regs-serial.h>
+#include <plat/backlight.h>
+#include <plat/gpio-cfg.h>
 
 #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);
 }
-- 
1.7.0.4

  parent reply	other threads:[~2012-07-18  5:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18  5:57 [PATCH V2 0/7] Add device tree based discovery support for drm-fimd Leela Krishna Amudala
2012-07-18  5:57 ` [PATCH V2 1/7] ARM: SAMSUNG: add additional registers and SFR definitions for writeback Leela Krishna Amudala
2012-07-18  6:51   ` Marek Szyprowski
2012-07-18  7:09     ` Ajay kumar
     [not found]       ` <CAEC9eQP01q+ddhA9Q4VQcm8wuvJXmR5KvAVZgX6MEdFLstST0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-20 10:09         ` Sylwester Nawrocki
2012-07-19 12:43     ` Leela Krishna Amudala
2012-07-20  6:45       ` Marek Szyprowski
2012-07-18 11:05   ` Tomasz Figa
2012-07-19 13:00     ` Leela Krishna Amudala
2012-07-19 13:35       ` Tomasz Figa
2012-07-20  2:21         ` Jingoo Han
2012-07-20  2:59           ` Leela Krishna Amudala
2012-07-20  9:49             ` Tomasz Figa
2012-07-20 10:00             ` Sylwester Nawrocki
2012-07-20 11:07               ` Leela Krishna Amudala
2012-07-20 12:54                 ` Sylwester Nawrocki
2012-07-22 22:35               ` Jingoo Han
2012-07-18  5:57 ` Leela Krishna Amudala [this message]
2012-07-18  5:57 ` [PATCH V2 3/7] ARM: EXYNOS5: add machine specific support for LCD Leela Krishna Amudala
2012-07-18  6:45   ` Marek Szyprowski
2012-07-19 13:21     ` Leela Krishna Amudala
2012-07-20  6:31       ` Marek Szyprowski
2012-07-24 16:02         ` Leela Krishna Amudala
2012-07-20  7:17       ` Joonyoung Shim
2012-07-18  5:57 ` [PATCH V2 4/7] ARM: EXYNOS: Adding DRM platform device Leela Krishna Amudala
2012-07-20  7:33   ` Joonyoung Shim
2012-07-18  5:57 ` [PATCH V2 5/7] ARM: EXYNOS: add device tree based discovery support for FIMD Leela Krishna Amudala
2012-07-20  7:39   ` Joonyoung Shim
2012-07-18  5:57 ` [PATCH V2 6/7] ARM: EXYNOS5: Add the bus clock " Leela Krishna Amudala
2012-07-23  8:34   ` Joonyoung Shim
2012-07-23  9:54     ` Joonyoung Shim
2012-07-23 23:14       ` Jingoo Han
2012-07-23 23:45         ` Joonyoung Shim
2012-07-23 23:48           ` Jingoo Han
     [not found]           ` <500DE22F.5010006-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-07-23 23:55             ` Jingoo Han
2012-07-24  1:55               ` Joonyoung Shim
     [not found]                 ` <500E00A3.8080203-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-07-24  2:15                   ` Jingoo Han
2012-07-24  3:06                     ` Joonyoung Shim
2012-07-24  4:02                       ` Jingoo Han
2012-07-24  9:13                         ` Sylwester Nawrocki
2012-07-18  5:57 ` [PATCH V2 7/7] ARM: EXYNOS5: Set parent clock to fimd Leela Krishna Amudala
2012-07-23  8:41   ` Joonyoung Shim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342591053-7092-3-git-send-email-l.krishna@samsung.com \
    --to=l.krishna@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jg1.han@samsung.com \
    --cc=joshi@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=olofj@google.com \
    --cc=thomas.ab@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).