All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add LCD backlight and LCD enable gpios pins to dp-controller DT node
@ 2013-05-14 12:55 Vikas Sajjan
  2013-05-14 12:55 ` [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver Vikas Sajjan
  2013-05-14 12:55 ` [PATCH 2/2] ARM: dts: Add LCD backlight and LCD enable gpios pins to dp-controller DT node Vikas Sajjan
  0 siblings, 2 replies; 9+ messages in thread
From: Vikas Sajjan @ 2013-05-14 12:55 UTC (permalink / raw)
  To: jg1.han, linux-samsung-soc
  Cc: kgene.kim, devicetree-discuss, patches, linaro-kernel

This patch series adds LCD backlight and LCD enable gpios pins to dp-controller
DT node of exynos5250-smdk5250 and parsing of these gpio pins in exynos-dp driver

tested on exynos5250-smdk5250 Board.

rebased on kgene-next branch of 
https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/

Vikas Sajjan (2):
  video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
  ARM: dts: Add LCD backlight and LCD enable gpios pins to
    dp-controller DT node

 arch/arm/boot/dts/exynos5250-smdk5250.dts |    3 ++
 drivers/video/exynos/exynos_dp_core.c     |   45 +++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
  2013-05-14 12:55 [PATCH 0/2] Add LCD backlight and LCD enable gpios pins to dp-controller DT node Vikas Sajjan
