diff options
author | ed crowe <fbsdbug@edcrowe.com> | 2022-07-25 15:35:46 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-07-25 15:43:56 +0000 |
commit | 3416f5cde7a7e01b25b5f5fd240ae8aa12fd70bf (patch) | |
tree | da89b747fa45a7ce4f7d64f846ee82165eca3926 | |
parent | 05b6744c446c2d274738fbb27a3ded1bf9f9f1d1 (diff) | |
download | src-3416f5cde7a7e01b25b5f5fd240ae8aa12fd70bf.tar.gz src-3416f5cde7a7e01b25b5f5fd240ae8aa12fd70bf.zip |
asmc: Add support for MacBookPro6,2
Modify asmc_sms_printintr() to be silent when the ambient light sensor
interrupt fires on this model, since the messages can otherwise fill up
the dmesg.
PR: 265005
Reviewed by: markj
MFC after: 2 weeks
-rw-r--r-- | sys/dev/asmc/asmc.c | 18 | ||||
-rw-r--r-- | sys/dev/asmc/asmcvar.h | 32 |
2 files changed, 49 insertions, 1 deletions
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 37949b52afda..cd35c35cd9ce 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -227,6 +227,12 @@ static const struct asmc_model asmc_models[] = { }, { + "MacBookPro6,2", "Apple SMC MacBook Pro (Mid 2010, 15-inch)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP62_TEMPS, ASMC_MBP62_TEMPNAMES, ASMC_MBP62_TEMPDESCS + }, + + { "MacBookPro8,1", "Apple SMC MacBook Pro (early 2011, 13-inch)", ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS, ASMC_MBP81_TEMPS, ASMC_MBP81_TEMPNAMES, ASMC_MBP81_TEMPDESCS @@ -1376,6 +1382,7 @@ asmc_sms_intrfast(void *arg) static void asmc_sms_printintr(device_t dev, uint8_t type) { + struct asmc_softc *sc = device_get_softc(dev); switch (type) { case ASMC_SMS_INTFF: @@ -1387,8 +1394,17 @@ asmc_sms_printintr(device_t dev, uint8_t type) case ASMC_SMS_INTSH: device_printf(dev, "WARNING: possible shock!\n"); break; + case ASMC_ALSL_INT2A: + /* + * This suppresses console and log messages for the ambient + * light sensor for the only model known to generate this + * interrupt. + */ + if (strcmp(sc->sc_model->smc_model, "MacBookPro6,2") == 0) + break; + /* FALLTHROUGH */ default: - device_printf(dev, "%s unknown interrupt\n", __func__); + device_printf(dev, "unknown interrupt: 0x%x\n", type); } } diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 533686d0c56b..769903701a99 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -110,6 +110,11 @@ struct asmc_softc { #define ASMC_SMS_INTSH 0x80 /* Shock Interrupt */ /* + * Light Sensor. + */ +#define ASMC_ALSL_INT2A 0x2a /* Ambient Light related Interrupt */ + +/* * Keyboard backlight. */ #define ASMC_KEY_LIGHTLEFT "ALV0" /* RO; 6 bytes */ @@ -232,6 +237,33 @@ struct asmc_softc { "Heatsink 2", "Memory Controller", \ "PCI Express Slot Pin", "PCI Express Slot (unk)" } +#define ASMC_MBP62_TEMPS { "TB0T", "TB1T", "TB2T", \ + "TC0C", "TC0D", "TC0P", \ + "TC1C", "TG0D", "TG0P", \ + "TG0T", "TMCD", "TP0P", \ + "TPCD", "Th1H", "Th2H", \ + "Tm0P", "Ts0P", "Ts0S" } + +#define ASMC_MBP62_TEMPNAMES { "enclosure_bottom_0", "enclosure_bottom_1", \ + "enclosure_bottom_2", "cpu0", \ + "cpu_diode", "cpu_proximity", \ + "cpu1", "gpu_diode", \ + "gpu_pin", "gpu_transistor", \ + "TMCD", "pch_controller_proximity", \ + "pch_die", "heatsink1", \ + "heatsink2", "memory-controller", \ + "palmrest", "memoryproximity" } + +#define ASMC_MBP62_TEMPDESCS { "Enclosure Bottom 0", "Enclosure Bottom 1", \ + "Enclosure Bottom 2", "CPU 0", \ + "CPU Diode", "CPU Proximity", \ + "CPU 1", "GPU Diode", \ + "GPU Pin", "GPU Transistor", \ + "TMCD", "PCH Controller Proximity", \ + "PCH Die", "Heat Sink 1", \ + "Heat Sink 2", "Memory Controller", \ + "Palm Rest", "Memory Proximity" } + #define ASMC_MBP81_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ |