Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp636967pxu; Tue, 1 Dec 2020 22:34:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJznZGQobO0s8Ha4VqqCZUUltfN1aIKkUHrzsHx0fRErmoJMpBLXc6kHgiaALd6QMrEs4b1j X-Received: by 2002:a05:6402:1c04:: with SMTP id ck4mr1176684edb.320.1606890887919; Tue, 01 Dec 2020 22:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606890887; cv=none; d=google.com; s=arc-20160816; b=g/Db2HAWBFYVa2H5kWQjcDMZ3YKwNPmnxsTPg6FmBtTZTtcda1nE1bgCdBXACU2JuC vY5bBJjdDgGtOF7cdzXS27CW5CIy69JXwasu/9rRZQoKcrjT1PQc9nIDeeqEONl1QV0h YeSmQEp9EQFet7WI3k5g2avAQRD5gehUuVr0kB5zJtuqYdK7IrVh8FcYOYbVxpq1ZeSI xustYmrZG0n360YdDqGe/XhwpDuOEr7eKCjpR+UQufBVAQscVK2PVRy4tUG6h5EHttL8 hhtcCsqTj82Hho4o9c8gkhYS4bRjmBqv4sOos++rJG23BW6/Zr0voLHX9tFuAP8UVluH IKcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from :authenticated-by; bh=02zfGqTXATzvxhoRCSa+IZNCaAGFomsMUtSCazWeqAE=; b=u9C06Z2gIH3SQdMzXnLnq1Zu1tWL7fiLQ8Bb9W86mkMW/+mvmkd01xgMPkPxyJ/awB I7BGSkJPk3Pg8LUNVBu8lsHKGUpHH/ZwjrlnZJL+dSQUfV9tWJhEAqfyE0PycuOeZ9my ka8xVXIXl7mwMG18FZJ6uK62SYLCt7xoUW5mpDkuXJGZQtmnyN5PaO4nUFGH9m6qisWC jMpzL6DiOvnvMei6dLQJ0pQzcc4SIrs7KaUHjHEgUMkszLVfhSjW8bSqTqvjUdydEu1B zooGRF/tFbLQPu6+l0dtGgnl5NZgYObEjiPLU56ZctmyhR75W3JK4luOhVHBNA1/4Bk/ c7Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si445115edh.221.2020.12.01.22.34.25; Tue, 01 Dec 2020 22:34:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728656AbgLBGci (ORCPT + 99 others); Wed, 2 Dec 2020 01:32:38 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:33545 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728345AbgLBGch (ORCPT ); Wed, 2 Dec 2020 01:32:37 -0500 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 0B26VS7G0025898, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexmb01.realtek.com.tw[172.21.6.94]) by rtits2.realtek.com.tw (8.15.2/2.70/5.88) with ESMTPS id 0B26VS7G0025898 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 2 Dec 2020 14:31:28 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.36) by RTEXMB01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Wed, 2 Dec 2020 14:31:28 +0800 Received: from localhost (172.22.88.222) by RTEXMBS01.realtek.com.tw (172.21.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 2 Dec 2020 14:31:28 +0800 From: To: , , , , , , , Subject: [PATCH v2 1/4] misc: rtsx: modify en/disable aspm function Date: Wed, 2 Dec 2020 14:31:24 +0800 Message-ID: <20201202063124.18262-1-ricky_wu@realtek.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.22.88.222] X-ClientProxiedBy: RTEXH365.realtek.com.tw (172.21.6.37) To RTEXMBS01.realtek.com.tw (172.21.6.36) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ricky Wu enable/disable device ASPM function: changed write ASPM configuration directly to use write register Signed-off-by: Ricky Wu --- drivers/misc/cardreader/rtsx_pcr.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c index 5d15607027e9..c87f791bdcb5 100644 --- a/drivers/misc/cardreader/rtsx_pcr.c +++ b/drivers/misc/cardreader/rtsx_pcr.c @@ -89,9 +89,15 @@ static void rtsx_comm_set_aspm(struct rtsx_pcr *pcr, bool enable) if (pcr->aspm_enabled == enable) return; - pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPMC, - enable ? pcr->aspm_en : 0); + if (pcr->aspm_en & 0x02) + rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, FORCE_ASPM_CTL0 | + FORCE_ASPM_CTL1, enable ? 0 : FORCE_ASPM_CTL0 | FORCE_ASPM_CTL1); + else + rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, FORCE_ASPM_CTL0 | + FORCE_ASPM_CTL1, FORCE_ASPM_CTL0 | FORCE_ASPM_CTL1); + + if (!enable && (pcr->aspm_en & 0x02)) + mdelay(10); pcr->aspm_enabled = enable; } -- 2.17.1