diff mbox series

[1/2] dt-bindings: pwm: sophgo: add pwm controller for SG2044

Message ID 20250407072056.8629-2-looong.bin@gmail.com (mailing list archive)
State Superseded
Headers show
Series riscv: pwm: sophgo: add pwm support for SG2044 | expand

Checks

Context Check Description
bjorn/pre-ci_am success Success
bjorn/build-rv32-defconfig success build-rv32-defconfig
bjorn/build-rv64-clang-allmodconfig success build-rv64-clang-allmodconfig
bjorn/build-rv64-gcc-allmodconfig success build-rv64-gcc-allmodconfig
bjorn/build-rv64-nommu-k210-defconfig success build-rv64-nommu-k210-defconfig
bjorn/build-rv64-nommu-k210-virt success build-rv64-nommu-k210-virt
bjorn/checkpatch success checkpatch
bjorn/dtb-warn-rv64 success dtb-warn-rv64
bjorn/header-inline success header-inline
bjorn/kdoc success kdoc
bjorn/module-param success module-param
bjorn/verify-fixes success verify-fixes
bjorn/verify-signedoff fail verify-signedoff

Commit Message

Longbin Li April 7, 2025, 7:20 a.m. UTC
From: ghost <2990955050@qq.com>

Add compatible string for PWM controller on SG2044.

Signed-off-by: Longbin Li <looong.bin@gmail.com>
---
 Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.48.1

Comments

Uwe Kleine-König April 7, 2025, 12:31 p.m. UTC | #1
Hello,

On Mon, Apr 07, 2025 at 03:20:38PM +0800, Longbin Li wrote:
> diff --git a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> index bbb6326d47d7..e0e91aa237ec 100644
> --- a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> @@ -17,7 +17,9 @@ allOf:
> 
>  properties:
>    compatible:
> -    const: sophgo,sg2042-pwm
> +    enum:
> +      - sophgo,sg2042-pwm
> +      - sophgo,sg2044-pwm

Given that the sg2044 has more registers (to e.g. implement different
polarity), but the sg2042 registers are identical, I wonder if the 2044
device should use:

	compatible = "sophgo,sg2044-pwm", "sophgo,sg2042-pwm";

Note, I'm unsure here, only providing input to people who are more
knowledgeable in DT that I am.

Best regards
Uwe
Rob Herring (Arm) April 7, 2025, 2:11 p.m. UTC | #2
On Mon, Apr 07, 2025 at 02:31:24PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Mon, Apr 07, 2025 at 03:20:38PM +0800, Longbin Li wrote:
> > diff --git a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> > index bbb6326d47d7..e0e91aa237ec 100644
> > --- a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> > +++ b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> > @@ -17,7 +17,9 @@ allOf:
> > 
> >  properties:
> >    compatible:
> > -    const: sophgo,sg2042-pwm
> > +    enum:
> > +      - sophgo,sg2042-pwm
> > +      - sophgo,sg2044-pwm
> 
> Given that the sg2044 has more registers (to e.g. implement different
> polarity), but the sg2042 registers are identical, I wonder if the 2044
> device should use:
> 
> 	compatible = "sophgo,sg2044-pwm", "sophgo,sg2042-pwm";
> 
> Note, I'm unsure here, only providing input to people who are more
> knowledgeable in DT that I am.

Depends if s/w only understanding "sophgo,sg2042-pwm" will work on the 
2044. IOW, will a kernel without the driver change here work?

Rob
Inochi Amaoto April 8, 2025, 2:33 a.m. UTC | #3
On Mon, Apr 07, 2025 at 09:11:19AM -0500, Rob Herring wrote:
> On Mon, Apr 07, 2025 at 02:31:24PM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > On Mon, Apr 07, 2025 at 03:20:38PM +0800, Longbin Li wrote:
> > > diff --git a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> > > index bbb6326d47d7..e0e91aa237ec 100644
> > > --- a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> > > +++ b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
> > > @@ -17,7 +17,9 @@ allOf:
> > > 
> > >  properties:
> > >    compatible:
> > > -    const: sophgo,sg2042-pwm
> > > +    enum:
> > > +      - sophgo,sg2042-pwm
> > > +      - sophgo,sg2044-pwm
> > 
> > Given that the sg2044 has more registers (to e.g. implement different
> > polarity), but the sg2042 registers are identical, I wonder if the 2044
> > device should use:
> > 
> > 	compatible = "sophgo,sg2044-pwm", "sophgo,sg2042-pwm";
> > 
> > Note, I'm unsure here, only providing input to people who are more
> > knowledgeable in DT that I am.
> 
> Depends if s/w only understanding "sophgo,sg2042-pwm" will work on the 
> 2044. IOW, will a kernel without the driver change here work?
> 

No luck, the logic for SG2042 is broken on SG2044. In fact, it seems
to be more familiar to the pwm ip on CV1800 than it on SG2042.

Regards,
Inochi
Krzysztof Kozlowski April 9, 2025, 7:57 a.m. UTC | #4
On Mon, Apr 07, 2025 at 03:20:38PM GMT, Longbin Li wrote:
> From: ghost <2990955050@qq.com>
> 
> Add compatible string for PWM controller on SG2044.
> 
> Signed-off-by: Longbin Li <looong.bin@gmail.com>

Messed SoB and From.

Use known identities, not ghosts.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
index bbb6326d47d7..e0e91aa237ec 100644
--- a/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml
@@ -17,7 +17,9 @@  allOf:

 properties:
   compatible:
-    const: sophgo,sg2042-pwm
+    enum:
+      - sophgo,sg2042-pwm
+      - sophgo,sg2044-pwm

   reg:
     maxItems: 1