git: 601abb300ce8 - main - asmc: Add support for Macmini 5,1 (2011) and 5,3 and 7,1 (2014) models

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 04 May 2022 15:33:55 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=601abb300ce8b28d84c300e70881039d943c28b9

commit 601abb300ce8b28d84c300e70881039d943c28b9
Author:     Trev <fbsdbugs4@sentry.org>
AuthorDate: 2022-05-04 15:00:40 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-05-04 15:31:01 +0000

    asmc: Add support for Macmini 5,1 (2011) and 5,3 and 7,1 (2014) models
    
    PR:             262456
    MFC after:      2 weeks
---
 sys/dev/asmc/asmc.c    | 31 ++++++++++++++++++++++++++++++-
 sys/dev/asmc/asmcvar.h | 31 +++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
index 9f18c7271042..8ca9d1486749 100644
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -298,8 +298,18 @@ static const struct asmc_model asmc_models[] = {
 	  ASMC_MM41_TEMPS, ASMC_MM41_TEMPNAMES, ASMC_MM41_TEMPDESCS
 	},
 
+	/* The Mac Mini 5,1 has no SMS */
+	/* - same sensors as Mac Mini 5,2 */
+	{
+	  "Macmini5,1", "Apple SMC Mac Mini 5,1",
+	  NULL, NULL, NULL,
+	  ASMC_FAN_FUNCS2,
+	  NULL, NULL, NULL,
+	  ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS
+	},
+
 	/* The Mac Mini 5,2 has no SMS */
-	{ 
+	{
 	  "Macmini5,2", "Apple SMC Mac Mini 5,2",
 	  NULL, NULL, NULL,
 	  ASMC_FAN_FUNCS2,
@@ -307,6 +317,25 @@ static const struct asmc_model asmc_models[] = {
 	  ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS
 	},
 
+	/* The Mac Mini 5,3 has no SMS */
+	/* - same sensors as Mac Mini 5,2 */
+	{
+	  "Macmini5,3", "Apple SMC Mac Mini 5,3",
+	  NULL, NULL, NULL,
+	  ASMC_FAN_FUNCS2,
+	  NULL, NULL, NULL,
+	  ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS
+	},
+
+	/* The Mac Mini 7,1 has no SMS */
+	{
+	  "Macmini7,1", "Apple SMC Mac Mini 7,1",
+	  NULL, NULL, NULL,
+	  ASMC_FAN_FUNCS2,
+	  NULL, NULL, NULL,
+	  ASMC_MM71_TEMPS, ASMC_MM71_TEMPNAMES, ASMC_MM71_TEMPDESCS
+	},
+
 	/* Idem for the Mac Pro "Quad Core" (original) */
 	{
 	  "MacPro1,1", "Apple SMC Mac Pro (Quad Core)",
diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h
index 55f309208bf2..2b981f1bd6c6 100644
--- a/sys/dev/asmc/asmcvar.h
+++ b/sys/dev/asmc/asmcvar.h
@@ -475,6 +475,37 @@ struct asmc_softc {
 				  "Power Supply Temperature", \
 				  "Wireless Module Proximity Temperature", }
 
+#define ASMC_MM71_TEMPS		{ "TA0p", "TA1p", \
+				  "TA2p", "TC0c", \
+				  "TC0p", "TC1c", \
+				  "TCGc", "TCSc", \
+				  "TCXC", "TCXR", \
+				  "TM0p", "TPCd", \
+				  "TW0p", "Te0T", \
+				  "Tm0P", NULL }
+
+#define ASMC_MM71_TEMPNAMES	{ "ambient_air1", "ambient_air2", \
+				  "ambient_air3", "cpu_core1_peci", \
+				  "cpu_proximity", "cpu_core2_peci", \
+				  "intel_gpu", "cpu_sa_core_peci", \
+				  "cpu_core", "cpu_peci_dts", \
+				  "memory_proximity", "pch_controller_die", \
+				  "wireless_proximity", "thunderbolt_diode", \
+				  "logic_board", }
+
+#define ASMC_MM71_TEMPDESCS	{ "Ambient Air Temperature 1", \
+				  "Ambient Air Temperature 2", \
+				  "Ambient Air Temperature 3", \
+				  "CPU Core 1 PECI Temperature", "CPU Proximity Temperature", \
+				  "CPU Core 2 PECI Temperature", "Intel GPU Temperature", \
+				  "CPU System Agent Core PECI Temperature", \
+				  "CPU Core Temperature", "CPU PECI DTS Temperature", \
+				  "Memory Proximity Temperature", \
+				  "Platform Controller Hub Die Temperature", \
+				  "Wireless Module Proximity Temperature", \
+				  "Thunderbolt Diode Temperature", \
+				  "Logic Board temperature", }
+
 #define ASMC_MP1_TEMPS		{ "TA0P", \
 				  "TCAH", "TCBH", \
 				  "TC0P", "TC0C", "TC1C", \