mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 11:25:14 +00:00
pyro: Name USB port numbers appropriately
Some USB PD port numbers are not named. Some numbers are named using I2C port names. This patch fixes them Follow reef setting. BUG=none BRANCH=reef TEST=make buildall Change-Id: I4a9d3a765f6de84ac1a6f3e903171a505bc37d6c Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/449123 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
@@ -62,6 +62,9 @@
|
||||
#define IN_PGOOD_PP3300 POWER_SIGNAL_MASK(X86_PGOOD_PP3300)
|
||||
#define IN_PGOOD_PP5000 POWER_SIGNAL_MASK(X86_PGOOD_PP5000)
|
||||
|
||||
#define USB_PD_PORT_ANX74XX 0
|
||||
#define USB_PD_PORT_PS8751 1
|
||||
|
||||
static void tcpc_alert_event(enum gpio_signal signal)
|
||||
{
|
||||
if ((signal == GPIO_USB_C0_PD_INT_ODL) &&
|
||||
@@ -88,7 +91,7 @@ static void anx74xx_cable_det_handler(void)
|
||||
* handle only the attach event.
|
||||
*/
|
||||
if (level)
|
||||
anx74xx_handle_power_mode(NPCX_I2C_PORT0_0,
|
||||
anx74xx_handle_power_mode(USB_PD_PORT_ANX74XX,
|
||||
ANX74XX_NORMAL_MODE);
|
||||
|
||||
/* confirm if cable_det is asserted */
|
||||
@@ -235,8 +238,18 @@ const int i2c_test_dev_used = ARRAY_SIZE(i2c_stress_tests);
|
||||
#endif /* CONFIG_CMD_I2C_STRESS_TEST */
|
||||
|
||||
const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
|
||||
{NPCX_I2C_PORT0_0, 0x50, &anx74xx_tcpm_drv, TCPC_ALERT_ACTIVE_LOW},
|
||||
{NPCX_I2C_PORT0_1, 0x16, &tcpci_tcpm_drv, TCPC_ALERT_ACTIVE_LOW},
|
||||
[USB_PD_PORT_ANX74XX] = {
|
||||
.i2c_host_port = NPCX_I2C_PORT0_0,
|
||||
.i2c_slave_addr = 0x50,
|
||||
.drv = &anx74xx_tcpm_drv,
|
||||
.pol = TCPC_ALERT_ACTIVE_LOW,
|
||||
},
|
||||
[USB_PD_PORT_PS8751] = {
|
||||
.i2c_host_port = NPCX_I2C_PORT0_1,
|
||||
.i2c_slave_addr = 0x16,
|
||||
.drv = &tcpci_tcpm_drv,
|
||||
.pol = TCPC_ALERT_ACTIVE_LOW,
|
||||
},
|
||||
};
|
||||
|
||||
uint16_t tcpc_get_alert_status(void)
|
||||
@@ -266,12 +279,12 @@ const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
|
||||
|
||||
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
|
||||
{
|
||||
.port_addr = 0, /* don't care / unused */
|
||||
.port_addr = USB_PD_PORT_ANX74XX, /* don't care / unused */
|
||||
.driver = &anx74xx_tcpm_usb_mux_driver,
|
||||
.hpd_update = &anx74xx_tcpc_update_hpd_status,
|
||||
},
|
||||
{
|
||||
.port_addr = 1,
|
||||
.port_addr = USB_PD_PORT_PS8751,
|
||||
.driver = &tcpci_tcpm_usb_mux_driver,
|
||||
.hpd_update = &ps8751_tcpc_update_hpd_status,
|
||||
}
|
||||
@@ -512,8 +525,8 @@ int pd_snk_is_vbus_provided(int port)
|
||||
enum bd9995x_charge_port bd9995x_port;
|
||||
|
||||
switch (port) {
|
||||
case 0:
|
||||
case 1:
|
||||
case USB_PD_PORT_ANX74XX:
|
||||
case USB_PD_PORT_PS8751:
|
||||
bd9995x_port = bd9995x_pd_port_to_chg_port(port);
|
||||
break;
|
||||
default:
|
||||
@@ -549,8 +562,8 @@ int board_set_active_charge_port(int charge_port)
|
||||
return -1;
|
||||
|
||||
switch (charge_port) {
|
||||
case 0:
|
||||
case 1:
|
||||
case USB_PD_PORT_ANX74XX:
|
||||
case USB_PD_PORT_PS8751:
|
||||
/* Don't charge from a source port */
|
||||
if (board_vbus_source_enabled(charge_port))
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user