| 1 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 |
|
| 3 |
#define R_ICLK_PCR_CAMERA1 0x8000 |
| 4 |
#define B_ICLK_PCR_FREQUENCY 0x1 |
| 5 |
#define B_ICLK_PCR_REQUEST 0x2 |
| 6 |
|
| 7 |
/* The clock control registers for each IMGCLK are offset by 0xC */ |
| 8 |
#define B_ICLK_PCR_OFFSET 0xC |
| 9 |
|
| 10 |
Scope (\_SB.PCI0) { |
| 11 |
|
| 12 |
/* IsCLK PCH base register for clock settings */ |
| 13 |
Name (ICKB, 0) |
| 14 |
ICKB = PCRB (PID_ISCLK) + R_ICLK_PCR_CAMERA1 |
| 15 |
/* |
| 16 |
* Helper function for Read And Or Write |
| 17 |
* Arg0 : Clock source select |
| 18 |
* Arg1 : And data |
| 19 |
* Arg2 : Or data |
| 20 |
*/ |
| 21 |
Method (RAOW, 3, Serialized) |
| 22 |
{ |
| 23 |
OperationRegion (ICLK, SystemMemory, (ICKB + (Arg0 * B_ICLK_PCR_OFFSET)), 4) |
| 24 |
Field (ICLK, AnyAcc, NoLock, Preserve) |
| 25 |
{ |
| 26 |
VAL0, 32 |
| 27 |
} |
| 28 |
Local0 = VAL0 |
| 29 |
VAL0 = Local0 & Arg1 | Arg2 |
| 30 |
} |
| 31 |
|
| 32 |
/* |
| 33 |
* Clock control Method |
| 34 |
* Arg0: Clock source select (0 .. 5 => IMGCLKOUT_0 .. IMGCLKOUT_5) |
| 35 |
* Arg1: Frequency select (0: 24MHz, 1: 19.2MHz) |
| 36 |
*/ |
| 37 |
Method (MCON, 0x2, NotSerialized) |
| 38 |
{ |
| 39 |
/* Set Clock Frequency */ |
| 40 |
RAOW (Arg0, ~B_ICLK_PCR_FREQUENCY, Arg1) |
| 41 |
|
| 42 |
/* Enable Clock */ |
| 43 |
RAOW (Arg0, ~B_ICLK_PCR_REQUEST, B_ICLK_PCR_REQUEST) |
| 44 |
} |
| 45 |
|
| 46 |
Method (MCOF, 0x1, NotSerialized) |
| 47 |
{ |
| 48 |
/* Disable Clock */ |
| 49 |
RAOW (Arg0, ~B_ICLK_PCR_REQUEST, 0) |
| 50 |
} |
| 51 |
} |