|
62 | 62 | MODULE_DESCRIPTION("ACPI Battery Driver"); |
63 | 63 | MODULE_LICENSE("GPL"); |
64 | 64 |
|
| 65 | +static int battery_bix_broken_package; |
65 | 66 | static unsigned int cache_time = 1000; |
66 | 67 | module_param(cache_time, uint, 0644); |
67 | 68 | MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); |
@@ -416,7 +417,12 @@ static int acpi_battery_get_info(struct acpi_battery *battery) |
416 | 417 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", name)); |
417 | 418 | return -ENODEV; |
418 | 419 | } |
419 | | - if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags)) |
| 420 | + |
| 421 | + if (battery_bix_broken_package) |
| 422 | + result = extract_package(battery, buffer.pointer, |
| 423 | + extended_info_offsets + 1, |
| 424 | + ARRAY_SIZE(extended_info_offsets) - 1); |
| 425 | + else if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags)) |
420 | 426 | result = extract_package(battery, buffer.pointer, |
421 | 427 | extended_info_offsets, |
422 | 428 | ARRAY_SIZE(extended_info_offsets)); |
@@ -754,6 +760,17 @@ static int battery_notify(struct notifier_block *nb, |
754 | 760 | return 0; |
755 | 761 | } |
756 | 762 |
|
| 763 | +static struct dmi_system_id bat_dmi_table[] = { |
| 764 | + { |
| 765 | + .ident = "NEC LZ750/LS", |
| 766 | + .matches = { |
| 767 | + DMI_MATCH(DMI_SYS_VENDOR, "NEC"), |
| 768 | + DMI_MATCH(DMI_PRODUCT_NAME, "PC-LZ750LS"), |
| 769 | + }, |
| 770 | + }, |
| 771 | + {}, |
| 772 | +}; |
| 773 | + |
757 | 774 | static int acpi_battery_add(struct acpi_device *device) |
758 | 775 | { |
759 | 776 | int result = 0; |
@@ -846,6 +863,9 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) |
846 | 863 | { |
847 | 864 | if (acpi_disabled) |
848 | 865 | return; |
| 866 | + |
| 867 | + if (dmi_check_system(bat_dmi_table)) |
| 868 | + battery_bix_broken_package = 1; |
849 | 869 | acpi_bus_register_driver(&acpi_battery_driver); |
850 | 870 | } |
851 | 871 |
|
|
0 commit comments