-
Notifications
You must be signed in to change notification settings - Fork 2
Porting cmos sensor to mainline next
Generally speaking this porting is very limited and soc/board dependent.
A very detail how-to is written by Yassine Oudjana, https://emainline.gitlab.io/2022/08/24/camera.html
The devlopment flow is as below:
- get camss sybsys on and dump test pattern from csid. Usually a similar soc is available inside camss.c so copy and paste then modify is a key.
- Get camcc and CCI up and running, for cmos sensor communication. And this is independent to camss so either doing this or camss first is free to choose.
- Enable debug info in vendor kernel, best is to switch on debug options like
- /dev/mem for debugcc direct camcc access and dump clk rate/enablement
- debugfs for debug_mdl boot param debug change on the fly
- Add pr_info in cam_sensor_module/cam_cci, dump all req that written to CCI, for cmos init reg val
- Find relevant cmos driver on other soc especially good source from MTK SOCs.
- Find/Search from github.com repo for example, search model name s5k5e9/ov16a1q/ov16a1x/gc8034 or its cmos_id like 559b
- Determine topoligy of component connection about cmos_sensor and csiphy
- Lane number, and lane assigment (some case might use abnormal lane assigment instead of incremental e.g. [0 1] and [0 1 2], [0, 1 2 3])
- Lane clk determination, according to various source, it is 240000000 as usual both in MTK and qcom soc, and 36000000 is also found a case.
- Usual case there are cmos product family, so found a similar driver from mainline/mail-list is a good start. Quite funny example, s5k5e9 cmos have very similar reg pattern (almost identical) with imx214. So lets use it as code base.
It is hightly believe that cmos init reg write also depend on d-phy lane number. So lets make use of those value like dummy.
On some platform using libcamera, there are some important v4l control to present. Implement a dummy control to pass the libcamera check is a good choice too.
The debug information of sensor config is at below, it is a s5k5e9 cmos connected to sm7125 soc, aka miatoll phone. https://github.com/99degree/linux/wiki/developing-qcom-camss#get-more-info-from-los-kernel
and the debug procedure is at: https://github.com/99degree/linux/wiki/developing-qcom-camss#debugging-with-vendor-kernel