From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/11] ARM: tegra: Remove VBUS_GPIO handling from board files
Date: Fri, 30 Mar 2012 16:59:55 -0600 [thread overview]
Message-ID: <1333148404-17691-3-git-send-email-swarren@wwwdotorg.org> (raw)
In-Reply-To: <1333148404-17691-1-git-send-email-swarren@wwwdotorg.org>
From: Stephen Warren <swarren@nvidia.com>
Instead of having board files manually request and initialize USB VBUS
GPIOs, fill in the USB driver's platform data and have it do it.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
arch/arm/mach-tegra/board-seaboard.c | 17 ++++-------------
arch/arm/mach-tegra/board-trimslice.c | 15 +++++----------
2 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index 0e2957f..e6642c6 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -24,6 +24,7 @@
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
+#include <linux/platform_data/tegra_usb.h>
#include <sound/wm8903.h>
@@ -185,20 +186,10 @@ static struct i2c_board_info __initdata wm8903_device = {
static int seaboard_ehci_init(void)
{
- int gpio_status;
+ struct tegra_ehci_platform_data *pdata;
- gpio_status = gpio_request(TEGRA_GPIO_USB1, "VBUS_USB1");
- if (gpio_status < 0) {
- pr_err("VBUS_USB1 request GPIO FAILED\n");
- WARN_ON(1);
- }
-
- gpio_status = gpio_direction_output(TEGRA_GPIO_USB1, 1);
- if (gpio_status < 0) {
- pr_err("VBUS_USB1 request GPIO DIRECTION FAILED\n");
- WARN_ON(1);
- }
- gpio_set_value(TEGRA_GPIO_USB1, 1);
+ pdata = tegra_ehci1_device.dev.platform_data;
+ pdata->vbus_gpio = TEGRA_GPIO_USB1;
platform_device_register(&tegra_ehci1_device);
platform_device_register(&tegra_ehci3_device);
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index ba2e047..7a21cf5 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -25,6 +25,7 @@
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
+#include <linux/platform_data/tegra_usb.h>
#include <asm/hardware/gic.h>
#include <asm/mach-types.h>
@@ -110,19 +111,13 @@ static void trimslice_i2c_init(void)
static void trimslice_usb_init(void)
{
- int err;
+ struct tegra_ehci_platform_data *pdata;
- platform_device_register(&tegra_ehci3_device);
+ pdata = tegra_ehci1_device.dev.platform_data;
+ pdata->vbus_gpio = TRIMSLICE_GPIO_USB1_MODE;
+ platform_device_register(&tegra_ehci3_device);
platform_device_register(&tegra_ehci2_device);
-
- err = gpio_request_one(TRIMSLICE_GPIO_USB1_MODE, GPIOF_OUT_INIT_HIGH,
- "usb1mode");
- if (err) {
- pr_err("TrimSlice: failed to obtain USB1 mode gpio: %d\n", err);
- return;
- }
-
platform_device_register(&tegra_ehci1_device);
}
--
1.7.0.4
next prev parent reply other threads:[~2012-03-30 22:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 22:59 [PATCH 00/11] ARM: tegra: GPIO and pinmux-related changes Stephen Warren
2012-03-30 22:59 ` [PATCH 01/11] usb: ehci-tegra: Add vbus_gpio to platform data Stephen Warren
2012-04-04 17:51 ` Olof Johansson
2012-03-30 22:59 ` Stephen Warren [this message]
2012-04-04 17:52 ` [PATCH 02/11] ARM: tegra: Remove VBUS_GPIO handling from board files Olof Johansson
2012-03-30 22:59 ` [PATCH 03/11] gpio: tegra: fix register address calculations for Tegra30 Stephen Warren
2012-04-04 17:57 ` Olof Johansson
2012-04-04 18:53 ` Stephen Warren
2012-04-04 18:57 ` Olof Johansson
2012-03-30 22:59 ` [PATCH 04/11] gpio: tegra: Iterate over the correct number of banks Stephen Warren
2012-04-04 17:58 ` Olof Johansson
2012-04-04 18:41 ` Stephen Warren
2012-04-04 18:59 ` Olof Johansson
2012-03-30 22:59 ` [PATCH 05/11] gpio: tegra: configure pins during irq_set_type Stephen Warren
2012-04-04 17:58 ` Olof Johansson
2012-03-30 22:59 ` [PATCH 06/11] ARM: tegra: seaboard: Don't gpio_request() ISL29018_IRQ Stephen Warren
2012-04-04 17:59 ` Olof Johansson
2012-03-30 23:00 ` [PATCH 07/11] gpio: tegra: Hide tegra_gpio_enable/disable() Stephen Warren
2012-04-01 4:32 ` Chris Ball
2012-04-01 9:54 ` Linus Walleij
2012-04-04 18:01 ` Olof Johansson
2012-04-09 1:09 ` Chris Ball
2012-03-30 23:00 ` [PATCH 08/11] ARM: tegra: Switch to new pinctrl driver Stephen Warren
2012-04-03 20:49 ` Linus Walleij
2012-04-04 18:49 ` Olof Johansson
2012-03-30 23:00 ` [PATCH 09/11] ARM: tegra: Remove pre-pinctrl pinmux driver Stephen Warren
2012-03-30 23:00 ` [PATCH 10/11] ARM: dt: tegra cardhu: add pinmux to device tree Stephen Warren
2012-04-04 18:52 ` Olof Johansson
2012-03-30 23:00 ` [PATCH 11/11] ARM: dt: tegra20: " Stephen Warren
2012-04-03 20:51 ` Linus Walleij
2012-04-04 19:14 ` Olof Johansson
2012-04-04 19:16 ` [PATCH 00/11] ARM: tegra: GPIO and pinmux-related changes Olof Johansson
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=1333148404-17691-3-git-send-email-swarren@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).