diff mbox

[Maverick,SRU,1/6] UBUNTU - ARM: igepv2: Adding support for VBUS and overcurrent

Message ID 1286814972.3125.32.camel@black
State Accepted
Delegated to: Brad Figg
Headers show

Commit Message

Mathieu Poirier Oct. 11, 2010, 4:36 p.m. UTC
SRU Justification:

Impact: This patch is part of a series of fix for the IGEPv2.  The board
features multiple GPIOs that must be initialized in order for signals to
be considered by the processor.  

Fix: GPIOs for VBUS and over current are requested and their direction
set in the GPIO setup routine, part of the initial initialization of the
board.

Testcase: Booting the board without the fix will see input and outputs
from the external VBUS power switch and over current ignored.


>From 452f4fd729b6a464a91ab5e461189f2a0a637fe5 Mon Sep 17 00:00:00 2001
From: Enric Balletbo i Serra <eballetbo@gmail.com>
Date: Mon, 11 Oct 2010 10:08:18 -0600
Subject: [PATCH 1/6] UBUNTU - ARM: igepv2: Adding support for VBUS and overcurrent

GPIO for various devices are missing from the board initialization.
This patch adds support for the VBUS and over current gpios.
Without this patch, input/outputs from these two sources are ignored.

This work has also been submitted here:
http://marc.info/?l=linux-omap&m=128628834619169&w=2

BugLink: https://bugs.launchpad.net/bugs/651589

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Mathieu J Poirier <mathieu.poirier@canonical.com>
---
 arch/arm/mach-omap2/board-igep0020.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

Comments

Lee Jones Oct. 12, 2010, 8:20 a.m. UTC | #1
On 11/10/10 17:36, Mathieu Poirier wrote:
> SRU Justification:
> 
> Impact: This patch is part of a series of fix for the IGEPv2.  The board
> features multiple GPIOs that must be initialized in order for signals to
> be considered by the processor.  
> 
> Fix: GPIOs for VBUS and over current are requested and their direction
> set in the GPIO setup routine, part of the initial initialization of the
> board.
> 
> Testcase: Booting the board without the fix will see input and outputs
> from the external VBUS power switch and over current ignored.
> 
> 
>>From 452f4fd729b6a464a91ab5e461189f2a0a637fe5 Mon Sep 17 00:00:00 2001
> From: Enric Balletbo i Serra <eballetbo@gmail.com>
> Date: Mon, 11 Oct 2010 10:08:18 -0600
> Subject: [PATCH 1/6] UBUNTU - ARM: igepv2: Adding support for VBUS and overcurrent
> 
> GPIO for various devices are missing from the board initialization.
> This patch adds support for the VBUS and over current gpios.
> Without this patch, input/outputs from these two sources are ignored.
> 
> This work has also been submitted here:
> http://marc.info/?l=linux-omap&m=128628834619169&w=2
> 
> BugLink: https://bugs.launchpad.net/bugs/651589
> 
> Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Signed-off-by: Mathieu J Poirier <mathieu.poirier@canonical.com>
> ---
>  arch/arm/mach-omap2/board-igep0020.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index d55c57b..0b999f8 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -274,6 +274,22 @@ static int igep2_twl_gpio_setup(struct device *dev,
>  	igep2_vmmc1_supply.dev = mmc[0].dev;
>  	igep2_vmmc2_supply.dev = mmc[1].dev;
>  
> +	/*
> +	 * REVISIT: need ehci-omap hooks for external VBUS
> +	 * power switch and overcurrent detect
> +	 */
> +	if ((gpio_request(gpio + 1, "GPIO_EHCI_NOC") < 0) ||
> +	    (gpio_direction_input(gpio + 1) < 0))
> +		pr_err("IGEP2: Could not obtain gpio for EHCI NOC");
> +
> +	/*
> +	 * TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN
> +	 * (out, active low)
> +	 */
> +	if ((gpio_request(gpio + TWL4030_GPIO_MAX, "GPIO_USBH_CPEN") < 0) ||
> +	    (gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0) < 0))
> +		pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
> +
>  	return 0;
>  };
>  
Signed-off-by: Lee Jones <lee.jones@canonical.com>
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index d55c57b..0b999f8 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -274,6 +274,22 @@  static int igep2_twl_gpio_setup(struct device *dev,
 	igep2_vmmc1_supply.dev = mmc[0].dev;
 	igep2_vmmc2_supply.dev = mmc[1].dev;
 
+	/*
+	 * REVISIT: need ehci-omap hooks for external VBUS
+	 * power switch and overcurrent detect
+	 */
+	if ((gpio_request(gpio + 1, "GPIO_EHCI_NOC") < 0) ||
+	    (gpio_direction_input(gpio + 1) < 0))
+		pr_err("IGEP2: Could not obtain gpio for EHCI NOC");
+
+	/*
+	 * TWL4030_GPIO_MAX + 0 == ledA, GPIO_USBH_CPEN
+	 * (out, active low)
+	 */
+	if ((gpio_request(gpio + TWL4030_GPIO_MAX, "GPIO_USBH_CPEN") < 0) ||
+	    (gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0) < 0))
+		pr_err("IGEP2: Could not obtain gpio for USBH_CPEN");
+
 	return 0;
 };