From 01ea8f1fcc6e9e144de97e18afac3fb69676ba1c Mon Sep 17 00:00:00 2001 From: V Sowmya Date: Thu, 20 Jul 2017 16:15:56 +0530 Subject: [PATCH] mainboard/google/poppy: Configure GPIO.1 and GPIO.2 for daisy chain mode Configure GPIO.1 and GPIO.2 as sensor SDA and SCL respectively for TPS68470 PMIC in daisy chain mode. * GPIO.1: Sensor SDA in daisy chain mode. * GPIO.2: Sensor SCL in daisy chain mode. BUG=b:38326541 BRANCH=none TEST=Build and boot soraka. Dump and verify that the generated DSDT table has the required entries. Verified that sensor probe is successful. Change-Id: I7f9686427772a33c06e4cdaafee9b0349d700639 Signed-off-by: V Sowmya Reviewed-on: https://review.coreboot.org/20665 Tested-by: build bot (Jenkins) Reviewed-by: Rajmohan Mani Reviewed-by: Furquan Shaikh --- .../google/poppy/acpi/mipi_camera.asl | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/mainboard/google/poppy/acpi/mipi_camera.asl b/src/mainboard/google/poppy/acpi/mipi_camera.asl index d32e7a3e08..0c3ceec146 100644 --- a/src/mainboard/google/poppy/acpi/mipi_camera.asl +++ b/src/mainboard/google/poppy/acpi/mipi_camera.asl @@ -86,6 +86,20 @@ Scope (\_SB.PCI0.I2C2) AddressingMode7Bit, "\\_SB.PCI0.I2C2", 0x00, ResourceConsumer, , ) + /* GPIO.1 is sensor SDA in daisy chain mode */ + GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, + IoRestrictionInputOnly, "\\_SB.PCI0.I2C2.PMIC", + 0x00, ResourceConsumer,,) + { + 1 + } + /* GPIO.2 is sensor SCL in daisy chain mode */ + GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, + IoRestrictionInputOnly, "\\_SB.PCI0.I2C2.PMIC", + 0x00, ResourceConsumer,,) + { + 2 + } /* GPIO.4 is AVDD pin for user facing camera */ GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly, "\\_SB.PCI0.I2C2.PMIC", @@ -292,12 +306,22 @@ Scope (\_SB.PCI0.I2C2) } } + /* C0GP is used to indicate if CAM0 + * GPIOs are configured as input. + */ + Name (C0GP, 0) /* Power resource methods for CAM0 */ PowerResource (OVTH, 0, 0) { Name (STA, 0) Method (_ON, 0, Serialized) { If (LEqual (AVBL, 1)) { If (LEqual (STA, 0)) { + If (LEqual (C0GP, 0)) { + \_SB.PCI0.I2C2.CAM0.CGP1() + \_SB.PCI0.I2C2.CAM0.CGP2() + C0GP = 1 + } + /* Enable VSIO regulator + daisy chain */ DOVD(1) @@ -505,6 +529,26 @@ Scope (\_SB.PCI0.I2C2) Field (\_SB.PCI0.I2C2.PMIC.GPOP, ByteAcc, NoLock, Preserve) { + Connection + ( + GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, + IoRestrictionInputOnly, "\\_SB.PCI0.I2C2.PMIC", + 0x00, ResourceConsumer,,) + { + 1 + } + ), + GPO1, 1, + Connection + ( + GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, + IoRestrictionInputOnly, "\\_SB.PCI0.I2C2.PMIC", + 0x00, ResourceConsumer,,) + { + 2 + } + ), + GPO2, 1, Connection ( GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, @@ -524,6 +568,18 @@ Scope (\_SB.PCI0.I2C2) GRST = Arg0 } + /* Read GPO1 GPIO, to configure as input */ + Method (CGP1, 0, Serialized) + { + Return (GPO1) + } + + /* Read GPO2 GPIO, to configure as input */ + Method (CGP2, 0, Serialized) + { + Return (GPO2) + } + Name (_PR0, Package () { ^^I2C2.PMIC.OVTH }) Name (_PR3, Package () { ^^I2C2.PMIC.OVTH })