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: <aOZgy-ngtrilVQ5N@kuha.fi.intel.com>
Date: Wed, 8 Oct 2025 16:02:03 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Jameson Thies <jthies@...gle.com>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	dmitry.baryshkov@....qualcomm.com, bleung@...omium.org,
	gregkh@...uxfoundation.org, akuchynski@...omium.org,
	abhishekpandit@...omium.org, sebastian.reichel@...labora.com,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH 2/6] usb: typec: ucsi: psy: Add support for DRP USB type

On Tue, Oct 07, 2025 at 12:00:03AM +0000, Jameson Thies wrote:
> The USB Type registered with the power supply class is based on the
> current power operation mode of the port. When the port is using USB
> PD and is connected to a DRP partner, report that the power supply's
> USB type is USB PD DRP.
> 
> Signed-off-by: Jameson Thies <jthies@...gle.com>

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

> ---
>  drivers/usb/typec/ucsi/psy.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/ucsi/psy.c b/drivers/usb/typec/ucsi/psy.c
> index 2b0225821502..985a90d3f898 100644
> --- a/drivers/usb/typec/ucsi/psy.c
> +++ b/drivers/usb/typec/ucsi/psy.c
> @@ -209,8 +209,16 @@ static int ucsi_psy_get_usb_type(struct ucsi_connector *con,
>  {
>  	val->intval = POWER_SUPPLY_USB_TYPE_C;
>  	if (UCSI_CONSTAT(con, CONNECTED) &&
> -	    UCSI_CONSTAT(con, PWR_OPMODE) == UCSI_CONSTAT_PWR_OPMODE_PD)
> +	    UCSI_CONSTAT(con, PWR_OPMODE) == UCSI_CONSTAT_PWR_OPMODE_PD) {
> +		for (int i = 0; i < con->num_pdos; i++) {
> +			if (pdo_type(con->src_pdos[i]) == PDO_TYPE_FIXED &&
> +			    con->src_pdos[i] & PDO_FIXED_DUAL_ROLE) {
> +				val->intval = POWER_SUPPLY_USB_TYPE_PD_DRP;
> +				return 0;
> +			}
> +		}
>  		val->intval = POWER_SUPPLY_USB_TYPE_PD;
> +	}
>  
>  	return 0;
>  }
> -- 
> 2.51.0.618.g983fd99d29-goog

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