linux/drivers/acpi
Hans de Goede bd8ba20597 ACPI / video: Filter the _BCL table for duplicate brightness values
Some devices have duplicate entries in there brightness levels table, ie
on my Dell Latitude E6430 the table looks like this:

[    3.686060] acpi backlight index   0, val 80
[    3.686095] acpi backlight index   1, val 50
[    3.686122] acpi backlight index   2, val 5
[    3.686147] acpi backlight index   3, val 5
[    3.686172] acpi backlight index   4, val 5
[    3.686197] acpi backlight index   5, val 5
[    3.686223] acpi backlight index   6, val 5
[    3.686248] acpi backlight index   7, val 5
[    3.686273] acpi backlight index   8, val 6
[    3.686332] acpi backlight index   9, val 7
[    3.686356] acpi backlight index  10, val 8
[    3.686380] acpi backlight index  11, val 9
etc.

Notice that brightness values 0-5 are all mapped to 5. This means that
if userspace writes any value between 0 and 5 to the brightness sysfs attribute
and then reads it, it will always return 0, which is somewhat unexpected.

This is a problem for ie gnome-settings-daemon, which uses read-modify-write
logic when the users presses the brightness up or down keys. This is done
this way to take brightness changes from other sources into account.

On this specific laptop what happens once the brightness has been set to 0,
is that gsd reads 0, adds 5, writes 5, and on the next brightness up key press
again reads 0, so things get stuck at the lowest brightness setting.

Filtering out the duplicate table entries, makes any write to brightness
read back as the written value as one would expect, fixing this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-20 01:33:40 +01:00
..
acpica ACPICA: Remove bool usage from ACPICA. 2014-01-27 23:59:08 +01:00
apei ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
ac.c Merge branch 'acpi-cleanup' 2014-01-12 23:44:09 +01:00
acpi_cmos_rtc.c ACPI: Add CMOS RTC Operation Region handler support 2013-06-27 21:35:37 +02:00
acpi_extlog.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
acpi_ipmi.c ACPI / IPMI: Cleanup coding styles 2013-09-30 19:46:13 +02:00
acpi_lpss.c Revert "ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs" 2014-01-18 14:04:58 +01:00
acpi_memhotplug.c ACPI / memhotplug: add parameter to disable memory hotplug 2014-01-16 01:43:49 +01:00
acpi_pad.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
acpi_platform.c ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
acpi_processor.c Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' 2014-01-29 11:47:18 +01:00
battery.c ACPI / battery: Fix incorrect sscanf() string in acpi_battery_init_alarm() 2014-02-05 01:07:54 +01:00
bgrt.c acpi: bgrt: fix build error due to attribute change 2013-08-22 08:34:39 -07:00
blacklist.c Merge branches 'acpi-gpe', 'acpi-video', 'acpi-thermal', 'acpi-processor', 'acpi-sleep' 2014-01-12 23:46:55 +01:00
bus.c Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' 2014-01-29 11:47:18 +01:00
button.c Merge branches 'acpi-gpe', 'acpi-video', 'acpi-thermal', 'acpi-processor', 'acpi-sleep' 2014-01-12 23:46:55 +01:00
container.c ACPI / container: Fix error code path in container_device_attach() 2014-02-12 14:55:16 +01:00
custom_method.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
debugfs.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
device_pm.c Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' 2014-01-29 11:47:18 +01:00
dock.c ACPI / dock: Use acpi_device_enumerated() to check if dock is present 2014-02-10 13:44:20 +01:00
ec_sys.c ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c 2014-01-06 00:13:22 +01:00
ec.c Merge branches 'acpi-gpe', 'acpi-video', 'acpi-thermal', 'acpi-processor', 'acpi-sleep' 2014-01-12 23:46:55 +01:00
event.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
fan.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
glue.c ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c 2013-12-07 01:05:50 +01:00
hed.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
internal.h Merge branch 'acpi-hotplug' 2014-01-12 23:45:04 +01:00
Kconfig x86/efi: Don't select EFI from certain special ACPI drivers 2013-12-19 21:32:46 +01:00
Makefile ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
numa.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
nvs.c ACPI / NVS: Include appropriate header file in nvs.c 2014-01-06 00:13:22 +01:00
osl.c Merge branch 'acpi-hotplug' 2014-01-12 23:45:04 +01:00
pci_irq.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
pci_link.c ACPI / PCI: Include appropriate header file in pci_link.c 2014-01-06 00:13:22 +01:00
pci_root.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
pci_slot.c ACPI / PCI: Include appropriate header file in pci_slot.c 2014-01-06 00:13:22 +01:00
power.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
proc.c ACPI / proc: remove unneeded NULL check 2014-02-05 01:06:21 +01:00
processor_core.c Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' 2014-01-29 11:47:18 +01:00
processor_driver.c ACPI / processor: use ACPI_COMPANION() to get ACPI device 2013-12-07 01:41:01 +01:00
processor_idle.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
processor_perflib.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
processor_thermal.c ACPI: correct minor typos 2013-12-07 01:38:45 +01:00
processor_throttling.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
resource.c ACPI: introduce helper function acpi_has_method() 2013-07-15 01:33:10 +02:00
sbs.c ACPI / SBS: Remove SBS's proc directory 2013-10-12 00:19:44 +02:00
sbshc.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
sbshc.h
scan.c ACPI / hotplug: Fix panic on eject to ejected device 2014-02-05 12:14:43 +01:00
sleep.c Merge branches 'acpi-gpe', 'acpi-video', 'acpi-thermal', 'acpi-processor', 'acpi-sleep' 2014-01-12 23:46:55 +01:00
sleep.h ACPI: Drop power resources driver 2013-01-17 14:11:06 +01:00
sysfs.c Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' 2014-01-29 11:47:18 +01:00
tables.c ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment. 2014-01-06 12:33:06 +01:00
thermal.c Merge branches 'acpi-gpe', 'acpi-video', 'acpi-thermal', 'acpi-processor', 'acpi-sleep' 2014-01-12 23:46:55 +01:00
utils.c ACPI / utils: remove a pointless NULL check 2014-02-05 01:05:24 +01:00
video_detect.c ACPI / video: Add HP EliteBook Revolve 810 to the blacklist 2014-02-05 01:03:21 +01:00
video.c ACPI / video: Filter the _BCL table for duplicate brightness values 2014-02-20 01:33:40 +01:00
wakeup.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00