2 * Copyright (c) 2008, 2009 Michael Shalayeff
3 * Copyright (c) 2009, 2010 Hans-Joerg Hoexer
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
15 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * $FreeBSD: src/sys/dev/tpm/tpm_acpi.c,v 1.1 2010/08/12 00:16:18 takawata Exp $
21 #include <sys/param.h>
22 #include <sys/systm.h>
23 #include <sys/kernel.h>
24 #include <sys/malloc.h>
27 #include <sys/module.h>
34 #include <machine/md_var.h>
36 #include <bus/isa/isareg.h>
37 #include <bus/isa/isavar.h>
41 #include <contrib/dev/acpica/source/include/acpi.h>
42 #include <contrib/dev/acpica/source/include/accommon.h>
43 #include <dev/acpica/acpivar.h>
47 char *tpm_ids
[] = {"ATM1200", "BCM0102", "INTC0102", "SNO3504", "WEC1000",
51 tpm_acpi_probe(device_t dev
)
53 if (ACPI_ID_PROBE(device_get_parent(dev
), dev
, tpm_ids
) != NULL
) {
54 device_set_desc(dev
, "Trusted Platform Module");
55 return BUS_PROBE_DEFAULT
;
61 static device_method_t tpm_acpi_methods
[] = {
63 /*In some case, TPM existance is found only in TPCA header*/
64 DEVMETHOD(device_identify
, tpm_acpi_identify
),
67 DEVMETHOD(device_probe
, tpm_acpi_probe
),
68 DEVMETHOD(device_attach
, tpm_attach
),
69 DEVMETHOD(device_detach
, tpm_detach
),
70 DEVMETHOD(device_suspend
, tpm_suspend
),
71 DEVMETHOD(device_resume
, tpm_resume
),
74 static driver_t tpm_acpi_driver
= {
75 "tpm", tpm_acpi_methods
, sizeof(struct tpm_softc
),
78 devclass_t tpm_devclass
;
79 DRIVER_MODULE(tpm
, acpi
, tpm_acpi_driver
, tpm_devclass
, NULL
, NULL
);