From patchwork Fri Jun 6 12:12:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4311451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3FFDB9F170 for ; Fri, 6 Jun 2014 12:15:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 740A6201DD for ; Fri, 6 Jun 2014 12:15:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2EBB201BC for ; Fri, 6 Jun 2014 12:15:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wst19-0002Lb-Pr; Fri, 06 Jun 2014 12:13:07 +0000 Received: from mail-pb0-x22a.google.com ([2607:f8b0:400e:c01::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wst15-0002JQ-Ia for linux-arm-kernel@lists.infradead.org; Fri, 06 Jun 2014 12:13:03 +0000 Received: by mail-pb0-f42.google.com with SMTP id md12so2411200pbc.15 for ; Fri, 06 Jun 2014 05:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1a+oaz9Waa2ATNmBJ8E12R+P2bYtk0umSD3S6rGk9xI=; b=l+lFWIYuZpuHvhrz85aBx+uu6pQn4wtgVMMNvaGlDbOWdxDsbUAwYFpHKK51CrH5M3 hnytGxbKSkBQVgzakcItYKDxGWquMSu3tVfwiu8qV8qZtQCyrig6b1H8Sk8A38zyiHay 4e+1a35mZgs9cwTUBMinIwSUIvexrjVP93MV2DKc8bfGk3WrZaifS2bN5s8lMruHJC6M wOK5oMI2ZJm52R2e+yTxSrXlopYHw+LwaWWU6+ZmugKeEiHNbzPGzaILAtPpXVjpussU MTdvutLU2j9ivD+oaMDLqNhH9IAnRSuxQlD/Vn7lX9V75MzHtnvTowNhAcU3pOSXJG+G TeVg== X-Received: by 10.68.103.165 with SMTP id fx5mr118770pbb.118.1402056762884; Fri, 06 Jun 2014 05:12:42 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id su8sm35172740pbc.72.2014.06.06.05.12.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 05:12:42 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, gregkh@linuxfoundation.org, kishon@ti.com, mathias.nyman@intel.com Subject: [PATCH 2/4] usb: host: xhci-plat: Add support to get PHYs Date: Fri, 6 Jun 2014 17:42:13 +0530 Message-Id: <1402056736-12674-3-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402056736-12674-1-git-send-email-gautam.vivek@samsung.com> References: <1402056736-12674-1-git-send-email-gautam.vivek@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140606_051303_633399_4CFD087B X-CRM114-Status: GOOD ( 16.10 ) X-Spam-Score: 0.2 (/) Cc: jwerner@chromium.org, kgene.kim@samsung.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vivek Gautam X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The host controller by itself may sometimes need to handle PHY and/or calibrate some of the PHY settings to get full support out of the PHY controller. The PHY core provides a calibration funtionality now to do so. Therefore, facilitate getting the two possible PHY types for xhci controller, viz. USB 2.0 type (UTMI+) and USB 3.0 type (PIPE3) from its parent. Signed-off-by: Vivek Gautam --- drivers/usb/host/xhci-plat.c | 24 ++++++++++++++++++++++++ drivers/usb/host/xhci.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 29d8adb..e7145b5 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "xhci.h" #include "xhci-mvebu.h" @@ -183,6 +184,29 @@ static int xhci_plat_probe(struct platform_device *pdev) } /* + * Get possile USB 2.0 type PHY (UTMI+), as well as + * USB 3.0 type PHY (PIPE3). + * The host controller may need to handle PHYs by itself too + * sometimes, so as to calibrate it based on the need. + */ + xhci->phy2_gen = devm_phy_get(&pdev->dev, "usb2-phy"); + if (IS_ERR(xhci->phy2_gen)) { + ret = PTR_ERR(xhci->phy2_gen); + if (ret != -ENOSYS && ret != -ENODEV) { + dev_err(&pdev->dev, "no usb2 phy configured\n"); + return ret; + } + } + xhci->phy3_gen = devm_phy_get(&pdev->dev, "usb3-phy"); + if (IS_ERR(xhci->phy3_gen)) { + ret = PTR_ERR(xhci->phy3_gen); + if (ret != -ENOSYS && ret != -ENODEV) { + dev_err(&pdev->dev, "no usb3 phy configured\n"); + return ret; + } + } + + /* * Set the xHCI pointer before xhci_plat_setup() (aka hcd_driver.reset) * is called by usb_add_hcd(). */ diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 9ffecd5..453d89e 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1582,6 +1582,9 @@ struct xhci_hcd { u32 port_status_u0; /* Compliance Mode Timer Triggered every 2 seconds */ #define COMP_MODE_RCVRY_MSECS 2000 + /* phys for the controller */ + struct phy *phy2_gen; + struct phy *phy3_gen; }; /* convert between an HCD pointer and the corresponding EHCI_HCD */