public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: netdev@vger.kernel.org
Cc: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	Guenter Roeck <linux@roeck-us.net>, Jiri Pirko <jiri@resnulli.us>,
	Prathosh Satish <Prathosh.Satish@microchip.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	Michal Schmidt <mschmidt@redhat.com>,
	Petr Oros <poros@redhat.com>, Simon Horman <horms@kernel.org>
Subject: [PATCH net-next 0/3] dpll: zl3073x: add hwmon support
Date: Fri, 20 Mar 2026 11:59:12 +0100	[thread overview]
Message-ID: <20260320105915.149068-1-ivecera@redhat.com> (raw)

Add hwmon support to the ZL3073x DPLL driver, exposing die temperature
and input reference frequency measurements via the standard hwmon
interface.

Patch 1 registers an hwmon device with the standard temperature sensor
channel. The die temperature is only available on chip variants with the
ZL3073X_FLAG_DIE_TEMP flag and visibility is controlled via the
is_visible callback. The temperature register value in 0.1°C units is
converted to millidegrees Celsius.

Patch 2 adds the frequency measurement infrastructure. It extracts
common measurement latch logic into a zl3073x_ref_freq_meas_latch()
helper shared with the existing FFO measurement code, and adds
zl3073x_ref_freq_meas_update() to periodically read absolute input
reference frequencies in Hz.

Patch 3 exposes the measured frequencies via custom sysfs attributes
(freqN_input and freqN_label) since hwmon has no native frequency
sensor type. A cached device ready flag ensures freq_input_show()
returns -ENODATA without I2C access when firmware is not configured.

The hwmon registration is conditionally compiled using
IS_REACHABLE(CONFIG_HWMON) with a stub fallback.

Tested on Microchip EDS2 (pcb8385) platform:

  $ sensors zl3073x-i2c-1-70
  zl3073x-i2c-1-70
  Adapter: AT91
  temp1:        +24.2°C
  REF0P:        125 MHz
  REF0N:          0 Hz
  REF1P:        125 MHz
  REF1N:        125 MHz
  REF2P:         10 MHz
  REF2N:       1000 mHz
  REF3P:          0 Hz
  REF3N:       1000 mHz
  REF4P:         25 MHz
  REF4N:        170 kHz

  $ sensors -u zl3073x-i2c-1-70
  zl3073x-i2c-1-70
  Adapter: AT91
  temp1:
    temp1_input: 24.200
  REF0P:
    freq0_input: 124999220.000
  REF0N:
    freq1_input: 0.000
  REF1P:
    freq2_input: 125001660.000
  REF1N:
    freq3_input: 125001661.000
  REF2P:
    freq4_input: 10000000.000
  REF2N:
    freq5_input: 1.000
  REF3P:
    freq6_input: 0.000
  REF3N:
    freq7_input: 1.000
  REF4P:
    freq8_input: 25000000.000
  REF4N:
    freq9_input: 169598.000

Ivan Vecera (3):
  dpll: zl3073x: add hwmon support for die temperature
  dpll: zl3073x: add input reference frequency measurement
  dpll: zl3073x: add hwmon support for input reference frequencies

 drivers/dpll/zl3073x/Makefile |   1 +
 drivers/dpll/zl3073x/core.c   |  91 ++++++++++++++++----
 drivers/dpll/zl3073x/core.h   |   2 +
 drivers/dpll/zl3073x/hwmon.c  | 151 ++++++++++++++++++++++++++++++++++
 drivers/dpll/zl3073x/hwmon.h  |  16 ++++
 drivers/dpll/zl3073x/ref.h    |  14 ++++
 6 files changed, 261 insertions(+), 14 deletions(-)
 create mode 100644 drivers/dpll/zl3073x/hwmon.c
 create mode 100644 drivers/dpll/zl3073x/hwmon.h

-- 
2.52.0


             reply	other threads:[~2026-03-20 10:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 10:59 Ivan Vecera [this message]
2026-03-20 10:59 ` [PATCH net-next 1/3] dpll: zl3073x: add hwmon support for die temperature Ivan Vecera
2026-03-20 10:59 ` [PATCH net-next 2/3] dpll: zl3073x: add input reference frequency measurement Ivan Vecera
2026-03-20 10:59 ` [PATCH net-next 3/3] dpll: zl3073x: add hwmon support for input reference frequencies Ivan Vecera
2026-03-20 12:21   ` Guenter Roeck
2026-03-20 13:48     ` Ivan Vecera
2026-03-23 22:48       ` Jakub Kicinski
2026-03-24  5:16         ` Guenter Roeck
2026-03-24 10:49           ` Paolo Abeni
2026-03-24 12:59             ` Ivan Vecera
2026-03-24 21:36               ` Jakub Kicinski
2026-03-25 11:19                 ` Ivan Vecera
2026-03-25 15:56                   ` Vadim Fedorenko
2026-03-25 16:04                     ` Ivan Vecera

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=20260320105915.149068-1-ivecera@redhat.com \
    --to=ivecera@redhat.com \
    --cc=Prathosh.Satish@microchip.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=poros@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    /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