xref: /aosp_15_r20/external/coreboot/src/mainboard/google/volteer/variants/voema/include/variant/acpi/mipi_camera.asl (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3Scope (\_SB.PCI0.IPU0)
4{
5	Name (_DSD, Package (0x02)  /* _DSD: Device-Specific Data */
6	{
7		ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
8		Package (0x02)
9		{
10			Package (0x02)
11			{
12				"port0",
13				"PRT0"
14			},
15			Package (0x02)
16			{
17				"port1",
18				"PRT1"
19			}
20		}
21	})
22
23	Name (PRT0, Package (0x04)
24	{
25		ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
26		Package (0x01)
27		{
28			Package (0x02)
29			{
30				"port",
31				5
32			}
33		},
34		ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
35		Package (0x01)
36		{
37			Package (0x02)
38			{
39				"endpoint0",
40				"EP00"
41			}
42		}
43	})
44
45	Name (PRT1, Package (0x04)
46	{
47		ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
48		Package (0x01)
49		{
50			Package (0x02)
51			{
52				"port",
53				1
54			}
55		},
56
57		ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
58		Package (0x01)
59		{
60			Package (0x02)
61			{
62				"endpoint0",
63				"EP10"
64			}
65		}
66	})
67}
68
69Scope (\_SB.PCI0.IPU0)
70{
71	Name (EP10, Package (0x02)
72	{
73		ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
74		Package (0x04)
75		{
76			Package (0x02)
77			{
78				"endpoint",
79				0
80			},
81			Package (0x02)
82			{
83				"clock-lanes",
84				0
85			},
86			Package (0x02)
87			{
88				"data-lanes",
89				Package (0x02)
90				{
91					1,
92					0x02
93				}
94			},
95			Package (0x02)
96			{
97				"remote-endpoint",
98				Package (0x03)
99				{
100					^I2C2.CAM1,
101					0,
102					0
103				}
104			}
105		}
106	})
107}
108
109Scope (\_SB.PCI0.I2C2)
110{
111	Name (STA, 0)
112	PowerResource (FCPR, 0x00, 0x0000)
113	{
114		Method (_ON, 0, Serialized)  /* Front camera_ON_: Power On */
115		{
116			If (STA == 0)
117			{
118				/* Enable IMG_CLK */
119				MCON(2,1) /* Clock 2, 19.2MHz */
120
121				/* Pull RST low */
122				CTXS(GPP_D4)
123
124				/* Pull PWREN high */
125				STXS(GPP_D17)
126				Sleep(10) /* t9 */
127
128				/* Pull RST high */
129				STXS(GPP_D4)
130				Sleep(1) /* t2 */
131
132				STA = 1
133			}
134		}
135		Method (_OFF, 0, Serialized)  /* Front camera_OFF_: Power Off */
136		{
137			If (STA == 1)
138			{
139				/* Disable IMG_CLK */
140				Sleep(1) /* t0+t1 */
141				MCOF(2) /* Clock 2 */
142
143				/* Pull RST low */
144				CTXS(GPP_D4)
145
146				/* Pull PWREN low */
147				CTXS(GPP_D17)
148
149				STA = 0
150			}
151		}
152		Method (_STA, 0, NotSerialized)
153		{
154			Return (STA)
155		}
156	}
157
158	Device (CAM1)
159	{
160		Name (_HID, "INT3474")
161		Name (_UID, 0)
162		Name (_DDN, "Ov 2740 Camera")  /* _DDN: DOS Device Name */
163		Method (_STA, 0, NotSerialized)
164		{
165			Return (0x0F)
166		}
167		Name (_CRS, ResourceTemplate ()  /* _CRS: Current Resource Settings */
168		{
169			I2cSerialBus (0x0036, ControllerInitiated, 0x00061A80,
170				AddressingMode7Bit, "\\_SB.PCI0.I2C2",
171				0x00, ResourceConsumer, ,
172			)
173		})
174		Name (_PR0, Package (0x01)  /* _PR0: Power Resources for D0 */
175		{
176			FCPR
177		})
178		Name (_PR3, Package (0x01)  /* _PR3: Power Resources for D3hot */
179		{
180			FCPR
181		})
182		Name (_DSD, Package (0x04)  /* _DSD: Device-Specific Data */
183		{
184			ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
185			Package (0x01)
186			{
187				Package (0x02)
188				{
189					"port0",
190					"PRT0"
191				}
192			},
193			ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
194			Package (0x02)
195			{
196				Package (0x02)
197				{
198					"clock-frequency",
199					0x0124F800
200				},
201				Package (0x02)
202				{
203					"i2c-allow-low-power-probe",
204					0x01
205				}
206			}
207		})
208		Name (PRT0, Package (0x04)
209		{
210			ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
211			Package (0x01)
212			{
213				Package (0x02)
214				{
215					"port",
216					0
217				}
218			},
219			ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
220			Package (0x01)
221			{
222				Package (0x02)
223				{
224					"endpoint0",
225					"EP00"
226				}
227			}
228		})
229		Name (EP00, Package (0x02)
230		{
231			ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
232			Package (0x05)
233			{
234				Package (0x02)
235				{
236					"endpoint",
237					0
238				},
239				Package (0x02)
240				{
241					"clock-lanes",
242					0
243				},
244				Package (0x02)
245				{
246					"data-lanes",
247					Package (0x02)
248					{
249						1,
250						0x02
251					}
252				},
253				Package (0x02)
254				{
255					"link-frequencies",
256					Package (0x01)
257					{
258						0x15752A00
259					}
260				},
261				Package (0x02)
262				{
263					"remote-endpoint",
264					Package (0x03)
265					{
266						IPU0,
267						1,
268						0
269					}
270				}
271			}
272		})
273	}
274	Device (NVM0)
275	{
276		Name (_HID, "PRP0001")
277		Name (_UID, 0x01)
278		Name (_DDN, "AT24 EEPROM")  // _DDN: DOS Device Name
279		Method (_STA, 0, NotSerialized)
280		{
281			Return (0x0F)
282		}
283		Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
284		{
285			I2cSerialBusV2 (0x0050, ControllerInitiated, 0x00061A80,
286				AddressingMode7Bit, "\\_SB.PCI0.I2C2",
287				0x00, ResourceConsumer, , Exclusive,
288				)
289		})
290		Name (_DEP, Package (0x01)  // _DEP: Dependencies
291		{
292			CAM1
293		})
294		Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
295		{
296			FCPR
297		})
298		Name (_PR3, Package (0x01)  // _PR3: Power Resources for D3hot
299		{
300			FCPR
301		})
302		Name (_DSD, Package (0x02)  // _DSD: Device-Specific Data
303		{
304			ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */,
305			Package (0x06)
306			{
307				Package (0x02)
308				{
309					"size",
310					0x2000
311				},
312				Package (0x02)
313				{
314					"pagesize",
315					1
316				},
317				Package (0x02)
318				{
319					"read-only",
320					1
321				},
322				Package (0x02)
323				{
324					"address-width",
325					0x10
326				},
327				Package (0x02)
328				{
329					"compatible",
330					"atmel,24c64"
331				},
332				Package (0x02)
333				{
334					"i2c-allow-low-power-probe",
335					0x01
336				}
337			}
338		})
339	}
340}
341