Is it possible to dynamically link a camera to a mipi_csi port

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to dynamically link a camera to a mipi_csi port

193 Views
cthilo
Contributor I

Hi

I want to switch between hdmi in and camera in, both via one mipi_csi channel

HDMI would use 4 data lanes and camera just one data lane. The one DataLane and the CSI Clock Lane will be multiplexed between hdmi and camera.

Is it possible to change the links between mipi_csi and hdmi resp. camera, so when I mux to hdmi, add a link via media-ctrl to have the hdmi in as source for the mipi csi and vica versa?

So, do not have any ports in the devicetree but do the link between camera (resp. hdmi) to mipi csi via media-ctrl.

Currently I have the problem, that /dev/media0 is not available, when mipi csi has no port.

Regards,
Thilo

0 Kudos
Reply
3 Replies

182 Views
cthilo
Contributor I

Working on it, but I found some keywords which do sound good.

For those interested:
The keywords I found are compatible: "video-mux" and "gpio-mux".

I currently compiling my kernel with theses two activated, so not sure if they work as I expect them to work. But at least it sounds like the correct way.

The open question is, how I can inform the mipi_csi about the 4 or 1 data lane config. ......

Any ideas?

Cheers,
Thilo

0 Kudos
Reply

21 Views
cthilo
Contributor I
video-mux seems to not be the solution, as the imx8-media-dev expects nodes to be i2c devices (drivers/staging/media/imx/imx8-media-dev.c:1041).

I even changed the of_find_i2c_device_by_node to of_find_device_by_node but this brings a kernel oops when the media pads should be linked.

My guess is, that the subdevices of the video-mux are not probed yet but the imx8-media-dev tests the video-mux only and so it dies then.

Any ideas?

Cheers,
Thilo
0 Kudos
Reply

11 Views
cthilo
Contributor I

I even tried to add such kind of tests into video-mux for the sink endpoints. 
Did not help.

The video-mux endpoint kills the im8-media-dev during probing.

I'm not sure what the video-mux driver would need to act as source for the imx8-media-dev .... 

So, currently I'm stuck here.

Any help would really be appreciated!

Cheers,
Thilo

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2291056%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIs%20it%20possible%20to%20dynamically%20link%20a%20camera%20to%20a%20mipi_csi%20port%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2291056%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20want%20to%20switch%20between%20hdmi%20in%20and%20camera%20in%2C%20both%20via%20one%20mipi_csi%20channel%3CBR%20%2F%3E%3CBR%20%2F%3EHDMI%20would%20use%204%20data%20lanes%20and%20camera%20just%20one%20data%20lane.%20The%20one%20DataLane%20and%20the%20CSI%20Clock%20Lane%20will%20be%20multiplexed%20between%20hdmi%20and%20camera.%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20it%20possible%20to%20change%20the%20links%20between%20mipi_csi%20and%20hdmi%20resp.%20camera%2C%20so%20when%20I%20mux%20to%20hdmi%2C%20add%20a%20link%20via%20media-ctrl%20to%20have%20the%20hdmi%20in%20as%20source%20for%20the%20mipi%20csi%20and%20vica%20versa%3F%3CBR%20%2F%3E%3CBR%20%2F%3ESo%2C%20do%20not%20have%20any%20ports%20in%20the%20devicetree%20but%20do%20the%20link%20between%20camera%20(resp.%20hdmi)%20to%20mipi%20csi%20via%20media-ctrl.%3CBR%20%2F%3E%3CBR%20%2F%3ECurrently%20I%20have%20the%20problem%2C%20that%20%2Fdev%2Fmedia0%20is%20not%20available%2C%20when%20mipi%20csi%20has%20no%20port.%3C%2FP%3E%3CP%3ERegards%2C%3CBR%20%2F%3EThilo%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2291064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Is%20it%20possible%20to%20dynamically%20link%20a%20camera%20to%20a%20mipi_csi%20port%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2291064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWorking%20on%20it%2C%20but%20I%20found%20some%20keywords%20which%20do%20sound%20good.%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20those%20interested%3A%3CBR%20%2F%3EThe%20keywords%20I%20found%20are%20compatible%3A%20%22video-mux%22%20and%26nbsp%3B%22gpio-mux%22.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20currently%20compiling%20my%20kernel%20with%20theses%20two%20activated%2C%20so%20not%20sure%20if%20they%20work%20as%20I%20expect%20them%20to%20work.%20But%20at%20least%20it%20sounds%20like%20the%20correct%20way.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20open%20question%20is%2C%20how%20I%20can%20inform%20the%20mipi_csi%20about%20the%204%20or%201%20data%20lane%20config.%20......%3C%2FP%3E%3CP%3EAny%20ideas%3F%3C%2FP%3E%3CP%3ECheers%2C%3CBR%20%2F%3EThilo%3C%2FP%3E%3C%2FLINGO-BODY%3E