@ 2013-05-14 12:55 ` Vikas Sajjan
  2013-05-14 14:16     ` Tomasz Figa
  2013-05-14 12:55 ` [PATCH 2/2] ARM: dts: Add LCD backlight and LCD enable gpios pins to dp-controller DT node Vikas Sajjan
  1 sibling, 1 reply; 9+ messages in thread
From: Vikas Sajjan @ 2013-05-14 12:55 UTC (permalink / raw)
  To: jg1.han, linux-samsung-soc
  Cc: kgene.kim, devicetree-discuss, patches, linaro-kernel

 Adds GPIO parsing functionality for "LCD backlight" and "LCD enable"
 GPIO pins of exynos dp controller.

Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
---
 drivers/video/exynos/exynos_dp_core.c |   45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index de9d4da..242a708 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -19,6 +19,7 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/of.h>
+#include <linux/of_gpio.h>
 
 #include <video/exynos_dp.h>
 
@@ -895,11 +896,51 @@ static void exynos_dp_hotplug(struct work_struct *work)
 }
 
 #ifdef CONFIG_OF
+
+static int exynos_parse_gpio(struct device *dev)
+{
+	int gpio = -1;
+	struct device_node *np = dev->of_node;
+	enum of_gpio_flags flags;
+	u32 value;
+	int ret = -1;
+
+	if (!of_find_property(np, "lcd_bl_gpio", &value)) {
+                dev_err(dev, "no bl gpio property found\n");
+		return -1;
+        }
+
+	gpio = of_get_named_gpio_flags(np, "lcd_bl_gpio", 0, &flags);
+        if (gpio_is_valid(gpio)) {
+                ret = gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "exynos4-fb");
+                if (ret < 0) {
+                        return ret;
+		}
+        }
+	gpio_set_value(gpio, 1);
+
+	if (!of_find_property(np, "lcd_en_gpio", &value)) {
+                dev_err(dev, "no bl gpio property found\n");
+		return -1;
+        }
+        gpio = of_get_named_gpio_flags(np, "lcd_en_gpio", 0, &flags);
+        if (gpio_is_valid(gpio)) {
+                ret = gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "exynos4-fb");
+                if (ret < 0) {
+                        return ret;
+		}
+        }
+	gpio_set_value(gpio, 1);
+
+	return 0;
+}
+
 static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
 {
 	struct device_node *dp_node = dev->of_node;
 	struct exynos_dp_platdata *pd;
 	struct video_info *dp_video_config;
+	int ret = -1;
 
 	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
 	if (!pd) {
@@ -960,6 +1001,10 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
 		return ERR_PTR(-EINVAL);
 	}
 
+	ret = exynos_parse_gpio(dev);
+	if (ret != 0)
+		return NULL;
+
 	return pd;
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] ARM: dts: Add LCD backlight and LCD enable gpios pins to dp-controller DT node
  2013-05-14 12:55 [PATCH 0/2] Add LCD backlight and LCD enable gpios pins to dp-controller DT node Vikas Sajjan
  2013-05-14 12:55 ` [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver Vikas Sajjan
@ 2013-05-14 12:55 ` Vikas Sajjan
  1 sibling, 0 replies; 9+ messages in thread
From: Vikas Sajjan @ 2013-05-14 12:55 UTC (permalink / raw)
  To: jg1.han, linux-samsung-soc
  Cc: kgene.kim, devicetree-discuss, patches, linaro-kernel

Adds gpios pins for LCD backlight and LCD enable for dp-controller DT
node in exynos5250-smdk5250.dts

Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
---
 arch/arm/boot/dts/exynos5250-smdk5250.dts |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index 26d856b..82e7621 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -224,6 +224,9 @@
 		samsung,color-depth = <1>;
 		samsung,link-rate = <0x0a>;
 		samsung,lane-count = <4>;
+
+		lcd_bl_gpio = <&gpb2 0 1>;
+		lcd_en_gpio = <&gpx1 5 1>;
 	};
 
 	display-timings {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
  2013-05-14 12:55 ` [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver Vikas Sajjan
@ 2013-05-14 14:16     ` Tomasz Figa
  0 siblings, 0 replies; 9+ messages in thread
From: Tomasz Figa @ 2013-05-14 14:16 UTC (permalink / raw)
  To: Vikas Sajjan
  Cc: jg1.han, linux-samsung-soc, kgene.kim, devicetree-discuss,
	patches, linaro-kernel, rpurdie, FlorianSchandinat, linux-fbdev

Hi Vikas,

On Tuesday 14 of May 2013 18:25:51 Vikas Sajjan wrote:
>  Adds GPIO parsing functionality for "LCD backlight" and "LCD enable"
>  GPIO pins of exynos dp controller.
> 
> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> ---
>  drivers/video/exynos/exynos_dp_core.c |   45
> +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
> 

I don't think that Exynos DP driver is right place for such code. Backlight 
and LCD drivers are responsible for backlight and LCD power control using 
backlight and LCD subsystems.

IMHO the correct solution would be to either extend existing backlight/lcd 
drivers found in drivers/video/backlight to support direct GPIO control and 
parse GPIO pins from device tree or create new gpio_bl and gpio_lcd drivers.

CCing Richard, Florian and linux-fbdev.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
@ 2013-05-14 14:16     ` Tomasz Figa
  0 siblings, 0 replies; 9+ messages in thread
From: Tomasz Figa @ 2013-05-14 14:16 UTC (permalink / raw)
  To: Vikas Sajjan
  Cc: jg1.han, linux-samsung-soc, kgene.kim, devicetree-discuss,
	patches, linaro-kernel, rpurdie, FlorianSchandinat, linux-fbdev

Hi Vikas,

On Tuesday 14 of May 2013 18:25:51 Vikas Sajjan wrote:
>  Adds GPIO parsing functionality for "LCD backlight" and "LCD enable"
>  GPIO pins of exynos dp controller.
> 
> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> ---
>  drivers/video/exynos/exynos_dp_core.c |   45
> +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
> 

I don't think that Exynos DP driver is right place for such code. Backlight 
and LCD drivers are responsible for backlight and LCD power control using 
backlight and LCD subsystems.

IMHO the correct solution would be to either extend existing backlight/lcd 
drivers found in drivers/video/backlight to support direct GPIO control and 
parse GPIO pins from device tree or create new gpio_bl and gpio_lcd drivers.

CCing Richard, Florian and linux-fbdev.

Best regards,
Tomasz


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
  2013-05-14 14:16     ` Tomasz Figa
@ 2013-05-16  2:04 ` 한진구
  -1 siblings, 0 replies; 9+ messages in thread
From: 한진구 @ 2013-05-16  2:03 UTC (permalink / raw)
  To: Tomasz Figa, Vikas Sajjan
  Cc: 한진구,
	linux-samsung-soc, 김국진,
	devicetree-discuss, patches, linaro-kernel, rpurdie,
	FlorianSchandinat, linux-fbdev

Tuesday, May 14, 2013 11:17 PM, Vikas Sajjan wrote:
> 
> Hi Vikas,
> 
> On Tuesday 14 of May 2013 18:25:51 Vikas Sajjan wrote:
> >  Adds GPIO parsing functionality for "LCD backlight" and "LCD enable"
> >  GPIO pins of exynos dp controller.
> >
> > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> > ---
> >  drivers/video/exynos/exynos_dp_core.c |   45
> > +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
> >
> 
> I don't think that Exynos DP driver is right place for such code. Backlight
> and LCD drivers are responsible for backlight and LCD power control using
> backlight and LCD subsystems.
> 
> IMHO the correct solution would be to either extend existing backlight/lcd
> drivers found in drivers/video/backlight to support direct GPIO control and
> parse GPIO pins from device tree or create new gpio_bl and gpio_lcd drivers.

Hi Vikas Sajian,

I agree with Tomasz Figa's opinion.
Backlight/LCD framework should be used.
eDP panel backlight on SMDK5210 board can be controlled by PWM;
thus, pwm-backlight driver should be used.
Also, eDP panel reset pin should be controlled by using
platform-lcd driver.

> 
> CCing Richard, Florian and linux-fbdev.

Also, I have been doing backlight reviews instead of Richard,
please do CC'ing me.

Best regards,
Jingoo Han

> 
> Best regards,
> Tomasz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
@ 2013-05-16  2:04 ` 한진구
  0 siblings, 0 replies; 9+ messages in thread
From: 한진구 @ 2013-05-16  2:04 UTC (permalink / raw)
  To: Tomasz Figa, Vikas Sajjan
  Cc: 한진구,
	linux-samsung-soc, 김국진,
	devicetree-discuss, patches, linaro-kernel, rpurdie,
	FlorianSchandinat, linux-fbdev

VHVlc2RheSwgTWF5IDE0LCAyMDEzIDExOjE3IFBNLCBWaWthcyBTYWpqYW4gd3JvdGU6DQo+IA0K
PiBIaSBWaWthcywNCj4gDQo+IE9uIFR1ZXNkYXkgMTQgb2YgTWF5IDIwMTMgMTg6MjU6NTEgVmlr
YXMgU2FqamFuIHdyb3RlOg0KPiA+ICBBZGRzIEdQSU8gcGFyc2luZyBmdW5jdGlvbmFsaXR5IGZv
ciAiTENEIGJhY2tsaWdodCIgYW5kICJMQ0QgZW5hYmxlIg0KPiA+ICBHUElPIHBpbnMgb2YgZXh5
bm9zIGRwIGNvbnRyb2xsZXIuDQo+ID4NCj4gPiBTaWduZWQtb2ZmLWJ5OiBWaWthcyBTYWpqYW4g
PHZpa2FzLnNhamphbkBsaW5hcm8ub3JnPg0KPiA+IC0tLQ0KPiA+ICBkcml2ZXJzL3ZpZGVvL2V4
eW5vcy9leHlub3NfZHBfY29yZS5jIHwgICA0NQ0KPiA+ICsrKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysrKyAxIGZpbGUgY2hhbmdlZCwgNDUgaW5zZXJ0aW9ucygrKQ0KPiA+DQo+IA0KPiBJ
IGRvbid0IHRoaW5rIHRoYXQgRXh5bm9zIERQIGRyaXZlciBpcyByaWdodCBwbGFjZSBmb3Igc3Vj
aCB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ydpbmcgbWUuDQoNCkJl
c3QgcmVnYXJkcywNCkppbmdvbyBIYW4NCg0KPiANCj4gQmVzdCByZWdhcmRzLA0KPiBUb21hc3oN
Cg=



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
  2013-05-16  2:04 ` 한진구
@ 2013-05-17 12:29   ` Tomasz Figa
  -1 siblings, 0 replies; 9+ messages in thread
From: Tomasz Figa @ 2013-05-17 12:29 UTC (permalink / raw)
  To: jg1.han
  Cc: Vikas Sajjan, linux-samsung-soc, 김국진,
	devicetree-discuss, patches, linaro-kernel, rpurdie,
	FlorianSchandinat, linux-fbdev

Hi Jingoo,

On Thursday 16 of May 2013 02:03:59 한진구 wrote:
> Tuesday, May 14, 2013 11:17 PM, Vikas Sajjan wrote:
> 
> > 
> > Hi Vikas,
> > 
> > On Tuesday 14 of May 2013 18:25:51 Vikas Sajjan wrote:
> > 
> > >  Adds GPIO parsing functionality for "LCD backlight" and "LCD enable"
> > >  GPIO pins of exynos dp controller.
> > >
> > >
> > >
> > > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> > > ---
> > > 
> > >  drivers/video/exynos/exynos_dp_core.c |   45
> > > 
> > > +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
> > >
> > >
> > 
> > 
> > I don't think that Exynos DP driver is right place for such code.
> > Backlight
 and LCD drivers are responsible for backlight and LCD power
> > control using backlight and LCD subsystems.
> > 
> > IMHO the correct solution would be to either extend existing
> > backlight/lcd
> > drivers found in drivers/video/backlight to support direct GPIO control
> > and
 parse GPIO pins from device tree or create new gpio_bl and gpio_lcd
> > drivers.
> 
> Hi Vikas Sajian,
> 
> I agree with Tomasz Figa's opinion.
> Backlight/LCD framework should be used.
> eDP panel backlight on SMDK5210 board can be controlled by PWM;
> thus, pwm-backlight driver should be used.
> Also, eDP panel reset pin should be controlled by using
> platform-lcd driver.
> 
> 
> > 
> > CCing Richard, Florian and linux-fbdev.
> 
> 
> Also, I have been doing backlight reviews instead of Richard,
> please do CC'ing me.

OK. I used get_maintainers script, but it seems like the result was a bit off 
in this case. Will remember for future.

Best regards,
-- 
Tomasz Figa
Linux Kernel Developer
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver
@ 2013-05-17 12:29   ` Tomasz Figa
  0 siblings, 0 replies; 9+ messages in thread
From: Tomasz Figa @ 2013-05-17 12:29 UTC (permalink / raw)
  To: jg1.han
  Cc: Vikas Sajjan, linux-samsung-soc, 김국진,
	devicetree-discuss, patches, linaro-kernel, rpurdie,
	FlorianSchandinat, linux-fbdev

Hi Jingoo,

On Thursday 16 of May 2013 02:03:59 한진구 wrote:
> Tuesday, May 14, 2013 11:17 PM, Vikas Sajjan wrote:
> 
> > 
> > Hi Vikas,
> > 
> > On Tuesday 14 of May 2013 18:25:51 Vikas Sajjan wrote:
> > 
> > >  Adds GPIO parsing functionality for "LCD backlight" and "LCD enable"
> > >  GPIO pins of exynos dp controller.
> > >
> > >
> > >
> > > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> > > ---
> > > 
> > >  drivers/video/exynos/exynos_dp_core.c |   45
> > > 
> > > +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
> > >
> > >
> > 
> > 
> > I don't think that Exynos DP driver is right place for such code.
> > Backlight
 and LCD drivers are responsible for backlight and LCD power
> > control using backlight and LCD subsystems.
> > 
> > IMHO the correct solution would be to either extend existing
> > backlight/lcd
> > drivers found in drivers/video/backlight to support direct GPIO control
> > and
 parse GPIO pins from device tree or create new gpio_bl and gpio_lcd
> > drivers.
> 
> Hi Vikas Sajian,
> 
> I agree with Tomasz Figa's opinion.
> Backlight/LCD framework should be used.
> eDP panel backlight on SMDK5210 board can be controlled by PWM;
> thus, pwm-backlight driver should be used.
> Also, eDP panel reset pin should be controlled by using
> platform-lcd driver.
> 
> 
> > 
> > CCing Richard, Florian and linux-fbdev.
> 
> 
> Also, I have been doing backlight reviews instead of Richard,
> please do CC'ing me.

OK. I used get_maintainers script, but it seems like the result was a bit off 
in this case. Will remember for future.

Best regards,
-- 
Tomasz Figa
Linux Kernel Developer
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-05-17 12:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-16  2:03 [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver 한진구
2013-05-16  2:04 ` 한진구
2013-05-17 12:29 ` Tomasz Figa
2013-05-17 12:29   ` Tomasz Figa
  -- strict thread matches above, loose matches on Subject: below --
2013-05-14 12:55 [PATCH 0/2] Add LCD backlight and LCD enable gpios pins to dp-controller DT node Vikas Sajjan
2013-05-14 12:55 ` [PATCH 1/2] video: exynos_dp: Add parsing of gpios pins to exynos-dp driver Vikas Sajjan
2013-05-14 14:16   ` Tomasz Figa
2013-05-14 14:16     ` Tomasz Figa
2013-05-14 12:55 ` [PATCH 2/2] ARM: dts: Add LCD backlight and LCD enable gpios pins to dp-controller DT node Vikas Sajjan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.