Loading drivers/acpi/Kconfig +11 −0 Original line number Original line Diff line number Diff line Loading @@ -243,6 +243,17 @@ config ACPI_IBM_DOCK If you are not sure, say N here. If you are not sure, say N here. config ACPI_IBM_BAY bool "Legacy Removable Bay Support" depends on ACPI_IBM default y ---help--- Allows the ibm_acpi driver to handle removable bays. It will allow disabling the device in the bay, and also generate notifications when the bay lever is ejected or inserted. If you are not sure, say Y here. config ACPI_TOSHIBA config ACPI_TOSHIBA tristate "Toshiba Laptop Extras" tristate "Toshiba Laptop Extras" depends on X86 depends on X86 Loading drivers/acpi/ibm_acpi.c +26 −2 Original line number Original line Diff line number Diff line Loading @@ -86,6 +86,7 @@ #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/backlight.h> #include <linux/backlight.h> #include <linux/fb.h> #include <asm/uaccess.h> #include <asm/uaccess.h> #include <linux/dmi.h> #include <linux/dmi.h> Loading Loading @@ -157,6 +158,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ "\\_SB.PCI.ISA.SLCE", /* 570 */ "\\_SB.PCI.ISA.SLCE", /* 570 */ ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ #endif #endif #ifdef CONFIG_ACPI_IBM_BAY IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ Loading @@ -174,6 +176,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */ IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ "_EJ0", /* 770x */ "_EJ0", /* 770x */ ); /* all others */ ); /* all others */ #endif /* CONFIG_ACPI_IBM_BAY */ /* don't list other alternatives as we install a notify handler on the 570 */ /* don't list other alternatives as we install a notify handler on the 570 */ IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ Loading Loading @@ -1044,6 +1047,7 @@ static int light_write(char *buf) return 0; return 0; } } #if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY) static int _sta(acpi_handle handle) static int _sta(acpi_handle handle) { { int status; int status; Loading @@ -1053,6 +1057,7 @@ static int _sta(acpi_handle handle) return status; return status; } } #endif #ifdef CONFIG_ACPI_IBM_DOCK #ifdef CONFIG_ACPI_IBM_DOCK #define dock_docked() (_sta(dock_handle) & 1) #define dock_docked() (_sta(dock_handle) & 1) Loading Loading @@ -1119,6 +1124,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event) } } #endif #endif #ifdef CONFIG_ACPI_IBM_BAY static int bay_status_supported; static int bay_status_supported; static int bay_status2_supported; static int bay_status2_supported; static int bay_eject_supported; static int bay_eject_supported; Loading Loading @@ -1194,6 +1200,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event) { { acpi_bus_generate_event(ibm->device, event, 0); acpi_bus_generate_event(ibm->device, event, 0); } } #endif /* CONFIG_ACPI_IBM_BAY */ static int cmos_read(char *p) static int cmos_read(char *p) { { Loading Loading @@ -1701,7 +1708,10 @@ static int brightness_write(char *buf) static int brightness_update_status(struct backlight_device *bd) static int brightness_update_status(struct backlight_device *bd) { { return brightness_set(bd->props.brightness); return brightness_set( (bd->props.fb_blank == FB_BLANK_UNBLANK && bd->props.power == FB_BLANK_UNBLANK) ? bd->props.brightness : 0); } } static struct backlight_ops ibm_backlight_data = { static struct backlight_ops ibm_backlight_data = { Loading @@ -1711,6 +1721,12 @@ static struct backlight_ops ibm_backlight_data = { static int brightness_init(void) static int brightness_init(void) { { int b; b = brightness_get(NULL); if (b < 0) return b; ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, &ibm_backlight_data); &ibm_backlight_data); if (IS_ERR(ibm_backlight_device)) { if (IS_ERR(ibm_backlight_device)) { Loading @@ -1719,6 +1735,8 @@ static int brightness_init(void) } } ibm_backlight_device->props.max_brightness = 7; ibm_backlight_device->props.max_brightness = 7; ibm_backlight_device->props.brightness = b; backlight_update_status(ibm_backlight_device); return 0; return 0; } } Loading Loading @@ -2353,6 +2371,7 @@ static struct ibm_struct ibms[] = { .type = ACPI_SYSTEM_NOTIFY, .type = ACPI_SYSTEM_NOTIFY, }, }, #endif #endif #ifdef CONFIG_ACPI_IBM_BAY { { .name = "bay", .name = "bay", .init = bay_init, .init = bay_init, Loading @@ -2362,6 +2381,7 @@ static struct ibm_struct ibms[] = { .handle = &bay_handle, .handle = &bay_handle, .type = ACPI_SYSTEM_NOTIFY, .type = ACPI_SYSTEM_NOTIFY, }, }, #endif /* CONFIG_ACPI_IBM_BAY */ { { .name = "cmos", .name = "cmos", .read = cmos_read, .read = cmos_read, Loading Loading @@ -2647,7 +2667,9 @@ IBM_PARAM(light); #ifdef CONFIG_ACPI_IBM_DOCK #ifdef CONFIG_ACPI_IBM_DOCK IBM_PARAM(dock); IBM_PARAM(dock); #endif #endif #ifdef CONFIG_ACPI_IBM_BAY IBM_PARAM(bay); IBM_PARAM(bay); #endif /* CONFIG_ACPI_IBM_BAY */ IBM_PARAM(cmos); IBM_PARAM(cmos); IBM_PARAM(led); IBM_PARAM(led); IBM_PARAM(beep); IBM_PARAM(beep); Loading Loading @@ -2723,12 +2745,14 @@ static int __init acpi_ibm_init(void) IBM_HANDLE_INIT(dock); IBM_HANDLE_INIT(dock); #endif #endif IBM_HANDLE_INIT(pci); IBM_HANDLE_INIT(pci); #ifdef CONFIG_ACPI_IBM_BAY IBM_HANDLE_INIT(bay); IBM_HANDLE_INIT(bay); if (bay_handle) if (bay_handle) IBM_HANDLE_INIT(bay_ej); IBM_HANDLE_INIT(bay_ej); IBM_HANDLE_INIT(bay2); IBM_HANDLE_INIT(bay2); if (bay2_handle) if (bay2_handle) IBM_HANDLE_INIT(bay2_ej); IBM_HANDLE_INIT(bay2_ej); #endif /* CONFIG_ACPI_IBM_BAY */ IBM_HANDLE_INIT(beep); IBM_HANDLE_INIT(beep); IBM_HANDLE_INIT(ecrd); IBM_HANDLE_INIT(ecrd); IBM_HANDLE_INIT(ecwr); IBM_HANDLE_INIT(ecwr); Loading Loading
drivers/acpi/Kconfig +11 −0 Original line number Original line Diff line number Diff line Loading @@ -243,6 +243,17 @@ config ACPI_IBM_DOCK If you are not sure, say N here. If you are not sure, say N here. config ACPI_IBM_BAY bool "Legacy Removable Bay Support" depends on ACPI_IBM default y ---help--- Allows the ibm_acpi driver to handle removable bays. It will allow disabling the device in the bay, and also generate notifications when the bay lever is ejected or inserted. If you are not sure, say Y here. config ACPI_TOSHIBA config ACPI_TOSHIBA tristate "Toshiba Laptop Extras" tristate "Toshiba Laptop Extras" depends on X86 depends on X86 Loading
drivers/acpi/ibm_acpi.c +26 −2 Original line number Original line Diff line number Diff line Loading @@ -86,6 +86,7 @@ #include <linux/proc_fs.h> #include <linux/proc_fs.h> #include <linux/backlight.h> #include <linux/backlight.h> #include <linux/fb.h> #include <asm/uaccess.h> #include <asm/uaccess.h> #include <linux/dmi.h> #include <linux/dmi.h> Loading Loading @@ -157,6 +158,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ "\\_SB.PCI.ISA.SLCE", /* 570 */ "\\_SB.PCI.ISA.SLCE", /* 570 */ ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ #endif #endif #ifdef CONFIG_ACPI_IBM_BAY IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ Loading @@ -174,6 +176,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */ IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ "_EJ0", /* 770x */ "_EJ0", /* 770x */ ); /* all others */ ); /* all others */ #endif /* CONFIG_ACPI_IBM_BAY */ /* don't list other alternatives as we install a notify handler on the 570 */ /* don't list other alternatives as we install a notify handler on the 570 */ IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ Loading Loading @@ -1044,6 +1047,7 @@ static int light_write(char *buf) return 0; return 0; } } #if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY) static int _sta(acpi_handle handle) static int _sta(acpi_handle handle) { { int status; int status; Loading @@ -1053,6 +1057,7 @@ static int _sta(acpi_handle handle) return status; return status; } } #endif #ifdef CONFIG_ACPI_IBM_DOCK #ifdef CONFIG_ACPI_IBM_DOCK #define dock_docked() (_sta(dock_handle) & 1) #define dock_docked() (_sta(dock_handle) & 1) Loading Loading @@ -1119,6 +1124,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event) } } #endif #endif #ifdef CONFIG_ACPI_IBM_BAY static int bay_status_supported; static int bay_status_supported; static int bay_status2_supported; static int bay_status2_supported; static int bay_eject_supported; static int bay_eject_supported; Loading Loading @@ -1194,6 +1200,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event) { { acpi_bus_generate_event(ibm->device, event, 0); acpi_bus_generate_event(ibm->device, event, 0); } } #endif /* CONFIG_ACPI_IBM_BAY */ static int cmos_read(char *p) static int cmos_read(char *p) { { Loading Loading @@ -1701,7 +1708,10 @@ static int brightness_write(char *buf) static int brightness_update_status(struct backlight_device *bd) static int brightness_update_status(struct backlight_device *bd) { { return brightness_set(bd->props.brightness); return brightness_set( (bd->props.fb_blank == FB_BLANK_UNBLANK && bd->props.power == FB_BLANK_UNBLANK) ? bd->props.brightness : 0); } } static struct backlight_ops ibm_backlight_data = { static struct backlight_ops ibm_backlight_data = { Loading @@ -1711,6 +1721,12 @@ static struct backlight_ops ibm_backlight_data = { static int brightness_init(void) static int brightness_init(void) { { int b; b = brightness_get(NULL); if (b < 0) return b; ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, &ibm_backlight_data); &ibm_backlight_data); if (IS_ERR(ibm_backlight_device)) { if (IS_ERR(ibm_backlight_device)) { Loading @@ -1719,6 +1735,8 @@ static int brightness_init(void) } } ibm_backlight_device->props.max_brightness = 7; ibm_backlight_device->props.max_brightness = 7; ibm_backlight_device->props.brightness = b; backlight_update_status(ibm_backlight_device); return 0; return 0; } } Loading Loading @@ -2353,6 +2371,7 @@ static struct ibm_struct ibms[] = { .type = ACPI_SYSTEM_NOTIFY, .type = ACPI_SYSTEM_NOTIFY, }, }, #endif #endif #ifdef CONFIG_ACPI_IBM_BAY { { .name = "bay", .name = "bay", .init = bay_init, .init = bay_init, Loading @@ -2362,6 +2381,7 @@ static struct ibm_struct ibms[] = { .handle = &bay_handle, .handle = &bay_handle, .type = ACPI_SYSTEM_NOTIFY, .type = ACPI_SYSTEM_NOTIFY, }, }, #endif /* CONFIG_ACPI_IBM_BAY */ { { .name = "cmos", .name = "cmos", .read = cmos_read, .read = cmos_read, Loading Loading @@ -2647,7 +2667,9 @@ IBM_PARAM(light); #ifdef CONFIG_ACPI_IBM_DOCK #ifdef CONFIG_ACPI_IBM_DOCK IBM_PARAM(dock); IBM_PARAM(dock); #endif #endif #ifdef CONFIG_ACPI_IBM_BAY IBM_PARAM(bay); IBM_PARAM(bay); #endif /* CONFIG_ACPI_IBM_BAY */ IBM_PARAM(cmos); IBM_PARAM(cmos); IBM_PARAM(led); IBM_PARAM(led); IBM_PARAM(beep); IBM_PARAM(beep); Loading Loading @@ -2723,12 +2745,14 @@ static int __init acpi_ibm_init(void) IBM_HANDLE_INIT(dock); IBM_HANDLE_INIT(dock); #endif #endif IBM_HANDLE_INIT(pci); IBM_HANDLE_INIT(pci); #ifdef CONFIG_ACPI_IBM_BAY IBM_HANDLE_INIT(bay); IBM_HANDLE_INIT(bay); if (bay_handle) if (bay_handle) IBM_HANDLE_INIT(bay_ej); IBM_HANDLE_INIT(bay_ej); IBM_HANDLE_INIT(bay2); IBM_HANDLE_INIT(bay2); if (bay2_handle) if (bay2_handle) IBM_HANDLE_INIT(bay2_ej); IBM_HANDLE_INIT(bay2_ej); #endif /* CONFIG_ACPI_IBM_BAY */ IBM_HANDLE_INIT(beep); IBM_HANDLE_INIT(beep); IBM_HANDLE_INIT(ecrd); IBM_HANDLE_INIT(ecrd); IBM_HANDLE_INIT(ecwr); IBM_HANDLE_INIT(ecwr); Loading