Skip to content

Commit c8f58b8

Browse files
Merge pull request #1041 from FrameworkComputer/marigold.pd_limit_current
fwk: needs to limit the current during the PD voltage transition
2 parents 682f3ee + 9803e2e commit c8f58b8

4 files changed

Lines changed: 20 additions & 7 deletions

File tree

zephyr/program/framework/marigold/src/charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static void charger_chips_init(void)
140140
goto init_fail;
141141

142142
/* TODO: should we need to talk to PD chip after initial complete ? */
143-
CPRINTS("ISL9241 customized initial complete! 3F:%d", value);
143+
CPRINTS("ISL9241 customized initial complete!");
144144
return;
145145

146146
init_fail:

zephyr/program/framework/src/board_host_command.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ static enum ec_status bb_retimer_control(struct host_cmd_handler_args *args)
497497
const struct ec_params_bb_retimer_control_mode *p = args->params;
498498
struct ec_response_bb_retimer_control_mode *r = args->response;
499499

500-
CPRINTS("TODO: bb-retimer interface :%d", p->controller);
501500
r->status = 0;
502501
args->response_size = sizeof(*r);
503502

zephyr/program/framework/src/cypd_ccg6.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ int board_set_active_charge_port(int charge_port)
270270
/* store current port and update power limit */
271271
update_active_charge_pd_port(charge_port);
272272
hook_call_deferred(&update_power_state_deferred_data, 100 * MSEC);
273-
CPRINTS("Updating %s port %d", __func__, charge_port);
274273
return EC_SUCCESS;
275274
}
276275

@@ -299,7 +298,6 @@ int board_set_active_charge_port(int charge_port)
299298
}
300299

301300
hook_call_deferred(&update_power_state_deferred_data, 100 * MSEC);
302-
CPRINTS("Updating %s port %d", __func__, charge_port);
303301

304302
#ifdef CONFIG_BOARD_MARIGOLD
305303
acok_control(pd_port_states[charge_port].voltage);

zephyr/program/framework/src/cypress_pd_common.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,9 @@ int cypd_device_int(int controller)
14141414
CPRINTS("PD%d Message Overflow", controller);
14151415
break;
14161416
default:
1417-
CPRINTS("INTR_REG CTRL:%d TODO Device 0x%x", controller, data & 0xFF);
1417+
/* reduce the EC logs without debugging */
1418+
if (verbose_msg_logging)
1419+
CPRINTS("C%d device response: 0x%x", controller, data & 0xFF);
14181420
}
14191421
} else
14201422
return EC_ERROR_INVAL;
@@ -1543,6 +1545,8 @@ void cypd_port_int(int controller, int port)
15431545
uint16_t addr_flags = pd_chip_config[controller].addr_flags;
15441546
int port_idx = (controller << 1) + port;
15451547
enum tcpci_msg_type sop_type;
1548+
static int snk_transition_flags;
1549+
15461550
/* enum pd_msg_type sop_type; */
15471551
rv = i2c_read_offset16_block(i2c_port, addr_flags,
15481552
CCG_PORT_PD_RESPONSE_REG(port), data2, 4);
@@ -1612,6 +1616,8 @@ void cypd_port_int(int controller, int port)
16121616
pd_port_states[port_idx].epr_support = 1;
16131617
CPRINTS("P%d EPR mode capable", port_idx);
16141618
}
1619+
1620+
snk_transition_flags = 1;
16151621
break;
16161622
#ifdef CONFIG_PD_CCG8_EPR
16171623
case CCG_RESPONSE_EPR_EVENT:
@@ -1620,6 +1626,13 @@ void cypd_port_int(int controller, int port)
16201626
cypd_update_port_state(controller, port);
16211627
break;
16221628
#endif
1629+
case CCG_RESPONSE_ACCEPT_MSG_RX:
1630+
CPRINTS("CCG_RESPONSE_ACCEPT_MSG_RX %d", port_idx);
1631+
if (snk_transition_flags) {
1632+
charge_manager_force_ceil(port_idx, 500);
1633+
snk_transition_flags = 0;
1634+
}
1635+
break;
16231636
case CCG_RESPONSE_EXT_MSG_SOP_RX:
16241637
case CCG_RESPONSE_EXT_SOP1_RX:
16251638
case CCG_RESPONSE_EXT_SOP2_RX:
@@ -1866,13 +1879,14 @@ enum pd_power_role pd_get_power_role(int port)
18661879

18671880
void pd_request_power_swap(int port)
18681881
{
1869-
CPRINTS("TODO Implement %s port %d", __func__, port);
1882+
/* We probably dont need to do this */
1883+
return;
18701884
}
18711885

18721886
void pd_set_new_power_request(int port)
18731887
{
18741888
/* We probably dont need to do this since we will always request max. */
1875-
CPRINTS("TODO Implement %s port %d", __func__, port);
1889+
return;
18761890
}
18771891

18781892
int pd_is_connected(int port)
@@ -1917,6 +1931,8 @@ int get_active_charge_pd_port(void)
19171931

19181932
void update_active_charge_pd_port(int update_charger_port)
19191933
{
1934+
CPRINTS("%s port %d, prev:%d", __func__, update_charger_port, prev_charge_port);
1935+
19201936
prev_charge_port = update_charger_port;
19211937
}
19221938

0 commit comments

Comments
 (0)