[PATCH 5/9] dt-bindings: hwmon: Add Sophgo SG2044 external hardware monitor support

Inochi Amaoto posted 9 patches 10 months, 1 week ago
There is a newer version of this series
[PATCH 5/9] dt-bindings: hwmon: Add Sophgo SG2044 external hardware monitor support
Posted by Inochi Amaoto 10 months, 1 week ago
The MCU device on SG2044 exposes the same interface as SG2042, which is
already supported by the kernel.

Add compatible string for monitor device of SG2044.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 .../devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
index f0667ac41d75..b76805d39427 100644
--- a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
+++ b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
@@ -11,7 +11,11 @@ maintainers:
 
 properties:
   compatible:
-    const: sophgo,sg2042-hwmon-mcu
+    oneOf:
+      - items:
+          - const: sophgo,sg2044-hwmon-mcu
+          - const: sophgo,sg2042-hwmon-mcu
+      - const: sophgo,sg2042-hwmon-mcu
 
   reg:
     maxItems: 1
-- 
2.49.0
Re: [PATCH 5/9] dt-bindings: hwmon: Add Sophgo SG2044 external hardware monitor support
Posted by Rob Herring (Arm) 10 months, 1 week ago
On Mon, 07 Apr 2025 09:06:10 +0800, Inochi Amaoto wrote:
> The MCU device on SG2044 exposes the same interface as SG2042, which is
> already supported by the kernel.
> 
> Add compatible string for monitor device of SG2044.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  .../devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml  | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Re: [PATCH 5/9] dt-bindings: hwmon: Add Sophgo SG2044 external hardware monitor support
Posted by Yixun Lan 10 months, 1 week ago
Hi Inochi:

On 09:06 Mon 07 Apr     , Inochi Amaoto wrote:
> The MCU device on SG2044 exposes the same interface as SG2042, which is
> already supported by the kernel.
> 
> Add compatible string for monitor device of SG2044.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  .../devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml  | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
> index f0667ac41d75..b76805d39427 100644
> --- a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
> @@ -11,7 +11,11 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: sophgo,sg2042-hwmon-mcu
> +    oneOf:
> +      - items:
> +          - const: sophgo,sg2044-hwmon-mcu
> +          - const: sophgo,sg2042-hwmon-mcu
> +      - const: sophgo,sg2042-hwmon-mcu

the compatible added here but not used in dts (or driver), e.g 9/9 patch
I'd personally prefer to add it when actually being used
(so it can be validated in the real use cases..)

another concern is whether better to just use 'enum'? (maybe not)
but I got your idea to fallback to compatible of sophgo,sg2042-hwmon-mcu..

same with mmc, i2c..

>  
>    reg:
>      maxItems: 1
> -- 
> 2.49.0
> 

-- 
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
Re: [PATCH 5/9] dt-bindings: hwmon: Add Sophgo SG2044 external hardware monitor support
Posted by Inochi Amaoto 10 months, 1 week ago
On Mon, Apr 07, 2025 at 02:05:17AM +0000, Yixun Lan wrote:
> Hi Inochi:
> 
> On 09:06 Mon 07 Apr     , Inochi Amaoto wrote:
> > The MCU device on SG2044 exposes the same interface as SG2042, which is
> > already supported by the kernel.
> > 
> > Add compatible string for monitor device of SG2044.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  .../devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml  | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
> > index f0667ac41d75..b76805d39427 100644
> > --- a/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
> > +++ b/Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml
> > @@ -11,7 +11,11 @@ maintainers:
> >  
> >  properties:
> >    compatible:
> > -    const: sophgo,sg2042-hwmon-mcu
> > +    oneOf:
> > +      - items:
> > +          - const: sophgo,sg2044-hwmon-mcu
> > +          - const: sophgo,sg2042-hwmon-mcu
> > +      - const: sophgo,sg2042-hwmon-mcu
> 
> the compatible added here but not used in dts (or driver), e.g 9/9 patch
> I'd personally prefer to add it when actually being used
> (so it can be validated in the real use cases..)
> 

The dts patch is blocked by the dependency (in most case, it is
the clk). I choose to sumbit these binding patch as they can be
reviewed in early stage so I can throw the dts patch only when
the clk is ready.

In fact, these binding changes are trivial so I think it is okay
to go with the initial patch.

> another concern is whether better to just use 'enum'? (maybe not)
> but I got your idea to fallback to compatible of sophgo,sg2042-hwmon-mcu..
> 
> same with mmc, i2c..
> 

I do not think it is a good idea to use enum. It lost the fallback
info.

Regards,
Inochi