From patchwork Fri Dec 21 07:27:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10740007 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06F3213BF for ; Fri, 21 Dec 2018 07:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E198728329 for ; Fri, 21 Dec 2018 07:28:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5A1A2834A; Fri, 21 Dec 2018 07:28:50 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A0F42833E for ; Fri, 21 Dec 2018 07:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732394AbeLUH2n (ORCPT ); Fri, 21 Dec 2018 02:28:43 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42089 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388220AbeLUH2M (ORCPT ); Fri, 21 Dec 2018 02:28:12 -0500 Received: by mail-pl1-f195.google.com with SMTP id y1so2098129plp.9; Thu, 20 Dec 2018 23:28:12 -0800 (PST) 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=os5HCIWWSeiXp86kNFBUOm5Js1nl9fgasgDsX5LPT/Y=; b=Kj97J01vYaRO2Tsth4vmAsL09eUm8ZfT+Y1IlvimyYHPKsSNx4cwmrtBkpYQB/pyrY L2QtTUlnNmLrAX6TAqZr6yne1yTCd7kLgANDnmAiDbBQ+jDHoohFzgZOxUlnDHv54PDr p/0c8okKY+ylW2UNiyjZoYDn0AP/jOhvFNzjPn5SlLTkBMhpXeuShdh29XLKsxy2//6M x2UDRXm0qvBnzH1AQz5M7CD4goUCjur5DPjsL2jX1PMz9RAxheMINSdKvTaZpiUJOT3E 0jBzNJMp0nMuxAbU6/aBF4PL85YI9mSyYL39bKCxPVSI4Th1puQCwHYDr5+7U9jYU7CT KdOA== 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=os5HCIWWSeiXp86kNFBUOm5Js1nl9fgasgDsX5LPT/Y=; b=NO8vcNdo64O/524uHyDp9Ve8CsLyhZedNJWsV0jRJ6g8ABW5yiyHSMbQJEhEaAjhDg YLJ1LchlPjNRNk/+QmiHrHRn8CHGI2vz1zgLyzWkrPFOy0rW2rfqjPfLgz2DGY1QrFzZ POZXtZLDyHTKeeNUWPJOne7HksuDBjWAOfRS7KtTAM3soGOBCqwPwsd7cR7KFCvceEC1 IRKM13f427EDLVOawwKJyPwq88gjS8JTESExLhl2y1B/ZZA/lDBECWqVLiO/w+81HW9Z vKSv/RZuVTIbnfGsBi6yNbDZstAbAA76Qy5JITO1qnNJwY1cLPNN9vXZp8Q6TS4zWnTn FUGA== X-Gm-Message-State: AJcUukfACISpaNouh3ZVdQgfbyDAG3kOSlzFTS/ltEvRekmLmZECQJel p2iac0jE+hUUk0ZCE/wLVtk9IErs X-Google-Smtp-Source: ALg8bN4z4ZU5nz72DBY5q8YOvRp5wW78zQBbybW7pRGQW2hcy8aJw7wfTvss0oEMNvtfTdMs0MWtMQ== X-Received: by 2002:a17:902:d697:: with SMTP id v23mr1388203ply.261.1545377291783; Thu, 20 Dec 2018 23:28:11 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id t90sm44971921pfj.23.2018.12.20.23.28.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 23:28:10 -0800 (PST) From: Andrey Smirnov To: linux-pci@vger.kernel.org Cc: Andrey Smirnov , Lorenzo Pieralisi , Bjorn Helgaas , Fabio Estevam , Chris Healy , Lucas Stach , Leonard Crestez , "A.s. Dong" , Richard Zhu , linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/21] PCI: imx6: Use common mask in imx6_pcie_reset_phy() Date: Thu, 20 Dec 2018 23:27:12 -0800 Message-Id: <20181221072716.29017-18-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181221072716.29017-1-andrew.smirnov@gmail.com> References: <20181221072716.29017-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify imx6_pcie_reset_phy() by using common mask. No functional change intended. Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: Andrey Smirnov --- drivers/pci/controller/dwc/pci-imx6.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index bade9d608605..38c8e8baa077 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -230,18 +230,18 @@ static int pcie_phy_write(struct imx6_pcie *imx6_pcie, int addr, u16 data) static void imx6_pcie_reset_phy(struct imx6_pcie *imx6_pcie) { + const u16 mask = PHY_RX_OVRD_IN_LO_RX_DATA_EN | + PHY_RX_OVRD_IN_LO_RX_PLL_EN; u16 tmp; pcie_phy_read(imx6_pcie, PHY_RX_OVRD_IN_LO, &tmp); - tmp |= (PHY_RX_OVRD_IN_LO_RX_DATA_EN | - PHY_RX_OVRD_IN_LO_RX_PLL_EN); + tmp |= mask; pcie_phy_write(imx6_pcie, PHY_RX_OVRD_IN_LO, tmp); usleep_range(2000, 3000); pcie_phy_read(imx6_pcie, PHY_RX_OVRD_IN_LO, &tmp); - tmp &= ~(PHY_RX_OVRD_IN_LO_RX_DATA_EN | - PHY_RX_OVRD_IN_LO_RX_PLL_EN); + tmp &= ~mask; pcie_phy_write(imx6_pcie, PHY_RX_OVRD_IN_LO, tmp); }