现在做开发,很多时候都会用到camera或者LCD,但是用dragonboard 410c开发过的同学都知道,410c开发板上面没有专门的camera或LCD接口,那怎么办呢?不要急,上面有个高速扩展接口,通过这个接口我们就可以连接camera和LCD了,不过这种接口也不是很常见,所以,在网上买了一块转接板。很多人都知道camera的私有部分是不公开的,所以没有办法调试,确实是这样。不过这个商家还不错,提供了相应的库。所以,camera tunning这部分就不用操心了。接下来简单说一下碰到的问题。首先声明一下,他们提供的库文件是针对Android L的,而我是在Android M上进行的调试,所以没有出图,现在在下载Android L的代码,后面有时间的话会把M的弄出来。
总的来说camera是比较复杂的,尤其是tunning这一块,不过既然已经有了库,就简单多了,只需要bring up起来就可以了。来看一下主要用到的一些文件:
首先是dtsi的配置:
路径:kernel/arch/arm64/boot/dts/qcom/apq8016-camera-sensor-sbc.dtsi
在这里面主要是camera的上电、时钟、拍摄角度、前置或后置等的基础配置。
1 qcom,camera@78 {
2 compatible = "ovti,ov5645";
3 reg = <0x78 0x0>;
4 qcom,slave-id = <0x78 0x300a 0x5645>;
5 qcom,csiphy-sd-index = <1>;
6 qcom,csid-sd-index = <1>;
7 qcom,mount-angle = <90>;
8 qcom,sensor-name = "ov5645";
9 cam_vdig-supply = <&vph_pwr_vreg>;
10 cam_vana-supply = <&vph_pwr_vreg>;
11 cam_vio-supply = <&vph_pwr_vreg>;
12 qcom,cam-vreg-name = "cam_vdig", "cam_vio", "cam_vana";
13 qcom,cam-vreg-min-voltage = <2100000 0 2850000>;
14 qcom,cam-vreg-max-voltage = <2100000 0 2850000>;
15 qcom,cam-vreg-op-mode = <200000 0 80000>;
16 pinctrl-names = "cam_default", "cam_suspend";
17 pinctrl-0 = <&cam_sensor_mclk1_default &cam_sensor_front_default>;
18 pinctrl-1 = <&cam_sensor_mclk1_sleep &cam_sensor_front_sleep>;
19 gpios = <&msm_gpio 27 0>,
20 <&msm_gpio 28 0>,
21 <&msm_gpio 33 0>;
22 qcom,gpio-reset = <1>;
23 qcom,gpio-standby = <2>;
24 qcom,gpio-req-tbl-num = <0 1 2>;
25 qcom,gpio-req-tbl-flags = <1 0 0>;
26 qcom,gpio-req-tbl-label = "CAMIF_MCLK",
27 "CAM_RESET",
28 "CAM_STANDBY";
29 qcom,gpio-set-tbl-num = <1 1>;
30 qcom,gpio-set-tbl-flags = <0 2>;
31 qcom,gpio-set-tbl-delay = <1000 4000>;
32 qcom,csi-lane-assign = <0x4320>;
33 qcom,csi-lane-mask = <0x3>;
34 qcom,sensor-position = <1>;
35 qcom,sensor-mode = <0>;
36 qcom,cci-master = <0>;
37 qcom,mclk-23880000;
38 status = "ok";
39 clocks = <&clock_gcc clk_mclk1_clk_src>,
40 <&clock_gcc clk_gcc_camss_mclk1_clk>;
41 clock-names = "cam_src_clk", "cam_clk";
42 };
其次是驱动代码,这部分基本上也不需要什么修改:
路径:kernel/drivers/media/platform/msm/camera_v2/sensor/vo5645.c
具体的流程这里就不详细介绍了,后面M的做出来后,再一起看看。