linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Ricky Wu <ricky_wu@realtek.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Rui Feng <rui_feng@realsil.com.cn>, Klaus Doth <kdlnx@doth.eu>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Puranjay Mohan <puranjay12@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH 1/5] misc: rtsx: Use pcie_capability_clear_and_set_word() for PCI_EXP_LNKCTL
Date: Tue, 21 Jul 2020 16:23:32 -0500	[thread overview]
Message-ID: <20200721212336.1159079-2-helgaas@kernel.org> (raw)
In-Reply-To: <20200721212336.1159079-1-helgaas@kernel.org>

From: Bjorn Helgaas <bhelgaas@google.com>

Instead of using the driver-specific rtsx_pci_write_config_byte() to update
the PCIe Link Control Register, use pcie_capability_write_word() like the
rest of the kernel does.  This makes it easier to maintain ASPM across the
PCI core and drivers.

No functional change intended.  I missed this when doing 3d1e7aa80d1c
("misc: rtsx: Use pcie_capability_clear_and_set_word() for
PCI_EXP_LNKCTL").

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/misc/cardreader/rtsx_pcr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c
index 0d5928bc1b6d..6a4d6c8f4e71 100644
--- a/drivers/misc/cardreader/rtsx_pcr.c
+++ b/drivers/misc/cardreader/rtsx_pcr.c
@@ -1231,6 +1231,7 @@ int rtsx_ms_power_off_card3v3(struct rtsx_pcr *pcr)
 
 static int rtsx_pci_init_hw(struct rtsx_pcr *pcr)
 {
+	struct pci_dev *pdev = pcr->pci;
 	int err;
 
 	pcr->pcie_cap = pci_find_capability(pcr->pci, PCI_CAP_ID_EXP);
@@ -1324,7 +1325,8 @@ static int rtsx_pci_init_hw(struct rtsx_pcr *pcr)
 	rtsx_pci_init_ocp(pcr);
 
 	/* Enable clk_request_n to enable clock power management */
-	rtsx_pci_write_config_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL + 1, 1);
+	pcie_capability_write_word(pdev, PCI_EXP_LNKCTL,
+				   PCI_EXP_LNKCTL_CLKREQ_EN);
 	/* Enter L1 when host tx idle */
 	rtsx_pci_write_config_byte(pcr, 0x70F, 0x5B);
 
-- 
2.25.1


  reply	other threads:[~2020-07-21 21:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 21:23 [PATCH 0/5] minor rtsx cleanups Bjorn Helgaas
2020-07-21 21:23 ` Bjorn Helgaas [this message]
2020-07-21 21:23 ` [PATCH 2/5] misc: rtsx: Remove unused pcie_cap Bjorn Helgaas
2020-07-21 21:23 ` [PATCH 3/5] misc: rtsx: Remove rtsx_pci_read/write_config() wrappers Bjorn Helgaas
2020-07-21 21:23 ` [PATCH 4/5] misc: rtsx: Find L1 PM Substates capability instead of hard-coding Bjorn Helgaas
2020-07-21 21:23 ` [PATCH 5/5] misc: rtsx: Use standard PCI definitions Bjorn Helgaas
2020-07-21 21:28 ` [PATCH 0/5] minor rtsx cleanups Arnd Bergmann
2020-07-23  8:16   ` 吳昊澄 Ricky
2020-07-23  8:28     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200721212336.1159079-2-helgaas@kernel.org \
    --to=helgaas@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kdlnx@doth.eu \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=puranjay12@gmail.com \
    --cc=ricky_wu@realtek.com \
    --cc=rmfrfs@gmail.com \
    --cc=rui_feng@realsil.com.cn \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).