[PATCH v4 0/2] Add driver support for ESWIN EIC7700 PVT controller

hehuan1@eswincomputing.com posted 2 patches 1 month, 2 weeks ago
There is a newer version of this series
.../bindings/hwmon/eswin,eic7700-pvt.yaml     |  68 ++
drivers/hwmon/Kconfig                         |  12 +
drivers/hwmon/Makefile                        |   1 +
drivers/hwmon/eic7700-pvt.c                   | 591 ++++++++++++++++++
drivers/hwmon/eic7700-pvt.h                   |  99 +++
5 files changed, 771 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml
create mode 100644 drivers/hwmon/eic7700-pvt.c
create mode 100644 drivers/hwmon/eic7700-pvt.h
[PATCH v4 0/2] Add driver support for ESWIN EIC7700 PVT controller
Posted by hehuan1@eswincomputing.com 1 month, 2 weeks ago
From: Huan He <hehuan1@eswincomputing.com>

Add support for the ESWIN EIC7700 PVT (Voltage, Temperature) sensor

Features:
The driver supports monitoring of voltage and temperature parameters
through the hardware monitoring subsystem. It provides an access to the
sampled Temperature and Voltage.

Test:
Tested this patch on the SiFive HiFive Premier P550 (which uses the ESWIN
EIC7700 SoC).

Updates:

  Changes in v4:
  - Update eswin,eic7700-pvt.yaml
    - Delete reviewed-by tag of Conor Dooley, because the label enum
      constraint is introduced
  - Update eic7700-pvt.c and eic7700-pvt.h
    - Remove the unused LVT/ULVT/SVT process-monitoring channels
    - Remove the probe-time power check since the PVT block is always
      powered on EIC7700 and the extra verification is unnecessary
    - Stop requesting the interrupt as shared and use the dedicated PVT IRQ
      only
    - Reorder probe initialization so the interface is initialized before
      the clock is disabled, avoiding register accesses with the clock gated
    - Fix runtime PM reference handling on error paths by balancing
      pm_runtime_get_noresume() with pm_runtime_put_noidle()
    - Add pm_runtime_put_noidle() handling for failed pm_runtime_get_sync()
      calls in hwmon read/write paths
    - Switch the PM callback registration from pm_sleep_ptr() to pm_ptr()

  Changes in v3:
  - Update eswin,eic7700-pvt.yaml
    - Remove redundant label property description and use 'label: true' to
      reference the definition in hwmon-common.yaml
    - Replace 'additionalProperties: false' with
      'unevaluatedProperties: false'
    - Remove the description for '#thermal-sensor-cells'
  - Update eic7700-pvt.c and eic7700-pvt.h
    - Fix clock reference count imbalance with Runtime PM:
      Replace devm_clk_get_enabled() with devm_clk_get() and manually
      manage clock enable/disable to avoid double-disable in remove() when
      Runtime PM is active. Clock is now enabled only during probe for
      eic7700_pvt_check_pwr(), then disabled before enabling Runtime PM,
      which takes full control of the clock thereafter
    - Add detailed comment explaining the spurious interrupt risk in
      eic7700_pvt_check_pwr()
    - Replace wait_for_completion_interruptible() with
      wait_for_completion_timeout() to prevent infinite wait

  Changes in v2:
  - Update eswin,eic7700-pvt.yaml
    - Reference the hwmon-common.yaml file
    - Remove the clock-names and reset-names properties
    - Move additionalProperties: false after the required block
    - Remove one example node to avoid redundancy
  - Update eic7700-pvt.c and eic7700-pvt.h
    - Remove unused sensor macros (PVT_SENSOR_FIRST, PVT_SENSOR_LAST,
      PVT_SENSORS_NUM)
    - Drop the unnecessary hwmon-sysfs.h header
    - Replace dynamic sensor info allocation with a static array and unify
      sensor labels
    - Remove unused hwmon_temp_type attribute
    - Eliminate redundant validation checks
    - Remove mutex and related locking, relying on hwmon core
      serialization
    - Replace per-sensor caches and completions with a single data cache
      and completion object
    - Remove pvt->sensor tracking. ISR no longer depends on the currently
      selected sensor
    - Move devm_add_action() registration after init_completion() for
      safer cleanup, and update cleanup function (pvt_clear_data)
    - Replace devm_reset_control_get_optional_exclusive() with
      devm_reset_control_get_exclusive_deasserted()
    - Replace eic7700_pvt_remove() with eic7700_pvt_disable_pm_runtime()
      and move it after PM runtime enable to avoid resource leaks on probe
      failure and remove clock disable and reset assert from
      eic7700_pvt_disable_pm_runtime() as it is already handled by devm_*
      framework
    - Remove redundant clock presence check in runtime_resume

  - Link to v1: https://lore.kernel.org/all/20260109090718.442-1-hehuan1@eswincomputing.com/

Huan He (2):
  dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor
  hwmon: Add Eswin EIC7700 PVT sensor driver

 .../bindings/hwmon/eswin,eic7700-pvt.yaml     |  68 ++
 drivers/hwmon/Kconfig                         |  12 +
 drivers/hwmon/Makefile                        |   1 +
 drivers/hwmon/eic7700-pvt.c                   | 591 ++++++++++++++++++
 drivers/hwmon/eic7700-pvt.h                   |  99 +++
 5 files changed, 771 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml
 create mode 100644 drivers/hwmon/eic7700-pvt.c
 create mode 100644 drivers/hwmon/eic7700-pvt.h

