From patchwork Fri Jan 4 17:49:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10748741 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 4EF3E6C5 for ; Fri, 4 Jan 2019 18:07:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40F4D285FF for ; Fri, 4 Jan 2019 18:07:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 351EE28706; Fri, 4 Jan 2019 18:07:10 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 D58D6285FF for ; Fri, 4 Jan 2019 18:07:09 +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=xdlpOcWFIYKPokEbmiC7jyBTluftCQ3TaZiiHEC5kXQ=; b=OWfoXMap4RVs5T KgT12fBQDRyuX68ph/gawWqi1hLDhox9/oIPHKDUj8gyEfOCvFNmM7y2AOL0MrtarbCM/wXr7xbBZ lQSX08sabKAd4FQwp/mXDxLR/jFX5QUMlDfvDzFowV8kXYJhu1GVI4rws7r5XHjcKuXQ9gi5+JOiB wqXnJyb1UNATf/BXXs6kEMn+q9n/DJQPWn8RNt5XbP7YQTkjCmdMo3UyDWZJ+z08AUdzEALMErz1b SGpyZzVQqdgl+vlNhGXRoAadsqaoDVii1VsPkiS+dBYZn0qiDXmRvLOLrwFMHqYHwbnqyUDmbsDo7 //ET6UeQs000WkGiMV5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfTsA-00030N-TS; Fri, 04 Jan 2019 18:07:06 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfTs1-0002Vg-OG for linux-arm-kernel@bombadil.infradead.org; Fri, 04 Jan 2019 18:06:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wgbDW5dpUQt98rEUFIyBYJEI6ndB9gcDqUzY7mel/6s=; b=u+UpNPMITZLG2P9ldkG9FyU1+s zUnZ9IqUsZEDsL5LYWMNOA3rupK7i3l+kaEpn1H7TESxckYkWxYs5ZbrUcXDD/2r0/ys//4fBgNfM W+fl82dMH1HfE6Aw/46lWMPaBriwlTmT0U/ZlX27ky3c2UA7rxw5SYLZ9UKIbj8wqIn/wCvON1IDN Ku40gzwBa/cAJeK6eEVIt8/N1le32aSmjdvpyZlgUUFuPG2p2APD26SlBeYslN/IaLVGdcKqlsEn3 smgHHUuXn7NChQQUT+7bf82R81YlL9tIhkRN4QjR3GA01Q4oq0laYkQ617e6GKPm1tiF1rfYKfcUm sn2s3S9w==; Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gfTbp-0004UK-H3 for linux-arm-kernel@lists.infradead.org; Fri, 04 Jan 2019 17:50:15 +0000 Received: by mail-pl1-x644.google.com with SMTP id 101so17734000pld.6 for ; Fri, 04 Jan 2019 09:50:13 -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=wgbDW5dpUQt98rEUFIyBYJEI6ndB9gcDqUzY7mel/6s=; b=iEoo1a/OKkKJZtfMoSTJBNRwLRmxHYiy5BELr0ZahkEJGPUnWHwAwbGSGWVnA2K3N8 DWThaSV1BEmfcBxiAl1ghAgv91foOjqkSX4pMTvTNUCjzCLNrdOz1weDJPulXHqesjzh eo5y6w4t7zvPtU5sktiCfCu1pXpsRxMjWppuO9SHLgmgKT9gXL2SX8Wfj6adxuE+Rugt GNg31n1h4+XGXfq7q7scRS3JKuR0gATy2gkluOWZDDgVBnj+gkDP79Tcl6mcoJ0SV7QR 2uJGVeXBm/wDHSiTwgvW5dPiDfSObElXccqjn1ADPmRyVU/oijZ3B9efIS2HA31eCYsK FvuQ== 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=wgbDW5dpUQt98rEUFIyBYJEI6ndB9gcDqUzY7mel/6s=; b=YXv4EkWG2QQtDX6OgI+MhHHS6Ni3uctPY0dYzkNj19OqhDawT1mgNkmSP/okheqHXl 1zjNJymLxz+N8ua4sX5ysIMVGvWYQeWUDGV1OnGpPGCz4ojxzRctmwGk4fsJOzUCVwJA Kgi7iQQJvW2ghhpEA99PkMPoaQQpAFgr0wSPzDo/UaP0xuHMs4hrjPMCTrDDOWh/Qe+W lo+VMwsyVc/Yx1iyyGdHshGZCzLIxfYqusmdFMrRp6CrEOQI7QKKdIgvyY4z5bo7Npiq 5vG3ttadA49NVZqio0bYMIGaiyBhZ6haQGTLdYFkeIPSOxgCCnXeAfiuyVR8tBgyka8/ MJCw== X-Gm-Message-State: AJcUukddL0i9WwCmMkyTZJu4YBtLjM2i4E9rYYTn7HJrlOs/s+6AAG27 VJFxauUcT0ypOr7TwYL+rj0= X-Google-Smtp-Source: ALg8bN7DWXymiFDJPJKMM8BjkzXwfxTzSSAkZlFhar78VPcv/On4+5l+ipcw6E2WWjhb9eRrCzZmFw== X-Received: by 2002:a17:902:2a66:: with SMTP id i93mr50874325plb.113.1546624211721; Fri, 04 Jan 2019 09:50: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 i193sm100699632pgc.22.2019.01.04.09.50.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jan 2019 09:50:11 -0800 (PST) From: Andrey Smirnov To: linux-pci@vger.kernel.org Subject: [PATCH v2 16/20] PCI: imx6: Use common mask in imx6_pcie_reset_phy() Date: Fri, 4 Jan 2019 09:49:21 -0800 Message-Id: <20190104174925.17153-17-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190104174925.17153-1-andrew.smirnov@gmail.com> References: <20190104174925.17153-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190104_175013_597046_F6834530 X-CRM114-Status: GOOD ( 12.31 ) 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: "A.s. Dong" , Lorenzo Pieralisi , Richard Zhu , linux-arm-kernel@lists.infradead.org, Andrey Smirnov , linux-kernel@vger.kernel.org, Fabio Estevam , linux-imx@nxp.com, Bjorn Helgaas , Leonard Crestez , Chris Healy , Lucas Stach 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 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 befbc09c9c41..130f577670c8 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -247,21 +247,21 @@ 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; if (!(imx6_pcie->drvdata->flags & IMX6_PCIE_FLAG_IMX6_PHY)) return; 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); }