All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Enable DVI-D output for Devkit8000
@ 2010-04-07  8:34 Kan-Ru Chen
  2010-04-07  8:34 ` [PATCH 2/2] Setup LCD reset " Kan-Ru Chen
  2010-04-09 13:07 ` [PATCH 1/2] Enable DVI-D output " Thomas Weber
  0 siblings, 2 replies; 6+ messages in thread
From: Kan-Ru Chen @ 2010-04-07  8:34 UTC (permalink / raw)
  To: linux-omap; +Cc: Kan-Ru Chen, Thomas Weber

This patch corrects the DVI-D output setup of Devkit8000

Devkit8000 has different DVI reset pin with the BeagleBoard. On Devkit8000
the TWL4030 GPIO_7 is assigned to do the job.

Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
---
 arch/arm/mach-omap2/board-devkit8000.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 5bfc13b..fd4454a 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -141,13 +141,18 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
 {
 }
+
 static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
 {
+	if (dssdev->reset_gpio != -EINVAL)
+		gpio_set_value(dssdev->reset_gpio, 1);
 	return 0;
 }
 
 static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
 {
+	if (dssdev->reset_gpio != -EINVAL)
+		gpio_set_value(dssdev->reset_gpio, 0);
 }
 
 static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev)
@@ -183,6 +188,7 @@ static struct omap_dss_device devkit8000_dvi_device = {
 	.driver_name            = "generic_panel",
 	.type                   = OMAP_DISPLAY_TYPE_DPI,
 	.phy.dpi.data_lines     = 24,
+	.reset_gpio             = -EINVAL, /* will be replaced */
 	.platform_enable        = devkit8000_panel_enable_dvi,
 	.platform_disable       = devkit8000_panel_disable_dvi,
 };
@@ -283,6 +289,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
+	/* gpio + 7 is "DVI_PD" (out, active low) */
+	devkit8000_dvi_device.reset_gpio = gpio + 7;
+	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
+	/* Disable until needed */
+	gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
+
 	return 0;
 }
 
@@ -303,7 +315,7 @@ static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = {
 	.dev		= &devkit8000_lcd_device.dev,
 	},
 	{
-	.supply		= "vdss_dsi",
+	.supply		= "vdds_dsi",
 	.dev		= &devkit8000_dss_device.dev,
 	}
 };
@@ -665,12 +677,6 @@ static void __init devkit8000_init(void)
 
 	devkit8000_ads7846_init();
 
-	omap_mux_init_gpio(170, OMAP_PIN_INPUT);
-
-	gpio_request(170, "DVI_nPD");
-	/* REVISIT leave DVI powered down until it's needed ... */
-	gpio_direction_output(170, true);
-
 	usb_musb_init(&musb_board_data);
 	usb_ehci_init(&ehci_pdata);
 	devkit8000_flash_init();
-- 
1.7.0.4


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

* [PATCH 2/2] Setup LCD reset for Devkit8000
  2010-04-07  8:34 [PATCH 1/2] Enable DVI-D output for Devkit8000 Kan-Ru Chen
