Skip to content

Commit 61c3568

Browse files
committed
fix power state values to allow dead battery
System can power on without a battery with new dead battery values. Signed-off-by: Kieran Levin <ktl@frame.work>
1 parent 865ab37 commit 61c3568

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

zephyr/program/lotus/include/cypress_pd_common.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@
140140
/************************************************/
141141
/* POWER STATE DEFINITION */
142142
/************************************************/
143-
#define CCG_POWERSTATE_S0 0x00
144-
#define CCG_POWERSTATE_S3 0x01
145-
#define CCG_POWERSTATE_S4 0x02
146-
#define CCG_POWERSTATE_S5 0x03
143+
#define CCG_POWERSTATE_S0 0x01
144+
#define CCG_POWERSTATE_S0ix 0x02
145+
#define CCG_POWERSTATE_S3 0x03
146+
#define CCG_POWERSTATE_S4 0x04
147+
#define CCG_POWERSTATE_S5 0x05
148+
#define CCG_POWERSTATE_G3 0x06
147149

148150
/************************************************/
149151
/* CCG_CUST_C_CTRL_CONTROL_REG DEFINITION */

zephyr/program/lotus/src/cypress_pd_common.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,8 @@ int cypd_set_power_state(int power_state, int controller)
842842
int i;
843843
int rv = EC_SUCCESS;
844844

845+
return EC_SUCCESS;
846+
845847
CPRINTS("C%d, %s pwr state %d", controller, __func__, power_state);
846848

847849
if (controller < 2)
@@ -918,12 +920,26 @@ void update_system_power_state(int controller)
918920
case POWER_G3:
919921
case POWER_S5:
920922
case POWER_S5G3:
923+
cypd_set_power_state(CCG_POWERSTATE_G3, controller);
924+
break;
921925
case POWER_S3S5:
922926
cypd_set_power_state(CCG_POWERSTATE_S5, controller);
923927
break;
924928
case POWER_S3:
925929
cypd_set_power_state(CCG_POWERSTATE_S3, controller);
926930
break;
931+
case POWER_S0ixS0: /* S0ix -> S0 */
932+
cypd_set_power_state(CCG_POWERSTATE_S0, controller);
933+
break;
934+
case POWER_S0S0ix: /* S0 -> S0ix */
935+
cypd_set_power_state(CCG_POWERSTATE_S0ix, controller);
936+
break;
937+
case POWER_S0ixS3: /* S0ix -> S3 */
938+
cypd_set_power_state(CCG_POWERSTATE_S3, controller);
939+
break;
940+
case POWER_S3S0ix: /* S3 -> S0ix */
941+
cypd_set_power_state(CCG_POWERSTATE_S0ix, controller);
942+
break;
927943
default:
928944
cypd_set_power_state(CCG_POWERSTATE_S0, controller);
929945
break;

0 commit comments

Comments
 (0)