I have some code in python that I'm working on that can change the colors and animation on the keyboard. It's based on the prototype from this github page: https://github.com/wroberts/rogauracore. The problem is that after running my modified code, or even the C application, the kernel driver loses the ability to adjust the intensity of the backlight until I reboot the computer.
The output of lsmod is exactly the same before and after running it.
[#] Update: SOLVED[/#]
It turns out that when the kernel driver is detached from and then reattached to the keyboard, it's address changes. this then confuses the power management service, which is still trying to use the old address.
Running sudo systemctl restart upower.service fixes the problem by re-initializing the power management service, which makes it see the new address of the keyboard.
The output of lsmod is exactly the same before and after running it.
[#] Update: SOLVED[/#]
It turns out that when the kernel driver is detached from and then reattached to the keyboard, it's address changes. this then confuses the power management service, which is still trying to use the old address.
Running sudo systemctl restart upower.service fixes the problem by re-initializing the power management service, which makes it see the new address of the keyboard.