From patchwork Mon Oct 28 10:21:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 177899 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3181156ill; Mon, 28 Oct 2019 03:22:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFMk36bti06uHrrKZaQXHL6YoO3yzxabdfwY3GO9r9HL8fHzXE4dQokIwcep05uocL+GUn X-Received: by 2002:a17:906:3010:: with SMTP id 16mr15998024ejz.74.1572258129815; Mon, 28 Oct 2019 03:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572258129; cv=none; d=google.com; s=arc-20160816; b=LULVMGv5yDzgCCoOZspKmpvRgFGPCC930ILdio44JD4qH3nnXeklsZofANoM0tlxa2 gk2Gy2aWdBiwzQfly0+3SMi0LGNgNjEPT67xsMxjoGn6yB9pv5aBi7JnnQFdozvLICO3 fMCOPDgB2FBu5sZcA1i9vETKKpXfGnVTwFDfcu7lph20HCLY2QwSdw4SjY4brBxHhf07 RtwKhi3Hd6vQ1IvKfuckDxa/akxPeSgOwXGGbzLm3sxywgxuKo0dMGgLnU4sH4AUfbB7 hq5AhmvjNeEoeGiJNqi4Snpr6sv1e7XOjJMui2ciOYtE4oeTiKZ81NzkEMCoPLQr+bP8 4mgg== 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=Xl5cA/S4FrIJ4vKFsN1p81S19Wj/S2z8fUocysgzMcqawKJAEFATdSFn9bY/xbttuO uSrmT5oCbJGwWCWZSymSIVRCnwo0/TEexRkQ9lJlQChncwZSwphJA/ze4bHfisUdMBhE yGN6kbPLLazuB4O3N4luoZIEvKqe0rjROFDxct7om+1ZIJSwye3cRhG4KMrAZn+eWHVB TMce38/tSWdzA7vlTlSknOjuU3hmUT7ozulDRjOe6pC7AsKfQArShrrMyQ4uHBV7TMWF eCoDQDt4kj9isK+sjYYh0J/oiWhyMDTR9okShlMsIF5zO/xAvVf1mIEi2Lq698C959Vi k3Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oz0vzEPJ; 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 z65si7754509ede.388.2019.10.28.03.22.09; Mon, 28 Oct 2019 03:22:09 -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=oz0vzEPJ; 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 S2388206AbfJ1KWG (ORCPT + 26 others); Mon, 28 Oct 2019 06:22:06 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:36652 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732186AbfJ1KWG (ORCPT ); Mon, 28 Oct 2019 06:22:06 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9SAM4lq017831; Mon, 28 Oct 2019 05:22:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572258124; bh=aZ5vSfLI7IEX6A4bp3VeoImtgXF8hKwoS6ngiBVedGY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=oz0vzEPJx+/9rGcvRua6itw2qL4/vz8gw8aLfzc8CTBdslytd/5VsJDXtyCJd8IXp UN5pfKhiAhrzlgsPK0mRw4Fusy2/0nN8YAl5leQzQ5JGhRIx1v5pYFyshkWr2Y1fhR vafiXQruPDbOKvF+lh6ustTf/UpRTKKDR83ft6qc= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9SAM48Z077369 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Oct 2019 05:22:04 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 28 Oct 2019 05:21:52 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE108.ent.ti.com (10.64.6.29) 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; Mon, 28 Oct 2019 05:21:52 -0500 Received: from lta0400828a.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9SALwqG024783; Mon, 28 Oct 2019 05:22:01 -0500 From: Roger Quadros To: CC: , , , , , , Roger Quadros Subject: [PATCH v4 1/3] phy: cadence: Sierra: add phy_reset hook Date: Mon, 28 Oct 2019 12:21:51 +0200 Message-ID: <20191028102153.24866-2-rogerq@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028102153.24866-1-rogerq@ti.com> References: <20191028102153.24866-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, };