From patchwork Wed Mar 1 05:27:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9597599 X-Patchwork-Delegate: rjw@sisk.pl 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 F2AB2600CB for ; Wed, 1 Mar 2017 05:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E66B626E56 for ; Wed, 1 Mar 2017 05:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB46728428; Wed, 1 Mar 2017 05:40:22 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 8A4A926E56 for ; Wed, 1 Mar 2017 05:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbdCAFkV (ORCPT ); Wed, 1 Mar 2017 00:40:21 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:35095 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020AbdCAFkR (ORCPT ); Wed, 1 Mar 2017 00:40:17 -0500 Received: by mail-qk0-f193.google.com with SMTP id n127so8231547qkf.2; Tue, 28 Feb 2017 21:37:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=4n2Jp1Xh8c0gaX5Gc7iIkYZtqwMQWEGujMs+yhnchyg=; b=ngCBLE07fhQWevwBISr+leH/aUgrN0FZwymLCkY3JQy0ManbYB5GApTC6V3I4wYfsz O2TcOcxECpUu1yw+pecoNVfth6gjE8LuFKAhaaY2D5qK+/3/3Askt4OLmvk+YuDB4rN1 +VTUMMYba3jkm9lJlbQOg3hCvK9Mg9mZn8z/453tdoU53UZmg0cqqlT1XvjpxU08LAme 3N2c0qMKHSiwty2HTwiNKoHb40m5YIc0euOjJ/6TjMJLOOTr5WW5VzJgosgghfc5I1rT MzsRH+v03ZESbgi+ttpZElmm1XwpLagoYcxTOzBV3wUyRhMF8g1YU9F5R0QEJHos1+j/ a2Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=4n2Jp1Xh8c0gaX5Gc7iIkYZtqwMQWEGujMs+yhnchyg=; b=p9gdBpzDE5iv51WQ3fG28VQHm42WM/qmRu7DOZepgPvi8xR56LLFxBBWnv72GB0IlY vJpChQdtQpcnyJLL5KxQHGUStHErRYKAuqyF2iBU938/CYmaS94hdptlMF5z82kYv262 8ILETkZ9Rtd1BmFQnk1QqjOlcHVoy8IzPRXbATeVxy8kD/i73D6FGKYfPw+dNhD+vJYs WOGGGNAdazOs2pRPa2xSj5pgiWsjsOfbuJP40OJa+sfcm5ah9frxoZDwXcS3L/Ps92am 20rOVa02DKGjoTQOO+7AfBkjQRONdYI1D6bIXUsiQyMGGyY9HOVJ7jEgCdqQo6ymEyjf epWg== X-Gm-Message-State: AMke39nVRVPAhmpk+iDzVUBX7JBoy+pEjc/UKRtKYHy5ZLcu8z1zXoUaSth467Z4UDVv4A== X-Received: by 10.55.91.129 with SMTP id p123mr7939289qkb.64.1488346112636; Tue, 28 Feb 2017 21:28:32 -0800 (PST) Received: from z87.localdomain (pool-96-230-116-151.bstnma.fios.verizon.net. [96.230.116.151]) by smtp.gmail.com with ESMTPSA id c141sm2530517qkb.10.2017.02.28.21.28.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 21:28:32 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 15/44] intel_pstate: use MSR_ATOM_RATIOS definitions from msr-index.h Date: Wed, 1 Mar 2017 00:27:19 -0500 Message-Id: <92134bdbc6272da6e98e9242cc6f1576cedc0735.1488345270.git.len.brown@intel.com> X-Mailer: git-send-email 2.11.0.161.g6610af872 In-Reply-To: <20170301052748.27810-1-lenb@kernel.org> References: <20170301052748.27810-1-lenb@kernel.org> In-Reply-To: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> References: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown Originally, these MSRs were locally defined in this driver. Now the definitions are in msr-index.h -- use them. Signed-off-by: Len Brown --- drivers/cpufreq/intel_pstate.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 50bd6d987fc3..6e68b556305a 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -39,11 +39,6 @@ #define INTEL_CPUFREQ_TRANSITION_LATENCY 20000 -#define ATOM_RATIOS 0x66a -#define ATOM_VIDS 0x66b -#define ATOM_TURBO_RATIOS 0x66c -#define ATOM_TURBO_VIDS 0x66d - #ifdef CONFIG_ACPI #include #include @@ -1258,7 +1253,7 @@ static int atom_get_min_pstate(void) { u64 value; - rdmsrl(ATOM_RATIOS, value); + rdmsrl(MSR_ATOM_CORE_RATIOS, value); return (value >> 8) & 0x7F; } @@ -1266,7 +1261,7 @@ static int atom_get_max_pstate(void) { u64 value; - rdmsrl(ATOM_RATIOS, value); + rdmsrl(MSR_ATOM_CORE_RATIOS, value); return (value >> 16) & 0x7F; } @@ -1274,7 +1269,7 @@ static int atom_get_turbo_pstate(void) { u64 value; - rdmsrl(ATOM_TURBO_RATIOS, value); + rdmsrl(MSR_ATOM_CORE_TURBO_RATIOS, value); return value & 0x7F; } @@ -1336,7 +1331,7 @@ static void atom_get_vid(struct cpudata *cpudata) { u64 value; - rdmsrl(ATOM_VIDS, value); + rdmsrl(MSR_ATOM_CORE_VIDS, value); cpudata->vid.min = int_tofp((value >> 8) & 0x7f); cpudata->vid.max = int_tofp((value >> 16) & 0x7f); cpudata->vid.ratio = div_fp( @@ -1344,7 +1339,7 @@ static void atom_get_vid(struct cpudata *cpudata) int_tofp(cpudata->pstate.max_pstate - cpudata->pstate.min_pstate)); - rdmsrl(ATOM_TURBO_VIDS, value); + rdmsrl(MSR_ATOM_CORE_TURBO_VIDS, value); cpudata->vid.turbo = value & 0x7f; }