From: Roger Quadros <rogerq@ti.com>
To: <balbi@ti.com>
Cc: <gregkh@linuxfoundation.org>, <sameo@linux.intel.com>,
<tony@atomide.com>, <kishon@ti.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <rogerq@ti.com>
Subject: [PATCH 13/14] ARM: OMAP2+: omap4panda: Adapt HUB reset to regulator framework
Date: Thu, 10 Jan 2013 18:51:33 +0200 [thread overview]
Message-ID: <1357836694-30788-14-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1357836694-30788-1-git-send-email-rogerq@ti.com>
We model the HUB_RESET GPIO as a fixed regulator device. This regulator
is then used as "reset" supply for the USB PHY device and is managed
by the PHY driver.
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
arch/arm/mach-omap2/board-omap4panda.c | 48 ++++++++++++++++++++++----------
1 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index a4831cc..fd2f907 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -132,6 +132,38 @@ static struct platform_device btwilink_device = {
.id = -1,
};
+/* Regulator for USB HUB/PHY reset */
+static struct regulator_consumer_supply hub_reset_supplies[] = {
+/* Link PHY device to reset supply so it gets used in the PHY driver */
+ REGULATOR_SUPPLY("reset", "nop_usb_xceiv.0"),
+};
+
+static struct regulator_init_data hub_reset_data = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = hub_reset_supplies,
+ .num_consumer_supplies = ARRAY_SIZE(hub_reset_supplies),
+};
+
+static struct fixed_voltage_config hub_reset_config = {
+ .supply_name = "hub_reset",
+ .microvolts = 3300000,
+ .gpio = GPIO_HUB_NRESET,
+ .startup_delay = 70000, /* 70msec */
+ .enable_high = 1,
+ .enabled_at_boot = 0, /* keep in RESET */
+ .init_data = &hub_reset_data,
+};
+
+static struct platform_device hub_reset_device = {
+ .name = "reg-fixed-voltage",
+ .id = 3,
+ .dev = {
+ .platform_data = &hub_reset_config,
+ },
+};
+
/* Regulator for USB HUB supply */
static struct regulator_consumer_supply hub_power_supplies[] = {
/* Link PHY device to USB HUB supply so it gets enabled in the PHY driver */
@@ -171,6 +203,7 @@ static struct platform_device *panda_devices[] __initdata = {
&panda_hdmi_audio_codec,
&btwilink_device,
&hub_power_device,
+ &hub_reset_device,
};
static struct nop_usb_xceiv_platform_data phy_pdata0 = {
@@ -196,25 +229,10 @@ static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
.phy_config[0] = &phy_config0,
};
-static struct gpio panda_ehci_gpios[] __initdata = {
- { GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" },
-};
-
static void __init omap4_ehci_init(void)
{
int ret;
- /* disable the power to the usb hub prior to init and reset phy+hub */
- ret = gpio_request_array(panda_ehci_gpios,
- ARRAY_SIZE(panda_ehci_gpios));
- if (ret) {
- pr_err("Unable to initialize EHCI power/reset\n");
- return;
- }
-
- gpio_export(GPIO_HUB_NRESET, 0);
- gpio_set_value(GPIO_HUB_NRESET, 1);
-
/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
ret = clk_add_alias("main_clk", "nop_usb_xceiv.0", "auxclk3_ck", NULL);
if (ret)
--
1.7.4.1
next prev parent reply other threads:[~2013-01-10 16:52 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 16:51 [PATCH 00/14] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
2013-01-10 16:51 ` [PATCH 01/14] mfd: omap-usb-host: Consolidate OMAP USB-HS platform data Roger Quadros
2013-01-10 23:45 ` Tony Lindgren
2013-01-11 9:40 ` Roger Quadros
2013-01-11 18:13 ` Tony Lindgren
2013-01-14 11:28 ` Roger Quadros
2013-01-14 17:18 ` Tony Lindgren
2013-01-10 16:51 ` [PATCH 02/14] usb: phy: Add new API usb_get_phy_from_dev() Roger Quadros
2013-01-10 16:51 ` [PATCH 03/14] usb: xceiv: nop: Manage PHY clock Roger Quadros
2013-01-10 16:51 ` [PATCH 04/14] usb: phy: nop: Handle power supply regulator for the PHY Roger Quadros
2013-01-10 18:06 ` Sergei Shtylyov
2013-01-11 9:41 ` Roger Quadros
2013-01-11 17:17 ` Russell King - ARM Linux
2013-01-14 9:54 ` Roger Quadros
2013-01-14 11:25 ` Russell King - ARM Linux
2013-01-14 11:51 ` Roger Quadros
2013-01-14 12:18 ` Russell King - ARM Linux
2013-01-10 16:51 ` [PATCH 05/14] usb: phy: nop: Handle RESET " Roger Quadros
2013-01-10 16:51 ` [PATCH 06/14] mfd: omap-usb-host: update nports in platform_data Roger Quadros
2013-01-22 3:29 ` Samuel Ortiz
2013-01-10 16:51 ` [PATCH 07/14] usb: ehci-omap: Instantiate PHY devices if required Roger Quadros
2013-01-10 20:48 ` Alan Stern
2013-01-11 10:59 ` Roger Quadros
2013-01-11 11:06 ` Roger Quadros
2013-01-11 15:28 ` Alan Stern
2013-01-11 16:03 ` Roger Quadros
2013-01-11 16:32 ` Russell King - ARM Linux
2013-01-14 9:48 ` Roger Quadros
2013-01-11 18:27 ` Alan Stern
2013-01-10 16:51 ` [PATCH 08/14] mfd: omap-usb-host: Remove PHY reset handling code Roger Quadros
2013-01-22 3:28 ` Samuel Ortiz
2013-01-10 16:51 ` [PATCH 09/14] usb: ehci-omap: " Roger Quadros
2013-01-10 16:51 ` [PATCH 10/14] usb: ehci-omap: Remove PHY regulator " Roger Quadros
2013-01-10 16:51 ` [PATCH 11/14] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data Roger Quadros
2013-01-10 16:51 ` [PATCH 12/14] ARM: OMAP2+: omap4panda: Adapt HUB power to regulator framework Roger Quadros
2013-01-10 16:51 ` Roger Quadros [this message]
2013-01-10 16:51 ` [PATCH 14/14] ARM: OMAP2+: omap4panda: Remove irrelevant USB host platform data Roger Quadros
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=1357836694-30788-14-git-send-email-rogerq@ti.com \
--to=rogerq@ti.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=tony@atomide.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
all inboxes | Powered by JetHome®