v4l2 controls inheritance on subdevices when using async kapi
by Artem.Metra from LinuxQuestions.org on (#5N7YD)
Hi,
I'm new to kernel development. I am currently working on embedded systems. I have a device tree and v4l2 devices/subdevices in which driver "A" depends on driver "B" and driver "B" depends on driver "C". I would like to make driver "B" wait for driver "C" first and then driver "B" registers with "A". Currently, I have mapped the dependency "A" <-> "B" and "B" <-> "C" with the async kapi. This works fine so far except that "B" has already registered with "A" before "C" is loaded. This leads to the fact that the controls of driver "C" are not visible in driver "A" (controls are transferred to the parent driver when registering when using ctrl_handler).
My question: What is the general approach in this situation. I believe the key is in returning -EPROBE_DEFER in the probe function in driver "B". However, it is unclear to me how to check if a connected node in the DeviceTree has already loaded its driver.
I'm new to kernel development. I am currently working on embedded systems. I have a device tree and v4l2 devices/subdevices in which driver "A" depends on driver "B" and driver "B" depends on driver "C". I would like to make driver "B" wait for driver "C" first and then driver "B" registers with "A". Currently, I have mapped the dependency "A" <-> "B" and "B" <-> "C" with the async kapi. This works fine so far except that "B" has already registered with "A" before "C" is loaded. This leads to the fact that the controls of driver "C" are not visible in driver "A" (controls are transferred to the parent driver when registering when using ctrl_handler).
My question: What is the general approach in this situation. I believe the key is in returning -EPROBE_DEFER in the probe function in driver "B". However, it is unclear to me how to check if a connected node in the DeviceTree has already loaded its driver.