From patchwork Wed Dec 5 15:03:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 152911 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9396721ljp; Wed, 5 Dec 2018 07:03:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/WdjnF6tSDFZbR/uA+zgCSUYo/X6Pxril2DWTr+W1Y+TeSaBIJCJhi/izKYa+Wgoos9yJei X-Received: by 2002:a63:d70e:: with SMTP id d14mr20966220pgg.159.1544022221408; Wed, 05 Dec 2018 07:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544022221; cv=none; d=google.com; s=arc-20160816; b=spBhq0bEvct5Ve4pjHhs9ddLEIDkNcxjYBblKSiuMz3Niqz3RFV/B3vLBTg3sqtUgZ jD5JMAtWCezziJ2jtr+E11INWc5a37GWgSH1OnCNuekckXmGYs/CCuqA7kmah+2bUPSK eP1X0p/E7xdF8ix+RGK6pRYvF+VvnKxg0PwAMEymNNy4J2wQ4ZxLR3JzbbudePnDH/CI zk00Vob5lg2Cr/uXaJs6BpyXIlThse8atgfFXsJLhdiZ7oYnb93Gu5ZNGzSuRr4p/zvn fH0ZJ3IRDNt7f22qF62pl9E0fZQaERuFBJz2ZmJ+xgbd4vwzHtIYeV5eR9A/Y678dRUA 5+pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=6I7EuOI+Ex6WnVoqTSfwZg8L3e1Q0JFDnN329OT3v6c=; b=boTXoGGTMuvTNU4acaRwOXcpd1jXGMdppZqRXEAmIIBU+GCec0uzFX2qLXpw+6dxWs SNuQicHQkgV6v7/UpPPGsE9boYFSuAVZah+gM7SocYrRZ677E0zgNzJ5sK4PnX8uAjin gJqmPPsoNonwvZIL9Udma9bcRmuTS+/HArAoaYCELC9UcLMp0mhaq95MRR2JZjh7Lro2 K8lYmx3zsFzuAh3lild+kqmo28raGE6SLQJmtZ5I30PNndSvx1+3RaGWzmJl1XGU1hj2 E/+VqpC57WNwOqeHPYJNUnaGgzuC2qXPowmXedsPWPqIfaQeb4D1+0mgyYpf2z5hFnpS 1A9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z186si18563280pgd.90.2018.12.05.07.03.40; Wed, 05 Dec 2018 07:03:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbeLEPDj (ORCPT + 31 others); Wed, 5 Dec 2018 10:03:39 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58984 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727195AbeLEPDh (ORCPT ); Wed, 5 Dec 2018 10:03:37 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB5F3Z8S068470; Wed, 5 Dec 2018 09:03:35 -0600 Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB5F3ZMU029374 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 09:03:35 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 5 Dec 2018 09:03:33 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 5 Dec 2018 09:03:33 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3XBc016211; Wed, 5 Dec 2018 09:03:33 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.237.247]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3S9r023981; Wed, 5 Dec 2018 09:03:31 -0600 From: Roger Quadros To: CC: , , , , , Roger Quadros Subject: [PATCH 1/4] phy: ti: usb2: Fix logic on -EPROBE_DEFER Date: Wed, 5 Dec 2018 17:03:23 +0200 Message-ID: <1544022206-2300-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544022206-2300-1-git-send-email-rogerq@ti.com> References: <1544022206-2300-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If clk_get() returns -EPROBE_DEFER then we should just return instead of falling back to old clock name. Use clk_prepare_enable() and clk_disable_unprepare() instead of splitting up prepare/unprepare from enable/disable. Signed-off-by: Roger Quadros --- drivers/phy/ti/phy-omap-usb2.c | 88 ++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 41 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c index fe909fd..418e7f1 100644 --- a/drivers/phy/ti/phy-omap-usb2.c +++ b/drivers/phy/ti/phy-omap-usb2.c @@ -135,9 +135,9 @@ static int omap_usb_power_on(struct phy *x) static int omap_usb2_disable_clocks(struct omap_usb *phy) { - clk_disable(phy->wkupclk); + clk_disable_unprepare(phy->wkupclk); if (!IS_ERR(phy->optclk)) - clk_disable(phy->optclk); + clk_disable_unprepare(phy->optclk); return 0; } @@ -146,14 +146,14 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy) { int ret; - ret = clk_enable(phy->wkupclk); + ret = clk_prepare_enable(phy->wkupclk); if (ret < 0) { dev_err(phy->dev, "Failed to enable wkupclk %d\n", ret); goto err0; } if (!IS_ERR(phy->optclk)) { - ret = clk_enable(phy->optclk); + ret = clk_prepare_enable(phy->optclk); if (ret < 0) { dev_err(phy->dev, "Failed to enable optclk %d\n", ret); goto err1; @@ -346,63 +346,72 @@ static int omap_usb2_probe(struct platform_device *pdev) } } - otg->set_host = omap_usb_set_host; - otg->set_peripheral = omap_usb_set_peripheral; - if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS) - otg->set_vbus = omap_usb_set_vbus; - if (phy_data->flags & OMAP_USB2_HAS_START_SRP) - otg->start_srp = omap_usb_start_srp; - otg->usb_phy = &phy->phy; - - platform_set_drvdata(pdev, phy); - pm_runtime_enable(phy->dev); - - generic_phy = devm_phy_create(phy->dev, NULL, &ops); - if (IS_ERR(generic_phy)) { - pm_runtime_disable(phy->dev); - return PTR_ERR(generic_phy); - } - - phy_set_drvdata(generic_phy, phy); - omap_usb_power_off(generic_phy); - - phy_provider = devm_of_phy_provider_register(phy->dev, - of_phy_simple_xlate); - if (IS_ERR(phy_provider)) { - pm_runtime_disable(phy->dev); - return PTR_ERR(phy_provider); - } phy->wkupclk = devm_clk_get(phy->dev, "wkupclk"); if (IS_ERR(phy->wkupclk)) { - dev_warn(&pdev->dev, "unable to get wkupclk, trying old name\n"); + if (PTR_ERR(phy->wkupclk) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + dev_warn(&pdev->dev, "unable to get wkupclk %ld, trying old name\n", + PTR_ERR(phy->wkupclk)); phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); + if (IS_ERR(phy->wkupclk)) { - dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); - pm_runtime_disable(phy->dev); + if (PTR_ERR(phy->wkupclk) != -EPROBE_DEFER) + dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); return PTR_ERR(phy->wkupclk); } else { dev_warn(&pdev->dev, "found usb_phy_cm_clk32k, please fix DTS\n"); } } - clk_prepare(phy->wkupclk); phy->optclk = devm_clk_get(phy->dev, "refclk"); if (IS_ERR(phy->optclk)) { + if (PTR_ERR(phy->optclk) == -EPROBE_DEFER) + return -EPROBE_DEFER; + dev_dbg(&pdev->dev, "unable to get refclk, trying old name\n"); phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m"); + if (IS_ERR(phy->optclk)) { - dev_dbg(&pdev->dev, - "unable to get usb_otg_ss_refclk960m\n"); + if (PTR_ERR(phy->optclk) != -EPROBE_DEFER) { + dev_dbg(&pdev->dev, + "unable to get usb_otg_ss_refclk960m\n"); + } } else { dev_warn(&pdev->dev, "found usb_otg_ss_refclk960m, please fix DTS\n"); } } - if (!IS_ERR(phy->optclk)) - clk_prepare(phy->optclk); + otg->set_host = omap_usb_set_host; + otg->set_peripheral = omap_usb_set_peripheral; + if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS) + otg->set_vbus = omap_usb_set_vbus; + if (phy_data->flags & OMAP_USB2_HAS_START_SRP) + otg->start_srp = omap_usb_start_srp; + otg->usb_phy = &phy->phy; + + platform_set_drvdata(pdev, phy); + pm_runtime_enable(phy->dev); + + generic_phy = devm_phy_create(phy->dev, NULL, &ops); + if (IS_ERR(generic_phy)) { + pm_runtime_disable(phy->dev); + return PTR_ERR(generic_phy); + } + + phy_set_drvdata(generic_phy, phy); + omap_usb_power_off(generic_phy); + + phy_provider = devm_of_phy_provider_register(phy->dev, + of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { + pm_runtime_disable(phy->dev); + return PTR_ERR(phy_provider); + } + usb_add_phy_dev(&phy->phy); @@ -413,9 +422,6 @@ static int omap_usb2_remove(struct platform_device *pdev) { struct omap_usb *phy = platform_get_drvdata(pdev); - clk_unprepare(phy->wkupclk); - if (!IS_ERR(phy->optclk)) - clk_unprepare(phy->optclk); usb_remove_phy(&phy->phy); pm_runtime_disable(phy->dev); From patchwork Wed Dec 5 15:03:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 152914 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9397083ljp; Wed, 5 Dec 2018 07:03:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/UueccR+XoBqA7zCt1lJzTRXF+uKcIF4Mqufh7hJgxR3nHAtZGGZQSjH3Lv6wM2e4YanYkB X-Received: by 2002:a65:5387:: with SMTP id x7mr20899647pgq.412.1544022237282; Wed, 05 Dec 2018 07:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544022237; cv=none; d=google.com; s=arc-20160816; b=lX9oOwy+zaed8L4pa4aiL2H79bQOVVb1jziN5nYFRuiH//MuwtYz2kZ+eB33apuKAh QIVGePSnIKUoptxH+8ceSMOSmPwJueJ6W4am94wxLv7y3N4J1X8YMD8CvubUARrj1d9Z yFeVwSn5wj7KxENiSIUwYSzXwcaKH8vW/BHG6XzcqTHJySJ85yNhXvnQAnBMDKAQHK2K BP4kbA33beRIlF0tBVFxd1cz1/FgP0bSbkkuzCZbQxvit5HUjmqNi+Y+gAvIYfpBUamh wfmanZHuHxy+30BtxnVHIN98GLG5L694245VHADsIL8WhwcbfxvFM6Pz4nQRDx0khDm4 y4jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=X5OObJ3LZx0UxQaltuZgl/i00oHtKI3h9c0c4qnSe28=; b=AQfZ0aUUsKiK4oHRmMXdFgixlcUdxwch1H8YMdoG7eF8mQPwje1kuKaWUVfGhRBvR4 saJOpcBeSv/UVD7Epr7okrJW8CcWspXSo4lfiBq5VCovq+7XZ54TfqEK4/envhNfp2H0 uaYWaDQ8Dok1RAD5FROpG9HOlSeKh0WW6aPMtQqdG9XmNHa8DttwwEM72vNhrbpj7UlL x+3hjVXFbdWFBKunJg2FHTXqheH2cOpSQ+HQDoS9cblpzXQ/MrkcP0acurWOcD6uYald 1musTKukxxevazo/85r94f57Nae2BH7zHsMCXEMFaef02QpuQTY13ZuXDQVsEuqU1/dI 88Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Vi+0Ve0Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si19810944plh.307.2018.12.05.07.03.56; Wed, 05 Dec 2018 07:03:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Vi+0Ve0Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727968AbeLEPDj (ORCPT + 31 others); Wed, 5 Dec 2018 10:03:39 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47976 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbeLEPDh (ORCPT ); Wed, 5 Dec 2018 10:03:37 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB5F3a7F081763; Wed, 5 Dec 2018 09:03:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544022216; bh=X5OObJ3LZx0UxQaltuZgl/i00oHtKI3h9c0c4qnSe28=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Vi+0Ve0QMNJtlvDM1kne7XlSuPLSPRDhkaOEywL0Es2h/neN7tH2swve36j9MlP3g bR690Rkf3qt5WKnuk94r96foW78Q4Y12i0lNsl2W/1gIE3EIhLYZ/3Pj4rw//BQxJ9 Jc9d1DyoOtQmgLqN9HqRClv3zpXK1lqzfsRJOf3I= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB5F3aAb085436 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 09:03:36 -0600 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 5 Dec 2018 09:03:35 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 5 Dec 2018 09:03:35 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3ZhF002282; Wed, 5 Dec 2018 09:03:35 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.237.247]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3S9s023981; Wed, 5 Dec 2018 09:03:33 -0600 From: Roger Quadros To: CC: , , , , , Roger Quadros Subject: [PATCH 2/4] phy: ti: Don't depend on OMAP_OCP2SCP Date: Wed, 5 Dec 2018 17:03:24 +0200 Message-ID: <1544022206-2300-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544022206-2300-1-git-send-email-rogerq@ti.com> References: <1544022206-2300-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TI_PIPE3 and OMAP_USB2 don't depend on OMAP_OCP2SCP for build. Signed-off-by: Roger Quadros Signed-off-by: Sekhar Nori --- drivers/phy/ti/Kconfig | 2 -- 1 file changed, 2 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig index 2050356..4fdbe06 100644 --- a/drivers/phy/ti/Kconfig +++ b/drivers/phy/ti/Kconfig @@ -38,7 +38,6 @@ config OMAP_USB2 select GENERIC_PHY select USB_PHY select OMAP_CONTROL_PHY - depends on OMAP_OCP2SCP help Enable this to support the transceiver that is part of SOC. This driver takes care of all the PHY functionality apart from comparator. @@ -50,7 +49,6 @@ config TI_PIPE3 depends on ARCH_OMAP2PLUS || COMPILE_TEST select GENERIC_PHY select OMAP_CONTROL_PHY - depends on OMAP_OCP2SCP help Enable this to support the PIPE3 PHY that is part of TI SOCs. This driver takes care of all the PHY functionality apart from comparator. From patchwork Wed Dec 5 15:03:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 152912 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9396789ljp; Wed, 5 Dec 2018 07:03:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/XEbMzdvZWEG/Esv8p1bnEXP+d1b27QybcnP2rNHpVQiV6NK8Uf71X+WdL9D9CCYcZUf1c9 X-Received: by 2002:a17:902:f64:: with SMTP id 91mr10913236ply.132.1544022225215; Wed, 05 Dec 2018 07:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544022225; cv=none; d=google.com; s=arc-20160816; b=e9HMdEippReldFwP05+g5K/dC3Sercc7U8Y0dsvhEhX2ieKbA9c/05dnff63kTtJ2N vwYcxx+slG9kaSBVy23bZcfoyFqh+d0ADugdSoumBlLhJvUQA/ieDr5bzh/x+7317nBU u1e/9HXdQAVr8QOn65pful8SvwPK4oLhEHY0uvOP98XCLOoO2PZo3Ux3rVdbaycDAJh0 nPVGi3co6JkiZL/FaE0vlD5dcAW6zPTFPK24D1JVmksUskvEeqpq8kSIZ6f36pZzcfz9 tNZ9ZEI3Z7wC5gfaVqxLkBCJ/0PjzoUVfnPdG+KOKhJkQ6R1bYaoIUIQjlTEP7yrTNOc sUrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gBe/ABVRJv7k0qghw4595YW0lh0XkIj3+1seaIYwMLM=; b=Z2DhfVLqKFY0faKOsY1zAaHdPYe6KKvYX1Kf4xVH7i2JVY+WZZWmkLjlVO1OjQTWFl nH+NfXQN14MJsOBuDb+2FrATDP/Ouszeo/b33aKHsEu84zXShohH4FuvwkMWPIOIpLj1 m3bmEwioU7nZI5kcgH3dPGqZjHlAqDguDfSyYdcWzwMPqtPwD+c8YncVokAYxKWcCA+L tlRiQp42dvqJdXI2hgF+pjIcSfGV3TbECycPNckVACIP+AG+jqbkEwblLUWgFm6BYIEh CeWQIp1Aw1qM7de4f9DSLkmcukoUhXJ3JRs4UpVcb+WC1ygnjhKcZiiVi6wDo7COxBXL gpQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mIszO1Vu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z186si18563280pgd.90.2018.12.05.07.03.44; Wed, 05 Dec 2018 07:03:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mIszO1Vu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbeLEPDn (ORCPT + 31 others); Wed, 5 Dec 2018 10:03:43 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:38066 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727965AbeLEPDj (ORCPT ); Wed, 5 Dec 2018 10:03:39 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB5F3bgS017062; Wed, 5 Dec 2018 09:03:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544022217; bh=gBe/ABVRJv7k0qghw4595YW0lh0XkIj3+1seaIYwMLM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mIszO1VuDqe8kQR8GNAk42HJ8vIpujKCTsGkna+eG/HwLRUow8P/A9t53y7bxc5z8 3fB7Qg7jTtUvqOLk1Php0iu3WVnYXayZf/5eUOeOCq0NiE/P4SM6mwahm94cnpovwz ujB/87l887OBSpY+uT2rifoHvKHfhhcgLaufIGBM= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB5F3b3S069550 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 09:03:37 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 5 Dec 2018 09:03:37 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 5 Dec 2018 09:03:37 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3bnO025070; Wed, 5 Dec 2018 09:03:37 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.237.247]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3S9t023981; Wed, 5 Dec 2018 09:03:35 -0600 From: Roger Quadros To: CC: , , , , , Roger Quadros Subject: [PATCH 3/4] dt-bindings: phy: ti: Add support for AM654x USB2 PHY Date: Wed, 5 Dec 2018 17:03:25 +0200 Message-ID: <1544022206-2300-4-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544022206-2300-1-git-send-email-rogerq@ti.com> References: <1544022206-2300-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for USB2 PHY on AM654x SoC. Signed-off-by: Roger Quadros Signed-off-by: Sekhar Nori --- Documentation/devicetree/bindings/phy/ti-phy.txt | 1 + 1 file changed, 1 insertion(+) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/Documentation/devicetree/bindings/phy/ti-phy.txt b/Documentation/devicetree/bindings/phy/ti-phy.txt index 57dfda8..8f93c3b 100644 --- a/Documentation/devicetree/bindings/phy/ti-phy.txt +++ b/Documentation/devicetree/bindings/phy/ti-phy.txt @@ -35,6 +35,7 @@ Required properties: DRA7x Should be "ti,dra7x-usb2-phy2" for the 2nd instance of USB2 PHY in DRA7x + Should be "ti,am654-usb2" for the USB2 PHYs on AM654. - reg : Address and length of the register set for the device. - #phy-cells: determine the number of cells that should be given in the phandle while referencing this phy. From patchwork Wed Dec 5 15:03:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 152913 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9396854ljp; Wed, 5 Dec 2018 07:03:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/W4MxpLE5zSXxLGMvh/JINt0RlDIYPntNT8MogZ3lZsiPeSDJ4CdLoaRuzie7btk8rNAgUq X-Received: by 2002:a62:1541:: with SMTP id 62mr24876620pfv.230.1544022228901; Wed, 05 Dec 2018 07:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544022228; cv=none; d=google.com; s=arc-20160816; b=B76NPs4PAylgA3aAVjPTzVkv3Xan+7wk9VWHeG7dO5wWtFKXrmiQFj9Edvp8XHQ2cu uLAJdZofzTHvZ8xbWe5FKB7KYbyKyfvlRlpK2YwKEwlzx3UxDdLg2ywVQtnh/6g06+hr YnW1Xk1ia2bDgZksGriF7EswA922Y+M2FQRc5V5Ej+1qlkde9DdrkXF8dc64wgMcukow t90evL0hvZtzrFtGCO0cZJN/Wu76cirugcRb6MjUSSb6urFOX4uYI3T528UGMlu/ga4P O9il0N/vY1KZ7hoG8KSNeThZrR+RlZYT5vv8E9WxgSxPaYLTY086W5E7lDxszomWBzM9 W+Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7zc/aeUK4/I38VepvGBAxbd/CRUK7BxkBTM7szegQfc=; b=mKTTtstFu7M7uV6z9GZJuw1QAA8C04sjbI2RIPTMpkM+3FnhusiE1Ig2UW9qktORJj ap1he8+y+CoKRStcwEKZq/4FVcP8gSucn43J4xy/RShkO7G6OBTvX8hDbd3LRAgKS+Bi sWyGoXjUisFrZkJ+skqeOXtE5233pAKpFTB4HHklfPc/K1XcYos90n727RsA/11cGEj2 NPCBCN7WyXrbQc8Q935x45s6mXLm840J5ag69qp2K1XEjHgBo8IMuh1EIzZx6Bo/ci3E KQ2gJ0/7H/yYxyYkzLcyJNLJ6r3OE6cXWO1dNsvyl9/IZVhoU477x9bP2bGIOx/O2PYC nUeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="ZLR/45U4"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z186si18563280pgd.90.2018.12.05.07.03.48; Wed, 05 Dec 2018 07:03:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="ZLR/45U4"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728027AbeLEPDr (ORCPT + 31 others); Wed, 5 Dec 2018 10:03:47 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47986 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727999AbeLEPDn (ORCPT ); Wed, 5 Dec 2018 10:03:43 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB5F3fYw081786; Wed, 5 Dec 2018 09:03:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544022221; bh=7zc/aeUK4/I38VepvGBAxbd/CRUK7BxkBTM7szegQfc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ZLR/45U4K/7wSbK7yu53QF+yqnxthiYJHgUaBEl289MToEmyd+ZDa9bNGcUChX2vJ PwZ9eL2sABeHPNbVN8OsN8Fp15Ng0EEDSTnafbINYdrQZ2Aord9EKfx01K9fcGPI/q CBu+QWg+8HdK1q/VzmGGKpkTLUOZhYkwQPdTm4eI= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB5F3fb8069593 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Dec 2018 09:03:41 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 5 Dec 2018 09:03:39 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 5 Dec 2018 09:03:39 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3dve002336; Wed, 5 Dec 2018 09:03:39 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.237.247]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB5F3S9u023981; Wed, 5 Dec 2018 09:03:37 -0600 From: Roger Quadros To: CC: , , , , , Roger Quadros Subject: [PATCH 4/4] phy: ti: usb2: Add support for AM654 USB2 PHY Date: Wed, 5 Dec 2018 17:03:26 +0200 Message-ID: <1544022206-2300-5-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544022206-2300-1-git-send-email-rogerq@ti.com> References: <1544022206-2300-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the USB2 PHY on the AM654 SoC. Signed-off-by: Roger Quadros Signed-off-by: Sekhar Nori --- drivers/phy/ti/Kconfig | 4 ++-- drivers/phy/ti/phy-omap-usb2.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig index 4fdbe06..a55959b 100644 --- a/drivers/phy/ti/Kconfig +++ b/drivers/phy/ti/Kconfig @@ -33,11 +33,11 @@ config OMAP_CONTROL_PHY config OMAP_USB2 tristate "OMAP USB2 PHY Driver" - depends on ARCH_OMAP2PLUS + depends on ARCH_OMAP2PLUS || ARCH_K3 depends on USB_SUPPORT select GENERIC_PHY select USB_PHY - select OMAP_CONTROL_PHY + select OMAP_CONTROL_PHY if ARCH_OMAP2PLUS help Enable this to support the transceiver that is part of SOC. This driver takes care of all the PHY functionality apart from comparator. diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c index 418e7f1..e871f29 100644 --- a/drivers/phy/ti/phy-omap-usb2.c +++ b/drivers/phy/ti/phy-omap-usb2.c @@ -36,6 +36,10 @@ #define USB2PHY_DISCON_BYP_LATCH (1 << 31) #define USB2PHY_ANA_CONFIG1 0x4c +#define AM654_USB2_OTG_PD BIT(8) +#define AM654_USB2_VBUS_DET_EN BIT(5) +#define AM654_USB2_VBUSVALID_DET_EN BIT(4) + /** * omap_usb2_set_comparator - links the comparator present in the sytem with * this phy @@ -245,6 +249,15 @@ static const struct usb_phy_data am437x_usb2_data = { .power_off = AM437X_USB2_PHY_PD | AM437X_USB2_OTG_PD, }; +static const struct usb_phy_data am654_usb2_data = { + .label = "am654_usb2", + .flags = OMAP_USB2_CALIBRATE_FALSE_DISCONNECT, + .mask = AM654_USB2_OTG_PD | AM654_USB2_VBUS_DET_EN | + AM654_USB2_VBUSVALID_DET_EN, + .power_on = AM654_USB2_VBUS_DET_EN | AM654_USB2_VBUSVALID_DET_EN, + .power_off = AM654_USB2_OTG_PD, +}; + static const struct of_device_id omap_usb2_id_table[] = { { .compatible = "ti,omap-usb2", @@ -266,6 +279,10 @@ static const struct of_device_id omap_usb2_id_table[] = { .compatible = "ti,am437x-usb2", .data = &am437x_usb2_data, }, + { + .compatible = "ti,am654-usb2", + .data = &am654_usb2_data, + }, {}, }; MODULE_DEVICE_TABLE(of, omap_usb2_id_table);