Lines 169-174
struct acpi_ibm_softc {
Link Here
|
169 |
int light_get_supported; |
169 |
int light_get_supported; |
170 |
int light_set_supported; |
170 |
int light_set_supported; |
171 |
|
171 |
|
|
|
172 |
/* USB power workaround */ |
173 |
ACPI_HANDLE power_handle; |
174 |
|
172 |
/* led(4) interface */ |
175 |
/* led(4) interface */ |
173 |
struct cdev *led_dev; |
176 |
struct cdev *led_dev; |
174 |
int led_busy; |
177 |
int led_busy; |
Lines 365-370
acpi_ibm_attach(device_t dev)
Link Here
|
365 |
{ |
368 |
{ |
366 |
struct acpi_ibm_softc *sc; |
369 |
struct acpi_ibm_softc *sc; |
367 |
devclass_t ec_devclass; |
370 |
devclass_t ec_devclass; |
|
|
371 |
ACPI_STATUS status; |
368 |
|
372 |
|
369 |
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); |
373 |
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); |
370 |
|
374 |
|
Lines 448-453
acpi_ibm_attach(device_t dev)
Link Here
|
448 |
if (sc->light_set_supported) |
452 |
if (sc->light_set_supported) |
449 |
sc->led_dev = led_create_state(ibm_led, sc, "thinklight", sc->light_val); |
453 |
sc->led_dev = led_create_state(ibm_led, sc, "thinklight", sc->light_val); |
450 |
|
454 |
|
|
|
455 |
/* |
456 |
* Obtain a handle to the power resource available on many models. |
457 |
* This must be turned on manually upon resume. Otherwise the system |
458 |
* may, for instance, resume from S3 with usb(4) powered down. |
459 |
*/ |
460 |
status = AcpiGetHandle(sc->handle, "\\_SB.PCI0.LPC.EC.PUBS", &sc->power_handle); |
461 |
if (ACPI_FAILURE(status)) { |
462 |
if (bootverbose) { |
463 |
device_printf(dev, "Failed to get power handle: %s\n", |
464 |
AcpiFormatException(status)); |
465 |
} |
466 |
sc->power_handle = NULL; |
467 |
} |
468 |
|
451 |
return (0); |
469 |
return (0); |
452 |
} |
470 |
} |
453 |
|
471 |
|
Lines 476-481
static int
Link Here
|
476 |
acpi_ibm_resume(device_t dev) |
494 |
acpi_ibm_resume(device_t dev) |
477 |
{ |
495 |
{ |
478 |
struct acpi_ibm_softc *sc = device_get_softc(dev); |
496 |
struct acpi_ibm_softc *sc = device_get_softc(dev); |
|
|
497 |
ACPI_STATUS status; |
479 |
|
498 |
|
480 |
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); |
499 |
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); |
481 |
|
500 |
|
Lines 495-500
acpi_ibm_resume(device_t dev)
Link Here
|
495 |
|
514 |
|
496 |
acpi_ibm_sysctl_set(sc, i, val); |
515 |
acpi_ibm_sysctl_set(sc, i, val); |
497 |
} |
516 |
} |
|
|
517 |
if (sc->power_handle != NULL) { |
518 |
status = AcpiEvaluateObject(sc->power_handle, |
519 |
"_ON", NULL, NULL); |
520 |
if (ACPI_FAILURE(status)) { |
521 |
device_printf(dev, "failed to switch %s on: %s\n", |
522 |
acpi_name(sc->power_handle), |
523 |
AcpiFormatException(status)); |
524 |
} |
525 |
} |
498 |
ACPI_SERIAL_END(ibm); |
526 |
ACPI_SERIAL_END(ibm); |
499 |
|
527 |
|
500 |
return (0); |
528 |
return (0); |