1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #define R_ICLK_PCR_CAMERA1 0x8000
4 #define B_ICLK_PCR_FREQUENCY 0x1
5 #define B_ICLK_PCR_REQUEST 0x2
7 /* The clock control registers for each IMGCLK are offset by 0xC */
8 #define B_ICLK_PCR_OFFSET 0xC
12 /* IsCLK PCH base register for clock settings */
14 ICKB = PCRB (PID_ISCLK) + R_ICLK_PCR_CAMERA1
16 * Helper function for Read And Or Write
17 * Arg0 : Clock source select
21 Method (RAOW, 3, Serialized)
23 OperationRegion (ICLK, SystemMemory, (ICKB + (Arg0 * B_ICLK_PCR_OFFSET)), 4)
24 Field (ICLK, AnyAcc, NoLock, Preserve)
29 VAL0 = Local0 & Arg1 | Arg2
33 * Clock control Method
34 * Arg0: Clock source select (0 .. 5 => IMGCLKOUT_0 .. IMGCLKOUT_5)
35 * Arg1: Frequency select (0: 24MHz, 1: 19.2MHz)
37 Method (MCON, 0x2, NotSerialized)
39 /* Set Clock Frequency */
40 RAOW (Arg0, ~B_ICLK_PCR_FREQUENCY, Arg1)
43 RAOW (Arg0, ~B_ICLK_PCR_REQUEST, B_ICLK_PCR_REQUEST)
46 Method (MCOF, 0x1, NotSerialized)
49 RAOW (Arg0, ~B_ICLK_PCR_REQUEST, 0)