Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 1/8] dt-bindings: watchdog: realtek: Convert RTD119x to schema
       [not found] <20191020040817.16882-1-afaerber@suse.de>
@ 2019-10-20  4:08 ` Andreas Färber
  2019-10-25 21:16   ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2019-10-20  4:08 UTC (permalink / raw)
  To: linux-realtek-soc
  Cc: linux-arm-kernel, Andreas Färber, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Mark Rutland, linux-watchdog,
	devicetree, linux-kernel

Convert the Realtek watchdog binding to a YAML schema.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v2: New
 
 .../bindings/watchdog/realtek,rtd119x.txt          | 17 ----------
 .../bindings/watchdog/realtek,rtd119x.yaml         | 38 ++++++++++++++++++++++
 2 files changed, 38 insertions(+), 17 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
deleted file mode 100644
index 05653054bd5b..000000000000
--- a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Realtek RTD1295 Watchdog
-========================
-
-Required properties:
-
-- compatible :  Should be "realtek,rtd1295-watchdog"
-- reg        :  Specifies the physical base address and size of registers
-- clocks     :  Specifies one clock input
-
-
-Example:
-
-	watchdog@98007680 {
-		compatible = "realtek,rtd1295-watchdog";
-		reg = <0x98007680 0x100>;
-		clocks = <&osc27M>;
-	};
diff --git a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
new file mode 100644
index 000000000000..5d92cfdfd046
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/watchdog/realtek,rtd119x.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Realtek RTD1295 Watchdog
+
+maintainers:
+  - Andreas Färber <afaerber@suse.de>
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: realtek,rtd1295-watchdog
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+examples:
+  - |
+	watchdog@98007680 {
+		compatible = "realtek,rtd1295-watchdog";
+		reg = <0x98007680 0x100>;
+		clocks = <&osc27M>;
+	};
+...
-- 
2.16.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/8] dt-bindings: watchdog: realtek: Convert RTD119x to schema
  2019-10-20  4:08 ` [PATCH v2 1/8] dt-bindings: watchdog: realtek: Convert RTD119x to schema Andreas Färber
@ 2019-10-25 21:16   ` Rob Herring
  2019-10-25 21:24     ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2019-10-25 21:16 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-realtek-soc, linux-arm-kernel, Wim Van Sebroeck,
	Guenter Roeck, Mark Rutland, linux-watchdog, devicetree,
	linux-kernel

On Sun, Oct 20, 2019 at 06:08:10AM +0200, Andreas Färber wrote:
> Convert the Realtek watchdog binding to a YAML schema.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  v2: New
>  
>  .../bindings/watchdog/realtek,rtd119x.txt          | 17 ----------
>  .../bindings/watchdog/realtek,rtd119x.yaml         | 38 ++++++++++++++++++++++
>  2 files changed, 38 insertions(+), 17 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
>  create mode 100644 Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
> deleted file mode 100644
> index 05653054bd5b..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -Realtek RTD1295 Watchdog
> -========================
> -
> -Required properties:
> -
> -- compatible :  Should be "realtek,rtd1295-watchdog"
> -- reg        :  Specifies the physical base address and size of registers
> -- clocks     :  Specifies one clock input
> -
> -
> -Example:
> -
> -	watchdog@98007680 {
> -		compatible = "realtek,rtd1295-watchdog";
> -		reg = <0x98007680 0x100>;
> -		clocks = <&osc27M>;
> -	};
> diff --git a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
> new file mode 100644
> index 000000000000..5d92cfdfd046
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
> @@ -0,0 +1,38 @@
> +# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/watchdog/realtek,rtd119x.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Realtek RTD1295 Watchdog
> +
> +maintainers:
> +  - Andreas Färber <afaerber@suse.de>
> +
> +allOf:
> +  - $ref: watchdog.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: realtek,rtd1295-watchdog

You can drop the 'oneOf' here unless you're planning to add another 
entry with 2 compatible strings.

With that,

Reviewed-by: Rob Herring <robh@kernel.org>

> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +
> +examples:
> +  - |
> +	watchdog@98007680 {
> +		compatible = "realtek,rtd1295-watchdog";
> +		reg = <0x98007680 0x100>;
> +		clocks = <&osc27M>;
> +	};
> +...
> -- 
> 2.16.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/8] dt-bindings: watchdog: realtek: Convert RTD119x to schema
  2019-10-25 21:16   ` Rob Herring
