All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: linux-usb@vger.kernel.org, dgilbert@interlog.com
Subject: Re: [Announce] lsucpd release 0.91 utility for USB Type-C
Date: Mon, 11 Dec 2023 16:07:31 +0100	[thread overview]
Message-ID: <2914483.e9J7NaK4W3@steina-w> (raw)
In-Reply-To: <5f74a231-e0c2-4be6-ab90-6592f7cfa8df@interlog.com>

Hi Douglas,

Am Freitag, 8. Dezember 2023, 07:36:02 CET schrieb Douglas Gilbert:
> lsucpd is a command line utility for listing USB Type-C ports, partners
> and any associated PD objects. It is essentially data-mining the
> /sys/class/typec and /sys/class/usb_power_delivery directories. So
> lsucpd performs no magic and root permissions are not required.
> 
> lsucpd was originally announced in this post on 28 August 2023:
>    https://marc.info/?l=linux-usb&m=169325926403279&w=2
> That code has been tagged as 'r0.89'. There is also a 'r0.90' tag
> but it was not announced. This release is tagged as 'r0.91'. The
> code is available at this git mirror at:
>      https://github.com/doug-gilbert/lsucpd

What is the actual license? There is LICENSE (BSP-2-Clause) and COPYING 
(GPL-2.0-or-later).

Thanks
Alexander

> Changelog since 0.89 [20230827] [svn: r9]
>    - add the first stage of JSON support
>    - add --pdo-snk= and --pdo-src= options to decode PDOs
>    - add --rdo= option to decode RDOs
>    - make preparations for PD revision 3.2
> 
> The last one is a bit optimistic as the kernel PD stack can't yet handle
> the additions in PD 3.1 (e.g. fixed 28, 36 and 48 Volts, plus AVS from
> 15 to 48 Volts). Recently PD 3.1 dropped all support for 3.3 to < 5 Volts.
> PD 3.2 splits AVS (Adjustable Voltage Supply) into SPR (Standard Power
> Range [<= 21 Volts]) and EPR (Extended ...) variants. SPR AVS is the new
> one going from 9 to 20 Volts. What is the difference between AVS and PPS
> (Programmable PS)? Answer: PPS does current limiting, AVS doesn't ***.
> 
> 
> Note: USB TypeC/PD standards have been in place for almost 10 years
> and now almost all new mobile devices use TypeC/PD . However visibility
> of TypeC/PD to host operating systems is relatively new and immature.
> Previously mobile devices handled TypeC/PD in their BIOS or Embedded
> Controllers and left the host OS "in the dark".
> Please keep this in mind if reporting issues.
> 
> Here is a debian binary package built on Ubuntu 23.10 :
>      https://doug-gilbert.github.io/p/lsucpd_0.91-0.1_amd64.deb
> 
> Here is a rpm built on Fedora 39 :
>      https://doug-gilbert.github.io/p/lsucpd-0.91-1.x86_64.rpm
> 
> Doug Gilbert
> 
> 
> *** "current limiting" as defined by PPS. AVS (and PPS) still does
>       OCP (Over Current Protection) but that is pretty brutal (i.e.
>       the source removes power for a few hundred milliseconds to
>       let the sink cool off)
> 
> 
> Examples from a Thinkpad X13 Gen 3, U 23.10 lk 6.7.0-rc1
>    [port0-partner: is an alternate mode DP dongle,
>     port1-partner: is a PD power adapter (source)]
> 
> $ lsucpd
>   port0 [pd0]  ====>>  partner [pd3]
>   port1 [pd1]  <<====  partner [pd2]
> 
> $ lsucpd -c
>   port0 [pd0]  ====>>  partner [pd3]
>   port1 [pd1]  <<====  partner [pd2]
> 
>  > pd0: has NO source-capabilities
>  > 
>  >  pd0: sink-capabilities:
>     >> 1:fixed_supply; fixed: 5.00 Volts, 3.00 Amps (op)
>     >> 2:variable_supply; variable: 5.00 to 20.00 Volts, 3.25 Amps (op)
>     >> 3:battery; battery: 5.00 to 20.00 Volts, 65.00 Watts (op)
>  > 
>  > pd1: source-capabilities:
>    >> 1:fixed_supply; fixed: 0.00 Volts, 7.21 Amps (max)
>  >  
>  >  pd1: sink-capabilities:
>     >> 1:fixed_supply; fixed: 5.00 Volts, 3.00 Amps (op)
>     >> 2:variable_supply; variable: 5.00 to 20.00 Volts, 3.25 Amps (op)
>     >> 3:battery; battery: 5.00 to 20.00 Volts, 65.00 Watts (op)
>  > 
>  > pd2: source-capabilities:
>    >> 1:fixed_supply; fixed: 5.00 Volts, 3.00 Amps (max)
>    >> 2:fixed_supply; fixed: 9.00 Volts, 3.00 Amps (max)
>    >> 3:fixed_supply; fixed: 12.00 Volts, 3.00 Amps (max)
>    >> 4:fixed_supply; fixed: 15.00 Volts, 3.00 Amps (max)
>    >> 5:fixed_supply; fixed: 20.00 Volts, 3.00 Amps (max)
>  >  
>  >  pd2: has NO sink-capabilities
>  > 
>  > pd3: has NO source-capabilities
>  > 
>  >  pd3: has NO sink-capabilities
> 
> $ lsucpd -ll
>   port0 [pd0]  ====>>  partner [pd3]
>   port1 [pd1]  <<====  partner [pd2]
> 
>  > port0  [pd0]:
>        data_role='[host] device'
>        power_operation_mode='usb_power_delivery'
>        power_role='[source] sink'
>        preferred_role=''
>        supported_accessory_modes='none'
>        usb_power_delivery_revision='2.0'
>        usb_typec_revision='1.0'
>        vconn_source='no'
>        waiting_for_supplier='0'
>     port0-partner  [pd3]:
>        accessory_mode='none'
>        number_of_alternate_modes='1'
>        supports_usb_power_delivery='yes'
>        usb_power_delivery_revision='0.0'
>        Alternate mode: /sys/class/typec/port0-partner/port0-partner.0
>          active='yes'
>          description='DisplayPort'
>          mode='1'
>          svid='ff01'
>          vdo='0x00001085'
> 
>  > port1  [pd1]:
>        data_role='host [device]'
>        power_operation_mode='usb_power_delivery'
>        power_role='source [sink]'
>        preferred_role=''
>        supported_accessory_modes='none'
>        usb_power_delivery_revision='2.0'
>        usb_typec_revision='1.0'
>        vconn_source='no'
>        waiting_for_supplier='0'
>     port1-partner  [pd2]:
>        accessory_mode='none'
>        supports_usb_power_delivery='yes'
>        usb_power_delivery_revision='0.0'
> 
> 
> Note: not all that output is believable (e.g. '0.00 Volts, 7.21 Amps (max)')
> so some common sense is required interpreting the output from lsucpd .


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



  parent reply	other threads:[~2023-12-11 15:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  6:36 [Announce] lsucpd release 0.91 utility for USB Type-C Douglas Gilbert
2023-12-08  7:16 ` Greg KH
2023-12-08 21:14   ` Douglas Gilbert
2023-12-11 15:07 ` Alexander Stein [this message]
2023-12-12  5:44   ` Douglas Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2914483.e9J7NaK4W3@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.