Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow fine tuning ALS usage via mce settings
MCE has one setting that dictates whether ambient light sensor is used or not. This was ok as long as ALS was used only for display brightness tuning, but now that there are other reasons for using ALS functionality of those too depend on whether automatic brightness tuning is in use or not. Leave the existing setting in place, use it as ALS master toggle and add separate settings for: - Use ALS automatic display brightness tuning - Use ALS for filtering false positive lid closed events If the master toggle is set to disabled, ALS is not used by mce. If the master toggle is set to enabled, ALS is powered up/down depending on feature specific settings and device state. Refactor ALS data processing so that: - callback for passing lux value from sensorfw uses int, not unsigned int - als power up depends on all three settings - variables holding cached lux values are given more descriptive names - all auto brightness filters use similar logic for testing whether the feature is enabled & als data is available - move all constants related to display settings to display.h ALS data is used for filtering out potential false positive lid close events only if the relevant settings are enabled. Options for mcetool: --set-als-mode=<enabled|disabled> Now works as use als master toggle. --set-als-autobrightness=<enabled|disabled> Can be used to disable automatic brightness tuning even if using ALS is otherwise enabled. --set-filter-lid-with-als=<enabled|disabled> Can be used to disable lid close filtering even if using ALS is otherwise enabled. [mce] Allow fine tuning ALS usage via mce settings. Fixes JB#29892
- Loading branch information
Showing
10 changed files
with
280 additions
and
129 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.