From patchwork Mon Jul 14 12:49:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4545911 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 69F469F1D6 for ; Mon, 14 Jul 2014 12:51:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FF7120121 for ; Mon, 14 Jul 2014 12:51:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8600D20103 for ; Mon, 14 Jul 2014 12:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755481AbaGNMvK (ORCPT ); Mon, 14 Jul 2014 08:51:10 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:56138 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755343AbaGNMuU (ORCPT ); Mon, 14 Jul 2014 08:50:20 -0400 Received: by mail-pd0-f172.google.com with SMTP id w10so5216140pde.31 for ; Mon, 14 Jul 2014 05:50:19 -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=1jL5x7iAOKYWiUPI5f4bmOSIfCnuwRIxSM1ahGQBT3U=; b=nFmEfJAymxhUWl4ovLX0Xx/xw0/EVxMDHqpPyU+QWckU55IObIDwzUYhHpeaaAmMSA RIr2c5RiSoHtJ+kZ40Ht309401QL2Qv3ivHsIZJALWcQGXsXLgfsz9PWA1uO8+e4Fjv4 NdclCDRe0Pqf6dNhV0U1nS+sB1N7fyvNTeMckGLrxPA4nUWCBC7Ndz0fGHIzlRhVRiKm e52P+5dXmHVLzOIUrn8xeU3BX1Uke4yYhycMRK6+P1zocFHmWVMoeAzY4oGm62Om8819 2OW5CmL5gQXTbVL9RiWv4+jLffbaYwvhZnxVoxI8/rDtIFy0n/KdYMNwTPBIml5bgNO6 IYZg== X-Received: by 10.70.39.66 with SMTP id n2mr202657pdk.143.1405342219585; Mon, 14 Jul 2014 05:50:19 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id av2sm10788774pbc.16.2014.07.14.05.50.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 05:50:19 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, kishon@ti.com, kgene.kim@samsung.com, mathias.nyman@intel.com, jwerner@chromium.org, sergei.shtylyov@cogentembedded.com, heikki.krogerus@linux.intel.com, pratyush.anand@st.com, Vivek Gautam Subject: [PATCH v3 2/4] usb: host: xhci-plat: Get PHYs for xhci's hcds Date: Mon, 14 Jul 2014 18:19:56 +0530 Message-Id: <1405342198-3870-3-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405342198-3870-1-git-send-email-gautam.vivek@samsung.com> References: <1405342198-3870-1-git-send-email-gautam.vivek@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 --- drivers/usb/host/xhci-plat.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 1a0cf9f..d097d60 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,14 @@ 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_dbg(&pdev->dev, "no usb2 phy configured\n"); + } + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto disable_clk; @@ -209,6 +218,14 @@ 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_dbg(&pdev->dev, "no usb3 phy configured\n"); + } + ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); if (ret) goto put_usb3_hcd;