From patchwork Mon Mar 5 22:38:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Rebe?= X-Patchwork-Id: 10260217 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 CB2086037E for ; Mon, 5 Mar 2018 22:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA8DE28CD9 for ; Mon, 5 Mar 2018 22:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEBF928CDB; Mon, 5 Mar 2018 22:55:27 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 1AE1928CD9 for ; Mon, 5 Mar 2018 22:55:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932088AbeCEWzU (ORCPT ); Mon, 5 Mar 2018 17:55:20 -0500 Received: from mx.exactcode.de ([144.76.154.42]:47396 "EHLO mx.exactcode.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbeCEWzU (ORCPT ); Mon, 5 Mar 2018 17:55:20 -0500 X-Greylist: delayed 999 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Mar 2018 17:55:19 EST DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=exactcode.de; s=x; h=Mime-Version:To:Cc:Message-Id:Date:Subject:Content-Transfer-Encoding:Content-Type:From; bh=rxLjc/KvArAddH339hPgbktNOBtW5m3OPNOzvFRmp9I=; b=JPT0Enm6PBFC3ARVvZFtbOW+3f+SpJMHJp3AJU+rRC/bW/90C0ghduiCBKxbAFIV7agoSk9BHn509MigL1xIG2stbtOMh7cSTiePr0/cCiqT38aM3Wakb+M1z3ydID56C39srLn9EExSq5TBY9rYmi5UYoKVAam4GOVikQUT0Rw=; Received: from exactco.de ([90.187.5.221]) by mx.exactcode.de with esmtp (Exim 4.82) (envelope-from ) id 1esylF-0007gt-3t; Mon, 05 Mar 2018 22:39:13 +0000 Received: from ip5b40180c.dynamic.kabel-deutschland.de ([91.64.24.12] helo=[192.168.0.15]) by exactco.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.54) id 1esxjn-0000An-Sx; Mon, 05 Mar 2018 21:33:49 +0000 From: =?iso-8859-1?Q?Ren=E9_Rebe?= Subject: [PATCH] k10temp support for AMD Ryzen w/ Vega gfx Date: Mon, 5 Mar 2018 23:38:24 +0100 Message-Id: <1769691A-DD1D-4641-B7BA-62C1BA571EBF@exactcode.de> Cc: Clemens Ladisch , linux-kernel@vger.kernel.org To: linux-hwmon@vger.kernel.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This enables k10temp for the new AMD Ryzen APUs w/ Vega Mobile Gfx. Tested on Ryzen 5 2500U, the temperature looked plausible. Signed-off-by: René Rebe PS: 1st RFC - might get white-space damaged, will resend when ACKed. Sorry my Xemacs/Mew broke. --- linux-4.15/drivers/hwmon/k10temp.c.vanilla 2018-03-05 22:22:30.974331180 +0000 +++ linux-4.15/drivers/hwmon/k10temp.c 2018-03-05 22:24:17.186327291 +0000 @@ -40,6 +40,10 @@ #define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 #endif +#ifndef PCI_DEVICE_ID_AMD_17H_RR_NB +#define PCI_DEVICE_ID_AMD_17H_RR_NB 0x15d0 +#endif + /* CPUID function 0x80000001, ebx */ #define CPUID_PKGTYPE_MASK 0xf0000000 #define CPUID_PKGTYPE_F 0x00000000 @@ -89,6 +93,8 @@ { 0x17, "AMD Ryzen Threadripper 1950", 10000 }, { 0x17, "AMD Ryzen Threadripper 1920", 10000 }, { 0x17, "AMD Ryzen Threadripper 1910", 10000 }, + { 0x17, "AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx", 20000 }, + { 0x17, "AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx", 20000 }, }; static void read_tempreg_pci(struct pci_dev *pdev, u32 *regval) @@ -289,6 +2944,7 @@ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) }, + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_RR_NB) }, {} }; MODULE_DEVICE_TABLE(pci, k10temp_id_table);