lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <39602911-2520-65fd-9479-9abed301f3f7@roeck-us.net>
Date:   Fri, 15 Jul 2022 06:39:17 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Gene Chen <gene.chen.richtek@...il.com>,
        heikki.krogerus@...ux.intel.com, gregkh@...uxfoundation.org,
        robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, gene_chen@...htek.com,
        cy_huang@...htek.com
Subject: Re: [PATCH 2/3] usb: typec: tcpci: Add get cc tcpci callback

On 7/15/22 03:04, Gene Chen wrote:
> From: Gene Chen <gene_chen@...htek.com>
> 
> Add set_vbus tcpci callback for vendor IC workaround.
> According to different rp level detected, set corresponding
> rx dead zone threshold in order to decode right pd message.
> 

Looking at the next patch, I dispute the need for this callback.
 From what I can see, the additional code should be implemented
in the driver's interrupt handler whenever CC changes, not when
CC values are read from higher level drivers.

Guenter

> Signed-off-by: Gene Chen <gene_chen@...htek.com>
> ---
>   drivers/usb/typec/tcpm/tcpci.c | 3 +++
>   drivers/usb/typec/tcpm/tcpci.h | 2 ++
>   2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index f33e08eb7670..fc2f6191b7d3 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -243,6 +243,9 @@ static int tcpci_get_cc(struct tcpc_dev *tcpc,
>   	unsigned int reg, role_control;
>   	int ret;
>   
> +	if (tcpci->data->get_cc)
> +		return tcpci->data->get_cc(tcpci, tcpci->data, cc1, cc2);
> +
>   	ret = regmap_read(tcpci->regmap, TCPC_ROLE_CTRL, &role_control);
>   	if (ret < 0)
>   		return ret;
> diff --git a/drivers/usb/typec/tcpm/tcpci.h b/drivers/usb/typec/tcpm/tcpci.h
> index b2edd45f13c6..2cef19e131f8 100644
> --- a/drivers/usb/typec/tcpm/tcpci.h
> +++ b/drivers/usb/typec/tcpm/tcpci.h
> @@ -190,6 +190,8 @@ struct tcpci_data {
>   	unsigned char vbus_vsafe0v:1;
>   
>   	int (*init)(struct tcpci *tcpci, struct tcpci_data *data);
> +	int (*get_cc)(struct tcpci *tcpci, struct tcpci_data *data,
> +		      enum typec_cc_status *cc1, enum typec_cc_status *cc2);
>   	int (*set_vconn)(struct tcpci *tcpci, struct tcpci_data *data,
>   			 bool enable);
>   	int (*start_drp_toggling)(struct tcpci *tcpci, struct tcpci_data *data,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