From nobody Mon Jul 25 16:04:35 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ls4cM3wFlz4Xpxb; Mon, 25 Jul 2022 16:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ls4cM3MGVz3Qhj; Mon, 25 Jul 2022 16:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658765075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7lanlvgskqkipE3sMYefuw+R8bBZQ0Ujm5P7hG28cZY=; b=eTB4YnCrNUnICvmkjFDPEnlETHhS9Nvn97a7RH5QZF9whc55WhmkiztnX+GwIdJiY/1xtF Z/vECx4vs0VHQ4sS9eiBFn4nCQkhmj2tyAiLHc0kmUc5rUz8+1iDWXFmyPGPSoRNXRVYZA 6AVm8HEWTevvejW0QduATIIP13lvGyCAcK4RI+NYxmQIJpq3xcioHHuGXdCth/IwkT74Ye 0JW9CI/PHxZ8rDDCcxj973lnMOve3H/XqGd4Tj3HhtlbTjszEmsdx0dkIlGbmdLzaH2VX8 aNjAPrrxmlugKyyFnpbbdco//mLFc+3GRJt8Lpt9NyYWX3rD2tDaTSokso7tOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ls4cM2N5Yz13LT; Mon, 25 Jul 2022 16:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26PG4Z36097861; Mon, 25 Jul 2022 16:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26PG4ZPn097860; Mon, 25 Jul 2022 16:04:35 GMT (envelope-from git) Date: Mon, 25 Jul 2022 16:04:35 GMT Message-Id: <202207251604.26PG4ZPn097860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3416f5cde7a7 - main - asmc: Add support for MacBookPro6,2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3416f5cde7a7e01b25b5f5fd240ae8aa12fd70bf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658765075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7lanlvgskqkipE3sMYefuw+R8bBZQ0Ujm5P7hG28cZY=; b=E0rr3pDa46jsUBIXDNZXnMMq44A9rN9twFBm6FoEZYBH16U+7HTcK7KefQHyKOMd2WNTcJ jkpeNJ0QhY8G4+8/qSyDlkbQnO2dFPnWD8swaJ3mPz3eOel3U2Xd+caUvL1QfIhSWgDRt3 hPhzDjOGwpKhV7aEfpfgrdRyNvpX5nOaaKmefePGG+8n9jYl+9JxhduTZjbcSZx836VkQv PIt/UDJGt+3Vy77TJDeo/Uxx2U+2ylDurMA3JHz8k5mPLv7P/CcZ3RYN+kM0okd92cyKy7 tss6MvExWHIImE2MN6K2uLfD3RwIHC24BSOwRt485RiGURbRt0FidwDgUKmxmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658765075; a=rsa-sha256; cv=none; b=AYI8KE6HOZsrSdAq59P1rFbxXaIHQMmyB5WWZFSxB3yMYWvDdiQG+LK61ggPPIDtxrC/ji TV6z9wYVa1RdY8mCWQDLR3SX739O2j5d0dVbl2LjyHNjg6N81bfcsO49fQ73DO1LWXC7yY SrpUUHwiXUEaSIwMgqWolG3AhA5Lnzg3IALjHOwmHmzh6tg2o7d2m4M+f22UDTdGy336hW 2tkPFR7HKkADZ384ZBXXuBiUfgSYitUse9TkTpjOQMuzukBXJJoYeGKmcGHslkL75WGTA6 1ZaoC194OwtPeFvkHwdElETXPWIVyRkjj34pCSv4sywc2N959xF2UygMOhEmLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3416f5cde7a7e01b25b5f5fd240ae8aa12fd70bf commit 3416f5cde7a7e01b25b5f5fd240ae8aa12fd70bf Author: ed crowe AuthorDate: 2022-07-25 15:35:46 +0000 Commit: Mark Johnston CommitDate: 2022-07-25 15:43:56 +0000 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 --- sys/dev/asmc/asmc.c | 18 +++++++++++++++++- sys/dev/asmc/asmcvar.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) 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 @@ -226,6 +226,12 @@ static const struct asmc_model asmc_models[] = { ASMC_MBP5_TEMPS, ASMC_MBP5_TEMPNAMES, ASMC_MBP5_TEMPDESCS }, + { + "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, @@ -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 @@ -109,6 +109,11 @@ struct asmc_softc { #define ASMC_SMS_INTHA 0x6f /* High Acceleration Interrupt */ #define ASMC_SMS_INTSH 0x80 /* Shock Interrupt */ +/* + * Light Sensor. + */ +#define ASMC_ALSL_INT2A 0x2a /* Ambient Light related Interrupt */ + /* * Keyboard backlight. */ @@ -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", \