diff options
Diffstat (limited to 'board/mithrax/i2c.c')
-rw-r--r-- | board/mithrax/i2c.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/board/mithrax/i2c.c b/board/mithrax/i2c.c index 12219981a8..a850c12544 100644 --- a/board/mithrax/i2c.c +++ b/board/mithrax/i2c.c @@ -1,15 +1,12 @@ -/* Copyright 2022 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "common.h" #include "compile_time_macros.h" -#include "console.h" -#include "hooks.h" -#include "i2c.h" -#define BOARD_ID_FAST_PLUS_CAPABLE 2 +#include "i2c.h" /* I2C port map configuration */ const struct i2c_port_t i2c_ports[] = { @@ -23,24 +20,24 @@ const struct i2c_port_t i2c_ports[] = { }, { /* I2C1 */ - .name = "tcpc0,2", - .port = I2C_PORT_USB_C0_C2_TCPC, + .name = "tcpc2", + .port = I2C_PORT_USB_C2_TCPC, .kbps = 1000, .scl = GPIO_EC_I2C_USB_C0_C2_TCPC_SCL, .sda = GPIO_EC_I2C_USB_C0_C2_TCPC_SDA, }, { /* I2C2 */ - .name = "ppc0,2", - .port = I2C_PORT_USB_C0_C2_PPC, + .name = "ppc2", + .port = I2C_PORT_USB_C2_PPC, .kbps = 1000, .scl = GPIO_EC_I2C_USB_C0_C2_PPC_BC_SCL, .sda = GPIO_EC_I2C_USB_C0_C2_PPC_BC_SDA, }, { /* I2C3 */ - .name = "retimer0,2", - .port = I2C_PORT_USB_C0_C2_MUX, + .name = "retimer2", + .port = I2C_PORT_USB_C2_MUX, .kbps = 1000, .scl = GPIO_EC_I2C_USB_C0_C2_RT_SCL, .sda = GPIO_EC_I2C_USB_C0_C2_RT_SDA, @@ -49,7 +46,7 @@ const struct i2c_port_t i2c_ports[] = { /* I2C4 C1 TCPC */ .name = "tcpc1", .port = I2C_PORT_USB_C1_TCPC, - .kbps = 1000, + .kbps = 400, .scl = GPIO_EC_I2C_USB_C1_TCPC_SCL, .sda = GPIO_EC_I2C_USB_C1_TCPC_SDA, .flags = I2C_PORT_FLAG_DYNAMIC_SPEED, @@ -66,10 +63,9 @@ const struct i2c_port_t i2c_ports[] = { /* I2C6 */ .name = "ppc1", .port = I2C_PORT_USB_C1_PPC, - .kbps = 1000, + .kbps = 400, .scl = GPIO_EC_I2C_USB_C1_MIX_SCL, .sda = GPIO_EC_I2C_USB_C1_MIX_SDA, - .flags = I2C_PORT_FLAG_DYNAMIC_SPEED, }, { /* I2C7 */ @@ -81,19 +77,3 @@ const struct i2c_port_t i2c_ports[] = { }, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - -/* - * I2C controllers are initialized in main.c. This sets the speed much - * later, but before I2C peripherals are initialized. - */ -static void set_board_legacy_i2c_speeds(void) -{ - if (get_board_id() >= BOARD_ID_FAST_PLUS_CAPABLE) - return; - - ccprints("setting USB DB I2C buses to 400 kHz\n"); - - i2c_set_freq(I2C_PORT_USB_C1_TCPC, I2C_FREQ_400KHZ); - i2c_set_freq(I2C_PORT_USB_C1_PPC, I2C_FREQ_400KHZ); -} -DECLARE_HOOK(HOOK_INIT, set_board_legacy_i2c_speeds, HOOK_PRIO_INIT_I2C - 1); |