summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/fizz/mainboard.c4
-rw-r--r--src/mainboard/google/hatch/variants/puff/mainboard.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mainboard/google/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c
index daf9da4388..9f35411c24 100644
--- a/src/mainboard/google/fizz/mainboard.c
+++ b/src/mainboard/google/fizz/mainboard.c
@@ -104,8 +104,9 @@ static void mainboard_set_power_limits(config_t *conf)
{
enum usb_chg_type type;
u32 watts;
+ u16 volts_mv, current_ma;
u32 pl2, psyspl2;
- int rv = google_chromeec_get_usb_pd_power_info(&type, &watts);
+ int rv = google_chromeec_get_usb_pd_power_info(&type, &current_ma, &volts_mv);
uint8_t sku = board_sku_id();
const uint32_t u42_mask = (1 << FIZZ_SKU_ID_I7_U42) |
(1 << FIZZ_SKU_ID_I5_U42) |
@@ -126,6 +127,7 @@ static void mainboard_set_power_limits(config_t *conf)
psyspl2 = FIZZ_PSYSPL2_U42;
} else {
/* Detected TypeC. Base on max value of adapter */
+ watts = ((u32)volts_mv * current_ma) / 1000000;
psyspl2 = watts;
conf->tdp_psyspl3 = SET_PSYSPL2(psyspl2);
/* set max possible time window */
diff --git a/src/mainboard/google/hatch/variants/puff/mainboard.c b/src/mainboard/google/hatch/variants/puff/mainboard.c
index e8098b96ac..3f74c968b1 100644
--- a/src/mainboard/google/hatch/variants/puff/mainboard.c
+++ b/src/mainboard/google/hatch/variants/puff/mainboard.c
@@ -90,8 +90,9 @@ static void mainboard_set_power_limits(config_t *conf)
{
enum usb_chg_type type;
u32 watts;
+ u16 volts_mv, current_ma;
u32 psyspl2 = PUFF_PSYSPL2; // default barrel jack value for U22
- int rv = google_chromeec_get_usb_pd_power_info(&type, &watts);
+ int rv = google_chromeec_get_usb_pd_power_info(&type, &current_ma, &volts_mv);
/* use SoC default value for PsysPL3 and PL4 unless we're on USB-PD*/
conf->tdp_psyspl3 = 0;
@@ -99,6 +100,7 @@ static void mainboard_set_power_limits(config_t *conf)
if (rv == 0 && type == USB_CHG_TYPE_PD) {
/* Detected USB-PD. Base on max value of adapter */
+ watts = ((u32)current_ma * volts_mv) / 1000000;
psyspl2 = watts;
conf->tdp_psyspl3 = SET_PSYSPL2(psyspl2);
/* set max possible time window */