From patchwork Wed Jan 6 10:59:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 59232 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6507643lbb; Wed, 6 Jan 2016 03:01:23 -0800 (PST) X-Received: by 10.66.232.74 with SMTP id tm10mr85888825pac.128.1452078082812; Wed, 06 Jan 2016 03:01:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 85si22523141pfm.189.2016.01.06.03.01.22; Wed, 06 Jan 2016 03:01:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753420AbcAFLBV (ORCPT + 29 others); Wed, 6 Jan 2016 06:01:21 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:56193 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752766AbcAFK73 (ORCPT ); Wed, 6 Jan 2016 05:59:29 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u06AxKN2005446; Wed, 6 Jan 2016 04:59:20 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u06AxKtY026592; Wed, 6 Jan 2016 04:59:20 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Wed, 6 Jan 2016 04:59:19 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u06AxB7j018319; Wed, 6 Jan 2016 04:59:16 -0600 From: Kishon Vijay Abraham I To: CC: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , , , , , , Subject: [PATCH 1/2] phy: ti-pipe3: get tx and rx MEM resource Date: Wed, 6 Jan 2016 16:29:07 +0530 Message-ID: <1452077948-26232-2-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1452077948-26232-1-git-send-email-kishon@ti.com> References: <1452077948-26232-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get tx and rx MEM resource since this has to be used to configure for DRA72x to work in X2 mode. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sekhar Nori --- drivers/phy/phy-ti-pipe3.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index 0a477d2..7d83d2b 100644 --- a/drivers/phy/phy-ti-pipe3.c +++ b/drivers/phy/phy-ti-pipe3.c @@ -91,6 +91,8 @@ struct pipe3_dpll_map { struct ti_pipe3 { void __iomem *pll_ctrl_base; + void __iomem *phy_rx; + void __iomem *phy_tx; struct device *dev; struct device *control_dev; struct clk *wkupclk; @@ -536,6 +538,27 @@ static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy) return 0; } +static int ti_pipe3_get_rx_tx_base(struct ti_pipe3 *phy) +{ + struct resource *res; + struct device *dev = phy->dev; + struct platform_device *pdev = to_platform_device(dev); + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "phy_rx"); + phy->phy_rx = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(phy->phy_rx)) + return PTR_ERR(phy->phy_rx); + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "phy_tx"); + phy->phy_tx = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(phy->phy_tx)) + return PTR_ERR(phy->phy_tx); + + return 0; +} + static int ti_pipe3_probe(struct platform_device *pdev) { struct ti_pipe3 *phy; @@ -555,6 +578,10 @@ static int ti_pipe3_probe(struct platform_device *pdev) if (ret) return ret; + ret = ti_pipe3_get_rx_tx_base(phy); + if (ret) + return ret; + ret = ti_pipe3_get_sysctrl(phy); if (ret) return ret;