18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * hwmon-vid.c - VID/VRM/VRD voltage conversions
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2004 Rudolf Marek <r.marek@assembler.cz>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Partly imported from i2c-vid.h of the lm_sensors project
88c2ecf20Sopenharmony_ci * Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
98c2ecf20Sopenharmony_ci * With assistance from Trent Piepho <xyzzy@speakeasy.org>
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/module.h>
158c2ecf20Sopenharmony_ci#include <linux/kernel.h>
168c2ecf20Sopenharmony_ci#include <linux/hwmon-vid.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/*
198c2ecf20Sopenharmony_ci * Common code for decoding VID pins.
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * References:
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci * For VRM 8.4 to 9.1, "VRM x.y DC-DC Converter Design Guidelines",
248c2ecf20Sopenharmony_ci * available at http://developer.intel.com/.
258c2ecf20Sopenharmony_ci *
268c2ecf20Sopenharmony_ci * For VRD 10.0 and up, "VRD x.y Design Guide",
278c2ecf20Sopenharmony_ci * available at http://developer.intel.com/.
288c2ecf20Sopenharmony_ci *
298c2ecf20Sopenharmony_ci * AMD Athlon 64 and AMD Opteron Processors, AMD Publication 26094,
308c2ecf20Sopenharmony_ci * http://support.amd.com/us/Processor_TechDocs/26094.PDF
318c2ecf20Sopenharmony_ci * Table 74. VID Code Voltages
328c2ecf20Sopenharmony_ci * This corresponds to an arbitrary VRM code of 24 in the functions below.
338c2ecf20Sopenharmony_ci * These CPU models (K8 revision <= E) have 5 VID pins. See also:
348c2ecf20Sopenharmony_ci * Revision Guide for AMD Athlon 64 and AMD Opteron Processors, AMD Publication 25759,
358c2ecf20Sopenharmony_ci * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25759.pdf
368c2ecf20Sopenharmony_ci *
378c2ecf20Sopenharmony_ci * AMD NPT Family 0Fh Processors, AMD Publication 32559,
388c2ecf20Sopenharmony_ci * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
398c2ecf20Sopenharmony_ci * Table 71. VID Code Voltages
408c2ecf20Sopenharmony_ci * This corresponds to an arbitrary VRM code of 25 in the functions below.
418c2ecf20Sopenharmony_ci * These CPU models (K8 revision >= F) have 6 VID pins. See also:
428c2ecf20Sopenharmony_ci * Revision Guide for AMD NPT Family 0Fh Processors, AMD Publication 33610,
438c2ecf20Sopenharmony_ci * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33610.pdf
448c2ecf20Sopenharmony_ci *
458c2ecf20Sopenharmony_ci * The 17 specification is in fact Intel Mobile Voltage Positioning -
468c2ecf20Sopenharmony_ci * (IMVP-II). You can find more information in the datasheet of Max1718
478c2ecf20Sopenharmony_ci * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2452
488c2ecf20Sopenharmony_ci *
498c2ecf20Sopenharmony_ci * The 13 specification corresponds to the Intel Pentium M series. There
508c2ecf20Sopenharmony_ci * doesn't seem to be any named specification for these. The conversion
518c2ecf20Sopenharmony_ci * tables are detailed directly in the various Pentium M datasheets:
528c2ecf20Sopenharmony_ci * https://www.intel.com/design/intarch/pentiumm/docs_pentiumm.htm
538c2ecf20Sopenharmony_ci *
548c2ecf20Sopenharmony_ci * The 14 specification corresponds to Intel Core series. There
558c2ecf20Sopenharmony_ci * doesn't seem to be any named specification for these. The conversion
568c2ecf20Sopenharmony_ci * tables are detailed directly in the various Pentium Core datasheets:
578c2ecf20Sopenharmony_ci * https://www.intel.com/design/mobile/datashts/309221.htm
588c2ecf20Sopenharmony_ci *
598c2ecf20Sopenharmony_ci * The 110 (VRM 11) specification corresponds to Intel Conroe based series.
608c2ecf20Sopenharmony_ci * https://www.intel.com/design/processor/applnots/313214.htm
618c2ecf20Sopenharmony_ci */
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/*
648c2ecf20Sopenharmony_ci * vrm is the VRM/VRD document version multiplied by 10.
658c2ecf20Sopenharmony_ci * val is the 4-bit or more VID code.
668c2ecf20Sopenharmony_ci * Returned value is in mV to avoid floating point in the kernel.
678c2ecf20Sopenharmony_ci * Some VID have some bits in uV scale, this is rounded to mV.
688c2ecf20Sopenharmony_ci */
698c2ecf20Sopenharmony_ciint vid_from_reg(int val, u8 vrm)
708c2ecf20Sopenharmony_ci{
718c2ecf20Sopenharmony_ci	int vid;
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci	switch (vrm) {
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci	case 100:		/* VRD 10.0 */
768c2ecf20Sopenharmony_ci		/* compute in uV, round to mV */
778c2ecf20Sopenharmony_ci		val &= 0x3f;
788c2ecf20Sopenharmony_ci		if ((val & 0x1f) == 0x1f)
798c2ecf20Sopenharmony_ci			return 0;
808c2ecf20Sopenharmony_ci		if ((val & 0x1f) <= 0x09 || val == 0x0a)
818c2ecf20Sopenharmony_ci			vid = 1087500 - (val & 0x1f) * 25000;
828c2ecf20Sopenharmony_ci		else
838c2ecf20Sopenharmony_ci			vid = 1862500 - (val & 0x1f) * 25000;
848c2ecf20Sopenharmony_ci		if (val & 0x20)
858c2ecf20Sopenharmony_ci			vid -= 12500;
868c2ecf20Sopenharmony_ci		return (vid + 500) / 1000;
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci	case 110:		/* Intel Conroe */
898c2ecf20Sopenharmony_ci				/* compute in uV, round to mV */
908c2ecf20Sopenharmony_ci		val &= 0xff;
918c2ecf20Sopenharmony_ci		if (val < 0x02 || val > 0xb2)
928c2ecf20Sopenharmony_ci			return 0;
938c2ecf20Sopenharmony_ci		return (1600000 - (val - 2) * 6250 + 500) / 1000;
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci	case 24:		/* Athlon64 & Opteron */
968c2ecf20Sopenharmony_ci		val &= 0x1f;
978c2ecf20Sopenharmony_ci		if (val == 0x1f)
988c2ecf20Sopenharmony_ci			return 0;
998c2ecf20Sopenharmony_ci		fallthrough;
1008c2ecf20Sopenharmony_ci	case 25:		/* AMD NPT 0Fh */
1018c2ecf20Sopenharmony_ci		val &= 0x3f;
1028c2ecf20Sopenharmony_ci		return (val < 32) ? 1550 - 25 * val
1038c2ecf20Sopenharmony_ci			: 775 - (25 * (val - 31)) / 2;
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci	case 26:		/* AMD family 10h to 15h, serial VID */
1068c2ecf20Sopenharmony_ci		val &= 0x7f;
1078c2ecf20Sopenharmony_ci		if (val >= 0x7c)
1088c2ecf20Sopenharmony_ci			return 0;
1098c2ecf20Sopenharmony_ci		return DIV_ROUND_CLOSEST(15500 - 125 * val, 10);
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci	case 91:		/* VRM 9.1 */
1128c2ecf20Sopenharmony_ci	case 90:		/* VRM 9.0 */
1138c2ecf20Sopenharmony_ci		val &= 0x1f;
1148c2ecf20Sopenharmony_ci		return val == 0x1f ? 0 :
1158c2ecf20Sopenharmony_ci				     1850 - val * 25;
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci	case 85:		/* VRM 8.5 */
1188c2ecf20Sopenharmony_ci		val &= 0x1f;
1198c2ecf20Sopenharmony_ci		return (val & 0x10  ? 25 : 0) +
1208c2ecf20Sopenharmony_ci		       ((val & 0x0f) > 0x04 ? 2050 : 1250) -
1218c2ecf20Sopenharmony_ci		       ((val & 0x0f) * 50);
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci	case 84:		/* VRM 8.4 */
1248c2ecf20Sopenharmony_ci		val &= 0x0f;
1258c2ecf20Sopenharmony_ci		fallthrough;
1268c2ecf20Sopenharmony_ci	case 82:		/* VRM 8.2 */
1278c2ecf20Sopenharmony_ci		val &= 0x1f;
1288c2ecf20Sopenharmony_ci		return val == 0x1f ? 0 :
1298c2ecf20Sopenharmony_ci		       val & 0x10  ? 5100 - (val) * 100 :
1308c2ecf20Sopenharmony_ci				     2050 - (val) * 50;
1318c2ecf20Sopenharmony_ci	case 17:		/* Intel IMVP-II */
1328c2ecf20Sopenharmony_ci		val &= 0x1f;
1338c2ecf20Sopenharmony_ci		return val & 0x10 ? 975 - (val & 0xF) * 25 :
1348c2ecf20Sopenharmony_ci				    1750 - val * 50;
1358c2ecf20Sopenharmony_ci	case 13:
1368c2ecf20Sopenharmony_ci	case 131:
1378c2ecf20Sopenharmony_ci		val &= 0x3f;
1388c2ecf20Sopenharmony_ci		/* Exception for Eden ULV 500 MHz */
1398c2ecf20Sopenharmony_ci		if (vrm == 131 && val == 0x3f)
1408c2ecf20Sopenharmony_ci			val++;
1418c2ecf20Sopenharmony_ci		return 1708 - val * 16;
1428c2ecf20Sopenharmony_ci	case 14:		/* Intel Core */
1438c2ecf20Sopenharmony_ci				/* compute in uV, round to mV */
1448c2ecf20Sopenharmony_ci		val &= 0x7f;
1458c2ecf20Sopenharmony_ci		return val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000;
1468c2ecf20Sopenharmony_ci	default:		/* report 0 for unknown */
1478c2ecf20Sopenharmony_ci		if (vrm)
1488c2ecf20Sopenharmony_ci			pr_warn("Requested unsupported VRM version (%u)\n",
1498c2ecf20Sopenharmony_ci				(unsigned int)vrm);
1508c2ecf20Sopenharmony_ci		return 0;
1518c2ecf20Sopenharmony_ci	}
1528c2ecf20Sopenharmony_ci}
1538c2ecf20Sopenharmony_ciEXPORT_SYMBOL(vid_from_reg);
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/*
1568c2ecf20Sopenharmony_ci * After this point is the code to automatically determine which
1578c2ecf20Sopenharmony_ci * VRM/VRD specification should be used depending on the CPU.
1588c2ecf20Sopenharmony_ci */
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_cistruct vrm_model {
1618c2ecf20Sopenharmony_ci	u8 vendor;
1628c2ecf20Sopenharmony_ci	u8 family;
1638c2ecf20Sopenharmony_ci	u8 model_from;
1648c2ecf20Sopenharmony_ci	u8 model_to;
1658c2ecf20Sopenharmony_ci	u8 stepping_to;
1668c2ecf20Sopenharmony_ci	u8 vrm_type;
1678c2ecf20Sopenharmony_ci};
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define ANY 0xFF
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci#ifdef CONFIG_X86
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci/*
1748c2ecf20Sopenharmony_ci * The stepping_to parameter is highest acceptable stepping for current line.
1758c2ecf20Sopenharmony_ci * The model match must be exact for 4-bit values. For model values 0x10
1768c2ecf20Sopenharmony_ci * and above (extended model), all models below the parameter will match.
1778c2ecf20Sopenharmony_ci */
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_cistatic struct vrm_model vrm_models[] = {
1808c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0x6, 0x0, ANY, ANY, 90},	/* Athlon Duron etc */
1818c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0xF, 0x0, 0x3F, ANY, 24},	/* Athlon 64, Opteron */
1828c2ecf20Sopenharmony_ci	/*
1838c2ecf20Sopenharmony_ci	 * In theory, all NPT family 0Fh processors have 6 VID pins and should
1848c2ecf20Sopenharmony_ci	 * thus use vrm 25, however in practice not all mainboards route the
1858c2ecf20Sopenharmony_ci	 * 6th VID pin because it is never needed. So we use the 5 VID pin
1868c2ecf20Sopenharmony_ci	 * variant (vrm 24) for the models which exist today.
1878c2ecf20Sopenharmony_ci	 */
1888c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0xF, 0x40, 0x7F, ANY, 24},	/* NPT family 0Fh */
1898c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0xF, 0x80, ANY, ANY, 25},	/* future fam. 0Fh */
1908c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0x10, 0x0, ANY, ANY, 25},	/* NPT family 10h */
1918c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0x11, 0x0, ANY, ANY, 26},	/* family 11h */
1928c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0x12, 0x0, ANY, ANY, 26},	/* family 12h */
1938c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0x14, 0x0, ANY, ANY, 26},	/* family 14h */
1948c2ecf20Sopenharmony_ci	{X86_VENDOR_AMD, 0x15, 0x0, ANY, ANY, 26},	/* family 15h */
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0x0, 0x6, ANY, 82},	/* Pentium Pro,
1978c2ecf20Sopenharmony_ci							 * Pentium II, Xeon,
1988c2ecf20Sopenharmony_ci							 * Mobile Pentium,
1998c2ecf20Sopenharmony_ci							 * Celeron */
2008c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0x7, 0x7, ANY, 84},	/* Pentium III, Xeon */
2018c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0x8, 0x8, ANY, 82},	/* Pentium III, Xeon */
2028c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0x9, 0x9, ANY, 13},	/* Pentium M (130 nm) */
2038c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0xA, 0xA, ANY, 82},	/* Pentium III Xeon */
2048c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0xB, 0xB, ANY, 85},	/* Tualatin */
2058c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0xD, 0xD, ANY, 13},	/* Pentium M (90 nm) */
2068c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0xE, 0xE, ANY, 14},	/* Intel Core (65 nm) */
2078c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0x6, 0xF, ANY, ANY, 110},	/* Intel Conroe and
2088c2ecf20Sopenharmony_ci							 * later */
2098c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0xF, 0x0, 0x0, ANY, 90},	/* P4 */
2108c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0xF, 0x1, 0x1, ANY, 90},	/* P4 Willamette */
2118c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0xF, 0x2, 0x2, ANY, 90},	/* P4 Northwood */
2128c2ecf20Sopenharmony_ci	{X86_VENDOR_INTEL, 0xF, 0x3, ANY, ANY, 100},	/* Prescott and above
2138c2ecf20Sopenharmony_ci							 * assume VRD 10 */
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0x7, 0x7, ANY, 85},	/* Eden ESP/Ezra */
2168c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0x8, 0x8, 0x7, 85},	/* Ezra T */
2178c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0x9, 0x9, 0x7, 85},	/* Nehemiah */
2188c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0x9, 0x9, ANY, 17},	/* C3-M, Eden-N */
2198c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0xA, 0xA, 0x7, 0},	/* No information */
2208c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0xA, 0xA, ANY, 13},	/* C7-M, C7,
2218c2ecf20Sopenharmony_ci							 * Eden (Esther) */
2228c2ecf20Sopenharmony_ci	{X86_VENDOR_CENTAUR, 0x6, 0xD, 0xD, ANY, 134},	/* C7-D, C7-M, C7,
2238c2ecf20Sopenharmony_ci							 * Eden (Esther) */
2248c2ecf20Sopenharmony_ci};
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci/*
2278c2ecf20Sopenharmony_ci * Special case for VIA model D: there are two different possible
2288c2ecf20Sopenharmony_ci * VID tables, so we have to figure out first, which one must be
2298c2ecf20Sopenharmony_ci * used. This resolves temporary drm value 134 to 14 (Intel Core
2308c2ecf20Sopenharmony_ci * 7-bit VID), 13 (Pentium M 6-bit VID) or 131 (Pentium M 6-bit VID
2318c2ecf20Sopenharmony_ci * + quirk for Eden ULV 500 MHz).
2328c2ecf20Sopenharmony_ci * Note: something similar might be needed for model A, I'm not sure.
2338c2ecf20Sopenharmony_ci */
2348c2ecf20Sopenharmony_cistatic u8 get_via_model_d_vrm(void)
2358c2ecf20Sopenharmony_ci{
2368c2ecf20Sopenharmony_ci	unsigned int vid, brand, __maybe_unused dummy;
2378c2ecf20Sopenharmony_ci	static const char *brands[4] = {
2388c2ecf20Sopenharmony_ci		"C7-M", "C7", "Eden", "C7-D"
2398c2ecf20Sopenharmony_ci	};
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	rdmsr(0x198, dummy, vid);
2428c2ecf20Sopenharmony_ci	vid &= 0xff;
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci	rdmsr(0x1154, brand, dummy);
2458c2ecf20Sopenharmony_ci	brand = ((brand >> 4) ^ (brand >> 2)) & 0x03;
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci	if (vid > 0x3f) {
2488c2ecf20Sopenharmony_ci		pr_info("Using %d-bit VID table for VIA %s CPU\n",
2498c2ecf20Sopenharmony_ci			7, brands[brand]);
2508c2ecf20Sopenharmony_ci		return 14;
2518c2ecf20Sopenharmony_ci	} else {
2528c2ecf20Sopenharmony_ci		pr_info("Using %d-bit VID table for VIA %s CPU\n",
2538c2ecf20Sopenharmony_ci			6, brands[brand]);
2548c2ecf20Sopenharmony_ci		/* Enable quirk for Eden */
2558c2ecf20Sopenharmony_ci		return brand == 2 ? 131 : 13;
2568c2ecf20Sopenharmony_ci	}
2578c2ecf20Sopenharmony_ci}
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_cistatic u8 find_vrm(u8 family, u8 model, u8 stepping, u8 vendor)
2608c2ecf20Sopenharmony_ci{
2618c2ecf20Sopenharmony_ci	int i;
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci	for (i = 0; i < ARRAY_SIZE(vrm_models); i++) {
2648c2ecf20Sopenharmony_ci		if (vendor == vrm_models[i].vendor &&
2658c2ecf20Sopenharmony_ci		    family == vrm_models[i].family &&
2668c2ecf20Sopenharmony_ci		    model >= vrm_models[i].model_from &&
2678c2ecf20Sopenharmony_ci		    model <= vrm_models[i].model_to &&
2688c2ecf20Sopenharmony_ci		    stepping <= vrm_models[i].stepping_to)
2698c2ecf20Sopenharmony_ci			return vrm_models[i].vrm_type;
2708c2ecf20Sopenharmony_ci	}
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci	return 0;
2738c2ecf20Sopenharmony_ci}
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ciu8 vid_which_vrm(void)
2768c2ecf20Sopenharmony_ci{
2778c2ecf20Sopenharmony_ci	struct cpuinfo_x86 *c = &cpu_data(0);
2788c2ecf20Sopenharmony_ci	u8 vrm_ret;
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci	if (c->x86 < 6)		/* Any CPU with family lower than 6 */
2818c2ecf20Sopenharmony_ci		return 0;	/* doesn't have VID */
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci	vrm_ret = find_vrm(c->x86, c->x86_model, c->x86_stepping, c->x86_vendor);
2848c2ecf20Sopenharmony_ci	if (vrm_ret == 134)
2858c2ecf20Sopenharmony_ci		vrm_ret = get_via_model_d_vrm();
2868c2ecf20Sopenharmony_ci	if (vrm_ret == 0)
2878c2ecf20Sopenharmony_ci		pr_info("Unknown VRM version of your x86 CPU\n");
2888c2ecf20Sopenharmony_ci	return vrm_ret;
2898c2ecf20Sopenharmony_ci}
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci/* and now for something completely different for the non-x86 world */
2928c2ecf20Sopenharmony_ci#else
2938c2ecf20Sopenharmony_ciu8 vid_which_vrm(void)
2948c2ecf20Sopenharmony_ci{
2958c2ecf20Sopenharmony_ci	pr_info("Unknown VRM version of your CPU\n");
2968c2ecf20Sopenharmony_ci	return 0;
2978c2ecf20Sopenharmony_ci}
2988c2ecf20Sopenharmony_ci#endif
2998c2ecf20Sopenharmony_ciEXPORT_SYMBOL(vid_which_vrm);
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ciMODULE_AUTHOR("Rudolf Marek <r.marek@assembler.cz>");
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("hwmon-vid driver");
3048c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL");
305