patches/openwrt/kernel: Update Turris Omnia 5.15 patches (LEDs + MCU)
Update Turris Omnia LED driver patches from upstream, and add pending patches to support Turris Omnia MCU.
This MCU driver adds the following abilities if the user has upgraded MCU firmware (see below as to how to do that):
- the poweroff command now completely powers the device off (the power consumption goes to minimum). To power the router on, the user needs to press the front button,
- the device can be configured to automatically power on from powered
off state at a specific time by using the
omnia-mcutool --wakeup
option, for exampleomnia-mcutool --wakeup '+10 hours'
omnia-mcutool --wakeup '2023-10-19 08:00'
With upgraded MCU firmware the updated LED driver now supports:
- enabling/disabling LED gamma correction with
echo 1 >/sys/bus/i2c/devices/1-002b/gamma_correction
echo 0 >/sys/bus/i2c/devices/1-002b/gamma_correction
- the LED panel global brightness file
/sys/bus/i2c/devices/1-002b/brightness
can now be polled for changes using theepoll()
system call. It will emit aMODIFY
event when the user changes the brightness by pressing the front button. This will be used inrainbow-ng
'sbutton-sync
daemon. Currently thebutton-sync.sh
script periodically reads the file every 2 seconds to determine if the user has changed the brightness.
The following features are supported by the MCU driver even without upgrading the MCU firmware:
- the factory reset level can be read by
cat /sys/bus/i2c/devices/1-002a/reset_selector
- the front button can be configured to act as an input device (via the
kmod-input-gpio-keys
driver). This is done by executingecho cpu >/sys/bus/i2c/devices/1-002a/front_button_mode
echo mcu >/sys/bus/i2c/devices/1-002a/front_button_mode
- some of the MCU GPIOs are now available via /sys/class/gpio.
For example we can now enable/disable power for USB ports via sysfs:
cd /sys/class/gpio echo 456 >export cd '/sys/class/gpio/gpio456.Front USB3 port power'
echo 0 >value
echo 1 >value
The user can upgrade the MCU firmware by executing
opkg update
opkg install omnia-mcutool
omnia-mcutool --upgrade
reboot
Edited by Marek Behun