From patchwork Thu Oct 24 11:40:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 177409 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2062753ill; Thu, 24 Oct 2019 04:41:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxb2K52GDJLM/3MGYsIPi/ziZaK3963KIFq4jwf6RklHpdsHiJwjBVN4OJiEaLu19aemysC X-Received: by 2002:aa7:d28d:: with SMTP id w13mr42219561edq.184.1571917262965; Thu, 24 Oct 2019 04:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571917262; cv=none; d=google.com; s=arc-20160816; b=THoeL2n9iAdNVXVJTTZRtF63LBhdt5G5BjwJZmRV+fgsNOwtS6fiqUXqf93Emd6pRm oOFsrUY5dV0dqKZAi5D54P9cGDY95aksrFtsSNv6R1asNeka/y3hDbkSaut923X8tAoV v9VZvyB8ZKa4RSvftXXy5QWnwvzKH76LsAQrAL1jSt0vMWSE8mJIusDfRhlq4LfS+RAH qjIHFf0CQpl6SNvxux6/DPHiTppPoibWgt/JThqAPnI8VvtSj+u+hVj7TObpsGUIGrQr FH9rV48U2RYRlzwsjVgz7nSvsZYK7KWxn1CeQu+CJt72nm52SOg8ndKt255p1Ro8jP2g qmCA== 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=aZ5vSfLI7IEX6A4bp3VeoImtgXF8hKwoS6ngiBVedGY=; b=aP0vOjCiGixXnxEmmFDbJJKjgKiO3jAVDww7hRAa7IN9YtyiC5JvLvUsRIwNriz7Nw PWthZ6Ap1LMkvBlQ2XoStzt98kWGbWMg/iyj6xplvtUYeIAVN4y1xbUq7MuziSdRsQBf lBD+AM8wbBGZcT02BivnpTCmEn761fnMRPMXh9myR2qfPFXdnln2Nv1yTvu6WTW+8D+g 2OavNRKwbCu0eGEnS/pByZQiBMewoXBvFNRvW2HMRfCigVnFpPLd7AgvoPElBOIjmMUG +YjRoROe3pUTKev604R3Bo/2a1ZLXGqiyV8+hR1nvUddfCiYhjuu6g2sLlpMSL2bd+4/ 78KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uBEUB0AC; 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 g31si231887eda.325.2019.10.24.04.41.02; Thu, 24 Oct 2019 04:41:02 -0700 (PDT) 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=uBEUB0AC; 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 S2439049AbfJXLkz (ORCPT + 26 others); Thu, 24 Oct 2019 07:40:55 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37584 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbfJXLkv (ORCPT ); Thu, 24 Oct 2019 07:40:51 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9OBen2A012074; Thu, 24 Oct 2019 06:40:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571917249; bh=aZ5vSfLI7IEX6A4bp3VeoImtgXF8hKwoS6ngiBVedGY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uBEUB0ACRQLq6gIrn8hYxxsl9YMZ82kqb/KunqhF3nIEa6BwdeGqcbZj5RidlGBMP K9pzJQb3lCs4KNE+gfmTz8Wf0C6Bs0VwVb98JYCkJrfc2HaQzvizqu/NzVB3xMkXpt b0JoqchcIR4SR64m++mUVHp6Z0VNdAqe++1lESxI= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9OBenci122198; Thu, 24 Oct 2019 06:40:49 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 24 Oct 2019 06:40:38 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 24 Oct 2019 06:40:48 -0500 Received: from lta0400828a.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9OBeiTB044238; Thu, 24 Oct 2019 06:40:46 -0500 From: Roger Quadros To: CC: , , , , , , Roger Quadros Subject: [PATCH v3 1/3] phy: cadence: Sierra: add phy_reset hook Date: Thu, 24 Oct 2019 14:40:40 +0300 Message-ID: <20191024114042.30237-2-rogerq@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191024114042.30237-1-rogerq@ti.com> References: <20191024114042.30237-1-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 Some platforms e.g. J721e need lane swap register to be programmed before reset is deasserted. This patch ensures that we propagate the phy_reset back to the reset controller driver. Signed-off-by: Roger Quadros Signed-off-by: Sekhar Nori Reviewed-by: Jyri Sarha --- drivers/phy/cadence/phy-cadence-sierra.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 04c28cbb6d39..7fed61211716 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -339,10 +339,20 @@ static int cdns_sierra_phy_off(struct phy *gphy) return reset_control_assert(ins->lnk_rst); } +static int cdns_sierra_phy_reset(struct phy *gphy) +{ + struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent); + + reset_control_assert(sp->phy_rst); + reset_control_deassert(sp->phy_rst); + return 0; +}; + static const struct phy_ops ops = { .init = cdns_sierra_phy_init, .power_on = cdns_sierra_phy_on, .power_off = cdns_sierra_phy_off, + .reset = cdns_sierra_phy_reset, .owner = THIS_MODULE, };