summaryrefslogtreecommitdiff
path: root/board/delbin
diff options
context:
space:
mode:
authorMichael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>2020-11-26 15:54:16 +0800
committerCommit Bot <commit-bot@chromium.org>2020-12-07 19:59:01 +0000
commit9519eb83f1ae7ff09c2e87b2344072773bb17259 (patch)
treecb7e6ebeb9961e61b706aa92ca05bbb9210874e5 /board/delbin
parent8405cbe461ad133aecbb9418b2d12e62f5e10277 (diff)
downloadchrome-ec-9519eb83f1ae7ff09c2e87b2344072773bb17259.tar.gz
delbin: Initial PS8811 registers.
Depend on b/160937185 #32, initial PS8811 registers. BUG=b:160937185 BRANCH=firmware-volteer-13521.B TEST=manual Check register value under s0. Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I262858b61050f9ad857f44e703bbd3cfd0e989f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2561904 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/delbin')
-rw-r--r--board/delbin/board.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/board/delbin/board.c b/board/delbin/board.c
index 1c712724bc..cb58616607 100644
--- a/board/delbin/board.c
+++ b/board/delbin/board.c
@@ -12,6 +12,7 @@
#include "driver/accelgyro_bmi260.h"
#include "driver/bc12/pi3usb9201.h"
#include "driver/ppc/syv682x.h"
+#include "driver/retimer/ps8811.h"
#include "driver/tcpm/ps8xxx.h"
#include "driver/tcpm/tcpci.h"
#include "driver/tcpm/tusb422.h"
@@ -342,6 +343,34 @@ __override const struct ec_response_keybd_config
return &delbin_kb;
}
+static void ps8811_init(void)
+{
+ int rv;
+
+ /* Set Channel A output swing to Level1 */
+ rv = i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x66, 0x10);
+ /* Set 50 ohm termination adjuct for B channel: -9%*/
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0x73, 0x04);
+ /* Set Channel B output swing to Level3 */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0xA4, 0x03);
+ /* Set PS level for B channel */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0xA5, 0x84);
+ /* Set DE level for B channel */
+ rv |= i2c_write8(I2C_PORT_USB_1_MIX,
+ PS8811_I2C_ADDR_FLAGS0 + PS8811_REG_PAGE1, 0xA6, 0x16);
+}
+
+/* Called on AP S5 -> S0ix transition */
+static void board_chipset_startup(void)
+{
+ ps8811_init();
+}
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
+
/* Called on AP S0ix -> S0 transition */
static void board_chipset_resume(void)
{