[PATCH] acpi: battery: Always read fresh battery state on update

2020-06-04 Thread Mathew King
that the battery has changed but the sysfs state will still have the cached state values. This change invalidates the update time forcing the state to be updated before notifying the power_supply subsystem of the change. Signed-off-by: Mathew King --- drivers/acpi/battery.c | 1 + 1 file changed, 1

[PATCH v2 0/4] Cleanup power_supply_sysfs.c

2020-05-04 Thread Mathew King
A few various patches to cleanup the power_supply sysfs implementation. --- v2: - Don't create attributes for unlisted properties - Use a char array for lower case name so no allocations neeed in init - Fix patch #2 does not compile because of change meant for patch #3 Mathew King

[PATCH v2 4/4] power_supply: Add power supply type property to uevent env

2020-05-04 Thread Mathew King
Add POWER_SUPPLY_TYPE to the uevent env for power supply. Type is a property of all power supplies and there is a sysfs entry for it but it is not included in the properties array of the power supply so explicitly add it to the udev env. Signed-off-by: Mathew King --- v2: - Fixup with patches

[PATCH v2 1/4] power_supply: Cleanup power supply sysfs attribute list

2020-05-04 Thread Mathew King
Make the device attribute list used to create sysfs attributes more robust by decoupling the list order from order of the enum defined in power_supply.h. This is done by using a designated initializer in the POWER_SUPPLY_ATTR macro. Signed-off-by: Mathew King --- v2: - Don't create attributes

[PATCH v2 3/4] power_supply: Add a macro that maps enum properties to text values

2020-05-04 Thread Mathew King
POWER_SUPPLY_ENUM_ATTR(${PROPNAME}) to the power_supply_attrs array. Signed-off-by: Mathew King --- v2: - Fix array name from previous patch --- drivers/power/supply/power_supply_sysfs.c | 126 +- 1 file changed, 51 insertions(+), 75 deletions(-) diff --git a/drivers/power/supply

[PATCH v2 2/4] power_supply: Use designated initializer for property text arrays

2020-05-04 Thread Mathew King
Use designated initializers for the sysfs power supply text values. This will help ensure that the text values are kept in sync with the enum values from power_supply.h. Signed-off-by: Mathew King --- v2: - Fix array name change meant for next patch --- drivers/power/supply/power_supply_sysfs.c

[PATCH] input: Add privacy screen toggle keycode

2019-10-17 Thread Mathew King
Add keycode for toggling electronic privacy screen to the keycodes definition. Some new laptops have a privacy screen which can be toggled with a key on the keyboard. Signed-off-by: Mathew King --- include/uapi/linux/input-event-codes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v2] platform/x86: intel-vbtn: Report switch events when event wakes device

2019-05-20 Thread Mathew King
by suspending a device in laptop mode and putting it in tablet mode, the device resumes and is in tablet mode. When suspending the device in tablet mode and putting it in laptop mode the device resumes and is in laptop mode. Signed-off-by: Mathew King --- Changes in v2: - Added comment explaining

[PATCH] platform/x86: intel-vbtn: Report switch events when event wakes device

2019-05-16 Thread Mathew King
by suspending a device in laptop mode and putting it in tablet mode, the device resumes and is in tablet mode. When suspending the device in tablet mode and putting it in laptop mode the device resumes and is in laptop mode. Signed-off-by: Mathew King --- drivers/platform/x86/intel-vbtn.c | 7