From patchwork Wed Jul 16 08:21:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4565111 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 185059F1D6 for ; Wed, 16 Jul 2014 08:24:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 471442018A for ; Wed, 16 Jul 2014 08:24:17 +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 708CF2017E for ; Wed, 16 Jul 2014 08:24:16 +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 1X7KTi-00079Y-RI; Wed, 16 Jul 2014 08:22:18 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X7KTe-00072r-9i for linux-arm-kernel@lists.infradead.org; Wed, 16 Jul 2014 08:22:15 +0000 Received: by mail-pa0-f46.google.com with SMTP id lj1so892850pab.33 for ; Wed, 16 Jul 2014 01:21:52 -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=2LqGtuUgD/DghaZgCNz/hX2vBb1W11OV8Mun4z0a9+o=; b=K/v6kZaWIiYg2GoySXtB2ZzkSNlZtujmJgmHRpESv91WgmbrGkRmbFtEbxghz8HGNc b7s6cu8CZgbdslLhqwaMUlv0zZXwSg29EEtopa28MhLlLNo3HawebRnjhf5dHnMH0CZw AsySYt5WrUTao2FB2YroWcv6uRDI6SZcuhrHQsqoSGHOS2U9NbkV+77TrBdYyqTUFtzX RWTF3rxeWqS0kQRuLSCwRUk7pK9ZkZpK46y6p2i62PfHt9khfHojawFpT924J8wZ+oWb XtukLEHvFp5KLmnuV+KgwXqhPwf+PzbYh49uCuG2zAqW28YpB/e0awJCtrS8es6RxQ0L xMXg== X-Received: by 10.66.141.165 with SMTP id rp5mr28264248pab.90.1405498912448; Wed, 16 Jul 2014 01:21:52 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id nt15sm438718pdb.63.2014.07.16.01.21.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jul 2014 01:21:51 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v4 2/4] usb: host: xhci-plat: Get PHYs for xhci's hcds Date: Wed, 16 Jul 2014 13:51:40 +0530 Message-Id: <1405498900-13473-1-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140716_012214_361888_D72DAB7C X-CRM114-Status: GOOD ( 11.41 ) X-Spam-Score: -0.4 (/) Cc: pratyush.anand@st.com, kgene.kim@samsung.com, sergei.shtylyov@cogentembedded.com, mathias.nyman@intel.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, kishon@ti.com, heikki.krogerus@linux.intel.com, Vivek Gautam , jwerner@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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 PHYs, viz. USB 2.0 type (UTMI+) and USB 3.0 type (PIPE3). Signed-off-by: Vivek Gautam --- Changes from v3: - Modified error message as per review comments from Julius. drivers/usb/host/xhci-plat.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 1a0cf9f..b1c0364 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -180,6 +181,15 @@ static int xhci_plat_probe(struct platform_device *pdev) goto put_hcd; } + /* Get possile USB 2.0 type PHY (UTMI+) available with xhci */ + hcd->gen_phy = devm_phy_get(&pdev->dev, "usb2-phy"); + if (IS_ERR(hcd->gen_phy)) { + ret = PTR_ERR(hcd->gen_phy); + if (ret != -ENOSYS && ret != -ENODEV) + dev_warn(&pdev->dev, + "Error retrieving usb2 phy: %d\n", ret); + } + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto disable_clk; @@ -209,6 +219,15 @@ static int xhci_plat_probe(struct platform_device *pdev) if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci->shared_hcd->can_do_streams = 1; + /* Get possile USB 3.0 type PHY (PIPE3) available with xhci */ + xhci->shared_hcd->gen_phy = devm_phy_get(&pdev->dev, "usb3-phy"); + if (IS_ERR(xhci->shared_hcd->gen_phy)) { + ret = PTR_ERR(xhci->shared_hcd->gen_phy); + if (ret != -ENOSYS && ret != -ENODEV) + dev_warn(&pdev->dev, + "Error retrieving usb3 phy: %d\n", ret); + } + ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); if (ret) goto put_usb3_hcd;