Deleted Added
full compact
acpi_toshiba.c (124442) acpi_toshiba.c (126517)
1/*-
2 * Copyright (c) 2003 Hiroyuki Aizu <aizu@navi.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 Hiroyuki Aizu <aizu@navi.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/acpi_support/acpi_toshiba.c 124442 2004-01-12 19:35:31Z njl $");
29__FBSDID("$FreeBSD: head/sys/dev/acpi_support/acpi_toshiba.c 126517 2004-03-03 03:02:17Z njl $");
30
31#include "opt_acpi.h"
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/bus.h>
35
36#include "acpi.h"
37#include <dev/acpica/acpivar.h>
38
30
31#include "opt_acpi.h"
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/bus.h>
35
36#include "acpi.h"
37#include <dev/acpica/acpivar.h>
38
39#define _COMPONENT ACPI_TOSHIBA
40ACPI_MODULE_NAME("TOSHIBA")
41
42/*
43 * Toshiba HCI interface definitions
44 *
45 * HCI is Toshiba's "Hardware Control Interface" which is supposed to
46 * be uniform across all their models. Ideally we would just call
47 * dedicated ACPI methods instead of using this primitive interface.
48 * However, the ACPI methods seem to be incomplete in some areas (for
49 * example they allow setting, but not reading, the LCD brightness

--- 158 unchanged lines hidden (view full) ---

208static int
209acpi_toshiba_attach(device_t dev)
210{
211 struct acpi_toshiba_softc *sc;
212 struct acpi_softc *acpi_sc;
213 ACPI_STATUS status;
214 int i;
215
39/*
40 * Toshiba HCI interface definitions
41 *
42 * HCI is Toshiba's "Hardware Control Interface" which is supposed to
43 * be uniform across all their models. Ideally we would just call
44 * dedicated ACPI methods instead of using this primitive interface.
45 * However, the ACPI methods seem to be incomplete in some areas (for
46 * example they allow setting, but not reading, the LCD brightness

--- 158 unchanged lines hidden (view full) ---

205static int
206acpi_toshiba_attach(device_t dev)
207{
208 struct acpi_toshiba_softc *sc;
209 struct acpi_softc *acpi_sc;
210 ACPI_STATUS status;
211 int i;
212
216 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
217
218 sc = device_get_softc(dev);
219 sc->dev = dev;
220 sc->handle = acpi_get_handle(dev);
221
222 acpi_sc = acpi_device_get_parent_softc(dev);
223 sysctl_ctx_init(&sc->sysctl_ctx);
224 sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx,
225 SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO,

--- 22 unchanged lines hidden (view full) ---

248 return (0);
249}
250
251static int
252acpi_toshiba_detach(device_t dev)
253{
254 struct acpi_toshiba_softc *sc;
255
213 sc = device_get_softc(dev);
214 sc->dev = dev;
215 sc->handle = acpi_get_handle(dev);
216
217 acpi_sc = acpi_device_get_parent_softc(dev);
218 sysctl_ctx_init(&sc->sysctl_ctx);
219 sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx,
220 SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO,

--- 22 unchanged lines hidden (view full) ---

243 return (0);
244}
245
246static int
247acpi_toshiba_detach(device_t dev)
248{
249 struct acpi_toshiba_softc *sc;
250
256 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
257
258 sc = device_get_softc(dev);
259 if (enable_fn_keys != 0) {
260 AcpiRemoveNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY,
261 acpi_toshiba_notify);
262 }
263 sysctl_ctx_free(&sc->sysctl_ctx);
264
265 return (0);

--- 222 unchanged lines hidden ---
251 sc = device_get_softc(dev);
252 if (enable_fn_keys != 0) {
253 AcpiRemoveNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY,
254 acpi_toshiba_notify);
255 }
256 sysctl_ctx_free(&sc->sysctl_ctx);
257
258 return (0);

--- 222 unchanged lines hidden ---