Skip to content

Commit e1ef488

Browse files
committed
Fwk: clean up some debug logs
Signed-off-by: Josh-Tsai <josh_tsai@compal.com>
1 parent eb72c98 commit e1ef488

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

board/hx30/cypress5525.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,10 @@ int cypd_write_reg8_wait_ack(int controller, int reg, int data, int delay_ms)
240240
rv = cypd_get_int(controller, &intr_status);
241241
if (rv != EC_SUCCESS)
242242
return rv;
243+
243244
if (intr_status & CYP5525_DEV_INTR) {
244-
CPRINTS("data = 0x%04x", data);
245245
if (data == CYP5525_AC_AT_PORT) {
246246
rv = cypd_read_reg8(controller, CYP5525_RESPONSE_REG, &event);
247-
CPRINTS("event = 0x%04x", event);
248247
if (rv != EC_SUCCESS)
249248
CPRINTS("fail to read response");
250249
switch (event) {
@@ -257,9 +256,10 @@ int cypd_write_reg8_wait_ack(int controller, int reg, int data, int delay_ms)
257256
case CYPD_RESPONSE_NO_AC:
258257
case CYPD_RESPONSE_EC_MODE:
259258
break;
259+
default:
260+
CPRINTS("Check AC get unknown event 0x%04x", event);
260261
}
261-
} else
262-
CPRINTS("unknown event");
262+
}
263263
cypd_clear_int(controller, CYP5525_DEV_INTR);
264264
}
265265
usleep(50);
@@ -1813,16 +1813,13 @@ int check_power_on_port(void)
18131813
static int prev_charge_port = -1;
18141814
int board_set_active_charge_port(int charge_port)
18151815
{
1816-
CPRINTS("start change port = %d, prev_charge_port = %d", charge_port, prev_charge_port);
1817-
18181816
/* if no battery, EC should not control C_CTRL */
18191817
if (board_batt_is_present() != BP_YES) {
18201818
/* check if CYPD ready */
18211819
if (charge_port == -1)
18221820
return EC_ERROR_TRY_AGAIN;
18231821

18241822
/* store current port and update power limit */
1825-
CPRINTS("No batt, no change");
18261823
prev_charge_port = charge_port;
18271824
hook_call_deferred(&update_power_limit_deferred_data, 100 * MSEC);
18281825
CPRINTS("Updating %s port %d", __func__, charge_port);
@@ -1832,7 +1829,7 @@ int board_set_active_charge_port(int charge_port)
18321829
/* port need change, stop all power and ready to switch. */
18331830
if (prev_charge_port != -1 && prev_charge_port != charge_port) {
18341831
update_soc_power_limit(false, true);
1835-
CPRINTS("all off");
1832+
CPRINTS("Disable all type-c port to change the charger port");
18361833
cypd_write_reg8(0, CYP5525_CUST_C_CTRL_CONTROL_REG, CYP5525_P0P1_TURN_OFF_C_CTRL);
18371834
cypd_write_reg8(1, CYP5525_CUST_C_CTRL_CONTROL_REG, CYP5525_P0P1_TURN_OFF_C_CTRL);
18381835
usleep(250*MSEC);
@@ -1844,15 +1841,11 @@ int board_set_active_charge_port(int charge_port)
18441841
if (charge_port >=0 ) {
18451842
int pd_controller = (charge_port & 0x02) >> 1;
18461843
int pd_port = charge_port & 0x01;
1847-
1848-
CPRINTS("force off ctrler = %d", (~pd_controller) & 0x01);
18491844
cypd_write_reg8((~pd_controller) & 0x01, CYP5525_CUST_C_CTRL_CONTROL_REG,
18501845
CYP5525_P0P1_TURN_OFF_C_CTRL);
1851-
CPRINTS("choose p %d, ctrler = %d, p = %d", charge_port, pd_controller, pd_port);
18521846
cypd_write_reg8(pd_controller, CYP5525_CUST_C_CTRL_CONTROL_REG,
18531847
pd_port ? CYP5525_P0_OFF_P1_CY : CYP5525_P0_CY_P1_OFF);
18541848
} else {
1855-
CPRINTS("else = %d, set all ports auto", charge_port);
18561849
cypd_write_reg8(0, CYP5525_CUST_C_CTRL_CONTROL_REG, CYP5525_P0P1_TURN_OFF_C_CTRL);
18571850
cypd_write_reg8(1, CYP5525_CUST_C_CTRL_CONTROL_REG, CYP5525_P0P1_TURN_OFF_C_CTRL);
18581851
}

common/charge_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void charge_manager_get_best_charge_port(int *new_port,
579579
/* If system initially power on w/o dc, CYPD will control C_CTRL */
580580
if ((charge_port == CHARGE_SUPPLIER_NONE) && (board_batt_is_present() != BP_YES)) {
581581
*new_port = check_power_on_port();
582-
CPRINTS("NO DC, choose AC by CYPD: %d", *new_port);
582+
CPRINTS("AC only power on port %d", *new_port);
583583
*new_supplier = CHARGE_SUPPLIER_PD;
584584
if (*new_port == -1)
585585
*new_supplier = CHARGE_SUPPLIER_NONE;

0 commit comments

Comments
 (0)