diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2010-02-22 18:49:43 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2010-02-22 18:49:43 +0000 |
commit | 90a1456b127dc6e08b46753d49261aa8ba434adc (patch) | |
tree | 97c859e453ee46415eee08e2a8201d87dd721e2a /sys/powerpc | |
parent | 41a11d8753984c313c12259d3dd9998b41cfc02c (diff) | |
download | src-test2-90a1456b127dc6e08b46753d49261aa8ba434adc.tar.gz src-test2-90a1456b127dc6e08b46753d49261aa8ba434adc.zip |
Notes
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/powermac/smu.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/powerpc/powermac/smu.c b/sys/powerpc/powermac/smu.c index f0e17d5e2c9a..26927572bad2 100644 --- a/sys/powerpc/powermac/smu.c +++ b/sys/powerpc/powermac/smu.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #include <machine/md_var.h> +#include <dev/led/led.h> #include <dev/ofw/openfirm.h> #include <dev/ofw/ofw_bus.h> #include <powerpc/powermac/macgpiovar.h> @@ -114,6 +115,8 @@ struct smu_softc { /* Thermal management parameters */ int sc_target_temp; /* Default 55 C */ int sc_critical_temp; /* Default 90 C */ + + struct cdev *sc_leddev; }; /* regular bus attachment functions */ @@ -133,6 +136,7 @@ static int smu_get_datablock(device_t dev, int8_t id, uint8_t *buf, static void smu_attach_fans(device_t dev, phandle_t fanroot); static void smu_attach_sensors(device_t dev, phandle_t sensroot); static void smu_fanmgt_callout(void *xdev); +static void smu_set_sleepled(void *xdev, int onoff); /* where to find the doorbell GPIO */ @@ -292,6 +296,11 @@ smu_attach(device_t dev) callout_init(&sc->sc_fanmgt_callout, 1); smu_fanmgt_callout(dev); + /* + * Set up LED interface + */ + sc->sc_leddev = led_create(smu_set_sleepled, dev, "sleepled"); + return (0); } @@ -853,3 +862,18 @@ smu_fanmgt_callout(void *xdev) { ms_to_ticks(SMU_FANMGT_INTERVAL), smu_fanmgt_callout, smu); } +static void +smu_set_sleepled(void *xdev, int onoff) +{ + struct smu_cmd cmd; + device_t smu = xdev; + + cmd.cmd = SMU_MISC; + cmd.len = 3; + cmd.data[0] = SMU_MISC_LED_CTRL; + cmd.data[1] = 0; + cmd.data[2] = onoff; + + smu_run_cmd(smu, &cmd); +} + |