aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2026-01-04 08:27:57 +0000
committerEnji Cooper <ngie@FreeBSD.org>2026-01-06 01:43:04 +0000
commitf224591746bdaf14ad5f63de4738a3146cc2f55f (patch)
treee0dc38e0ea3d73ec42961a75f8a92e6e061f55be /sys/dev
parent12c51484188f88bcabc5b38ca8523fcde76830a6 (diff)
Add ASMC_DEBUG make option
This allows folks to enable debug statements in asmc(4) using kernel configs via the `options ASMC_DEBUG` directive. While here, remove a duplicate `device vt_efifb` directive in `NOTES` as it's already handled in the `GENERIC` config MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54511
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/asmc/asmc.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
index 0572c8e663a7..5d3b97a065c9 100644
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -34,6 +34,8 @@
* Inspired by the Linux applesmc driver.
*/
+#include "opt_asmc.h"
+
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/conf.h>
@@ -83,7 +85,7 @@ static void asmc_sms_calibrate(device_t dev);
static int asmc_sms_intrfast(void *arg);
static void asmc_sms_printintr(device_t dev, uint8_t);
static void asmc_sms_task(void *arg, int pending);
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
void asmc_dumpall(device_t);
static int asmc_key_dump(device_t, int);
#endif
@@ -515,7 +517,7 @@ static driver_t asmc_driver = {
*/
#define _COMPONENT ACPI_OEM
ACPI_MODULE_NAME("ASMC")
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
#define ASMC_DPRINTF(str) device_printf(dev, str)
#else
#define ASMC_DPRINTF(str)
@@ -828,7 +830,7 @@ asmc_resume(device_t dev)
return (0);
}
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
void asmc_dumpall(device_t dev)
{
struct asmc_softc *sc = device_get_softc(dev);
@@ -939,7 +941,7 @@ nosms:
sc->sc_nkeys = 0;
}
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
asmc_dumpall(dev);
#endif
@@ -974,19 +976,19 @@ asmc_wait_ack(device_t dev, uint8_t val, int amount)
static int
asmc_wait(device_t dev, uint8_t val)
{
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
struct asmc_softc *sc;
#endif
if (asmc_wait_ack(dev, val, 1000) == 0)
return (0);
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
sc = device_get_softc(dev);
#endif
val = val & ASMC_STATUS_MASK;
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
device_printf(dev, "%s failed: 0x%x, 0x%x\n", __func__, val,
ASMC_CMDPORT_READ(sc));
#endif
@@ -1009,7 +1011,7 @@ asmc_command(device_t dev, uint8_t command) {
}
}
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
device_printf(dev, "%s failed: 0x%x, 0x%x\n", __func__, command,
ASMC_CMDPORT_READ(sc));
#endif
@@ -1055,7 +1057,7 @@ out:
return (error);
}
-#ifdef DEBUG
+#ifdef ASMC_DEBUG
static int
asmc_key_dump(device_t dev, int number)
{