Deleted Added
full compact
acpi_ec.c (124091) acpi_ec.c (126560)
1/*-
2 * Copyright (c) 2003 Nate Lawson
3 * Copyright (c) 2000 Michael Smith
4 * Copyright (c) 2000 BSDi
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 2003 Nate Lawson
3 * Copyright (c) 2000 Michael Smith
4 * Copyright (c) 2000 BSDi
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/acpica/acpi_ec.c 124091 2004-01-03 02:01:39Z njl $
28 * $FreeBSD: head/sys/dev/acpica/acpi_ec.c 126560 2004-03-03 18:34:42Z njl $
29 */
30/******************************************************************************
31 *
32 * 1. Copyright Notice
33 *
34 * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights
35 * reserved.
36 *

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

132 * software, or service, directly or indirectly, to any country for which the
133 * United States government or any agency thereof requires an export license,
134 * other governmental approval, or letter of assurance, without first obtaining
135 * such license, approval or letter.
136 *
137 *****************************************************************************/
138
139#include <sys/cdefs.h>
29 */
30/******************************************************************************
31 *
32 * 1. Copyright Notice
33 *
34 * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights
35 * reserved.
36 *

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

132 * software, or service, directly or indirectly, to any country for which the
133 * United States government or any agency thereof requires an export license,
134 * other governmental approval, or letter of assurance, without first obtaining
135 * such license, approval or letter.
136 *
137 *****************************************************************************/
138
139#include <sys/cdefs.h>
140__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_ec.c 124091 2004-01-03 02:01:39Z njl $");
140__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_ec.c 126560 2004-03-03 18:34:42Z njl $");
141
142#include "opt_acpi.h"
143#include <sys/param.h>
144#include <sys/kernel.h>
145#include <sys/bus.h>
146
147#include <machine/bus.h>
148#include <machine/resource.h>

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

444 } else if (acpi_MatchHid(dev, "PNP0C09")) {
445 h = acpi_get_handle(dev);
446
447 /*
448 * Read the unit ID to check for duplicate attach and the
449 * global lock value to see if we should acquire it when
450 * accessing the EC.
451 */
141
142#include "opt_acpi.h"
143#include <sys/param.h>
144#include <sys/kernel.h>
145#include <sys/bus.h>
146
147#include <machine/bus.h>
148#include <machine/resource.h>

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

444 } else if (acpi_MatchHid(dev, "PNP0C09")) {
445 h = acpi_get_handle(dev);
446
447 /*
448 * Read the unit ID to check for duplicate attach and the
449 * global lock value to see if we should acquire it when
450 * accessing the EC.
451 */
452 status = acpi_EvaluateInteger(h, "_UID", &uid);
452 status = acpi_GetInteger(h, "_UID", &uid);
453 if (ACPI_FAILURE(status))
454 uid = 0;
453 if (ACPI_FAILURE(status))
454 uid = 0;
455 status = acpi_EvaluateInteger(h, "_GLK", &glk);
455 status = acpi_GetInteger(h, "_GLK", &glk);
456 if (ACPI_FAILURE(status))
457 glk = 0;
458
459 /*
460 * Evaluate the _GPE method to find the GPE bit used by the EC to
461 * signal status (SCI). Note that we don't handle the case where
462 * it can return a package instead of an int.
463 */
456 if (ACPI_FAILURE(status))
457 glk = 0;
458
459 /*
460 * Evaluate the _GPE method to find the GPE bit used by the EC to
461 * signal status (SCI). Note that we don't handle the case where
462 * it can return a package instead of an int.
463 */
464 status = acpi_EvaluateInteger(h, "_GPE", &gpebit);
464 status = acpi_GetInteger(h, "_GPE", &gpebit);
465 if (ACPI_FAILURE(status)) {
466 device_printf(dev, "can't evaluate _GPE - %s\n",
467 AcpiFormatException(status));
468 return (ENXIO);
469 }
470
471 /* Store the values we got from the namespace for attach. */
472 magic = glk != 0 ? DEV_GLK_FLAG : 0;

--- 478 unchanged lines hidden ---
465 if (ACPI_FAILURE(status)) {
466 device_printf(dev, "can't evaluate _GPE - %s\n",
467 AcpiFormatException(status));
468 return (ENXIO);
469 }
470
471 /* Store the values we got from the namespace for attach. */
472 magic = glk != 0 ? DEV_GLK_FLAG : 0;

--- 478 unchanged lines hidden ---