acpi_lid.c (91123) | acpi_lid.c (96926) |
---|---|
1/*- 2 * Copyright (c) 2000 Takanori Watanabe <takawata@jp.freebsd.org> 3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 4 * Copyright (c) 2000 Michael Smith <msmith@freebd.org> 5 * Copyright (c) 2000 BSDi 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2000 Takanori Watanabe <takawata@jp.freebsd.org> 3 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 4 * Copyright (c) 2000 Michael Smith <msmith@freebd.org> 5 * Copyright (c) 2000 BSDi 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/dev/acpica/acpi_lid.c 91123 2002-02-23 05:26:45Z msmith $ | 29 * $FreeBSD: head/sys/dev/acpica/acpi_lid.c 96926 2002-05-19 06:16:47Z peter $ |
30 */ 31 32#include "opt_acpi.h" 33#include <sys/param.h> 34#include <sys/kernel.h> 35#include <sys/bus.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> --- 49 unchanged lines hidden (view full) --- 87 return(ENXIO); 88} 89 90static int 91acpi_lid_attach(device_t dev) 92{ 93 struct acpi_lid_softc *sc; 94 | 30 */ 31 32#include "opt_acpi.h" 33#include <sys/param.h> 34#include <sys/kernel.h> 35#include <sys/bus.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> --- 49 unchanged lines hidden (view full) --- 87 return(ENXIO); 88} 89 90static int 91acpi_lid_attach(device_t dev) 92{ 93 struct acpi_lid_softc *sc; 94 |
95 ACPI_FUNCTION_TRACE(__func__); | 95 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
96 97 sc = device_get_softc(dev); 98 sc->lid_dev = dev; 99 sc->lid_handle = acpi_get_handle(dev); 100 101 /* 102 * Install notification handler 103 */ 104 AcpiInstallNotifyHandler(sc->lid_handle, ACPI_DEVICE_NOTIFY, acpi_lid_notify_handler, sc); 105 return_VALUE(0); 106} 107 108static void 109acpi_lid_notify_status_changed(void *arg) 110{ 111 struct acpi_lid_softc *sc; 112 struct acpi_softc *acpi_sc; 113 | 96 97 sc = device_get_softc(dev); 98 sc->lid_dev = dev; 99 sc->lid_handle = acpi_get_handle(dev); 100 101 /* 102 * Install notification handler 103 */ 104 AcpiInstallNotifyHandler(sc->lid_handle, ACPI_DEVICE_NOTIFY, acpi_lid_notify_handler, sc); 105 return_VALUE(0); 106} 107 108static void 109acpi_lid_notify_status_changed(void *arg) 110{ 111 struct acpi_lid_softc *sc; 112 struct acpi_softc *acpi_sc; 113 |
114 ACPI_FUNCTION_TRACE(__func__); | 114 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
115 116 sc = (struct acpi_lid_softc *)arg; 117 118 /* 119 * Evaluate _LID and check the return value, update lid status. 120 * Zero: The lid is closed 121 * Non-zero: The lid is open 122 */ --- 20 unchanged lines hidden (view full) --- 143/* XXX maybe not here */ 144#define ACPI_NOTIFY_STATUS_CHANGED 0x80 145 146static void 147acpi_lid_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) 148{ 149 struct acpi_lid_softc *sc = (struct acpi_lid_softc *)context; 150 | 115 116 sc = (struct acpi_lid_softc *)arg; 117 118 /* 119 * Evaluate _LID and check the return value, update lid status. 120 * Zero: The lid is closed 121 * Non-zero: The lid is open 122 */ --- 20 unchanged lines hidden (view full) --- 143/* XXX maybe not here */ 144#define ACPI_NOTIFY_STATUS_CHANGED 0x80 145 146static void 147acpi_lid_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) 148{ 149 struct acpi_lid_softc *sc = (struct acpi_lid_softc *)context; 150 |
151 ACPI_FUNCTION_TRACE_U32(__func__, notify); | 151 ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); |
152 153 switch (notify) { 154 case ACPI_NOTIFY_STATUS_CHANGED: 155 AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_lid_notify_status_changed, sc); 156 break; 157 default: 158 break; /* unknown notification value */ 159 } 160 return_VOID; 161} 162 | 152 153 switch (notify) { 154 case ACPI_NOTIFY_STATUS_CHANGED: 155 AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_lid_notify_status_changed, sc); 156 break; 157 default: 158 break; /* unknown notification value */ 159 } 160 return_VOID; 161} 162 |