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]
Date: Mon, 15 Apr 2024 09:59:48 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Neil Armstrong <neil.armstrong@...aro.org>,
	linux-usb@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/5] usb: typec: ucsi: glink: use typec_set_orientation

On Thu, Apr 11, 2024 at 07:49:55AM +0300, Dmitry Baryshkov wrote:
> Use typec_set_orientation() instead of calling typec_switch_set()
> manually. This way the rest of the typec framework and the userspace are
> notified about the orientation change.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_glink.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
> index d21f8cd2fe35..d279e2cf9bba 100644
> --- a/drivers/usb/typec/ucsi/ucsi_glink.c
> +++ b/drivers/usb/typec/ucsi/ucsi_glink.c
> @@ -58,7 +58,6 @@ struct pmic_glink_ucsi {
>  	struct device *dev;
>  
>  	struct gpio_desc *port_orientation[PMIC_GLINK_MAX_PORTS];
> -	struct typec_switch *port_switch[PMIC_GLINK_MAX_PORTS];
>  
>  	struct pmic_glink_client *client;
>  
> @@ -198,9 +197,10 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con)
>  
>  	orientation = gpiod_get_value(ucsi->port_orientation[con->num - 1]);
>  	if (orientation >= 0) {
> -		typec_switch_set(ucsi->port_switch[con->num - 1],
> -				 orientation ? TYPEC_ORIENTATION_REVERSE
> -				 : TYPEC_ORIENTATION_NORMAL);
> +		typec_set_orientation(con->port,
> +				      orientation ?
> +				      TYPEC_ORIENTATION_REVERSE :
> +				      TYPEC_ORIENTATION_NORMAL);
>  	}
>  }
>  
> @@ -378,11 +378,6 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev,
>  			return dev_err_probe(dev, PTR_ERR(desc),
>  					     "unable to acquire orientation gpio\n");
>  		ucsi->port_orientation[port] = desc;
> -
> -		ucsi->port_switch[port] = fwnode_typec_switch_get(fwnode);
> -		if (IS_ERR(ucsi->port_switch[port]))
> -			return dev_err_probe(dev, PTR_ERR(ucsi->port_switch[port]),
> -					"failed to acquire orientation-switch\n");
>  	}
>  
>  	ucsi->client = devm_pmic_glink_register_client(dev,
> 
> -- 
> 2.39.2

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