linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Gregory Fuchedgi <gfuchedgi@gmail.com>, linux-hwmon@vger.kernel.org
Cc: robert.marko@sartura.hr, luka.perkov@sartura.hr
Subject: Re: [PATCH] hwmon: (tps23861) add class restrictions and semi-auto mode support
Date: Fri, 8 Aug 2025 08:03:38 +0200	[thread overview]
Message-ID: <4b4dba48-d8c2-41ba-a80f-6606d4231a18@kernel.org> (raw)
In-Reply-To: <20250807215037.1891666-1-gfuchedgi@gmail.com>

On 07/08/2025 23:50, Gregory Fuchedgi wrote:
> This commit adds optional individual per-port device tree nodes, in which ports
> can be:
>   - restricted by class. For example, class = <2> for a port would only enable
>     power if class 1 or class 2 were negotiated. Requires interrupt handler to
>     be configured if class != 4 (max supported). This is because hardware cannot
>     be set with acceptable classes in advance. So the driver would enable
>     Semi-Auto mode and in the interrupt handler would check negotiated class
>     against device tree config and enable power only if it is acceptable class.
>   - fully disabled. For boards that do not use all 4 ports. This would put
>     disabled ports in Off state and would hide corresponding hwmon files.
>   - off by default. The port is kept disabled, until enabled via corresponding
>     in_enable in sysfs.
> 

Please run scripts/checkpatch.pl on the patches and fix reported
warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
patches and (probably) fix more warnings. Some warnings can be ignored,
especially from --strict run, but the code here looks like it needs a
fix. Feel free to get in touch if the warning is not clear.

<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline) or work on fork of kernel
(don't, instead use mainline). Just use b4 and everything should be
fine, although remember about `b4 prep --auto-to-cc` if you added new
patches to the patchset.

You missed at least devicetree list (maybe more), so this won't be
tested by automated tooling. Performing review on untested code might be
a waste of time.

Please kindly resend and include all necessary To/Cc entries.
</form letter>


> The driver keeps current behavior of using Auto mode for all ports if no
> per-port device tree nodes given.
> 
> This commit also adds optional reset and shutdown pin support:
>   - if reset pin is configured the chip will be reset in probe.
>   - if both reset and shutdown pins are configured the driver would keep ports
>     shut down while configuring the tps23861 over i2c. Having both shutdown and
>     reset pins ensures no PoE activity happens while i2c configuration is
>     happening.
> 
> Signed-off-by: Gregory Fuchedgi <gfuchedgi@gmail.com>
> ---
>  .../bindings/hwmon/ti,tps23861.yaml           |  78 +++++-
>  Documentation/hwmon/tps23861.rst              |   6 +-
>  drivers/hwmon/tps23861.c                      | 253 +++++++++++++++++-
>  3 files changed, 325 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml b/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml
> index ee7de53e1918..328050656ab8 100644
> --- a/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml
> @@ -24,12 +24,34 @@ properties:
>    reg:
>      maxItems: 1
>  
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 0
> +
>    shunt-resistor-micro-ohms:
>      description: The value of current sense resistor in microohms.
>      default: 255000
>      minimum: 250000
>      maximum: 255000
>  
> +  reset-gpios:
> +    description: Optional GPIO for the reset pin.
> +    maxItems: 1
> +
> +  shutdown-gpios:
> +    description: |
> +      Optional GPIO for the shutdown pin. Used to prevent PoE activity before
> +      the driver had a chance to configure the chip.
> +    maxItems: 1
> +
> +  interrupts:
> +    description: |
> +      The interrupt specifier. Only required if PoE class is restricted to less
> +      than class 4 in the device tree.
> +    maxItems: 1
> +
>  required:
>    - compatible
>    - reg
> @@ -37,7 +59,27 @@ required:
>  allOf:
>    - $ref: hwmon-common.yaml#
>  
> -unevaluatedProperties: false
> +additionalProperties:
> +  type: object
> +  description: Port specific nodes.

Yuo should rather use patternProperties.

...

		IRQF_TRIGGER_FALLING,
> +						"tps23861_irq", data);
> +		if (ret) {
> +			dev_err(dev, "failed to request irq %d\n", data->irq);
> +			return ret;
> +		}
> +		dev_info(dev, "irq successfully requested\n");

Not useful. Drop.



Best regards,
Krzysztof

  parent reply	other threads:[~2025-08-08  6:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07 21:50 [PATCH] hwmon: (tps23861) add class restrictions and semi-auto mode support Gregory Fuchedgi
2025-08-07 22:45 ` Guenter Roeck
2025-08-08  0:32   ` Gregory Fuchedgi
2025-08-08  6:03 ` Krzysztof Kozlowski [this message]
2025-08-08 17:21   ` Gregory Fuchedgi
2025-08-11  5:55     ` Krzysztof Kozlowski

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=4b4dba48-d8c2-41ba-a80f-6606d4231a18@kernel.org \
    --to=krzk@kernel.org \
    --cc=gfuchedgi@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=luka.perkov@sartura.hr \
    --cc=robert.marko@sartura.hr \
    /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;
as well as URLs for NNTP newsgroup(s).