Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45159 )
Change subject: mb/google/volteer: Separate power resource for VCM ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/45159/3/src/mainboard/google/voltee... File src/mainboard/google/volteer/variants/baseboard/include/baseboard/acpi/mipi_camera.asl:
https://review.coreboot.org/c/coreboot/+/45159/3/src/mainboard/google/voltee... PS3, Line 345: Method (_ON, 0, Serialized) /* VCPR_ON_: VCM Power On */
Yes, these are separate devices and there is no ordering guarantee.
Gotcha. Then what we'll have to do is add a guard variable (reference count, like STA) for each "resource" in the on and off sequence that are shared with another PowerResource, which is what the drivers/intel/mipi_camera chip driver does, see https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src... (It's on my todo list to switch volteer over to that driver).
To me, that looks like the following will require guard variables: 1) Clock 3 2) RST GPIO 3) PWREN
What I would do then is create 2 new Methods for each of those (one to enable and one to disable; both of which check the value of the guard variable first and increment or decrement as appropriate), and change VCPR & RCPR to use those methods instead of directly calling `CTXS`, etc. or `MCON`/`MCOF`.
Let me know if this doesn't make sense, and I can write up some ASL here.
https://review.coreboot.org/c/coreboot/+/45159/3/src/mainboard/google/voltee... PS3, Line 366: Store(1,STA) We're trying to move to ASL 2.0 syntax, so `STA = 1` will work here.
https://review.coreboot.org/c/coreboot/+/45159/3/src/mainboard/google/voltee... PS3, Line 386: Store(0,STA) We're trying to move to ASL 2.0 syntax, so `STA = 0` will work here.