@ 2019-10-25 21:24     ` Andreas Färber
  2019-10-27  2:04       ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2019-10-25 21:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-realtek-soc, linux-arm-kernel, Wim Van Sebroeck,
	Guenter Roeck, Mark Rutland, linux-watchdog, devicetree,
	linux-kernel

Am 25.10.19 um 23:16 schrieb Rob Herring:
> On Sun, Oct 20, 2019 at 06:08:10AM +0200, Andreas Färber wrote:
>> Convert the Realtek watchdog binding to a YAML schema.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>>  v2: New
>>  
>>  .../bindings/watchdog/realtek,rtd119x.txt          | 17 ----------
>>  .../bindings/watchdog/realtek,rtd119x.yaml         | 38 ++++++++++++++++++++++
>>  2 files changed, 38 insertions(+), 17 deletions(-)
>>  delete mode 100644 Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
>>  create mode 100644 Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
>> deleted file mode 100644
>> index 05653054bd5b..000000000000
>> --- a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.txt
>> +++ /dev/null
>> @@ -1,17 +0,0 @@
>> -Realtek RTD1295 Watchdog
>> -========================
>> -
>> -Required properties:
>> -
>> -- compatible :  Should be "realtek,rtd1295-watchdog"
>> -- reg        :  Specifies the physical base address and size of registers
>> -- clocks     :  Specifies one clock input
>> -
>> -
>> -Example:
>> -
>> -	watchdog@98007680 {
>> -		compatible = "realtek,rtd1295-watchdog";
>> -		reg = <0x98007680 0x100>;
>> -		clocks = <&osc27M>;
>> -	};
>> diff --git a/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
>> new file mode 100644
>> index 000000000000..5d92cfdfd046
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/watchdog/realtek,rtd119x.yaml
>> @@ -0,0 +1,38 @@
>> +# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/watchdog/realtek,rtd119x.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>> +
>> +title: Realtek RTD1295 Watchdog
>> +
>> +maintainers:
>> +  - Andreas Färber <afaerber@suse.de>
>> +
>> +allOf:
>> +  - $ref: watchdog.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - const: realtek,rtd1295-watchdog
> 
> You can drop the 'oneOf' here unless you're planning to add another 
> entry with 2 compatible strings.

It's a preparation for adding rtd1195-watchdog when needed, to make
future diffs smaller. There's also RTD1395 and RTD1619 to be tested.

> 
> With that,
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Thanks,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/8] dt-bindings: watchdog: realtek: Convert RTD119x to schema
  2019-10-25 21:24     ` Andreas Färber
@ 2019-10-27  2:04       ` Andreas Färber
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2019-10-27  2:04 UTC (permalink / raw)
  To: Rob Herring, Wim Van Sebroeck, Guenter Roeck
  Cc: Mark Rutland, devicetree, linux-watchdog, linux-realtek-soc,
	linux-kernel, linux-arm-kernel

Am 25.10.19 um 23:24 schrieb Andreas Färber:
> Am 25.10.19 um 23:16 schrieb Rob Herring:
>> On Sun, Oct 20, 2019 at 06:08:10AM +0200, Andreas Färber wrote:
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - const: realtek,rtd1295-watchdog
>>
>> You can drop the 'oneOf' here unless you're planning to add another 
>> entry with 2 compatible strings.
> 
> It's a preparation for adding rtd1195-watchdog when needed, to make
> future diffs smaller. There's also RTD1395 and RTD1619 to be tested.
> 
>> With that,
>>
>> Reviewed-by: Rob Herring <robh@kernel.org>

Self-NAK.

The example doesn't pass dt_binding_check: It doesn't like the tabs
retained from the original binding. Replacing them with four spaces
makes it pass. Will post a v3.

As for the compatibles, currently in the rtd1195.dtsi patch I'm reusing
"realtek,rtd1295-watchdog", to avoid a dependency on the watchdog tree.

Long-term that's kind of ugly as it uses a later model number.
That leaves us with two alternatives:

a) "realtek,rtd1195-watchdog", "realtek,rtd1295-watchdog" - this
requires oneOf. Allows to distinguish between RTD1195 and RTD1295 while
remaining compatible with the current driver.

b) "realtek,rtd1195-watchdog" - requires the driver change now and
requires the binding to be merged before I can use it in the DT but
doesn't need oneOf here.

Guenter, any preference here?

Thanks,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191020040817.16882-1-afaerber@suse.de>
2019-10-20  4:08 ` [PATCH v2 1/8] dt-bindings: watchdog: realtek: Convert RTD119x to schema Andreas Färber
2019-10-25 21:16   ` Rob Herring
2019-10-25 21:24     ` Andreas Färber
2019-10-27  2:04       ` Andreas Färber

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git