hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards
authorJoaquín Ignacio Aramendía <samsagax@gmail.com>
Sun, 11 Jun 2023 14:33:20 +0000 (11:33 -0300)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 18 Jun 2023 03:49:18 +0000 (20:49 -0700)
commitbe144ee49127216b456da26f1a32b6ba281ac505
tree474f77ee7a885a8668e185b3e8b965a3732ae6eb
parentfbb5a7fee063fe97009ff28df8cd0e4af3202683
hwmon: (oxp-sensors) Add tt_toggle attribute on supported boards

OneXPlayer boards from the last generation (both for OneXPlayer and AOK
ZOE brands) have a toggle in the EC to switch the "Turbo/Silent" button
into a different keyboard event.

Add a means to use that "Turbo button takeover" function and expose it
to userspace in a custom sysfs `tt_toggle` attribute. It can be read to
take the current state. Write 1|0 to activate the function. The specific
keycode is dependent on the board but can be checked by running
`evtest` utility.

Newer BIOS on the OneXPlayer added this function aside from string changes.
Add a board enum to differentiate it from the old OneXplayer Mini AMD BIOS.

Currently known supported boards:
- AOK ZOE A1
- OneXPlayer Mini AMD (only newer BIOS version supported)
- OneXPlayer Mini Pro

Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com>
Link: https://lore.kernel.org/r/20230611143332.40590-2-samsagax@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/oxp-sensors.rst
drivers/hwmon/oxp-sensors.c