From patchwork Thu Aug 21 14:55:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4758391 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A80D6C0338 for ; Thu, 21 Aug 2014 14:56:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D104B2018A for ; Thu, 21 Aug 2014 14:56:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBB6920172 for ; Thu, 21 Aug 2014 14:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752233AbaHUOzq (ORCPT ); Thu, 21 Aug 2014 10:55:46 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:56324 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999AbaHUOzo (ORCPT ); Thu, 21 Aug 2014 10:55:44 -0400 Received: by mail-pd0-f179.google.com with SMTP id v10so14145705pde.24 for ; Thu, 21 Aug 2014 07:55:43 -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=hR3rSDKUvEUHeTmu/X03bbIXGWaZCLxvV2Iif7DxbXA=; b=JYfOUxG/3BtXzdGhjISS9mspIa6H2C8MVsqaqtDXTAbmckTmUFchyOyAZVdY3YSlIS Kgl4oGPJm2Lp348DIJ9g9ZJlw0uUq8tR+QB1NEb4VdibcBYDbSyeB2KZJNEYMpTqMLeU B5+2FI9HVjRRu7qSIcDflZvW971iX3ADc6nlLogld/0kU5pafAlYMnDS8QkkxI+U0o+8 /PbUD7UxdiYbKR+tdYJjFhA8TpCQ+C3dDX85RxhMmd2t7DBIaGD/QBX5VQQj3MoV6jzn BduUMYYGZH1e7SehrLnjnNueHx2MxIN/h+z9ZnBDLw+AmjaItqet15zCH5l95wq3FDlJ RAmQ== X-Received: by 10.66.139.200 with SMTP id ra8mr8538174pab.69.1408632943732; Thu, 21 Aug 2014 07:55:43 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id wc3sm91835580pac.18.2014.08.21.07.55.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 07:55:42 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, kishon@ti.com, kgene.kim@samsung.com, mathias.nyman@intel.com, stern@rowland.harvard.edu, sergei.shtylyov@cogentembedded.com, heikki.krogerus@linux.intel.com, balbi@ti.com, Vivek Gautam Subject: [PATCH v5 2/4] usb: host: xhci-plat: Get PHYs for xhci's hcds Date: Thu, 21 Aug 2014 20:25:21 +0530 Message-Id: <1408632923-19591-3-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1408632923-19591-1-git-send-email-gautam.vivek@samsung.com> References: <1408632923-19591-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=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 PHYs, viz. USB 2.0 type (UTMI+) and USB 3.0 type (PIPE3). Signed-off-by: Vivek Gautam --- drivers/usb/host/xhci-plat.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 1a0cf9f..56ef9cf 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,17 @@ 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 == -EPROBE_DEFER) + return ret; + else 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 +221,17 @@ 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 == -EPROBE_DEFER) + return ret; + else 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;