devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venu Byravarasu <vbyravarasu@nvidia.com>
To: grant.likely@secretlab.ca, rob.herring@calxeda.com,
	rob@landley.net, swarren@wwwdotorg.org, linux@arm.linux.org.uk,
	stern@rowland.harvard.edu, gregkh@linuxfoundation.org,
	sjg@chromium.org, olof@lixom.net
Cc: linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
	Venu Byravarasu <vbyravarasu@nvidia.com>
Subject: [PATCH 2/2] usb: host: tegra: Resetting PORT0 based on information received via DT.
Date: Fri, 14 Dec 2012 12:29:08 +0530	[thread overview]
Message-ID: <1355468348-8821-3-git-send-email-vbyravarasu@nvidia.com> (raw)
In-Reply-To: <1355468348-8821-1-git-send-email-vbyravarasu@nvidia.com>

Tegra USB host driver is using port instance number,
to handle some of the hardware issues on SOC e.g. reset PORT0
twice etc. As instance number based handling looks ugly,
making use of information passed through DT for achieving this.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
---
 drivers/usb/host/ehci-tegra.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index acf1755..55a9cde 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -43,6 +43,7 @@ struct tegra_ehci_hcd {
 	struct usb_phy *transceiver;
 	int host_resumed;
 	int port_resuming;
+	bool needs_double_reset;
 	enum tegra_usb_phy_port_speed port_speed;
 };
 
@@ -184,7 +185,7 @@ static int tegra_ehci_hub_control(
 	}
 
 	/* For USB1 port we need to issue Port Reset twice internally */
-	if (tegra->phy->instance == 0 &&
+	if (tegra->needs_double_reset &&
 	   (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_RESET)) {
 		spin_unlock_irqrestore(&ehci->lock, flags);
 		return tegra_ehci_internal_port_reset(ehci, status_reg);
@@ -666,6 +667,9 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 	clk_prepare_enable(tegra->emc_clk);
 	clk_set_rate(tegra->emc_clk, 400000000);
 
+	tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node,
+		"nvidia,needs-double-reset");
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "Failed to get I/O memory\n");
-- 
1.7.0.4

      parent reply	other threads:[~2012-12-14  6:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14  6:59 [PATCH 0/2] usb: tegra: modifying port reset based on instance number Venu Byravarasu
2012-12-14  6:59 ` [PATCH 1/2] arm: tegra: Add new DT property to USB node Venu Byravarasu
2012-12-17 21:07   ` Stephen Warren
     [not found]     ` <50CF89AF.3000308-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-12-17 21:18       ` Greg KH
2012-12-17 22:06         ` Alan Stern
2012-12-17 22:04       ` Alan Stern
     [not found]         ` <Pine.LNX.4.44L0.1212171704060.1409-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-01-12  0:14           ` Greg KH
2013-01-12  0:43             ` Stephen Warren
2012-12-14  6:59 ` Venu Byravarasu [this message]

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=1355468348-8821-3-git-send-email-vbyravarasu@nvidia.com \
    --to=vbyravarasu@nvidia.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=sjg@chromium.org \
    --cc=stern@rowland.harvard.edu \
    --cc=swarren@wwwdotorg.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).