Skip to content

Commit cc0918a

Browse files
authored
Merge pull request #547 from FrameworkComputer/hx20-hx30
merge hx30 changes to RPL platform
2 parents d23c144 + 96e5e21 commit cc0918a

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

board/hx30/cypress5525.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -423,20 +423,11 @@ void cypd_set_error_recovery(void)
423423
int i;
424424

425425
for (i = 0; i < PD_CHIP_COUNT; i++) {
426-
if (charger_current_battery_params()->flags & BATT_FLAG_RESPONSIVE &&
427-
charger_current_battery_params()->state_of_charge > 0 &&
428-
board_batt_is_present() == BP_YES) {
429-
/* CYPD firmware will issue error recovery when we change the system
430-
* power state to S0, if battery can't provide the power, it will cause
431-
* power loss.
432-
*
433-
* We can write the 0xC0 to avoid cypd to do the error recovery before we
434-
* change the system power state
435-
*/
436-
cypd_write_reg8_wait_ack(i, CYP5525_SYS_PWR_STATE, 0xC0);
437-
reconnect_flag = false;
438-
} else
439-
cypd_write_reg8_wait_ack(i, CYP5525_SYS_PWR_STATE, 0xC0);
426+
/* We use port reconnect (0x2C) to replace error recovery (0xC1) for GRL issue.
427+
* GRL FV 3.1.2.3.
428+
* 0xC0 means no recovery.
429+
*/
430+
cypd_write_reg8_wait_ack(i, CYP5525_SYS_PWR_STATE, 0xC0);
440431
}
441432
}
442433

@@ -460,7 +451,7 @@ void update_system_power_state(int controller)
460451
cypd_set_power_state(CYP5525_POWERSTATE_S0, controller);
461452
if (reconnect_flag) {
462453
CPRINTS("CYPD reconnect");
463-
cypd_aconly_reconnect();
454+
cypd_reconnect();
464455
reconnect_flag = false;
465456
}
466457
break;
@@ -1411,10 +1402,11 @@ int cypd_reconnect_port_enable(int controller)
14111402
return rv;
14121403
}
14131404

1414-
void cypd_aconly_reconnect(void)
1405+
void cypd_reconnect(void)
14151406
{
14161407
int events;
14171408

1409+
/* trigger port reconnect, will check ac status while disable port */
14181410
events = task_wait_event_mask(TASK_EVENT_TIMER, 100*MSEC);
14191411
if (events & TASK_EVENT_TIMER)
14201412
cypd_enque_evt(CYPD_EVT_PORT_DISABLE, 0);

board/hx30/cypress5525.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ void set_pd_fw_update(bool update);
461461

462462
void cypd_charger_init_complete(void);
463463

464-
void cypd_aconly_reconnect(void);
464+
void cypd_reconnect(void);
465465

466466
int cypd_reconnect_port_enable(int controller);
467467

0 commit comments

Comments
 (0)