From patchwork Thu May 11 13:29:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9721509 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ACD2660364 for ; Thu, 11 May 2017 13:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E05E28665 for ; Thu, 11 May 2017 13:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92C0628676; Thu, 11 May 2017 13:30:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CB8328685 for ; Thu, 11 May 2017 13:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6Q1hfN7+2aatXon4eVb5Y4yhTXvtqMyvJsRfQ4IVYcE=; b=nICu8hFw+wLPmi zMrSf7Ksoq5znW/1t2iXKjpoDskMF0zOFnFXfFjo3TId7BqASqOyflD69dgPlf+RJdR2vbQGq/8H8 6VHgcqK8L6Jd7wkg6KVoo0wM+8YCzZVkjjfIlbJ67XkR5o6+ajnQP4cKCaTNjPXgxHWRtw825dGku rDbLqCbTzpGNHDu6NBfVR2iZuMKL5u0UAxVvfJ0gU4HUsQJLoNy1BTiUuJAxGgNVtZYK6C5qVB2pR 9uMDh5HBJ43JlP13W0njVpnJg4IzqQTwis5dACjpCBukntYQJz9xgIeFYoMHMM/mwYZbxML9qE4vd c+eQ9hXi7+0X0hPDDyoQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d8oAb-0004ps-9N; Thu, 11 May 2017 13:30:17 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8oAP-0003Ou-EI for linux-arm-kernel@lists.infradead.org; Thu, 11 May 2017 13:30:07 +0000 Received: by mail-wr0-x243.google.com with SMTP id w50so3577311wrc.0 for ; Thu, 11 May 2017 06:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E98JYhOMBa63PsEAUz5J2Dk+D0DctiUp5J7QvGNHq5s=; b=XCM9j9yqEwB4/xdQq8xw8kvTi/BSLHvJ10wzqSWD8/aOCW3n2lpwvNHiQjec2SRp8Q dRdF9LBHC6FiOZhwrM70O4Z7mwDLfsvKhXyyt5z6vgQLuXfrynqgNSNhX33Ssrlw5SS5 m9nYcXncIxLdxdgzPOIlXudhpsjS4/Z00LvqcCXBJSzlm1WjmQwA7NRzTo3iU1hMI6uq vYL27yK0NSqXWn0Gvxeh4gqhOToAFyOu+3zMHHMk+ugqqJVw9/bOjcGnuxhfUWDcN8xw GQJfMpkZcXXVgZeNTeRmyOZsXlNJSpdL3LJRlT2xJqIhy4B1nyVimhV08QS8icgFASP6 EiVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E98JYhOMBa63PsEAUz5J2Dk+D0DctiUp5J7QvGNHq5s=; b=X8AyTMLYRP2X4mQnlun7L9GS2Oege6Szmog7NgEtxs+YWJ7UXAYknn/4/JO27QFF/D oqODs9GLkFiUBUYiaoB9tHA4/P6QdrH1qnyX8Eurk1oOoxN/xck15svZV4eATq7ama52 MUhFTIDiZ0YcvASwqrzd8cq/x2rixlhQTsGLmGs8XtiOagEQP0DZ03Zwi/v+59UA/dWO owNrRRUu3ntq0D1CoZwQFSSVtabTNLZxCM5j0/hJ7LqaZF0cUcFjWL9/z2JbOoDjqNhd IURMNw8Xr7CeX7EHiq0uVWDy7vSNByPkrutzt0gyrXFLeEMdXd1Udwm3Tg44CaBEmekk iVTg== X-Gm-Message-State: AODbwcC8493hxHKARoeODxdINv1+a01Oj+eP88jQEi7r/xgJ6ZMuHaYZ mw0il3Vde1esiA== X-Received: by 10.46.21.79 with SMTP id 15mr127243ljv.15.1494509383629; Thu, 11 May 2017 06:29:43 -0700 (PDT) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id i18sm31725ljd.28.2017.05.11.06.29.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 06:29:42 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kishon Vijay Abraham I Subject: [PATCH 1/5] phy: bcm-ns-usb3: always wait for idle after writing to the PHY reg Date: Thu, 11 May 2017 15:29:21 +0200 Message-Id: <20170511132925.14564-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170511132925.14564-1-zajec5@gmail.com> References: <20170511132925.14564-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170511_063005_652389_39176E22 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Florian Fainelli , Jon Mason , linux-kernel@vger.kernel.org, Yendapally Reddy Dhananjaya Reddy , bcm-kernel-feedback-list@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki Move MDIO specific code to the writing helper function. This makes init code a bit more generic and doesn't require it to track what happens after every write. Signed-off-by: Rafał Miłecki --- drivers/phy/phy-bcm-ns-usb3.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/phy/phy-bcm-ns-usb3.c b/drivers/phy/phy-bcm-ns-usb3.c index 22b5e7047fa6..5e89326886dc 100644 --- a/drivers/phy/phy-bcm-ns-usb3.c +++ b/drivers/phy/phy-bcm-ns-usb3.c @@ -112,7 +112,7 @@ static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg, tmp |= value; writel(tmp, usb3->ccb_mii + BCMA_CCB_MII_MNG_CMD_DATA); - return 0; + return bcm_ns_usb3_mii_mng_wait_idle(usb3); } static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3) @@ -143,9 +143,6 @@ static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3) /* Deaaserting PLL Reset */ bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLLA_CONTROL1, 0x8000); - /* Waiting MII Mgt interface idle */ - bcm_ns_usb3_mii_mng_wait_idle(usb3); - /* Deasserting USB3 system reset */ writel(0, usb3->dmp + BCMA_RESET_CTL); @@ -169,9 +166,6 @@ static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3) /* Enabling SSC */ bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_TX_PMD_CONTROL1, 0x1003); - /* Waiting MII Mgt interface idle */ - bcm_ns_usb3_mii_mng_wait_idle(usb3); - return 0; } @@ -205,9 +199,6 @@ static int bcm_ns_usb3_phy_init_ns_ax(struct bcm_ns_usb3 *usb3) bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_TX_PMD_CONTROL1, 0x1003); - /* Waiting MII Mgt interface idle */ - bcm_ns_usb3_mii_mng_wait_idle(usb3); - /* Deasserting USB3 system reset */ writel(0, usb3->dmp + BCMA_RESET_CTL);