-- 
2.25.1
Re: [PATCH v4 0/2] Add driver support for ESWIN EIC7700 PVT controller
Posted by Guenter Roeck 1 month, 2 weeks ago
On 4/29/26 23:41, hehuan1@eswincomputing.com wrote:
> From: Huan He <hehuan1@eswincomputing.com>
> 
> Add support for the ESWIN EIC7700 PVT (Voltage, Temperature) sensor
> 
> Features:
> The driver supports monitoring of voltage and temperature parameters
> through the hardware monitoring subsystem. It provides an access to the
> sampled Temperature and Voltage.
> 

Please either address the issues reported by Sashiko, or explain why they are invalid.

Thanks,
Guenter

> Test:
> Tested this patch on the SiFive HiFive Premier P550 (which uses the ESWIN
> EIC7700 SoC).
> 
> Updates:
> 
>    Changes in v4:
>    - Update eswin,eic7700-pvt.yaml
>      - Delete reviewed-by tag of Conor Dooley, because the label enum
>        constraint is introduced
>    - Update eic7700-pvt.c and eic7700-pvt.h
>      - Remove the unused LVT/ULVT/SVT process-monitoring channels
>      - Remove the probe-time power check since the PVT block is always
>        powered on EIC7700 and the extra verification is unnecessary
>      - Stop requesting the interrupt as shared and use the dedicated PVT IRQ
>        only
>      - Reorder probe initialization so the interface is initialized before
>        the clock is disabled, avoiding register accesses with the clock gated
>      - Fix runtime PM reference handling on error paths by balancing
>        pm_runtime_get_noresume() with pm_runtime_put_noidle()
>      - Add pm_runtime_put_noidle() handling for failed pm_runtime_get_sync()
>        calls in hwmon read/write paths
>      - Switch the PM callback registration from pm_sleep_ptr() to pm_ptr()
> 
>    Changes in v3:
>    - Update eswin,eic7700-pvt.yaml
>      - Remove redundant label property description and use 'label: true' to
>        reference the definition in hwmon-common.yaml
>      - Replace 'additionalProperties: false' with
>        'unevaluatedProperties: false'
>      - Remove the description for '#thermal-sensor-cells'
>    - Update eic7700-pvt.c and eic7700-pvt.h
>      - Fix clock reference count imbalance with Runtime PM:
>        Replace devm_clk_get_enabled() with devm_clk_get() and manually
>        manage clock enable/disable to avoid double-disable in remove() when
>        Runtime PM is active. Clock is now enabled only during probe for
>        eic7700_pvt_check_pwr(), then disabled before enabling Runtime PM,
>        which takes full control of the clock thereafter
>      - Add detailed comment explaining the spurious interrupt risk in
>        eic7700_pvt_check_pwr()
>      - Replace wait_for_completion_interruptible() with
>        wait_for_completion_timeout() to prevent infinite wait
> 
>    Changes in v2:
>    - Update eswin,eic7700-pvt.yaml
>      - Reference the hwmon-common.yaml file
>      - Remove the clock-names and reset-names properties
>      - Move additionalProperties: false after the required block
>      - Remove one example node to avoid redundancy
>    - Update eic7700-pvt.c and eic7700-pvt.h
>      - Remove unused sensor macros (PVT_SENSOR_FIRST, PVT_SENSOR_LAST,
>        PVT_SENSORS_NUM)
>      - Drop the unnecessary hwmon-sysfs.h header
>      - Replace dynamic sensor info allocation with a static array and unify
>        sensor labels
>      - Remove unused hwmon_temp_type attribute
>      - Eliminate redundant validation checks
>      - Remove mutex and related locking, relying on hwmon core
>        serialization
>      - Replace per-sensor caches and completions with a single data cache
>        and completion object
>      - Remove pvt->sensor tracking. ISR no longer depends on the currently
>        selected sensor
>      - Move devm_add_action() registration after init_completion() for
>        safer cleanup, and update cleanup function (pvt_clear_data)
>      - Replace devm_reset_control_get_optional_exclusive() with
>        devm_reset_control_get_exclusive_deasserted()
>      - Replace eic7700_pvt_remove() with eic7700_pvt_disable_pm_runtime()
>        and move it after PM runtime enable to avoid resource leaks on probe
>        failure and remove clock disable and reset assert from
>        eic7700_pvt_disable_pm_runtime() as it is already handled by devm_*
>        framework
>      - Remove redundant clock presence check in runtime_resume
> 
>    - Link to v1: https://lore.kernel.org/all/20260109090718.442-1-hehuan1@eswincomputing.com/
> 
> Huan He (2):
>    dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor
>    hwmon: Add Eswin EIC7700 PVT sensor driver
> 
>   .../bindings/hwmon/eswin,eic7700-pvt.yaml     |  68 ++
>   drivers/hwmon/Kconfig                         |  12 +
>   drivers/hwmon/Makefile                        |   1 +
>   drivers/hwmon/eic7700-pvt.c                   | 591 ++++++++++++++++++
>   drivers/hwmon/eic7700-pvt.h                   |  99 +++
>   5 files changed, 771 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml
>   create mode 100644 drivers/hwmon/eic7700-pvt.c
>   create mode 100644 drivers/hwmon/eic7700-pvt.h
>