Search code examples
androidcameraandroid-sourcei2c

Where is the camera sensor booting setting?


I am studying the camera bring up process in Android with Qualcomm platform. I have searched many bring up tutorial but I just can't figure out one thing: most of the tutorial would focus on the .dtsi setting and the driver porting. But I just can't find out where is the camera sensor boot setting. I can see the i2c booting sequence when I log the kernel message, but where the setting be recorded in BSP? Thanks a lot!

Kernel log of camera sensor booting


Solution

  • If the kernel logs those lines, then the kernel sends the settings to the sensor. Which makes sense: initializing a device is supposed to be done by the device driver, and in Linux device drivers are supposed to be in the kernel.

    Looking at your log, it seems like a file named msm_camera_cci_i2c.c does it.

    After a basic online search, it looks like it comes from an Android kernel, and that msm_camera_cci_i2c.c is just a utility file whoes functions are used by your actual driver. Thus look into your driver, the initialization data should live there.

    To know which driver is being used you can look either in your devicetree or navigate through the /sys directory, e.g. in /sys/bus/i2c/devices/.