diff options
| -rw-r--r-- | share/man/man4/Makefile | 2 | ||||
| -rw-r--r-- | share/man/man4/acpi_aiboost.4 | 102 | ||||
| -rw-r--r-- | sys/conf/files | 1 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_aiboost.c | 353 | ||||
| -rw-r--r-- | sys/i386/conf/NOTES | 3 | ||||
| -rw-r--r-- | sys/modules/acpi/Makefile | 2 | ||||
| -rw-r--r-- | sys/modules/acpi/acpi_aiboost/Makefile | 8 |
7 files changed, 1 insertions, 470 deletions
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 186421128b72..a48d78009cef 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -3,7 +3,6 @@ MAN= aac.4 \ acpi.4 \ - ${_acpi_aiboost.4} \ ${_acpi_asus.4} \ ${_acpi_dock.4} \ ${_acpi_fujitsu.4} \ @@ -629,7 +628,6 @@ MLINKS+=xl.4 if_xl.4 MLINKS+=zyd.4 if_zyd.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -_acpi_aiboost.4=acpi_aiboost.4 _acpi_asus.4= acpi_asus.4 _acpi_dock.4= acpi_dock.4 _acpi_fujitsu.4=acpi_fujitsu.4 diff --git a/share/man/man4/acpi_aiboost.4 b/share/man/man4/acpi_aiboost.4 deleted file mode 100644 index a4631a89c71e..000000000000 --- a/share/man/man4/acpi_aiboost.4 +++ /dev/null @@ -1,102 +0,0 @@ -.\" $NetBSD: aiboost.4,v 1.2 2007/03/14 07:10:51 wiz Exp $ -.\" -.\" Copyright (c) 2007 Takanori Watanabe -.\" Copyright (c) 2007 Juan Romero Pardines -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd March 14, 2007 -.Dt ACPI_AIBOOST 4 -.Os -.Sh NAME -.Nm acpi_aiboost -.Nd ASUS AI Booster hardware monitor -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device acpi_aiboost" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -acpi_aiboost_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for monitoring the hardware sensors in recent -.Tn ASUS -motherboards. -The driver uses ACPI as the backend to fetch sensor values and -descriptions and provides its data via the -.Xr sysctl 8 -interface, under dev.acpi_aiboost.0 namespace. -Descriptions for these values are available -with sysctl -d. -.Pp -The -.Nm -driver typically has 7 sensors, depending on the motherboard and -chipset: -.Bl -column "Sensor" "Units" "Typical" -offset indent -.It Sy "Sensor" Ta Sy "Units" Ta Sy "Typical Use" -.It Li "CPU" Ta "uK" Ta "CPU Temperature" -.It Li "MB" Ta "uK" Ta "MB Temperature" -.It Li "VCC" Ta "uV DC" Ta "Core Voltage" -.It Li "+3.3V" Ta "uV DC" Ta "+3.3 Voltage" -.It Li "+5V" Ta "uV DC" Ta "+5 Voltage" -.It Li "+12V" Ta "uV DC" Ta "+12 Voltage" -.It Li "CPU" Ta "RPM" Ta "CPU Fan" -.El -.Sh SEE ALSO -.Xr acpi 4 , -.Xr sysctl.conf 5 -.Xr sysctl 8 -.Sh HISTORY -The -.Nm -driver first appeared in -.Fx 7.0 . -.Sh AUTHORS -.An -nosplit -The -.Nm -driver was written by -.An Takanori Watanabe . -This manual page was written by -.An Juan Romero Pardines , -who adapted the code for -.Nx , -and adopted back to FreeBSD by -.An Takanori Watanabe . -.Sh BUGS -It's possible to modify voltages via the ACPI methods in the DSDT, -but for now the driver only reports the sensors' values. -CPU Q-Fan is another thing that is typically specified in the ACPI -namespace, and in the future we should handle this feature (to -enable or disable automatic/manual fan mode). diff --git a/sys/conf/files b/sys/conf/files index e85e31cace0c..7a3f70b8180d 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -428,7 +428,6 @@ dev/aac/aac_disk.c optional aac dev/aac/aac_linux.c optional aac compat_linux dev/aac/aac_pci.c optional aac pci dev/acpi_support/acpi_wmi.c optional acpi_wmi acpi -dev/acpi_support/acpi_aiboost.c optional acpi_aiboost acpi dev/acpi_support/acpi_asus.c optional acpi_asus acpi dev/acpi_support/acpi_fujitsu.c optional acpi_fujitsu acpi dev/acpi_support/acpi_hp.c optional acpi_hp acpi diff --git a/sys/dev/acpi_support/acpi_aiboost.c b/sys/dev/acpi_support/acpi_aiboost.c deleted file mode 100644 index ab7433b54481..000000000000 --- a/sys/dev/acpi_support/acpi_aiboost.c +++ /dev/null @@ -1,353 +0,0 @@ -/*- - * Copyright (c) 2006 Takanori Watanabe - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "opt_acpi.h" -#include <sys/param.h> -#include <sys/kernel.h> -#include <sys/bus.h> - -#include <contrib/dev/acpica/include/acpi.h> - -#include "acpi_if.h" -#include <sys/module.h> -#include <dev/acpica/acpivar.h> -#include <sys/sysctl.h> -#include <sys/malloc.h> -#include <sys/sysctl.h> - -#define _COMPONENT ACPI_OEM -ACPI_MODULE_NAME("AIBOOST") - -#define DESCSTRLEN 32 - -struct acpi_aiboost_element { - uint32_t id; - char desc[DESCSTRLEN]; -}; - -ACPI_SERIAL_DECL(aiboost, "ACPI AIBOOST"); - -struct acpi_aiboost_component { - u_int num; - struct acpi_aiboost_element elem[0]; -}; - -struct acpi_aiboost_softc { - int pid; - struct acpi_aiboost_component *temp; - struct acpi_aiboost_component *volt; - struct acpi_aiboost_component *fan; -}; - -static int acpi_aiboost_probe(device_t dev); -static int acpi_aiboost_attach(device_t dev); -static int acpi_aiboost_detach(device_t dev); - -static device_method_t acpi_aiboost_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, acpi_aiboost_probe), - DEVMETHOD(device_attach, acpi_aiboost_attach), - DEVMETHOD(device_detach, acpi_aiboost_detach), - - {0, 0} -}; - -static driver_t acpi_aiboost_driver = { - "acpi_aiboost", - acpi_aiboost_methods, - sizeof(struct acpi_aiboost_softc), -}; - -static devclass_t acpi_aiboost_devclass; - -DRIVER_MODULE(acpi_aiboost, acpi, acpi_aiboost_driver, acpi_aiboost_devclass, - 0, 0); -MODULE_DEPEND(acpi_aiboost, acpi, 1, 1, 1); - -static char *abs_id[] = {"ATK0110", NULL}; - -/* VSIF, RVLT, SVLT, TSIF, RTMP, STMP, FSIF, RFAN, SFAN */ - -static ACPI_STATUS -acpi_aiboost_getcomponent(device_t dev, char *name, - struct acpi_aiboost_component **comp) -{ - ACPI_BUFFER buf, buf2; - ACPI_OBJECT *elem, *o, *subobj; - ACPI_STATUS status; - struct acpi_aiboost_component *c; - int i; - - c = NULL; - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - buf2.Pointer = NULL; - status = AcpiEvaluateObject(acpi_get_handle(dev), name, NULL, &buf); - - if (ACPI_FAILURE(status)) - return (status); - - o = buf.Pointer; - if (o->Type != ACPI_TYPE_PACKAGE) { - device_printf(dev, "%s is not a package\n", name); - goto error; - } - - elem = o->Package.Elements; - if (elem->Type != ACPI_TYPE_INTEGER) { - device_printf(dev, "First item in %s is not a count\n", name); - goto error; - } - - if (elem->Integer.Value != o->Package.Count - 1) { - device_printf(dev, "Device count mismatch in %s\n", name); - goto error; - } - - c = malloc(sizeof(struct acpi_aiboost_component) + - sizeof(struct acpi_aiboost_element) * elem->Integer.Value, M_DEVBUF, - M_WAITOK | M_ZERO); - *comp = c; - c->num = elem->Integer.Value; - - for (i = 1; i < o->Package.Count; i++) { - elem = &o->Package.Elements[i]; - if (elem->Type == ACPI_TYPE_ANY) { - buf2.Pointer = NULL; - buf2.Length = ACPI_ALLOCATE_BUFFER; - - status = AcpiEvaluateObject(elem->Reference.Handle, - NULL, NULL, &buf2); - if (ACPI_FAILURE(status)) { - device_printf(dev, - "Failed to fetch object for %s\n", name); - goto error; - } - subobj = buf2.Pointer; - } else if (elem->Type == ACPI_TYPE_PACKAGE) - subobj = elem; - else { - device_printf(dev, - "Subitem %d was not a package for %s\n", i, name); - goto error; - } - status = acpi_PkgInt32(subobj, 0, &c->elem[i - 1].id); - if (ACPI_FAILURE(status)) { - device_printf(dev, - "Failed to fetch ID for subobject %d in %s\n", i, - name); - goto error; - } - status = acpi_PkgStr(subobj, 1, c->elem[i - 1].desc, - sizeof(c->elem[i - 1].desc)); - if (ACPI_FAILURE(status)){ - if (status == E2BIG) { - c->elem[i - 1].desc[DESCSTRLEN-1] = 0; - } else { - device_printf(dev, - "Failed to fetch description for subobject %d in %s\n", - i, name); - goto error; - } - } - - if (buf2.Pointer) { - AcpiOsFree(buf2.Pointer); - buf2.Pointer = NULL; - } - } - - if (buf.Pointer) - AcpiOsFree(buf.Pointer); - - return (0); - -error: - if (buf.Pointer) - AcpiOsFree(buf.Pointer); - if (buf2.Pointer) - AcpiOsFree(buf2.Pointer); - if (c) - free(c, M_DEVBUF); - return (AE_BAD_DATA); -} - -static int -acpi_aiboost_get_value(ACPI_HANDLE handle, char *path, UINT32 number) -{ - ACPI_OBJECT arg1, *ret; - ACPI_OBJECT_LIST args; - ACPI_BUFFER buf; - int val; - - arg1.Type = ACPI_TYPE_INTEGER; - arg1.Integer.Value = number; - args.Count = 1; - args.Pointer = &arg1; - buf.Length = ACPI_ALLOCATE_BUFFER; - buf.Pointer = NULL; - if (ACPI_FAILURE(AcpiEvaluateObject(handle, path, &args, &buf))) - return (-1); - - ret = buf.Pointer; - if (ret->Type == ACPI_TYPE_INTEGER) - val = ret->Integer.Value; - else - val = -1; - - AcpiOsFree(buf.Pointer); - return (val); -} - - -static int -acpi_aiboost_temp_sysctl(SYSCTL_HANDLER_ARGS) -{ - device_t dev; - int error, val; - - dev = arg1; - ACPI_SERIAL_BEGIN(aiboost); - val = acpi_aiboost_get_value(acpi_get_handle(dev), "RTMP", arg2); - error = sysctl_handle_int(oidp, &val, 0, req); - ACPI_SERIAL_END(aiboost); - return (error); -} - -static int -acpi_aiboost_volt_sysctl(SYSCTL_HANDLER_ARGS) -{ - device_t dev; - int error, val; - - dev = arg1; - ACPI_SERIAL_BEGIN(aiboost); - val = acpi_aiboost_get_value(acpi_get_handle(dev), "RVLT", arg2); - error = sysctl_handle_int(oidp, &val, 0, req); - ACPI_SERIAL_END(aiboost); - return (error); -} - -static int -acpi_aiboost_fan_sysctl(SYSCTL_HANDLER_ARGS) -{ - device_t dev; - int error, val; - - dev = arg1; - ACPI_SERIAL_BEGIN(aiboost); - val = acpi_aiboost_get_value(acpi_get_handle(dev), "RFAN", arg2); - error = sysctl_handle_int(oidp, &val, 0, req); - ACPI_SERIAL_END(aiboost); - return (error); -} - -static int -acpi_aiboost_probe(device_t dev) -{ - - if (ACPI_ID_PROBE(device_get_parent(dev), dev, abs_id) == NULL) - return (ENXIO); - - device_set_desc(dev, "ASUStek AIBOOSTER"); - return (0); -} - -static int -acpi_aiboost_attach(device_t dev) -{ - struct acpi_aiboost_softc *sc; - char nambuf[16]; - int i; - - sc = device_get_softc(dev); - if (ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "TSIF", &sc->temp))) - goto error; - for (i = 0; i < sc->temp->num; i++) { - snprintf(nambuf, sizeof(nambuf), "temp%d", i); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - nambuf, CTLTYPE_INT | CTLFLAG_RD, dev, sc->temp->elem[i].id, - acpi_aiboost_temp_sysctl, "I", sc->temp->elem[i].desc); - } - - if (ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "VSIF", &sc->volt))) - goto error; - for (i = 0; i < sc->volt->num; i++) { - snprintf(nambuf, sizeof(nambuf), "volt%d", i); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - nambuf, CTLTYPE_INT | CTLFLAG_RD, dev, sc->volt->elem[i].id, - acpi_aiboost_volt_sysctl, "I", sc->volt->elem[i].desc); - } - - if (ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "FSIF", &sc->fan))) - goto error; - for (i = 0; i < sc->fan->num; i++) { - snprintf(nambuf, sizeof(nambuf), "fan%d", i); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - nambuf, CTLTYPE_INT | CTLFLAG_RD, dev, sc->fan->elem[i].id, - acpi_aiboost_fan_sysctl, "I", sc->fan->elem[i].desc); - } - - return (0); - error: - return (EINVAL); -} - -static int -acpi_aiboost_detach(device_t dev) -{ - struct acpi_aiboost_softc *sc; - - sc = device_get_softc(dev); - if (sc->temp) - free(sc->temp, M_DEVBUF); - if (sc->volt) - free(sc->volt, M_DEVBUF); - if (sc->fan) - free(sc->fan, M_DEVBUF); - return (0); -} - -#if 0 -static int -acpi_aiboost_suspend(device_t dev) -{ - struct acpi_aiboost_softc *sc = device_get_softc(dev); - return (0); -} - -static int -acpi_aiboost_resume(device_t dev) -{ - return (0); -} -#endif diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index e9f791d536f4..b4f8ee80bc81 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -482,9 +482,6 @@ options ACPI_DEBUG # ACPI WMI Mapping driver device acpi_wmi -# ACPI Asus Desktop Extras. (voltage, temp, fan) -device acpi_aiboost - # ACPI Asus Extras (LCD backlight/brightness, video output, etc.) device acpi_asus diff --git a/sys/modules/acpi/Makefile b/sys/modules/acpi/Makefile index c9480946ca70..a68504fdf627 100644 --- a/sys/modules/acpi/Makefile +++ b/sys/modules/acpi/Makefile @@ -4,7 +4,7 @@ SUBDIR= acpi .endif -SUBDIR+= acpi_aiboost acpi_asus acpi_fujitsu acpi_hp acpi_ibm \ +SUBDIR+= acpi_asus acpi_fujitsu acpi_hp acpi_ibm \ acpi_panasonic acpi_sony acpi_toshiba acpi_video \ acpi_dock acpi_wmi aibs diff --git a/sys/modules/acpi/acpi_aiboost/Makefile b/sys/modules/acpi/acpi_aiboost/Makefile deleted file mode 100644 index e4a96c10d018..000000000000 --- a/sys/modules/acpi/acpi_aiboost/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../dev/acpi_support - -KMOD= acpi_aiboost -SRCS= acpi_aiboost.c opt_acpi.h device_if.h bus_if.h acpi_if.h - -.include <bsd.kmod.mk> |
