|
|
Log in / Subscribe / Register

hwmon: Add WITRN USB tester driver

From:  Rong Zhang <i-AT-rong.moe>
To:  Guenter Roeck <linux-AT-roeck-us.net>, Jonathan Corbet <corbet-AT-lwn.net>, Shuah Khan <skhan-AT-linuxfoundation.org>
Subject:  [PATCH 0/4] hwmon: Add WITRN USB tester driver
Date:  Fri, 27 Mar 2026 03:19:49 +0800
Message-ID:  <20260327-b4-hwmon-witrn-v1-0-8d2f1896c045@rong.moe>
Cc:  linux-hwmon-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-doc-AT-vger.kernel.org, Rong Zhang <i-AT-rong.moe>
Archive-link:  Article

WITRN produces a series of devices to monitor power characteristics of
USB connections and display those on a on-device display. Most of them
contain an additional port which exposes the measurements via USB HID.

These devices report sensor values in IEEE-754 float (binary32) format.
The driver must perform floating-point number to integer conversions to
provide hwmon channels. Meanwhile, they also report accumulative float
values, and simple division or multiplication turns them into useful
hwmon channels.

Patch 1 adds label support for 64-bit energy attributes, as the driver
needs it.

Patch 2 adds a helper module for floating-point to integer conversions,
so that the conversion, multification and division methods can be used
in this driver as well as other drivers (I am also working on another
USB tester driver that needs it).

Patch 3 adds a barebone HID driver for WITRN K2.

Patch 4 adds hwmon channels and attributes to the driver.

Signed-off-by: Rong Zhang <i@rong.moe>
---
Rong Zhang (4):
      hwmon: Add label support for 64-bit energy attributes
      hwmon: New helper module for floating-point to integer conversions
      hwmon: Add barebone HID driver for WITRN
      hwmon: (witrn) Add monitoring support

 Documentation/hwmon/index.rst |   1 +
 Documentation/hwmon/witrn.rst |  53 ++++
 MAINTAINERS                   |   7 +
 drivers/hwmon/Kconfig         |  14 +
 drivers/hwmon/Makefile        |   2 +
 drivers/hwmon/hwmon-fp.c      | 262 ++++++++++++++++
 drivers/hwmon/hwmon-fp.h      | 212 +++++++++++++
 drivers/hwmon/hwmon.c         |   1 +
 drivers/hwmon/witrn.c         | 691 ++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 1243 insertions(+)
---
base-commit: 0138af2472dfdef0d56fc4697416eaa0ff2589bd
change-id: 20260327-b4-hwmon-witrn-a629b9040250

Thanks,
Rong




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds