Devicetree
 help / color / mirror / Atom feed
From: Changhuang Liang <changhuang.liang@starfivetech.com>
To: Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	devicetree@vger.kernel.org,
	Changhuang Liang <changhuang.liang@starfivetech.com>
Subject: [PATCH v2 0/2] Add JHB100 Fan-Tach support
Date: Wed, 19 Aug 2026 02:15:59 -0700	[thread overview]
Message-ID: <20260819091601.41077-1-changhuang.liang@starfivetech.com> (raw)

StarFive Fan-Tach controller can support up to 16 fan tach input.
The series has been tested on the EVB1 board.

Change since v1:
PATCH 1:
- Add explicit minItems/maxItems and range constraints for tach-ch.
- Switch fan node regex to support hex addresses.
- Add pulses-per-revolution demo.
- Rename example node to fan-controller for consistency.
- Limit the reg property to a maximum value of 15
- Fix tach-ch example by changing /bits/ 8 <0x0>, <0x8> to
  /bits/ 8 <0x0 0x8> so both values are parsed as 8-bit cells.

PATCH 2:
- Added hwmon documentation (starfive-fan-tach.rst)
- Added HAS_IOMEM dependency in Kconfig
- Added per-channel pulses-per-revolution DT property (default 2, range 1-4)
- Added mutex and spinlock for proper concurrency protection
- Added armed_stall/armed_slow mechanism to prevent spurious interrupts
- Added retry logic for zero sampling value in rpm read
- Improved probe sequence: clock enable before reset deassert
- Added devm action for remove path cleanup
- Added input validation for write operations
- Added MODULE_DEVICE_TABLE
- Added linux-hwmon mailing list to MAINTAINERS

v1: https://lore.kernel.org/all/20260428082337.743546-1-changhuang.liang@starfivetech.com/

Changhuang Liang (2):
  dt-bindings: hwmon: Add starfive,jhb100-fan-tach
  hwmon: (starfive-fan-tach) Add fan tach driver for StarFive JHB100

 .../hwmon/starfive,jhb100-fan-tach.yaml       |  93 +++
 Documentation/hwmon/index.rst                 |   1 +
 Documentation/hwmon/starfive-fan-tach.rst     |  34 ++
 MAINTAINERS                                   |   8 +
 drivers/hwmon/Kconfig                         |  14 +
 drivers/hwmon/Makefile                        |   1 +
 drivers/hwmon/starfive-fan-tach.c             | 561 ++++++++++++++++++
 7 files changed, 712 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jhb100-fan-tach.yaml
 create mode 100644 Documentation/hwmon/starfive-fan-tach.rst
 create mode 100644 drivers/hwmon/starfive-fan-tach.c

--
2.25.1

             reply	other threads:[~2026-08-19  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19  9:15 Changhuang Liang [this message]
2026-08-19  9:16 ` [PATCH v2 1/2] dt-bindings: hwmon: Add starfive,jhb100-fan-tach Changhuang Liang

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=20260819091601.41077-1-changhuang.liang@starfivetech.com \
    --to=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox