diff mbox series

[1/2] platform/chrome: cros_ec: Add VDM attention headers

Message ID 20230126205620.3714994-1-pmalani@chromium.org (mailing list archive)
State Accepted
Commit 4b1936cd081496865151eaab539f767240952306
Headers show
Series [1/2] platform/chrome: cros_ec: Add VDM attention headers | expand

Commit Message

Prashant Malani Jan. 26, 2023, 8:55 p.m. UTC
Incorporate updates to the EC headers to support the retrieval of VDM
Attention messages from port partners. These headers are already present
in the ChromeOS EC codebase. [1]

[1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 include/linux/platform_data/cros_ec_commands.h | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Comments

Benson Leung Jan. 26, 2023, 9 p.m. UTC | #1
Hi Prashant,

On Thu, Jan 26, 2023 at 08:55:45PM +0000, Prashant Malani wrote:
> Incorporate updates to the EC headers to support the retrieval of VDM
> Attention messages from port partners. These headers are already present
> in the ChromeOS EC codebase. [1]
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

Reviewed-by: Benson Leung <bleung@chromium.org>


> ---
>  include/linux/platform_data/cros_ec_commands.h | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
> index b9c4a3964247..ec327638c6eb 100644
> --- a/include/linux/platform_data/cros_ec_commands.h
> +++ b/include/linux/platform_data/cros_ec_commands.h
> @@ -5862,6 +5862,7 @@ enum tcpc_cc_polarity {
>  #define PD_STATUS_EVENT_MUX_1_SET_DONE		BIT(5)
>  #define PD_STATUS_EVENT_VDM_REQ_REPLY		BIT(6)
>  #define PD_STATUS_EVENT_VDM_REQ_FAILED		BIT(7)
> +#define PD_STATUS_EVENT_VDM_ATTENTION			BIT(8)
>  
>  struct ec_params_typec_status {
>  	uint8_t port;
> @@ -5906,7 +5907,8 @@ struct ec_response_typec_status {
>  } __ec_align1;
>  
>  /*
> - * Gather the response to the most recent VDM REQ from the AP
> + * Gather the response to the most recent VDM REQ from the AP, as well
> + * as popping the oldest VDM:Attention from the DPM queue
>   */
>  #define EC_CMD_TYPEC_VDM_RESPONSE 0x013C
>  
> @@ -5919,10 +5921,18 @@ struct ec_response_typec_vdm_response {
>  	uint8_t vdm_data_objects;
>  	/* Partner to address - see enum typec_partner_type */
>  	uint8_t partner_type;
> -	/* Reserved */
> -	uint16_t reserved;
> +	/* enum ec_status describing VDM response */
> +	uint16_t vdm_response_err;
>  	/* VDM data, including VDM header */
>  	uint32_t vdm_response[VDO_MAX_SIZE];
> +	/* Number of 32-bit Attention fields filled in */
> +	uint8_t vdm_attention_objects;
> +	/* Number of remaining messages to consume */
> +	uint8_t vdm_attention_left;
> +	/* Reserved */
> +	uint16_t reserved1;
> +	/* VDM:Attention contents */
> +	uint32_t vdm_attention[2];
>  } __ec_align1;
>  
>  #undef VDO_MAX_SIZE
> -- 
> 2.39.1.456.gfc5497dd1b-goog
>
Tzung-Bi Shih Jan. 31, 2023, 3:19 a.m. UTC | #2
On Thu, Jan 26, 2023 at 08:55:45PM +0000, Prashant Malani wrote:
> Incorporate updates to the EC headers to support the retrieval of VDM
> Attention messages from port partners. These headers are already present
> in the ChromeOS EC codebase. [1]
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

With a nit:
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

> diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
> index b9c4a3964247..ec327638c6eb 100644
> --- a/include/linux/platform_data/cros_ec_commands.h
> +++ b/include/linux/platform_data/cros_ec_commands.h
> @@ -5862,6 +5862,7 @@ enum tcpc_cc_polarity {
>  #define PD_STATUS_EVENT_MUX_1_SET_DONE		BIT(5)
>  #define PD_STATUS_EVENT_VDM_REQ_REPLY		BIT(6)
>  #define PD_STATUS_EVENT_VDM_REQ_FAILED		BIT(7)
> +#define PD_STATUS_EVENT_VDM_ATTENTION			BIT(8)

This has an extra tab if comparing with others around.
patchwork-bot+chrome-platform@kernel.org Jan. 31, 2023, 6:20 p.m. UTC | #3
Hello:

This series was applied to chrome-platform/linux.git (for-kernelci)
by Prashant Malani <pmalani@chromium.org>:

On Thu, 26 Jan 2023 20:55:45 +0000 you wrote:
> Incorporate updates to the EC headers to support the retrieval of VDM
> Attention messages from port partners. These headers are already present
> in the ChromeOS EC codebase. [1]
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>
> 
> [...]

Here is the summary with links:
  - [1/2] platform/chrome: cros_ec: Add VDM attention headers
    https://git.kernel.org/chrome-platform/c/4b1936cd0814
  - [2/2] platform/chrome: cros_typec_vdm: Add Attention support
    https://git.kernel.org/chrome-platform/c/f54c013e7eef

You are awesome, thank you!
Prashant Malani Jan. 31, 2023, 6:21 p.m. UTC | #4
Thanks for reviewing the patch, Tzung-Bi.

On Mon, Jan 30, 2023 at 7:19 PM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> On Thu, Jan 26, 2023 at 08:55:45PM +0000, Prashant Malani wrote:
> > Incorporate updates to the EC headers to support the retrieval of VDM
> > Attention messages from port partners. These headers are already present
> > in the ChromeOS EC codebase. [1]
> >
> > [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> >
> > Signed-off-by: Prashant Malani <pmalani@chromium.org>
>
> With a nit:
> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
>
> > diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
> > index b9c4a3964247..ec327638c6eb 100644
> > --- a/include/linux/platform_data/cros_ec_commands.h
> > +++ b/include/linux/platform_data/cros_ec_commands.h
> > @@ -5862,6 +5862,7 @@ enum tcpc_cc_polarity {
> >  #define PD_STATUS_EVENT_MUX_1_SET_DONE               BIT(5)
> >  #define PD_STATUS_EVENT_VDM_REQ_REPLY                BIT(6)
> >  #define PD_STATUS_EVENT_VDM_REQ_FAILED               BIT(7)
> > +#define PD_STATUS_EVENT_VDM_ATTENTION                        BIT(8)
>
> This has an extra tab if comparing with others around.
Fixed the tab and applied to chrome-platform/for-kernelci.
patchwork-bot+chrome-platform@kernel.org Feb. 7, 2023, 12:10 a.m. UTC | #5
Hello:

This series was applied to chrome-platform/linux.git (for-next)
by Prashant Malani <pmalani@chromium.org>:

On Thu, 26 Jan 2023 20:55:45 +0000 you wrote:
> Incorporate updates to the EC headers to support the retrieval of VDM
> Attention messages from port partners. These headers are already present
> in the ChromeOS EC codebase. [1]
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>
> 
> [...]

Here is the summary with links:
  - [1/2] platform/chrome: cros_ec: Add VDM attention headers
    https://git.kernel.org/chrome-platform/c/4b1936cd0814
  - [2/2] platform/chrome: cros_typec_vdm: Add Attention support
    https://git.kernel.org/chrome-platform/c/f54c013e7eef

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index b9c4a3964247..ec327638c6eb 100644
--- a/include/linux/platform_data/cros_ec_commands.h
+++ b/include/linux/platform_data/cros_ec_commands.h
@@ -5862,6 +5862,7 @@  enum tcpc_cc_polarity {
 #define PD_STATUS_EVENT_MUX_1_SET_DONE		BIT(5)
 #define PD_STATUS_EVENT_VDM_REQ_REPLY		BIT(6)
 #define PD_STATUS_EVENT_VDM_REQ_FAILED		BIT(7)
+#define PD_STATUS_EVENT_VDM_ATTENTION			BIT(8)
 
 struct ec_params_typec_status {
 	uint8_t port;
@@ -5906,7 +5907,8 @@  struct ec_response_typec_status {
 } __ec_align1;
 
 /*
- * Gather the response to the most recent VDM REQ from the AP
+ * Gather the response to the most recent VDM REQ from the AP, as well
+ * as popping the oldest VDM:Attention from the DPM queue
  */
 #define EC_CMD_TYPEC_VDM_RESPONSE 0x013C
 
@@ -5919,10 +5921,18 @@  struct ec_response_typec_vdm_response {
 	uint8_t vdm_data_objects;
 	/* Partner to address - see enum typec_partner_type */
 	uint8_t partner_type;
-	/* Reserved */
-	uint16_t reserved;
+	/* enum ec_status describing VDM response */
+	uint16_t vdm_response_err;
 	/* VDM data, including VDM header */
 	uint32_t vdm_response[VDO_MAX_SIZE];
+	/* Number of 32-bit Attention fields filled in */
+	uint8_t vdm_attention_objects;
+	/* Number of remaining messages to consume */
+	uint8_t vdm_attention_left;
+	/* Reserved */
+	uint16_t reserved1;
+	/* VDM:Attention contents */
+	uint32_t vdm_attention[2];
 } __ec_align1;
 
 #undef VDO_MAX_SIZE