React to camera getting enabled
The case that should be working:
https://source.puri.sm/Librem5/linux-next/-/issues/330#note_168594
- Camera switch off
- Megapixels starts (notifies that the camera is unavailable)
- Camera switch turned on
Result: Megapixels enters camera mode.
It's really 2 scenarios, because the camera may be in 2 different states, at least the way the big camera driver is implemented today. One: camera was never present, driver is unloaded. Two: camera was present, driver is loaded, but it was turned off later.
I'm not sure which method should be used to communicate the state change. It should ideally reflect the camera status and not the switch state. Perhaps rfkill: https://source.puri.sm/Librem5/linux-next/-/issues/298