@ 2010-04-07  8:34 ` Kan-Ru Chen
  2010-04-09 13:13   ` Thomas Weber
  2010-04-09 13:07 ` [PATCH 1/2] Enable DVI-D output " Thomas Weber
  1 sibling, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2010-04-07  8:34 UTC (permalink / raw)
  To: linux-omap; +Cc: Kan-Ru Chen, Thomas Weber

This patch corrects the LCD reset pin config

Original code from early devkit8000 patch sets the TWL4030 GPIO_1
to EHCI_nOC and TWL4030_GPIO_MAX+1 to ledA. Indeed these two pins
are both LCD_PWREN. Setup the lcd reset_gpio properly so it can be
disabled when other display is turned on.

Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
---
 arch/arm/mach-omap2/board-devkit8000.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index fd4454a..e38a669 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -135,11 +135,15 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
 	twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
 	twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
 
+	if (dssdev->reset_gpio != -EINVAL)
+		gpio_set_value(dssdev->reset_gpio, 1);
 	return 0;
 }
 
 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
 {
+	if (dssdev->reset_gpio != -EINVAL)
+		gpio_set_value(dssdev->reset_gpio, 0);
 }
 
 static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
@@ -180,6 +184,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
 	.driver_name            = "innolux_at_panel",
 	.type                   = OMAP_DISPLAY_TYPE_DPI,
 	.phy.dpi.data_lines     = 24,
+	.reset_gpio             = -EINVAL, /* will be replaced */
 	.platform_enable        = devkit8000_panel_enable_lcd,
 	.platform_disable       = devkit8000_panel_disable_lcd,
 };
@@ -275,20 +280,15 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
 	devkit8000_vmmc1_supply.dev = mmc[0].dev;
 	devkit8000_vsim_supply.dev = mmc[0].dev;
 
-	/* REVISIT: need ehci-omap hooks for external VBUS
-	 * power switch and overcurrent detect
-	 */
-
-	gpio_request(gpio + 1, "EHCI_nOC");
-	gpio_direction_input(gpio + 1);
-
-	/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
-	gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
-	gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
-
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
+        /* gpio + 1 is "LCD_PWREN" (out, active high) */
+	devkit8000_lcd_device.reset_gpio = gpio + 1;
+	gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
+	/* Disable until needed */
+	gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
+
 	/* gpio + 7 is "DVI_PD" (out, active low) */
 	devkit8000_dvi_device.reset_gpio = gpio + 7;
 	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
-- 
1.7.0.4


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

* Re: [PATCH 1/2] Enable DVI-D output for Devkit8000
  2010-04-07  8:34 [PATCH 1/2] Enable DVI-D output for Devkit8000 Kan-Ru Chen
  2010-04-07  8:34 ` [PATCH 2/2] Setup LCD reset " Kan-Ru Chen
@ 2010-04-09 13:07 ` Thomas Weber
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Weber @ 2010-04-09 13:07 UTC (permalink / raw)
  To: Kan-Ru Chen; +Cc: linux-omap, Tony Lindgren

Hello Kan-Ru,

On 04/07/10 08:34, Kan-Ru Chen wrote:
> This patch corrects the DVI-D output setup of Devkit8000
> 
> Devkit8000 has different DVI reset pin with the BeagleBoard. On Devkit8000
> the TWL4030 GPIO_7 is assigned to do the job.
> 
> Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
> ---
>  arch/arm/mach-omap2/board-devkit8000.c |   20 +++++++++++++-------
>  1 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index 5bfc13b..fd4454a 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
> @@ -141,13 +141,18 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
>  static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
>  {
>  }
> +
>  static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
>  {
> +	if (dssdev->reset_gpio != -EINVAL)
> +		gpio_set_value(dssdev->reset_gpio, 1);
>  	return 0;
>  }
>  
>  static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
>  {
> +	if (dssdev->reset_gpio != -EINVAL)
> +		gpio_set_value(dssdev->reset_gpio, 0);
>  }
>  
>  static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev)
> @@ -183,6 +188,7 @@ static struct omap_dss_device devkit8000_dvi_device = {
>  	.driver_name            = "generic_panel",
>  	.type                   = OMAP_DISPLAY_TYPE_DPI,
>  	.phy.dpi.data_lines     = 24,
> +	.reset_gpio             = -EINVAL, /* will be replaced */
>  	.platform_enable        = devkit8000_panel_enable_dvi,
>  	.platform_disable       = devkit8000_panel_disable_dvi,
>  };
> @@ -283,6 +289,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
>  	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
>  	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
>  
> +	/* gpio + 7 is "DVI_PD" (out, active low) */
> +	devkit8000_dvi_device.reset_gpio = gpio + 7;
> +	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
> +	/* Disable until needed */
> +	gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
> +
>  	return 0;
>  }
>  
> @@ -303,7 +315,7 @@ static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = {
>  	.dev		= &devkit8000_lcd_device.dev,
>  	},
>  	{
> -	.supply		= "vdss_dsi",
> +	.supply		= "vdds_dsi",
>  	.dev		= &devkit8000_dss_device.dev,
>  	}
>  };
This is already fixed in patch
http://marc.info/?l=linux-omap&m=126943519824335&w=2

> @@ -665,12 +677,6 @@ static void __init devkit8000_init(void)
>  
>  	devkit8000_ads7846_init();
>  
> -	omap_mux_init_gpio(170, OMAP_PIN_INPUT);
> -
> -	gpio_request(170, "DVI_nPD");
> -	/* REVISIT leave DVI powered down until it's needed ... */
> -	gpio_direction_output(170, true);
> -
>  	usb_musb_init(&musb_board_data);
>  	usb_ehci_init(&ehci_pdata);
>  	devkit8000_flash_init();
This is already fixed in patch
http://marc.info/?l=linux-omap&m=126943519124317&w=2

Thomas

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

* Re: [PATCH 2/2] Setup LCD reset for Devkit8000
  2010-04-07  8:34 ` [PATCH 2/2] Setup LCD reset " Kan-Ru Chen
