From patchwork Thu Jun 8 20:04:24 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: 9776391 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 C3D1C60393 for ; Thu, 8 Jun 2017 20:05:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4AEA27F98 for ; Thu, 8 Jun 2017 20:05:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7C8E2846F; Thu, 8 Jun 2017 20:05:20 +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 F106327F98 for ; Thu, 8 Jun 2017 20:05:19 +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=Cj9xlAZsDw/ub5Hcij2nuLlqL2mr4m3/e4170eDRMkg=; b=M8sAASwwxZLyA7 jalJkANazFx0Ra6X6EQuO2QwvN25NvoV+yLtb1KcSqr2EZDlIT3tM7ZFyC//hoAa6hHSpM6nN/3wW CuvlDENOWTG5RkDZPgxNVrnx+TSaRc/95MwDVw6zn8WcWxaHsq718RJ9fDnuucXQy5wLL27LYN9rb jedhXF38EP3RQe9eGc+8Te3s0l1lLfF+B0iU70t6tedrj6vJxDtFemDSb+YbfzZYq2i0GFiMZauQo nyDx77h8Olns5gL9DuitYaaxdeWKJg8bo7W6kgsmP8Wv8kesZijho4wqngypbZcqJt+eQ+27DpIX4 glqFmhGkmQT4DELRGqrw==; 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 1dJ3gE-0002oz-6o; Thu, 08 Jun 2017 20:05:18 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dJ3fz-0001OD-Sh for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2017 20:05:05 +0000 Received: by mail-lf0-x241.google.com with SMTP id u62so3823035lfg.0 for ; Thu, 08 Jun 2017 13:04:43 -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=Z4isPF3X7uNPy4hWXElxI+VYrhIz8aA6nvK32YwqwOk=; b=rxWUJVUboxPNubdDhmoqFsrzGMaR+aGfcVTPF9me77M//MPewhPIxRtxAbD5yYnm1m XeDEWcm6HZHOaRewSc+AMAKj3Z5V0NSBukyti8QhaiQgbfNYgbJInR2uJvDVGOOUZNyT fMNcJJZ31irYfAK39hojSX5FbBKR60aAc+PvYc+G58nzYqHvVuMydz01WXVZ+quhsWx7 c5Sa24Au07kZCAJw/PUvaaOS9pf7q2YybDYR7vE9GdT7Vkn5PRx3D28OVUqrrsRfYJ2O nqqdbUuENIk8i/e6Jglmco4gdJ8zjIFTsEVBP29bFKQXaNNUf9ZIKRlUM/WzaEdmxXC0 huPA== 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=Z4isPF3X7uNPy4hWXElxI+VYrhIz8aA6nvK32YwqwOk=; b=oN9KyjVF/5xKKZTANE5B0ltzvVZUxXh3ME6JmmawR0B6kUnDiN6bh+Jn3cqKOGdQ7Z iqxlRE2jnu0g7jq42Q+kXqW7laVM+r040b2yJ2iDPFlTRhPueW0/WkM2hXLdrGLC8EVB dW3T7ZgIcbO8X85pU6GiftLKoxABYMLIy0+crmcogNybP1YlWkpYfJI8BbLnQNyOwL9N zfX4wBTZsZiPd7874Knf4LXQgsfBfDEIPsXxRn3R20ChKMZIyd+6mn1FD6zGrP+u45BL 2o7REpMgbA7pY+uqRxmpywmVVZDUb/MK2cPadhs4Q5crS19jj9KVmmDM4ii8dguWtwaG 9XMw== X-Gm-Message-State: AODbwcDfSGL76SLeZzsLUcKiVjjByea8/14Y0d7ZAyK5PmimNxhRtInm /1HRwk2AMI3J1K28 X-Received: by 10.25.170.12 with SMTP id t12mr4723730lfe.51.1496952281838; Thu, 08 Jun 2017 13:04:41 -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 s14sm37477ljd.3.2017.06.08.13.04.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 13:04:41 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kishon Vijay Abraham I Subject: [PATCH V2 1/5] phy: bcm-ns-usb3: always wait for idle after writing to the PHY reg Date: Thu, 8 Jun 2017 22:04:24 +0200 Message-Id: <20170608200428.9187-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170608200428.9187-1-zajec5@gmail.com> References: <20170511132925.14564-1-zajec5@gmail.com> <20170608200428.9187-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170608_130504_156467_8D80E2FC X-CRM114-Status: GOOD ( 12.02 ) 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/broadcom/phy-bcm-ns-usb3.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb3.c b/drivers/phy/broadcom/phy-bcm-ns-usb3.c index 22b5e7047fa6..5e89326886dc 100644 --- a/drivers/phy/broadcom/phy-bcm-ns-usb3.c +++ b/drivers/phy/broadcom/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);