Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3a2d2be authored by davidwang's avatar davidwang Committed by Guenter Roeck
Browse files

hwmon: (via-cputemp) support new centaur CPUs



New centaur CPUs (Familiy == 7) also support this cpu temperature sensor.

Signed-off-by: default avatarDavid Wang <davidwang@zhaoxin.com>
[groeck: Dropped changelog, updated subject]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 415eb2a1
Loading
Loading
Loading
Loading
+18 −13
Original line number Original line Diff line number Diff line
@@ -136,6 +136,9 @@ static int via_cputemp_probe(struct platform_device *pdev)
	data->id = pdev->id;
	data->id = pdev->id;
	data->name = "via_cputemp";
	data->name = "via_cputemp";


	if (c->x86 == 7) {
		data->msr_temp = 0x1423;
	} else {
		switch (c->x86_model) {
		switch (c->x86_model) {
		case 0xA:
		case 0xA:
			/* C7 A */
			/* C7 A */
@@ -151,6 +154,7 @@ static int via_cputemp_probe(struct platform_device *pdev)
		default:
		default:
			return -ENODEV;
			return -ENODEV;
		}
		}
	}


	/* test if we can access the TEMPERATURE MSR */
	/* test if we can access the TEMPERATURE MSR */
	err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
	err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
@@ -283,6 +287,7 @@ static const struct x86_cpu_id __initconst cputemp_ids[] = {
	{ X86_VENDOR_CENTAUR, 6, 0xa, }, /* C7 A */
	{ X86_VENDOR_CENTAUR, 6, 0xa, }, /* C7 A */
	{ X86_VENDOR_CENTAUR, 6, 0xd, }, /* C7 D */
	{ X86_VENDOR_CENTAUR, 6, 0xd, }, /* C7 D */
	{ X86_VENDOR_CENTAUR, 6, 0xf, }, /* Nano */
	{ X86_VENDOR_CENTAUR, 6, 0xf, }, /* Nano */
	{ X86_VENDOR_CENTAUR, 7, X86_MODEL_ANY, },
	{}
	{}
};
};
MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);
MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);