Created
September 21, 2011 00:14
-
-
Save xqms/1230801 to your computer and use it in GitHub Desktop.
Redock Thinkpad UltraBay - http://xqms.github.com/blog/redock_thinkpad_ultrabay.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void eject_dock(struct dock_station *ds) | |
{ | |
struct acpi_object_list arg_list; | |
union acpi_object arg; | |
acpi_status status; | |
acpi_handle tmp; | |
/* all dock devices should have _EJ0, but check anyway */ | |
status = acpi_get_handle(ds->handle, "_EJ0", &tmp); | |
if (ACPI_FAILURE(status)) { | |
pr_debug("No _EJ0 support for dock device\n"); | |
return; | |
} | |
arg_list.count = 1; | |
arg_list.pointer = &arg; | |
arg.type = ACPI_TYPE_INTEGER; | |
arg.integer.value = 1; | |
status = acpi_evaluate_object(ds->handle, "_EJ0", &arg_list, NULL); | |
if (ACPI_FAILURE(status)) | |
pr_debug("Failed to evaluate _EJ0!\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method (_EJ0, 1, NotSerialized) | |
{ | |
\_SB.PCI0.LPC.EC.BEJ0 (Arg0) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method (BEJ0, 1, NotSerialized) | |
{ | |
If (Arg0) | |
{ | |
BDIS () | |
LED (0x04, 0x00) | |
\BHDP (0x01, 0x00) | |
Store (0x01, BSTS) | |
If (BHKE) | |
{ | |
Store (0x00, BHKE) | |
\_SB.PCI0.LPC.EC.HKEY.MHKQ (0x3003) | |
} | |
} | |
Else | |
{ | |
LED (0x04, 0x80) | |
Store (0x00, BSTS) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method (BDIS, 0, NotSerialized) | |
{ | |
If (LNot (\_SB.PCI0.LPC.CSON)) | |
{ | |
Store (0x01, \_SB.PCI0.LPC.CSON) | |
Store (0x0F, \IDET) | |
} | |
} | |
Method (BPON, 1, NotSerialized) | |
{ | |
If (\_SB.PCI0.LPC.CSON) | |
{ | |
Store (0x00, \_SB.PCI0.LPC.CSON) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo undock > /sys/devices/platform/dock.2/undock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment