3.1 kernel-3.18/arch/arm64/boot/dts/amt6797_64_open.dts
3.2 For camera,
– &pio→define states of GPIOs
camera_pins_cam0_pnd0
camera_pins_cam0_pnd1
… all the gpio of camera are listed
– kd_camera_hw1→pinctrl mapping
Path :kernel-3.18/arch/arm64/boot/dts/amt6797_64_open.dts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | &kd_camera_hw1 { pinctrl-names = "default", "cam0_rst0", "cam0_rst1", "cam0_pnd0", "cam0_pnd1", "cam1_rst0", "cam1_rst1", "cam1_pnd0", "cam1_pnd1", "cam2_rst0", "cam2_rst1", "cam2_pnd0", "cam2_pnd1", "cam_ldo_vcama_0", "cam_ldo_vcama_1", "cam_ldo_vcamd_0", "cam_ldo_vcamd_1", "cam_ldo_vcamd2_0", "cam_ldo_vcamd2_1"; pinctrl-0 = <&camera_pins_default>; pinctrl-1 = <&camera_pins_cam0_rst0>; pinctrl-2 = <&camera_pins_cam0_rst1>; pinctrl-3 = <&camera_pins_cam0_pnd0>; pinctrl-4 = <&camera_pins_cam0_pnd1>; pinctrl-5 = <&camera_pins_cam1_rst0>; pinctrl-6 = <&camera_pins_cam1_rst1>; pinctrl-7 = <&camera_pins_cam1_pnd0>; pinctrl-8 = <&camera_pins_cam1_pnd1>; /* for main2 */ pinctrl-9 = <&camera_pins_cam2_rst0>; pinctrl-10 = <&camera_pins_cam2_rst1>; pinctrl-11 = <&camera_pins_cam2_pnd0>; pinctrl-12 = <&camera_pins_cam2_pnd1>; /* for ldo control by gpio */ pinctrl-13 = <&camera_pins_cam_ldo_vcama_0>; pinctrl-14 = <&camera_pins_cam_ldo_vcama_1>; pinctrl-15 = <&camera_pins_cam_ldo_vcamd_0>; pinctrl-16 = <&camera_pins_cam_ldo_vcamd_1>; pinctrl-17 = <&camera_pins_cam_ldo_e2_vcamd_0>; pinctrl-18 = <&camera_pins_cam_ldo_e2_vcamd_1>; status = "okay"; }; &pio { camera_pins_cam0_rst0: cam0@0 { pins_cmd_dat { pins = <PINMUX_GPIO32__FUNC_GPIO32>; slew-rate = <1>; /*direction 0:in, 1:out*/ output-low;/*direction out used only. output_low or high*/ }; }; camera_pins_cam0_rst1: cam0@1 { pins_cmd_dat { pins = <PINMUX_GPIO32__FUNC_GPIO32>; slew-rate = <1>; output-high; }; }; camera_pins_cam0_pnd0: cam0@2 { pins_cmd_dat { pins = <PINMUX_GPIO28__FUNC_GPIO28>; slew-rate = <1>; output-low; }; }; camera_pins_cam0_pnd1: cam0@3 { pins_cmd_dat { pins = <PINMUX_GPIO28__FUNC_GPIO28>; slew-rate = <1>; output-high; }; }; |
Path :\kernel-3.18\drivers\misc\mediatek\imgsensor\src\mt6797\camera_hw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /*Cam0 Power/Rst Ping initialization */ cam0_pnd_h = pinctrl_lookup_state(camctrl, "cam0_pnd1"); if (IS_ERR(cam0_pnd_h)) { ret = PTR_ERR(cam0_pnd_h); PK_ERR("%s : pinctrl err, cam0_pnd_h\n", __func__); } cam0_pnd_l = pinctrl_lookup_state(camctrl, "cam0_pnd0"); if (IS_ERR(cam0_pnd_l)) { ret = PTR_ERR(cam0_pnd_l); PK_ERR("%s : pinctrl err, cam0_pnd_l\n", __func__); } cam0_rst_h = pinctrl_lookup_state(camctrl, "cam0_rst1"); if (IS_ERR(cam0_rst_h)) { ret = PTR_ERR(cam0_rst_h); PK_ERR("%s : pinctrl err, cam0_rst_h\n", __func__); } cam0_rst_l = pinctrl_lookup_state(camctrl, "cam0_rst0"); if (IS_ERR(cam0_rst_l)) { ret = PTR_ERR(cam0_rst_l); PK_ERR("%s : pinctrl err, cam0_rst_l\n", __func__); } |