Re: [Announce] lsucpd release 0.91 utility for USB Type-C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/8/23 02:16, Greg KH wrote:
On Fri, Dec 08, 2023 at 01:36:02AM -0500, Douglas Gilbert wrote:
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

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

Nice!  Any thoughts about adding this functionality to the usbutils
package to make it all in one place?

Well that should be a medium term goal. However currently the environment in
which lsucpd works is far from ideal.

The main problem is the dubious nature of some of the information provided
(via UCSI_ACPI in my case). For my Thinkpad X13 Gen3 either Intel or Lenovo
have screwed up but since that design is 18 months old my guess is those
companies won't do anything about it, only fixing serious security issues.
Maybe they will fix UCSI_ACPI properly in future models. Some other recent
laptops I have tested (less than 12 months old) don't support UCSI_ACPI at
all. Also the design of /sys/class/power_supply isn't a good fit for USB PD.
Not sure how that could be solved. Heikki sounded off about design issues in:
   https://marc.info/?l=linux-usb&m=169278141600478&w=2
Maybe USB PD needs its own power_supply class or at least a class that
is higher level than class/typec and class/usb-power_delivery.

A secondary problem is that I chose to implement lsucpd in C++20 and later
found out that g++ and clang were bending the truth when they said they
supported C++20. std::print is one area of non-compliance. Hopefully this
will improve in time for the next LTS cycle of major distributions.

Doug Gilbert







[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux