aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-03-13 05:07:49 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-03-13 05:07:49 -0400
commit7a4ea10c01cdda3d66aa98af258f150d863aee24 (patch)
treeada3ff840a4a080ee96721dd1a19cc861a1e85eb
parenta20136a67a995cd5b74e8c0fcb3b2f2e5b2848dd (diff)
Revert "ACPI: battery: Add the ThinkPad "Not Charging" quirk"
Revert commit 91eea70e5e5c (ACPI: battery: Add the ThinkPad "Not Charging" quirk) as it is reported to cause user space to misbehave. That appears to be due to bugs in user space, so this commit will go in again after the bugs have been fixed and the fixes have been delivered to users. Link: https://marc.info/?l=linux-acpi&m=152089585129589&w=2 Reported-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/battery.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 96ed134bacf8..c88d41b04789 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -74,7 +74,6 @@ static async_cookie_t async_cookie;
74static bool battery_driver_registered; 74static bool battery_driver_registered;
75static int battery_bix_broken_package; 75static int battery_bix_broken_package;
76static int battery_notification_delay_ms; 76static int battery_notification_delay_ms;
77static int battery_quirk_notcharging;
78static int battery_full_discharging; 77static int battery_full_discharging;
79static unsigned int cache_time = 1000; 78static unsigned int cache_time = 1000;
80module_param(cache_time, uint, 0644); 79module_param(cache_time, uint, 0644);
@@ -240,8 +239,6 @@ static int acpi_battery_get_property(struct power_supply *psy,
240 val->intval = POWER_SUPPLY_STATUS_CHARGING; 239 val->intval = POWER_SUPPLY_STATUS_CHARGING;
241 else if (acpi_battery_is_charged(battery)) 240 else if (acpi_battery_is_charged(battery))
242 val->intval = POWER_SUPPLY_STATUS_FULL; 241 val->intval = POWER_SUPPLY_STATUS_FULL;
243 else if (battery_quirk_notcharging)
244 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
245 else 242 else
246 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; 243 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
247 break; 244 break;
@@ -728,7 +725,7 @@ EXPORT_SYMBOL_GPL(battery_hook_register);
728 * This function gets called right after the battery sysfs 725 * This function gets called right after the battery sysfs
729 * attributes have been added, so that the drivers that 726 * attributes have been added, so that the drivers that
730 * define custom sysfs attributes can add their own. 727 * define custom sysfs attributes can add their own.
731 */ 728*/
732static void battery_hook_add_battery(struct acpi_battery *battery) 729static void battery_hook_add_battery(struct acpi_battery *battery)
733{ 730{
734 struct acpi_battery_hook *hook_node; 731 struct acpi_battery_hook *hook_node;
@@ -1345,12 +1342,6 @@ static int __init battery_full_discharging_quirk(const struct dmi_system_id *d)
1345 return 0; 1342 return 0;
1346} 1343}
1347 1344
1348static int __init battery_quirk_not_charging(const struct dmi_system_id *d)
1349{
1350 battery_quirk_notcharging = 1;
1351 return 0;
1352}
1353
1354static const struct dmi_system_id bat_dmi_table[] __initconst = { 1345static const struct dmi_system_id bat_dmi_table[] __initconst = {
1355 { 1346 {
1356 .callback = battery_bix_broken_package_quirk, 1347 .callback = battery_bix_broken_package_quirk,
@@ -1400,19 +1391,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
1400 DMI_MATCH(DMI_PRODUCT_NAME, "UX410UAK"), 1391 DMI_MATCH(DMI_PRODUCT_NAME, "UX410UAK"),
1401 }, 1392 },
1402 }, 1393 },
1403 {
1404 /*
1405 * On Lenovo ThinkPads the BIOS specification defines
1406 * a state when the bits for charging and discharging
1407 * are both set to 0. That state is "Not Charging".
1408 */
1409 .callback = battery_quirk_not_charging,
1410 .ident = "Lenovo ThinkPad",
1411 .matches = {
1412 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1413 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"),
1414 },
1415 },
1416 {}, 1394 {},
1417}; 1395};
1418 1396