@ 2010-04-09 13:13   ` Thomas Weber
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Weber @ 2010-04-09 13:13 UTC (permalink / raw)
  To: Kan-Ru Chen; +Cc: linux-omap, Thomas Weber, Tony Lindgren

Hello Kan-Ru,

On 04/07/10 08:34, Kan-Ru Chen wrote:
> This patch corrects the LCD reset pin config
> 
> Original code from early devkit8000 patch sets the TWL4030 GPIO_1
> to EHCI_nOC and TWL4030_GPIO_MAX+1 to ledA. Indeed these two pins
> are both LCD_PWREN. Setup the lcd reset_gpio properly so it can be
> disabled when other display is turned on.
> 
> Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
> ---
>  arch/arm/mach-omap2/board-devkit8000.c |   22 +++++++++++-----------
>  1 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index fd4454a..e38a669 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
> @@ -135,11 +135,15 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
>  	twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
>  	twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
>  
> +	if (dssdev->reset_gpio != -EINVAL)
> +		gpio_set_value(dssdev->reset_gpio, 1);
>  	return 0;
>  }
>  
>  static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
>  {
> +	if (dssdev->reset_gpio != -EINVAL)
> +		gpio_set_value(dssdev->reset_gpio, 0);
>  }
>  
>  static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
> @@ -180,6 +184,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
>  	.driver_name            = "innolux_at_panel",
>  	.type                   = OMAP_DISPLAY_TYPE_DPI,
>  	.phy.dpi.data_lines     = 24,
> +	.reset_gpio             = -EINVAL, /* will be replaced */
>  	.platform_enable        = devkit8000_panel_enable_lcd,
>  	.platform_disable       = devkit8000_panel_disable_lcd,
>  };
> @@ -275,20 +280,15 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
>  	devkit8000_vmmc1_supply.dev = mmc[0].dev;
>  	devkit8000_vsim_supply.dev = mmc[0].dev;
>  
> -	/* REVISIT: need ehci-omap hooks for external VBUS
> -	 * power switch and overcurrent detect
> -	 */
> -
> -	gpio_request(gpio + 1, "EHCI_nOC");
> -	gpio_direction_input(gpio + 1);
> -
> -	/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
> -	gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
> -	gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
> -
This is already fixed in
http://marc.info/?l=linux-omap&m=126943519124317&w=2
>  	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
>  	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
>  
> +        /* gpio + 1 is "LCD_PWREN" (out, active high) */
> +	devkit8000_lcd_device.reset_gpio = gpio + 1;
> +	gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
> +	/* Disable until needed */
> +	gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
> +
>  	/* gpio + 7 is "DVI_PD" (out, active low) */
>  	devkit8000_dvi_device.reset_gpio = gpio + 7;
>  	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");

Thomas

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

* Re: [PATCH 1/2] Enable DVI-D output for Devkit8000
  2010-04-07  4:09 Kan-Ru Chen
@ 2010-04-07  8:26 ` Kan-Ru Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Kan-Ru Chen @ 2010-04-07  8:26 UTC (permalink / raw)
  To: linux-omap; +Cc: Kan-Ru Chen, Thomas Weber

