03-14-2020, 10:43 PM
(03-14-2020, 10:48 AM)Foxchild Wrote: /proc/config.gz shows quite some LED configs. so those are the modules that are built into the kernel already?
Is it possible to load and unload built-in kernel modules? In other words, would it be possible to write a new LED driver and unload the old one?
The leds-gpio.c driver is probably enabled by CONFIG_LEDS_GPIO. You can verify this by checking in https://elixir.bootlin.com/linux/v5.5.8/...vers/leds/ these files
- Makefile: maps kernel configs to source files in this directory
- Kconfig: explains the purpose of kernel configs in this directory
=y are built-in modules
You can't easily remove built-in modules. Maybe there are some tricks. Google.
You can write your own led driver. Both, led-gpio and your driver should be able to co-exist. Nobody will trigger the led-gpio driver to access the gpio controller and even if someone does while your driver is accessing the gpio controller, no harm will be done to the hardware. I doubt you can put the controller in an inconsistent state, either.