diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 15 | ||||
-rw-r--r-- | include/ec_commands.h | 10 | ||||
-rw-r--r-- | include/host_command.h | 4 | ||||
-rw-r--r-- | include/usb_pd.h | 8 |
4 files changed, 29 insertions, 8 deletions
diff --git a/include/config.h b/include/config.h index 435a8889d0..e3983eb064 100644 --- a/include/config.h +++ b/include/config.h @@ -1157,18 +1157,18 @@ /* Include all USB Power Delivery modules */ #undef CONFIG_USB_POWER_DELIVERY -/* Alternative configuration keeping only the TX part of PHY */ -#undef CONFIG_USB_PD_TX_PHY_ONLY - -/* Default state of PD communication enabled flag */ -#define CONFIG_USB_PD_COMM_ENABLED 1 - /* Support for USB PD alternate mode */ #undef CONFIG_USB_PD_ALT_MODE /* Support for USB PD alternate mode of Downward Facing Port */ #undef CONFIG_USB_PD_ALT_MODE_DFP +/* Check if max voltage request is allowed before each request */ +#undef CONIFG_USB_PD_CHECK_MAX_REQUEST_ALLOWED + +/* Default state of PD communication enabled flag */ +#define CONFIG_USB_PD_COMM_ENABLED 1 + /* Respond to custom vendor-defined messages over PD */ #undef CONFIG_USB_PD_CUSTOM_VDM @@ -1206,6 +1206,9 @@ /* Use comparator module for PD RX interrupt */ #define CONFIG_USB_PD_RX_COMP_IRQ +/* Alternative configuration keeping only the TX part of PHY */ +#undef CONFIG_USB_PD_TX_PHY_ONLY + /* Support for USB type-c superspeed mux */ #undef CONFIG_USBC_SS_MUX diff --git a/include/ec_commands.h b/include/ec_commands.h index f42e525c4a..304cb9acda 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2680,9 +2680,17 @@ struct ec_params_reboot_ec { /* EC to PD MCU exchange status command */ #define EC_CMD_PD_EXCHANGE_STATUS 0x100 +enum pd_charge_state { + PD_CHARGE_NO_CHANGE = 0, /* Don't change charge state */ + PD_CHARGE_NONE, /* No charging allowed */ + PD_CHARGE_5V, /* 5V charging only */ + PD_CHARGE_MAX /* Charge at max voltage */ +}; + /* Status of EC being sent to PD */ struct ec_params_pd_status { - int8_t batt_soc; /* battery state of charge */ + int8_t batt_soc; /* battery state of charge */ + uint8_t charge_state; /* charging state (from enum pd_charge_state) */ } __packed; /* Status of PD being sent back to EC */ diff --git a/include/host_command.h b/include/host_command.h index e833b96101..4661e59dd6 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -210,8 +210,10 @@ void host_throttle_cpu(int throttle); /** * Signal host command task to send status to PD MCU. + * + * @new_chg_state PD MCU charge state */ -void host_command_pd_send_status(void); +void host_command_pd_send_status(enum pd_charge_state new_chg_state); /** * Ask the PD MCU for its status, obtaining the current charge_port as a diff --git a/include/usb_pd.h b/include/usb_pd.h index 543b939682..410251775f 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -759,6 +759,14 @@ int pd_build_request(int cnt, uint32_t *src_caps, uint32_t *rdo, uint32_t *ma, uint32_t *mv, enum pd_request_type req_type); /** + * Check if max voltage request is allowed (only used if + * CONFIG_USB_PD_CHECK_MAX_REQUEST_ALLOWED is defined). + * + * @return True if max voltage request allowed, False otherwise + */ +int pd_is_max_request_allowed(void); + +/** * Process source capabilities packet * * @param port USB-C port number |