Received: by 10.213.65.68 with SMTP id h4csp1204880imn; Wed, 28 Mar 2018 23:38:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+iLgZS4bmU4A2feFEEMJyr6Hllu+zTbOsLPXr1E1JMein01RCN+wiZR7G+edLWlD0aREt1 X-Received: by 2002:a17:902:d03:: with SMTP id 3-v6mr7018082plu.245.1522305519970; Wed, 28 Mar 2018 23:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522305519; cv=none; d=google.com; s=arc-20160816; b=0jBzDZIxSSMh1kZdcPw2U9TOTt7IrzXsAHc5sSjC/IGqjOwGx1Chi4OKrchmD7BBnB +oTYLsaL6E6TJ+TX4+9WYgSTwMqn6tgsvj9EQIQYU3S+lSmI2PAKBzD+RYX36xTl4PZG C0MWBTfLJnWS6Vs73nOXo++Voi765qnVWR0Zy9yl9GEI+p7WzSn3QClPegffKfKmN7C9 Z9aQKGkaB4rlDaHaseB0SRjeDxaXHAA856F8OXw/o3c4o1ktZ7Y0Uwo2Asvalz8Z3tCK 0iTazgfKnV8PCBvPwDrUNn2r3DvRrKo74Jizjqp2X4fw7fA66fVgzqHi8+tIMvb0cjLI DnjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=RVeuuYoxeKVoIzUebIlewV1K07ew4nqDBhTQqf5o5x8=; b=bMpZ/fuOkc9viXrth/M4Cc/itfxdxYq1j3Yp8qu8+nr0XYq9QwQ2umRXJWopik3iG4 iCHdNfo+4xsu7H7xPEQJGE7bNCPTylMgOOLJrfUeABM7XeegPxgkhew+iusZM49niiQ8 308plcqSt6aNupWX38gGuy3kQw/gP5Hy4kxAPiBgKY7DlRRsePJFJiqzFUQnaFXr30IA nXVJBs3eMRDn2E9Q0zBqibqg3p8f5VzChlfDff0NFY3LvhUW5sJptvogmGoMvjnvlZjl hUmYSUIjlZD/W3ALxCXFiWyugP7S8B3hHsXnqMcRc5pvqwyPpU73Yo7APt3FE+9aiFqZ P2Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si5222362plj.247.2018.03.28.23.38.13; Wed, 28 Mar 2018 23:38:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751086AbeC2Gg5 (ORCPT + 99 others); Thu, 29 Mar 2018 02:36:57 -0400 Received: from zxshcas1.zhaoxin.com ([180.169.121.91]:22306 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750716AbeC2Gg4 (ORCPT ); Thu, 29 Mar 2018 02:36:56 -0400 Received: from zxbjmbx3.zhaoxin.com (10.29.252.165) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 29 Mar 2018 14:36:54 +0800 Received: from timguo-System-Product-Name.zhaoxin.com (10.29.8.54) by zxbjmbx3.zhaoxin.com (10.29.252.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 29 Mar 2018 14:36:52 +0800 From: David Wang To: , , , , , , CC: , , , , , , David Wang Subject: [PATCH v1] hwmon, via-cputem: support new centaur CPUs Date: Thu, 29 Mar 2018 14:36:43 +0800 Message-ID: <1522305403-21009-1-git-send-email-davidwang@zhaoxin.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.29.8.54] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx3.zhaoxin.com (10.29.252.165) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Newer centaur CPUs(Family == 7) also support this cpu temperature sensor. Signed-off-by: David Wang --- drivers/hwmon/via-cputemp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c index 07a0cb0..2f5bd50 100644 --- a/drivers/hwmon/via-cputemp.c +++ b/drivers/hwmon/via-cputemp.c @@ -136,6 +136,11 @@ static int via_cputemp_probe(struct platform_device *pdev) data->id = pdev->id; data->name = "via_cputemp"; + if (c->x86 == 7) { + data->msr_temp = 0x1423; + goto test_access; + } + switch (c->x86_model) { case 0xA: /* C7 A */ @@ -152,6 +157,7 @@ static int via_cputemp_probe(struct platform_device *pdev) return -ENODEV; } +test_access: /* test if we can access the TEMPERATURE MSR */ err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx); if (err) { @@ -283,6 +289,7 @@ static int via_cputemp_down_prep(unsigned int cpu) { X86_VENDOR_CENTAUR, 6, 0xa, }, /* C7 A */ { X86_VENDOR_CENTAUR, 6, 0xd, }, /* C7 D */ { X86_VENDOR_CENTAUR, 6, 0xf, }, /* Nano */ + { X86_VENDOR_CENTAUR, 7, X86_MODEL_ANY, }, {} }; MODULE_DEVICE_TABLE(x86cpu, cputemp_ids); -- 1.9.1