diff options
author | Daniel Kang <daniel.h.kang@intel.com> | 2020-08-27 14:39:02 -0700 |
---|---|---|
committer | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-10-30 20:25:13 +0000 |
commit | 8661fe220d92cedbb5eb7956d74b764670d354f3 (patch) | |
tree | 9a6a0aaf988ce4c94cc89884cda0bf0090e915a5 /src | |
parent | b3e9aaf62b5608781bf59e282ec220cb4424d152 (diff) |
mb/google/volteer: Separate power resource for VCM
The camera privacy LED blinks during the boot and this gives a wrong
impression to the users that the camera is being used during the power
up. The blink happens when the camera module is probed and a series of
kernel patches and coreboot patches are being submitted to resolve the
issue.
The kernel patches are submitted to the chromium gerrit.
https://chromium-review.googlesource.com/2403386
https://chromium-review.googlesource.com/2403387
https://chromium-review.googlesource.com/2403385
https://chromium-review.googlesource.com/2403384
https://chromium-review.googlesource.com/2403383
https://chromium-review.googlesource.com/2403382
https://chromium-review.googlesource.com/2403381
https://chromium-review.googlesource.com/2403380
This is to separate the power resource for the VCM so that it can be
controlled by the driver and suppress the LED turn on.
BUG=b:169049942
BRANCH=none
TEST=Build and boot volteer board. Monitor camera privacy LED
and check if it blinks. It should not blink.
Signed-off-by: Daniel Kang <daniel.h.kang@intel.com>
Change-Id: Id51c98e42c5f20e231d8096c9d2d98deebc7c968
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45159
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/google/volteer/variants/baseboard/include/baseboard/acpi/mipi_camera.asl | 110 |
1 files changed, 72 insertions, 38 deletions
diff --git a/src/mainboard/google/volteer/variants/baseboard/include/baseboard/acpi/mipi_camera.asl b/src/mainboard/google/volteer/variants/baseboard/include/baseboard/acpi/mipi_camera.asl index 51034c3d73..38cf14a80d 100644 --- a/src/mainboard/google/volteer/variants/baseboard/include/baseboard/acpi/mipi_camera.asl +++ b/src/mainboard/google/volteer/variants/baseboard/include/baseboard/acpi/mipi_camera.asl @@ -146,64 +146,69 @@ Scope (\_SB.PCI0.IPU0) Scope (\_SB.PCI0.I2C3) { + /* Reference counter to track power control by RCAM and VCM */ + Name (REFC, 0) PowerResource (RCPR, 0x00, 0x0000) { - Name (STA, Zero) + Name (STA, 0) Method (_ON, 0, Serialized) /* Rear camera_ON_: Power On */ { - If ((STA == Zero)) - { - /* Enable IMG_CLK */ - MCON(3,1) /* Clock 3, 19.2MHz */ + /* Enable IMG_CLK */ + MCON(3,1) /* Clock 3, 19.2MHz */ - /* Pull RST low */ + /* Pull RST low */ #if CONFIG(BOARD_GOOGLE_VOLTEER) - CTXS(GPP_F15) + CTXS(GPP_F15) #else - CTXS(GPP_D4) + CTXS(GPP_D4) #endif - /* Pull SNRPWR_EN high */ - STXS(GPP_H14) + /* Pull SNRPWR_EN high */ + STXS(GPP_H14) + If (REFC == 0) + { /* Pull PWREN high */ STXS(GPP_H20) - Sleep(2) /* reset pulse width */ + } + Sleep(2) /* reset pulse width */ - /* Pull RST high */ + REFC++ + + /* Pull RST high */ #if CONFIG(BOARD_GOOGLE_VOLTEER) - STXS(GPP_F15) + STXS(GPP_F15) #else - STXS(GPP_D4) + STXS(GPP_D4) #endif - Sleep(1) /* t2 */ + Sleep(1) /* t2 */ - Store(1,STA) - } + STA = 1 } Method (_OFF, 0, Serialized) /* Rear camera _OFF: Power Off */ { - If ((STA == One)) - { - /* Disable IMG_CLK */ - Sleep(1) /* t0+t1 */ - MCOF(3) /* Clock 3 */ + /* Disable IMG_CLK */ + Sleep(1) /* t0+t1 */ + MCOF(3) /* Clock 3 */ - /* Pull RST low */ + /* Pull RST low */ #if CONFIG(BOARD_GOOGLE_VOLTEER) - CTXS(GPP_F15) + CTXS(GPP_F15) #else - CTXS(GPP_D4) + CTXS(GPP_D4) #endif + If (REFC == 1) + { /* Pull PWREN low */ CTXS(GPP_H20) + } + REFC-- - /* Pull SNRPWR_EN low */ - CTXS(GPP_H14) + /* Pull SNRPWR_EN low */ + CTXS(GPP_H14) - Store(0,STA) - } + STA = 0 } Method (_STA, 0, NotSerialized) /* _STA: Status */ { @@ -266,7 +271,7 @@ Scope (\_SB.PCI0.I2C3) { "i2c-allow-low-power-probe", 0x01 - } + } } }) Name (PRT0, Package (0x04) @@ -339,6 +344,35 @@ Scope (\_SB.PCI0.I2C3) }) } + PowerResource (VCPR, 0x00, 0x0000) + { + Name (STA, 0) + Method (_ON, 0, Serialized) /* VCPR_ON_: VCM Power On */ + { + If (REFC == 0) + { + /* Pull PWREN high */ + STXS(GPP_H20) + } + REFC++ + STA = 1 + } + Method (_OFF, 0, Serialized) /* VCPR_OFF: VCM Power Off */ + { + If (REFC == 1) + { + /* Pull PWREN low */ + CTXS(GPP_H20) + } + REFC-- + STA = 0 + } + Method (_STA, 0, NotSerialized) /* _STA: Status */ + { + Return (STA) + } + } + Device (VCM0) { Name (_HID, "PRP0001") /* _HID: Hardware ID */ @@ -361,11 +395,11 @@ Scope (\_SB.PCI0.I2C3) }) Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */ { - RCPR + VCPR }) Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */ { - RCPR + VCPR }) Name (_DSD, Package (0x02) /* _DSD: Device-Specific Data */ { @@ -381,7 +415,7 @@ Scope (\_SB.PCI0.I2C3) { "i2c-allow-low-power-probe", 0x01 - } + } } }) } @@ -455,12 +489,12 @@ Scope (\_SB.PCI0.I2C3) Scope (\_SB.PCI0.I2C2) { + Name (STA, Zero) PowerResource (FCPR, 0x00, 0x0000) { - Name (STA, Zero) Method (_ON, 0, Serialized) /* Front camera_ON_: Power On */ { - If ((STA == Zero)) + If (STA == 0) { /* Enable IMG_CLK */ MCON(2,1) /* Clock 2, 19.2MHz */ @@ -479,12 +513,12 @@ Scope (\_SB.PCI0.I2C2) STXS(GPP_D4) Sleep(1) /* t2 */ - Store(1,STA) + STA = 1 } } Method (_OFF, 0, Serialized) /* Front camera_OFF_: Power Off */ { - If ((STA == One)) + If (STA == 1) { /* Disable IMG_CLK */ Sleep(1) /* t0+t1 */ @@ -499,7 +533,7 @@ Scope (\_SB.PCI0.I2C2) /* Pull SNRPWR_EN low */ CTXS(GPP_D18) - Store(0,STA) + STA = 0 } } Method (_STA, 0, NotSerialized) /* _STA: Status */ |