Skip to content

Commit 44c39f0

Browse files
LeilaCY-LinJohnAZoidberg
authored andcommitted
fwk: refactor UCSI port and PD port map
Some project's pd port order is different, we need to switch the port order for UCSI. Refactor UCSI port and PD port map for the further project. BRANCH=fwk-main BUG=https://app.clickup.com/t/86eqhvxm6 TEST= use console cmd "cypdctl ucsi 1" enable UCSI log and check port is match on marigold unit. Signed-off-by: LeilaCY-Lin <LeilaCY_Lin@compal.com> (cherry picked from commit 64c85ed)
1 parent 5051aeb commit 44c39f0

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2024 The Chromium OS Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
7+
#include "ucsi.h"
8+
#include "cypress_pd_common.h"
9+
10+
enum ucsi_port {
11+
UCSI_PORT_1,
12+
UCSI_PORT_2,
13+
UCSI_PORT_3,
14+
UCSI_PORT_4,
15+
};
16+
17+
struct ucsi_to_pd_port_map ucsi_pd_port_map[] = {
18+
[UCSI_PORT_1] = {.pd_controller = PD_CHIP_0,
19+
.pd_controller_port = PD_CHIP_UCSI_CONNECTOR_1},
20+
[UCSI_PORT_2] = {.pd_controller = PD_CHIP_0,
21+
.pd_controller_port = PD_CHIP_UCSI_CONNECTOR_2},
22+
[UCSI_PORT_3] = {.pd_controller = PD_CHIP_1,
23+
.pd_controller_port = PD_CHIP_UCSI_CONNECTOR_1},
24+
[UCSI_PORT_4] = {.pd_controller = PD_CHIP_1,
25+
.pd_controller_port = PD_CHIP_UCSI_CONNECTOR_2},
26+
};
27+
BUILD_ASSERT(ARRAY_SIZE(ucsi_pd_port_map) == CONFIG_USB_PD_PORT_MAX_COUNT);

0 commit comments

Comments
 (0)