summarylogtreecommitdiffstats
path: root/sc8280xp-huawei-gaokun3-camera.dtsi
blob: b247abfb7c8dcca994bc6c5d9189c5206264512a (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022, Linaro Limited
 *
 * Copyright (c) 2025, Pengyu Luo <mitltlatltl@gmail.com>
 */

#include <dt-bindings/leds/common.h>

/ {
	leds {
		compatible = "gpio-leds";

		pinctrl-names = "default";
		pinctrl-0 = <&camf_indicator_en>;

		flash_camf: led-camera-indicator {
			label = "white:camera-indicator";
			function = LED_FUNCTION_INDICATOR;
			color = <LED_COLOR_ID_WHITE>;
			gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "none";
			default-state = "off";
			/* Reuse as a panic indicator until we get a "camera on" trigger */
			panic-indicator;
		};
	};

	vreg_camf_1v2: regulator-camf-lv2 {
		compatible = "regulator-fixed";

		regulator-name = "CAMF_1V2";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;

		gpio = <&tlmm 44 GPIO_ACTIVE_HIGH>;
		enable-active-high;

		pinctrl-0 = <&camf_lv2_reg_en>;
		pinctrl-names = "default";

		regulator-boot-on;
	};
};

&apps_rsc {
	regulators-1 {
			vreg_l2c: ldo2 {
			regulator-name = "vreg_l2c";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
			regulator-allow-set-load;
			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
						   RPMH_REGULATOR_MODE_HPM>;
		};

		vreg_l11c: ldo11 {
			regulator-name = "vreg_l11c";
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
			regulator-allow-set-load;
			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
						   RPMH_REGULATOR_MODE_HPM>;
		};
	};
};

&camss {
	vdda-phy-supply = <&vreg_l6d>;
	vdda-pll-supply = <&vreg_l4d>;

	status = "okay";

	ports {
		port@0 {
			csiphy0_lanes01_ep: endpoint@0 {
				reg = <0>;
				clock-lanes = <7>;
				data-lanes = <0 1>;
				remote-endpoint = <&hi846_ep>;
			};
		};
	};
};

&cci2 {
	status = "okay";
};

&cci2_i2c1 {
	camera_front: camera@20 {
		compatible = "hynix,hi846";
		reg = <0x20>;

		pinctrl-names = "default";
		pinctrl-0 = <&camf_rgb_default>;

		clocks = <&camcc CAMCC_MCLK3_CLK>;
		clock-frequency = <24000000>; // dummy, the default one is 19.2Mhz

		reset-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>;
		vddio-supply = <&vreg_l2c>;
		vdda-supply = <&vreg_l11c>;
		vddd-supply = <&vreg_camf_1v2>;

		orientation = <0>;	/* Front facing */
		rotation = <90>;

//		flash-leds = <&flash_camf>; /* which cause camera detect failure */

		port {
			hi846_ep: endpoint {
				data-lanes = <1 2>;
				link-frequencies = /bits/ 64 <80000000 200000000>;
				remote-endpoint = <&csiphy0_lanes01_ep>;
			};
		};
	};
};

&tlmm {

	camf_indicator_en: camf-indicator-en-state {
		pins = "gpio34";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	camf_lv2_reg_en: camf-lv2-reg-en-state {
		pins = "gpio44";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	camf_rgb_default: camf-rgb-default-state {
		mclk-pins {
			pins = "gpio17";
			function = "cam_mclk";
			drive-strength = <16>;
			bias-disable;
		};

		sc-rgb-xshut-n-pins {
			pins = "gpio15";
			function = "gpio";
			drive-strength = <2>;
			bias-disable;
		};
	};
};