On Wed,  7 Apr 2010 12:09:29 +0800, Kan-Ru Chen <kanru@0xlab.org> wrote:
> @@ -283,6 +289,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
>  	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
>  	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
>  
> +	/* gpio + 7 is "DVI_PUD" (out, active low) */
> +	devkit8000_dvi_device.reset_gpio = gpio + 7;
> +	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI_PUD");
> +	/* Disable until needed */
> +	gpio_direction_output(devkit8000_dvi_device.reset_gpio, 1);
> +
>  	return 0;
>  }

Sorry for the noise, it seems I misconfigured this pin. It's actually
active high. So the initial value should be 0 to disable it. I will
prepare a new patch about this.

And seems the second patch doesn't effect the LCD state at all. I have
no idea, but the patch can be dropped.

Cheers,
              Kanru
-- 
Kan-Ru Chen | http://kanru.info

Q: Why are my replies five sentences or less?
A: http://five.sentenc.es/

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

* [PATCH 1/2] Enable DVI-D output for Devkit8000
@ 2010-04-07  4:09 Kan-Ru Chen
  2010-04-07  8:26 ` Kan-Ru Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2010-04-07  4:09 UTC (permalink / raw)
  To: linux-omap; +Cc: Kan-Ru Chen, Thomas Weber

This patch corrects the DVI-D output setup of Devkit8000

Devkit8000 has different DVI reset pin with the BeagleBoard. On Devkit8000
the TWL4030 GPIO_7 is assigned to do the job.

Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
---
 arch/arm/mach-omap2/board-devkit8000.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 5bfc13b..2e7a539 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -141,13 +141,18 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
 {
 }
+
 static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
 {
+	if (dssdev->reset_gpio != -EINVAL)
+		gpio_set_value(dssdev->reset_gpio, 1);
 	return 0;
 }
 
 static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
 {
+	if (dssdev->reset_gpio != -EINVAL)
+		gpio_set_value(dssdev->reset_gpio, 0);
 }
 
 static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev)
@@ -183,6 +188,7 @@ static struct omap_dss_device devkit8000_dvi_device = {
 	.driver_name            = "generic_panel",
 	.type                   = OMAP_DISPLAY_TYPE_DPI,
 	.phy.dpi.data_lines     = 24,
+	.reset_gpio             = -EINVAL, /* will be replaced */
 	.platform_enable        = devkit8000_panel_enable_dvi,
 	.platform_disable       = devkit8000_panel_disable_dvi,
 };
@@ -283,6 +289,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
+	/* gpio + 7 is "DVI_PUD" (out, active low) */
+	devkit8000_dvi_device.reset_gpio = gpio + 7;
+	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI_PUD");
+	/* Disable until needed */
+	gpio_direction_output(devkit8000_dvi_device.reset_gpio, 1);
+
 	return 0;
 }
 
@@ -303,7 +315,7 @@ static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = {
 	.dev		= &devkit8000_lcd_device.dev,
 	},
 	{
-	.supply		= "vdss_dsi",
+	.supply		= "vdds_dsi",
 	.dev		= &devkit8000_dss_device.dev,
 	}
 };
@@ -665,12 +677,6 @@ static void __init devkit8000_init(void)
 
 	devkit8000_ads7846_init();
 
-	omap_mux_init_gpio(170, OMAP_PIN_INPUT);
-
-	gpio_request(170, "DVI_nPD");
-	/* REVISIT leave DVI powered down until it's needed ... */
-	gpio_direction_output(170, true);
-
 	usb_musb_init(&musb_board_data);
 	usb_ehci_init(&ehci_pdata);
 	devkit8000_flash_init();
-- 
1.7.0.4


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

end of thread, other threads:[~2010-04-09 12:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-07  8:34 [PATCH 1/2] Enable DVI-D output for Devkit8000 Kan-Ru Chen
2010-04-07  8:34 ` [PATCH 2/2] Setup LCD reset " Kan-Ru Chen
2010-04-09 13:13   ` Thomas Weber
2010-04-09 13:07 ` [PATCH 1/2] Enable DVI-D output " Thomas Weber
  -- strict thread matches above, loose matches on Subject: below --
2010-04-07  4:09 Kan-Ru Chen
2010-04-07  8:26 ` Kan-Ru Chen

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.