Linux RTC
 help / color / mirror / Atom feed
* Re: [PATCH v2] dt-bindings: arm: vt8500: via,vt8500-pmc: Convert to DT Schema
From: Alexey Charkov @ 2026-06-01  8:47 UTC (permalink / raw)
  To: Udaya Kiran Challa
  Cc: krzk, robh, krzk+dt, conor+dt, skhan, me, linux-rtc, devicetree,
	linux-kernel
In-Reply-To: <20260531171612.4536-1-challauday369@gmail.com>

On Sun, May 31, 2026 at 9:16 PM Udaya Kiran Challa
<challauday369@gmail.com> wrote:
>
> Convert the VIA/Wondermedia VT8500 Power Management controller binding
> from the legacy text format to DT schema.
>
> Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
> ---
> Changelog:
> Changes since v1:
> - Make child node binding constrained
> - Fix example to include the clock container node
> - Fix maintainers list
>
> Link to v1:https://lore.kernel.org/all/20260524110047.37590-1-challauday369@gmail.com/
> ---
>  .../bindings/arm/vt8500/via,vt8500-pmc.txt    | 13 -----
>  .../bindings/arm/vt8500/via,vt8500-pmc.yaml   | 53 +++++++++++++++++++
>  2 files changed, 53 insertions(+), 13 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
>  create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml
>
> diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
> deleted file mode 100644
> index 521b9c7de933..000000000000
> --- a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -VIA/Wondermedia VT8500 Power Management Controller
> ------------------------------------------------------
> -
> -Required properties:
> -- compatible : "via,vt8500-pmc"
> -- reg : Should contain 1 register ranges(address and length)
> -
> -Example:
> -
> -       pmc@d8130000 {
> -               compatible = "via,vt8500-pmc";
> -               reg = <0xd8130000 0x1000>;
> -       };
> diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml
> new file mode 100644
> index 000000000000..e340281e5726
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/arm/vt8500/via,vt8500-pmc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: VIA/Wondermedia VT8500 Power Management Controller
> +
> +maintainers:
> +  - Alexey Charkov <alchark@gmail.com>
> +  - Krzysztof Kozlowski <krzk@kernel.org>
> +
> +description:
> +  The VIA/Wondermedia Power Management Controller provides register access for
> +  clock and power management functions on VT8500 and WM8xxx series SoCs.
> +
> +properties:
> +  compatible:
> +    const: via,vt8500-pmc

Each SoC version had different registers within the PMC node (even
though key components such as the OS timer and reset control kept the
same offsets and function). So this really should be a SoC-versioned
enum rather than a single "compatible", as they were never really
mutually compatible (despite what current DTs say).

> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    type: object
> +    description: Container node for VT8500/WM8xxx clock provider nodes.
> +    properties:
> +      "#address-cells":
> +        const: 1
> +      "#size-cells":
> +        const: 0
> +    required:
> +      - "#address-cells"
> +      - "#size-cells"

#address-cells and #size-cells are automatically required once the
subnodes have regs, so it seems that this whole section could become
just "clocks: true" with no particular loss of meaning.

> +    additionalProperties: true

If the PMC binding ends up separate from the clock control bindings
(which I'm somewhat skeptical of, see [1]), shouldn't the subnodes of
this clocks node be explicitly specified to follow that binding? The
fixed 25 MHz reference clock is not part of the PMC and doesn't belong
there (despite what current device trees contain), but the rest do.

[1] https://lore.kernel.org/all/CABjd4YzJoHrx1suMbhNvrMP+X=d=thvXYwSY=UD-4Qy=7-qmjw@mail.gmail.com/

Best regards,
Alexey

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pmc@d8130000 {
> +        compatible = "via,vt8500-pmc";
> +        reg = <0xd8130000 0x1000>;
> +
> +        clocks {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +        };
> +    };
> --
> 2.43.0

^ permalink raw reply

* Re: [PATCH v5] dt-bindings: clock: via,vt8500: Convert to DT Schema
From: Alexey Charkov @ 2026-06-01  8:30 UTC (permalink / raw)
  To: Udaya Kiran Challa
  Cc: krzk, robh, krzk+dt, conor+dt, skhan, me, linux-rtc, devicetree,
	linux-kernel
In-Reply-To: <20260531171041.4149-1-challauday369@gmail.com>

On Sun, May 31, 2026 at 9:11 PM Udaya Kiran Challa
<challauday369@gmail.com> wrote:
>
> Convert the VIA/Wondermedia VT8500 and Wondermedia WM8xxx series SoCs clock
> controller binding from the legacy text format to DT schema.
>
> Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
> ---

Hi,

I'm not sure that this separation of the clock controller binding vs.
PMC is the right way to go (yes, I know it's been that way in the .txt
document, but still).

The clock controller is not a standalone device on these SoCs - it's
one of the functions of the PMC (weirdly enough), with its MMIO space
interweaved between clock statuses and enable controls,
reset/hibernation control, system timer and watchdog, then again clock
control. You can't run the clock controller separately from the
resources provided in its parent PMC node, because all those *reg
nodes are just offsets into the PMC controller's MMIO space. So the
way it's done currently doesn't look like idiomatic DT to me.

If I were to implement support for all that beauty today, I would have
made a top-level MFD node owning the whole MMIO range of the PMC, put
clock IDs into a dt-bindings header file and just implement all clock
operations in code without putting those offsets and bits into the
device tree. They are not configurable, they are not board specific,
they just constitute the interface of a particular SoC revision which
follows directly from a SoC versioned PMC compatible string.

The only thing that would have showed up in the DT then would have
been the PMC node with a register range and a bunch of named
interrupts (not for clocks, but for other functions), a
clock-controller attribute and a single clock cell to pass arbitrarily
assigned clock IDs from a new per-SoC dt-bindings header.

I'm pretty sure there are no users of these DTs outside of mainline
Linux, because vendor kernels used board files, and no DT-enabled
firmware has ever been created, thus the only way to boot these boards
with a device tree has only ever been via an appended-DTB uImage (i.e.
the DTB always comes from the currently used Linux kernel source).
From this perspective I believe redoing the DT in a more
hardware-aligned fashion (and breaking DT ABI) could be better than
making the current suboptimal approach more "official" by encoding it
in DT schema. Krzysztof will likely disagree though :)

Best regards,
Alexey

^ permalink raw reply

* [PATCH v2] dt-bindings: arm: vt8500: via,vt8500-pmc: Convert to DT Schema
From: Udaya Kiran Challa @ 2026-05-31 17:15 UTC (permalink / raw)
  To: alchark, krzk, robh, krzk+dt, conor+dt
  Cc: skhan, me, linux-rtc, devicetree, linux-kernel,
	Udaya Kiran Challa

Convert the VIA/Wondermedia VT8500 Power Management controller binding
from the legacy text format to DT schema.

Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
---
Changelog:
Changes since v1:
- Make child node binding constrained
- Fix example to include the clock container node
- Fix maintainers list

Link to v1:https://lore.kernel.org/all/20260524110047.37590-1-challauday369@gmail.com/
---
 .../bindings/arm/vt8500/via,vt8500-pmc.txt    | 13 -----
 .../bindings/arm/vt8500/via,vt8500-pmc.yaml   | 53 +++++++++++++++++++
 2 files changed, 53 insertions(+), 13 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml

diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
deleted file mode 100644
index 521b9c7de933..000000000000
--- a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-VIA/Wondermedia VT8500 Power Management Controller
------------------------------------------------------
-
-Required properties:
-- compatible : "via,vt8500-pmc"
-- reg : Should contain 1 register ranges(address and length)
-
-Example:
-
-	pmc@d8130000 {
-		compatible = "via,vt8500-pmc";
-		reg = <0xd8130000 0x1000>;
-	};
diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml
new file mode 100644
index 000000000000..e340281e5726
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/vt8500/via,vt8500-pmc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VIA/Wondermedia VT8500 Power Management Controller
+
+maintainers:
+  - Alexey Charkov <alchark@gmail.com>
+  - Krzysztof Kozlowski <krzk@kernel.org>
+
+description:
+  The VIA/Wondermedia Power Management Controller provides register access for
+  clock and power management functions on VT8500 and WM8xxx series SoCs.
+
+properties:
+  compatible:
+    const: via,vt8500-pmc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    type: object
+    description: Container node for VT8500/WM8xxx clock provider nodes.
+    properties:
+      "#address-cells":
+        const: 1
+      "#size-cells":
+        const: 0
+    required:
+      - "#address-cells"
+      - "#size-cells"
+    additionalProperties: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    pmc@d8130000 {
+        compatible = "via,vt8500-pmc";
+        reg = <0xd8130000 0x1000>;
+
+        clocks {
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+    };
-- 
2.43.0


^ permalink raw reply related

* [PATCH v5] dt-bindings: clock: via,vt8500: Convert to DT Schema
From: Udaya Kiran Challa @ 2026-05-31 17:09 UTC (permalink / raw)
  To: alchark, krzk, robh, krzk+dt, conor+dt
  Cc: skhan, me, linux-rtc, devicetree, linux-kernel,
	Udaya Kiran Challa

Convert the VIA/Wondermedia VT8500 and Wondermedia WM8xxx series SoCs clock
controller binding from the legacy text format to DT schema.

Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
---
Changelog:
Changes since v4:
- Remove schema select matching for via,vt8500-pmc
- Add dependentRequired validation for divisor-mask
- Fix maintainers list
- Add reg false condition for device clock
- Fix example validation against clocks child node

Link to v4:https://lore.kernel.org/all/20260524151110.21277-1-challauday369@gmail.com/

Changes since v3:
- Add schema select matching for via,vt8500-pmc
- Allow hyphen in node names under patternProperties
- Add dependentRequired validation for enable-reg/enable-bit
- Fix example validation against PMC schema

Link to v3:https://lore.kernel.org/all/20260524111813.39810-1-challauday369@gmail.com/

Changes since v2:
- Drop redundant description for clocks
- Disable reg property for device clocks
- Fix schema hierarchy to match actual DTS structure

Link to v2:https://lore.kernel.org/all/20260521170810.19702-1-challauday369@gmail.com/

Changes since v1:
- Add default value for divisor-mask
- Add required properties compatible and model
- Fix example node name
- Update example size cells and reg value

Link to v1:https://lore.kernel.org/all/20260520025131.17772-1-challauday369@gmail.com/
---
 .../bindings/clock/via,vt8500-clock.yaml      | 133 ++++++++++++++++++
 .../devicetree/bindings/clock/vt8500.txt      |  74 ----------
 2 files changed, 133 insertions(+), 74 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml
 delete mode 100644 Documentation/devicetree/bindings/clock/vt8500.txt

diff --git a/Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml b/Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml
new file mode 100644
index 000000000000..e2e674d95654
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/via,vt8500-clock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VIA/Wondermedia VT8500 Clock Controller
+
+maintainers:
+  - Alexey Charkov <alchark@gmail.com>
+  - Krzysztof Kozlowski <krzk@kernel.org>
+
+description:
+  Clock controller bindings for VIA/Wondermedia VT8500 and Wondermedia WM8xxx
+  series SoCs.
+
+properties:
+  compatible:
+    enum:
+      - via,vt8500-pll-clock
+      - wm,wm8650-pll-clock
+      - wm,wm8750-pll-clock
+      - wm,wm8850-pll-clock
+      - via,vt8500-device-clock
+
+  reg:
+    description: Offset of the PLL register within the PMC register space.
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 0
+
+  clock-output-names:
+    maxItems: 1
+
+  enable-reg:
+    description: Offset of the clock enable register within the PMC register space.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  enable-bit:
+    description: Bit index controlling clock enable.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maximum: 31
+
+  divisor-reg:
+    description: Offset of the clock divisor register within the PMC register space.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  divisor-mask:
+    description: Bitmask describing the divisor field inside divisor-reg.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 0x1f
+
+required:
+  - compatible
+  - clocks
+  - "#clock-cells"
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          const: via,vt8500-device-clock
+    then:
+      properties:
+        reg: false
+      anyOf:
+        - required:
+            - enable-reg
+            - enable-bit
+        - required:
+            - divisor-reg
+  - if:
+      properties:
+        compatible:
+          enum:
+            - via,vt8500-pll-clock
+            - wm,wm8650-pll-clock
+            - wm,wm8750-pll-clock
+            - wm,wm8850-pll-clock
+    then:
+      required:
+        - reg
+
+dependentRequired:
+  enable-reg:
+    - enable-bit
+  enable-bit:
+    - enable-reg
+  divisor-mask:
+    - divisor-reg
+
+additionalProperties: false
+
+examples:
+  - |
+    clocks {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ref25: clock-25000000 {
+            compatible = "fixed-clock";
+            clock-frequency = <25000000>;
+            #clock-cells = <0>;
+        };
+
+        plla: clock@200 {
+            compatible = "wm,wm8650-pll-clock";
+            reg = <0x200>;
+            clocks = <&ref25>;
+            #clock-cells = <0>;
+        };
+
+        pllb: clock@204 {
+            compatible = "wm,wm8650-pll-clock";
+            reg = <0x204>;
+            clocks = <&ref25>;
+            #clock-cells = <0>;
+        };
+
+        clksdhc: sdhc {
+            compatible = "via,vt8500-device-clock";
+            clocks = <&pllb>;
+            #clock-cells = <0>;
+            divisor-reg = <0x328>;
+            divisor-mask = <0x3f>;
+            enable-reg = <0x254>;
+            enable-bit = <18>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/clock/vt8500.txt b/Documentation/devicetree/bindings/clock/vt8500.txt
deleted file mode 100644
index 91d71cc0314a..000000000000
--- a/Documentation/devicetree/bindings/clock/vt8500.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-Device Tree Clock bindings for arch-vt8500
-
-This binding uses the common clock binding[1].
-
-[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-Required properties:
-- compatible : shall be one of the following:
-	"via,vt8500-pll-clock" - for a VT8500/WM8505 PLL clock
-	"wm,wm8650-pll-clock" - for a WM8650 PLL clock
-	"wm,wm8750-pll-clock" - for a WM8750 PLL clock
-	"wm,wm8850-pll-clock" - for a WM8850 PLL clock
-	"via,vt8500-device-clock" - for a VT/WM device clock
-
-Required properties for PLL clocks:
-- reg : shall be the control register offset from PMC base for the pll clock.
-- clocks : shall be the input parent clock phandle for the clock. This should
-	be the reference clock.
-- #clock-cells : from common clock binding; shall be set to 0.
-
-Required properties for device clocks:
-- clocks : shall be the input parent clock phandle for the clock. This should
-	be a pll output.
-- #clock-cells : from common clock binding; shall be set to 0.
-
-
-Device Clocks
-
-Device clocks are required to have one or both of the following sets of
-properties:
-
-
-Gated device clocks:
-
-Required properties:
-- enable-reg : shall be the register offset from PMC base for the enable
-	register.
-- enable-bit : shall be the bit within enable-reg to enable/disable the clock.
-
-
-Divisor device clocks:
-
-Required property:
-- divisor-reg : shall be the register offset from PMC base for the divisor
-	register.
-Optional property:
-- divisor-mask : shall be the mask for the divisor register. Defaults to 0x1f
-	if not specified.
-
-
-For example:
-
-ref25: ref25M {
-	#clock-cells = <0>;
-	compatible = "fixed-clock";
-	clock-frequency = <25000000>;
-};
-
-plla: plla {
-	#clock-cells = <0>;
-	compatible = "wm,wm8650-pll-clock";
-	clocks = <&ref25>;
-	reg = <0x200>;
-};
-
-sdhc: sdhc {
-	#clock-cells = <0>;
-	compatible = "via,vt8500-device-clock";
-	clocks = <&pllb>;
-	divisor-reg = <0x328>;
-	divisor-mask = <0x3f>;
-	enable-reg = <0x254>;
-	enable-bit = <18>;
-};
-- 
2.43.0


^ permalink raw reply related

* Re: [PATCH] dt-bindings: arm: vt8500: via,vt8500-pmc: Convert to DT Schema
From: Uday Kiran @ 2026-05-31 16:51 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux, robh, krzk+dt, conor+dt, skhan, me, linux-rtc, devicetree,
	linux-kernel
In-Reply-To: <20260530-devious-magnificent-jackdaw-cc48c1@quoll>

> > +properties:
> > +  compatible:
> > +    const: via,vt8500-pmc
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    type: object
> > +    additionalProperties: true
>
> No, binding must be constrained. See writing-bindings or any other
> binding. If you are unsure how to do something - open other existing
> bindings. Do you see anywhere such syntax?

Agreed. The clocks child node is now fully constrained: #address-cells and
#size-cells are declared with fixed values and marked required.
additionalProperties: true is retained only because the child clock nodes
inside have their own schema (via,vt8500-clock.yaml) with
additionalProperties: false, which is the pattern described in
example-schema.yaml for child nodes with their own device schema.

Regards,
Udaya Kiran Challa

^ permalink raw reply

* Re: [PATCH v4] dt-bindings: clock: via,vt8500: Convert to DT Schema
From: Uday Kiran @ 2026-05-31 16:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, skhan, me, linux-rtc,
	devicetree, linux-kernel
In-Reply-To: <20260530-academic-aspiring-sawfly-7dcfab@quoll>

> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/clock/via,vt8500-clock.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: VIA/Wondermedia VT8500 Clock Controller
>
> How PMC is a clock controller? Really?

No Krzysztof, actually that was a wrong direction in v4.

> > +
> > +maintainers:
> > +  - Michael Turquette <mturquette@baylibre.com>
> > +  - Stephen Boyd <sboyd@kernel.org>
>
>
> Subsystem maintainers do not care about PMC. This can be platform
> maintainer.

I agree with you. I changed maintainers accordingly.

> > +
> > +description:
> > +  Clock controller bindings for VIA/Wondermedia VT8500 and Wondermedia WM8xxx
> > +  series SoCs.
> > +
> > +select:
> > +  properties:
> > +    compatible:
> > +      const: via,vt8500-pmc
> > +
> > +  required:
> > +    - compatible
>
> Why do you have select?
>
> I don't understand your changes. This was not at v2 and I did not ask to
> change that.

The select: block with via,vt8500-pmc and the clocks: type: object were
mistakenly added to via,vt8500-clock.yaml in v4 — leftover confusion from
trying to handle the PMC node's clock container in the same schema. In v5 these
are removed from the clock schema entirely. The PMC binding is now a separate
patch (via,vt8500-pmc.yaml) which is the right place for the clock container
node description.

> > +
> > +properties:
> > +  compatible:
> > +    const: via,vt8500-pmc
>
>
> So via,vt8500-clock.yaml or pmc? Why aren't you removing the pmc file?
> Why is this located at clocks?

In the next revision, this patch is scope only to the clock provider bindings
(via,vt8500-device-clock, via,vt8500-pll-clock, wm,*-pll-clock). It no longer
models PMC/top-level node properties and does not modify PMC binding files.

> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    type: object
> > +    additionalProperties: true
>
> No, this cannot be "true".

Agreed, I dropped that structure and kept strict schema validation.

I also fixed remaining related points from review/bot feedback:
- example validation issues
- dependency constraints (enable-reg/enable-bit, divisor-mask/divisor-reg)
- explicit reg: false for via,vt8500-device-clock

Regards,
Udaya Kiran Challa

^ permalink raw reply

* Re: [PATCH] dt-bindings: arm: vt8500: via,vt8500-pmc: Convert to DT Schema
From: Krzysztof Kozlowski @ 2026-05-30 10:49 UTC (permalink / raw)
  To: Udaya Kiran Challa
  Cc: linux, robh, krzk+dt, conor+dt, skhan, me, linux-rtc, devicetree,
	linux-kernel
In-Reply-To: <20260524110047.37590-1-challauday369@gmail.com>

On Sun, May 24, 2026 at 04:30:09PM +0530, Udaya Kiran Challa wrote:
> +properties:
> +  compatible:
> +    const: via,vt8500-pmc
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    type: object
> +    additionalProperties: true

No, binding must be constrained. See writing-bindings or any other
binding. If you are unsure how to do something - open other existing
bindings. Do you see anywhere such syntax?

Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH v4] dt-bindings: clock: via,vt8500: Convert to DT Schema
From: Krzysztof Kozlowski @ 2026-05-30  7:35 UTC (permalink / raw)
  To: Udaya Kiran Challa
  Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, skhan, me, linux-rtc,
	devicetree, linux-kernel
In-Reply-To: <20260524151110.21277-1-challauday369@gmail.com>

On Sun, May 24, 2026 at 08:40:26PM +0530, Udaya Kiran Challa wrote:
> Convert the VIA/Wondermedia VT8500 and Wondermedia WM8xxx series SoCs clock
> controller binding from the legacy text format to DT schema.
> 
> Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
> ---
> Changelog:
> Changes since v3
> - Add schema select matching for via,vt8500-pmc
> - Allow hyphen in node names under patternProperties
> - Add dependentRequired validation for enable-reg/enable-bit
> - Fix example validation against PMC schema
> 
> Link to v3:https://lore.kernel.org/all/20260524111813.39810-1-challauday369@gmail.com/
> 
> Changes since v2:
> - Drop redundant description for clocks
> - Disable reg property for device clocks
> - Fix schema hierarchy to match actual DTS structure
> 
> Link to v2:https://lore.kernel.org/all/20260521170810.19702-1-challauday369@gmail.com/
> 
> Changes since v1:
> - Add default value for divisor-mask
> - Add required properties compatible and model
> - Fix example node name
> - Update example size cells and reg value
> 
> Link to v1:https://lore.kernel.org/all/20260520025131.17772-1-challauday369@gmail.com/
> ---
>  .../bindings/clock/via,vt8500-clock.yaml      | 209 ++++++++++++++++++
>  .../devicetree/bindings/clock/vt8500.txt      |  74 -------
>  2 files changed, 209 insertions(+), 74 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml
>  delete mode 100644 Documentation/devicetree/bindings/clock/vt8500.txt
> 
> diff --git a/Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml b/Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml
> new file mode 100644
> index 000000000000..51a68df6c2f3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/via,vt8500-clock.yaml
> @@ -0,0 +1,209 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/via,vt8500-clock.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: VIA/Wondermedia VT8500 Clock Controller

How PMC is a clock controller? Really?

> +
> +maintainers:
> +  - Michael Turquette <mturquette@baylibre.com>
> +  - Stephen Boyd <sboyd@kernel.org>


Subsystem maintainers do not care about PMC. This can be platform
maintainer.

> +
> +description:
> +  Clock controller bindings for VIA/Wondermedia VT8500 and Wondermedia WM8xxx
> +  series SoCs.
> +
> +select:
> +  properties:
> +    compatible:
> +      const: via,vt8500-pmc
> +
> +  required:
> +    - compatible

Why do you have select?

I don't understand your changes. This was not at v2 and I did not ask to
change that.

> +
> +properties:
> +  compatible:
> +    const: via,vt8500-pmc


So via,vt8500-clock.yaml or pmc? Why aren't you removing the pmc file?
Why is this located at clocks?

> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    type: object
> +    additionalProperties: true

No, this cannot be "true".

I finished review here.

Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH 0/5] rtc: renesas-rtca3: Various fixes and improvements
From: Lad, Prabhakar @ 2026-05-29 21:35 UTC (permalink / raw)
  To: Alexandre Belloni, Claudiu Beznea, Geert Uytterhoeven
  Cc: linux-rtc, linux-renesas-soc, linux-kernel, Biju Das,
	Fabrizio Castro, Lad Prabhakar
In-Reply-To: <20260506164914.3987293-1-prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi,

On Wed, May 6, 2026 at 5:49 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
>
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Hi all,
>
> This patch series includes various fixes and improvements for the
> Renesas RTCA-3 RTC driver, including:
> - Fixing the polling condition when clearing the PIE bit during alarm
>   setup error handling.
> - Checking the result of the RADJ polling during initial setup and
>   propagating errors.
> - Correcting an error message related to reset control.
> - Fixing a typo in the documentation for the rtca3_ppb_per_cycle struct.
> - Refactoring year decoding logic into a helper function for better
>   readability.
>
> Cheers,
> Prabhakar
>
> Lad Prabhakar (5):
>   rtc: renesas-rtca3: Fix PIE clear polling condition in alarm setup
>     error path
>   rtc: renesas-rtca3: Check RADJ poll result during initial setup
>   rtc: renesas-rtca3: Fix incorrect error message for reset assert
>   rtc: renesas-rtca3: Fix typo in rtca3_ppb_per_cycle documentation
>   rtc: renesas-rtca3: Factor out year decoding helper
>
>  drivers/rtc/rtc-renesas-rtca3.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
>
Gentle ping.

Cheers,
Prabhakar

^ permalink raw reply

* Re: [PATCH v1 3/3] rtc: Use named initializers for platform_device_id arrays
From: Matti Vaittinen @ 2026-05-29  7:33 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub), Alexandre Belloni
  Cc: Karel Balej, Chanwoo Choi, Krzysztof Kozlowski,
	André Draszik, linux-rtc, linux-kernel, linux-samsung-soc
In-Reply-To: <d14b9076b2c7703708bcc5cc35f339cd97fc10cd.1779950275.git.u.kleine-koenig@baylibre.com>

On 28/05/2026 09:48, Uwe Kleine-König (The Capable Hub) wrote:
> Named initializers are better readable and more robust to changes of the
> struct definition. This robustness is relevant for a planned change to
> struct platform_device_id replacing .driver_data by an anonymous union.
> 
> While touching these arrays unify spacing and usage of commas.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub)<u.kleine-koenig@baylibre.com>

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

-- 
---
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

^ permalink raw reply

* Re: [PATCH v1 2/3] rtc: ab8500: Simplify driver_data handling
From: Linus Walleij @ 2026-05-28 13:22 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Alexandre Belloni, linux-arm-kernel, linux-rtc, linux-kernel
In-Reply-To: <a909d3c59d00756130ac16051ceedbec0ce9cec7.1779950275.git.u.kleine-koenig@baylibre.com>

On Thu, May 28, 2026 at 8:48 AM Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig@baylibre.com> wrote:

> Instead of hiding the rtc ops for the only supported device behind an
> abstraction for multi-device support, hardcode the used ops which gets rid
> of the need to call platform_get_device_id and two casts.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v1 3/3] rtc: Use named initializers for platform_device_id arrays
From: Linus Walleij @ 2026-05-28 13:21 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Alexandre Belloni, Karel Balej, Matti Vaittinen, Chanwoo Choi,
	Krzysztof Kozlowski, André Draszik, linux-rtc, linux-kernel,
	linux-samsung-soc
In-Reply-To: <d14b9076b2c7703708bcc5cc35f339cd97fc10cd.1779950275.git.u.kleine-koenig@baylibre.com>

On Thu, May 28, 2026 at 8:48 AM Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig@baylibre.com> wrote:

> Named initializers are better readable and more robust to changes of the
> struct definition. This robustness is relevant for a planned change to
> struct platform_device_id replacing .driver_data by an anonymous union.
>
> While touching these arrays unify spacing and usage of commas.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v1 3/3] rtc: Use named initializers for platform_device_id arrays
From: Karel Balej @ 2026-05-28  8:40 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub), Alexandre Belloni
  Cc: Matti Vaittinen, Chanwoo Choi, Krzysztof Kozlowski,
	André Draszik, linux-rtc, linux-kernel, linux-samsung-soc
In-Reply-To: <d14b9076b2c7703708bcc5cc35f339cd97fc10cd.1779950275.git.u.kleine-koenig@baylibre.com>

Uwe Kleine-König (The Capable Hub), 2026-05-28T08:48:12+02:00:
> diff --git a/drivers/rtc/rtc-88pm886.c b/drivers/rtc/rtc-88pm886.c
> index 57e9b0a66eed..13aa3ae82239 100644
> --- a/drivers/rtc/rtc-88pm886.c
> +++ b/drivers/rtc/rtc-88pm886.c
> @@ -78,7 +78,7 @@ static int pm886_rtc_probe(struct platform_device *pdev)
>  }
>  
>  static const struct platform_device_id pm886_rtc_id_table[] = {
> -	{ "88pm886-rtc", },
> +	{ .name = "88pm886-rtc" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(platform, pm886_rtc_id_table);

Acked-by: Karel Balej <balejk@matfyz.cz> # for Marvell 88PM886

^ permalink raw reply

* Re: [PATCH v1 1/3] rtc: Drop unused assignment of platform_device_id driver data
From: Tzung-Bi Shih @ 2026-05-28  7:43 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: Alexandre Belloni, Benson Leung, Guenter Roeck, linux-rtc,
	chrome-platform, linux-kernel
In-Reply-To: <9ec7a174605a17dd19c011ee2253de28d09b02bd.1779950275.git.u.kleine-koenig@baylibre.com>

On Thu, May 28, 2026 at 08:48:10AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> The two drivers explicitly set the .driver_data member of struct
> platform_device_id to zero without relying on that value. Drop this
> unused assignments.
> 
> While touching these array unify spacing, usage of commas and use named
> initializers for .name.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

^ permalink raw reply

* [PATCH v1 3/3] rtc: Use named initializers for platform_device_id arrays
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28  6:48 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Karel Balej, Matti Vaittinen, Chanwoo Choi, Krzysztof Kozlowski,
	André Draszik, linux-rtc, linux-kernel, linux-samsung-soc
In-Reply-To: <cover.1779950275.git.u.kleine-koenig@baylibre.com>

Named initializers are better readable and more robust to changes of the
struct definition. This robustness is relevant for a planned change to
struct platform_device_id replacing .driver_data by an anonymous union.

While touching these arrays unify spacing and usage of commas.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/rtc/rtc-88pm886.c  |  2 +-
 drivers/rtc/rtc-bd70528.c  |  8 ++++----
 drivers/rtc/rtc-max77686.c | 10 +++++-----
 drivers/rtc/rtc-max8998.c  |  4 ++--
 drivers/rtc/rtc-s5m.c      | 12 ++++++------
 drivers/rtc/rtc-tps6594.c  |  4 ++--
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/rtc/rtc-88pm886.c b/drivers/rtc/rtc-88pm886.c
index 57e9b0a66eed..13aa3ae82239 100644
--- a/drivers/rtc/rtc-88pm886.c
+++ b/drivers/rtc/rtc-88pm886.c
@@ -78,7 +78,7 @@ static int pm886_rtc_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id pm886_rtc_id_table[] = {
-	{ "88pm886-rtc", },
+	{ .name = "88pm886-rtc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, pm886_rtc_id_table);
diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
index 4c8599761b2e..482810b61495 100644
--- a/drivers/rtc/rtc-bd70528.c
+++ b/drivers/rtc/rtc-bd70528.c
@@ -341,10 +341,10 @@ static int bd70528_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id bd718x7_rtc_id[] = {
-	{ "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 },
-	{ "bd71815-rtc", ROHM_CHIP_TYPE_BD71815 },
-	{ "bd72720-rtc", ROHM_CHIP_TYPE_BD72720 },
-	{ },
+	{ .name = "bd71828-rtc", .driver_data = ROHM_CHIP_TYPE_BD71828 },
+	{ .name = "bd71815-rtc", .driver_data = ROHM_CHIP_TYPE_BD71815 },
+	{ .name = "bd72720-rtc", .driver_data = ROHM_CHIP_TYPE_BD72720 },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id);
 
diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index 3cdfd78a07cc..375565a3bddf 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -866,11 +866,11 @@ static SIMPLE_DEV_PM_OPS(max77686_rtc_pm_ops,
 			 max77686_rtc_suspend, max77686_rtc_resume);
 
 static const struct platform_device_id rtc_id[] = {
-	{ "max77686-rtc", .driver_data = (kernel_ulong_t)&max77686_drv_data, },
-	{ "max77802-rtc", .driver_data = (kernel_ulong_t)&max77802_drv_data, },
-	{ "max77620-rtc", .driver_data = (kernel_ulong_t)&max77620_drv_data, },
-	{ "max77714-rtc", .driver_data = (kernel_ulong_t)&max77714_drv_data, },
-	{},
+	{ .name = "max77686-rtc", .driver_data = (kernel_ulong_t)&max77686_drv_data },
+	{ .name = "max77802-rtc", .driver_data = (kernel_ulong_t)&max77802_drv_data },
+	{ .name = "max77620-rtc", .driver_data = (kernel_ulong_t)&max77620_drv_data },
+	{ .name = "max77714-rtc", .driver_data = (kernel_ulong_t)&max77714_drv_data },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, rtc_id);
 
diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index c873b4509b3c..a2c946edcd1a 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -299,8 +299,8 @@ static int max8998_rtc_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id max8998_rtc_id[] = {
-	{ "max8998-rtc", TYPE_MAX8998 },
-	{ "lp3974-rtc", TYPE_LP3974 },
+	{ .name = "max8998-rtc", .driver_data = TYPE_MAX8998 },
+	{ .name = "lp3974-rtc", .driver_data = TYPE_LP3974 },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, max8998_rtc_id);
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index c6ed5a4ca8a0..aa706074ec3e 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -807,12 +807,12 @@ static int s5m_rtc_suspend(struct device *dev)
 static SIMPLE_DEV_PM_OPS(s5m_rtc_pm_ops, s5m_rtc_suspend, s5m_rtc_resume);
 
 static const struct platform_device_id s5m_rtc_id[] = {
-	{ "s5m-rtc",		S5M8767X },
-	{ "s2mpg10-rtc",	S2MPG10 },
-	{ "s2mps13-rtc",	S2MPS13X },
-	{ "s2mps14-rtc",	S2MPS14X },
-	{ "s2mps15-rtc",	S2MPS15X },
-	{ },
+	{ .name = "s5m-rtc",     .driver_data = S5M8767X },
+	{ .name = "s2mpg10-rtc", .driver_data = S2MPG10 },
+	{ .name = "s2mps13-rtc", .driver_data = S2MPS13X },
+	{ .name = "s2mps14-rtc", .driver_data = S2MPS14X },
+	{ .name = "s2mps15-rtc", .driver_data = S2MPS15X },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, s5m_rtc_id);
 
diff --git a/drivers/rtc/rtc-tps6594.c b/drivers/rtc/rtc-tps6594.c
index 7c6246e3f029..2cebd54c2dbf 100644
--- a/drivers/rtc/rtc-tps6594.c
+++ b/drivers/rtc/rtc-tps6594.c
@@ -485,8 +485,8 @@ static int tps6594_rtc_suspend(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(tps6594_rtc_pm_ops, tps6594_rtc_suspend, tps6594_rtc_resume);
 
 static const struct platform_device_id tps6594_rtc_id_table[] = {
-	{ "tps6594-rtc", },
-	{}
+	{ .name = "tps6594-rtc" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, tps6594_rtc_id_table);
 
-- 
2.47.3


^ permalink raw reply related

* [PATCH v1 2/3] rtc: ab8500: Simplify driver_data handling
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28  6:48 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Linus Walleij, linux-arm-kernel, linux-rtc, linux-kernel
In-Reply-To: <cover.1779950275.git.u.kleine-koenig@baylibre.com>

Instead of hiding the rtc ops for the only supported device behind an
abstraction for multi-device support, hardcode the used ops which gets rid
of the need to call platform_get_device_id and two casts.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/rtc/rtc-ab8500.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index c6147837f957..0978bd0a3393 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -323,14 +323,13 @@ static const struct rtc_class_ops ab8500_rtc_ops = {
 };
 
 static const struct platform_device_id ab85xx_rtc_ids[] = {
-	{ "ab8500-rtc", (kernel_ulong_t)&ab8500_rtc_ops, },
+	{ .name = "ab8500-rtc" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, ab85xx_rtc_ids);
 
 static int ab8500_rtc_probe(struct platform_device *pdev)
 {
-	const struct platform_device_id *platid = platform_get_device_id(pdev);
 	int err;
 	struct rtc_device *rtc;
 	u8 rtc_ctrl;
@@ -366,7 +365,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
-	rtc->ops = (struct rtc_class_ops *)platid->driver_data;
+	rtc->ops = &ab8500_rtc_ops;
 
 	err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 			rtc_alarm_handler, IRQF_ONESHOT,
-- 
2.47.3


^ permalink raw reply related

* [PATCH v1 1/3] rtc: Drop unused assignment of platform_device_id driver data
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28  6:48 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Benson Leung, Guenter Roeck, linux-rtc, chrome-platform,
	linux-kernel
In-Reply-To: <cover.1779950275.git.u.kleine-koenig@baylibre.com>

The two drivers explicitly set the .driver_data member of struct
platform_device_id to zero without relying on that value. Drop this
unused assignments.

While touching these array unify spacing, usage of commas and use named
initializers for .name.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/rtc/rtc-cros-ec.c | 4 ++--
 drivers/rtc/rtc-max8997.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-cros-ec.c b/drivers/rtc/rtc-cros-ec.c
index e956505a06fb..f3ecd017e2f7 100644
--- a/drivers/rtc/rtc-cros-ec.c
+++ b/drivers/rtc/rtc-cros-ec.c
@@ -388,8 +388,8 @@ static void cros_ec_rtc_remove(struct platform_device *pdev)
 }
 
 static const struct platform_device_id cros_ec_rtc_id[] = {
-	{ DRV_NAME, 0 },
-	{}
+	{ .name = DRV_NAME },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
 
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index e7618d715bd8..89203c92e2cd 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -512,8 +512,8 @@ static void max8997_rtc_shutdown(struct platform_device *pdev)
 }
 
 static const struct platform_device_id rtc_id[] = {
-	{ "max8997-rtc", 0 },
-	{},
+	{ .name = "max8997-rtc" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, rtc_id);
 
-- 
2.47.3


^ permalink raw reply related

* [PATCH v1 0/3] rtc: Use named initializers for platform_device_id arrays
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28  6:48 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Benson Leung, Guenter Roeck, linux-rtc, chrome-platform,
	linux-kernel, Linus Walleij, linux-arm-kernel, Karel Balej,
	Matti Vaittinen, Chanwoo Choi, Krzysztof Kozlowski,
	André Draszik, linux-samsung-soc

Hello,

this series targets to use named initializers for platform_device_id
arrays. In general these are better readable for humans and more robust
to changes in the respective struct definition.

This robustness is needed as I want to do

	diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
	--- a/include/linux/mod_devicetable.h
	+++ b/include/linux/mod_devicetable.h
	@@ -610,4 +610,7 @@ struct dmi_system_id {
	 struct platform_device_id {
		char name[PLATFORM_NAME_SIZE];
	-	kernel_ulong_t driver_data;
	+	union {
	+		kernel_ulong_t driver_data;
	+		const void *driver_data_ptr;
	+	};
	 };

which allows dropping several casts and eases porting CHERI to mainline
linux. A possible follow-up change is the following example:

	diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
	index 375565a3bddf..31b641bd8962 100644
	--- a/drivers/rtc/rtc-max77686.c
	+++ b/drivers/rtc/rtc-max77686.c
	@@ -760,8 +760,7 @@ static int max77686_rtc_probe(struct platform_device *pdev)
	 
		mutex_init(&info->lock);
		info->dev = &pdev->dev;
	-	info->drv_data = (const struct max77686_rtc_driver_data *)
	-		id->driver_data;
	+	info->drv_data = id->driver_data_ptr;
	 
		ret = max77686_init_rtc_regmap(info);
		if (ret < 0)
	@@ -866,10 +865,10 @@ static SIMPLE_DEV_PM_OPS(max77686_rtc_pm_ops,
				 max77686_rtc_suspend, max77686_rtc_resume);
	 
	 static const struct platform_device_id rtc_id[] = {
	-	{ .name = "max77686-rtc", .driver_data = (kernel_ulong_t)&max77686_drv_data },
	-	{ .name = "max77802-rtc", .driver_data = (kernel_ulong_t)&max77802_drv_data },
	-	{ .name = "max77620-rtc", .driver_data = (kernel_ulong_t)&max77620_drv_data },
	-	{ .name = "max77714-rtc", .driver_data = (kernel_ulong_t)&max77714_drv_data },
	+	{ .name = "max77686-rtc", .driver_data_ptr = &max77686_drv_data },
	+	{ .name = "max77802-rtc", .driver_data_ptr = &max77802_drv_data },
	+	{ .name = "max77620-rtc", .driver_data_ptr = &max77620_drv_data },
	+	{ .name = "max77714-rtc", .driver_data_ptr = &max77714_drv_data },
		{ }
	 };
	 MODULE_DEVICE_TABLE(platform, rtc_id);

increasing readability due to less casting which also improves type safety.

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (3):
  rtc: Drop unused assignment of platform_device_id driver data
  rtc: ab8500: Simplify driver_data handling
  rtc: Use named initializers for platform_device_id arrays

 drivers/rtc/rtc-88pm886.c  |  2 +-
 drivers/rtc/rtc-ab8500.c   |  5 ++---
 drivers/rtc/rtc-bd70528.c  |  8 ++++----
 drivers/rtc/rtc-cros-ec.c  |  4 ++--
 drivers/rtc/rtc-max77686.c | 10 +++++-----
 drivers/rtc/rtc-max8997.c  |  4 ++--
 drivers/rtc/rtc-max8998.c  |  4 ++--
 drivers/rtc/rtc-s5m.c      | 12 ++++++------
 drivers/rtc/rtc-tps6594.c  |  4 ++--
 9 files changed, 26 insertions(+), 27 deletions(-)


base-commit: e7d700e14934e68f86338c5610cf2ae76798b663
-- 
2.47.3


^ permalink raw reply

* [PATCH 4/4] rtc: s35390a: convert to dev_err_probe()
From: Balakrishnan Sambath @ 2026-05-28  3:46 UTC (permalink / raw)
  To: Alexandre Belloni, Baolin Wang, Chunyan Zhang, Orson Zhai
  Cc: linux-kernel, linux-rtc, Balakrishnan Sambath
In-Reply-To: <20260528-cleanup-dev-err-probe-rtc-v1-0-29dc9cb6c3f0@microchip.com>

Use dev_err_probe() in place of dev_err() and return, which
communicates the error type and helps debugging hardware issues.

No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
 drivers/rtc/rtc-s35390a.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
index a4678d7c6cf..342fd2b568a 100644
--- a/drivers/rtc/rtc-s35390a.c
+++ b/drivers/rtc/rtc-s35390a.c
@@ -479,10 +479,8 @@ static int s35390a_probe(struct i2c_client *client)
 		return PTR_ERR(rtc);
 
 	err_read = s35390a_read_status(s35390a, &status1);
-	if (err_read < 0) {
-		dev_err(dev, "error resetting chip\n");
-		return err_read;
-	}
+	if (err_read < 0)
+		return dev_err_probe(dev, err_read, "error resetting chip\n");
 
 	if (status1 & S35390A_FLAG_24H)
 		s35390a->twentyfourhour = 1;
@@ -493,16 +491,12 @@ static int s35390a_probe(struct i2c_client *client)
 		/* disable alarm (and maybe test mode) */
 		buf = 0;
 		err = s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, &buf, 1);
-		if (err < 0) {
-			dev_err(dev, "error disabling alarm");
-			return err;
-		}
+		if (err < 0)
+			return dev_err_probe(dev, err, "error disabling alarm");
 	} else {
 		err = s35390a_disable_test_mode(s35390a);
-		if (err < 0) {
-			dev_err(dev, "error disabling test mode\n");
-			return err;
-		}
+		if (err < 0)
+			return dev_err_probe(dev, err, "error disabling test mode\n");
 	}
 
 	device_set_wakeup_capable(dev, 1);

-- 
2.34.1


^ permalink raw reply related

* [PATCH 3/4] rtc: sc27xx: convert to dev_err_probe()
From: Balakrishnan Sambath @ 2026-05-28  3:46 UTC (permalink / raw)
  To: Alexandre Belloni, Baolin Wang, Chunyan Zhang, Orson Zhai
  Cc: linux-kernel, linux-rtc, Balakrishnan Sambath
In-Reply-To: <20260528-cleanup-dev-err-probe-rtc-v1-0-29dc9cb6c3f0@microchip.com>

Use dev_err_probe() in place of dev_err() and return, which
communicates the error type and helps debugging hardware issues.

No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
 drivers/rtc/rtc-sc27xx.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c
index 2b83561d4d2..2c6d4565389 100644
--- a/drivers/rtc/rtc-sc27xx.c
+++ b/drivers/rtc/rtc-sc27xx.c
@@ -574,10 +574,8 @@ static int sprd_rtc_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	ret = of_property_read_u32(node, "reg", &rtc->base);
-	if (ret) {
-		dev_err(&pdev->dev, "failed to get RTC base address\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "failed to get RTC base address\n");
 
 	rtc->irq = platform_get_irq(pdev, 0);
 	if (rtc->irq < 0)
@@ -592,26 +590,20 @@ static int sprd_rtc_probe(struct platform_device *pdev)
 
 	/* check if we need set the alarm interrupt */
 	ret = sprd_rtc_check_alarm_int(rtc);
-	if (ret) {
-		dev_err(&pdev->dev, "failed to check RTC alarm interrupt\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "failed to check RTC alarm interrupt\n");
 
 	/* check if RTC time values are valid */
 	ret = sprd_rtc_check_power_down(rtc);
-	if (ret) {
-		dev_err(&pdev->dev, "failed to check RTC time values\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "failed to check RTC time values\n");
 
 	ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
 					sprd_rtc_handler,
 					IRQF_ONESHOT | IRQF_EARLY_RESUME,
 					pdev->name, rtc);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "failed to request RTC irq\n");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "failed to request RTC irq\n");
 
 	device_init_wakeup(&pdev->dev, true);
 

-- 
2.34.1


^ permalink raw reply related

* [PATCH 2/4] rtc: moxart: convert to dev_err_probe()
From: Balakrishnan Sambath @ 2026-05-28  3:46 UTC (permalink / raw)
  To: Alexandre Belloni, Baolin Wang, Chunyan Zhang, Orson Zhai
  Cc: linux-kernel, linux-rtc, Balakrishnan Sambath
In-Reply-To: <20260528-cleanup-dev-err-probe-rtc-v1-0-29dc9cb6c3f0@microchip.com>

Use dev_err_probe() in place of dev_err() and return, which
communicates the error type and helps debugging hardware issues.

No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
 drivers/rtc/rtc-moxart.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c
index 2247dd39ee4..e1766f03d73 100644
--- a/drivers/rtc/rtc-moxart.c
+++ b/drivers/rtc/rtc-moxart.c
@@ -253,26 +253,20 @@ static int moxart_rtc_probe(struct platform_device *pdev)
 	moxart_rtc->gpio_data = devm_gpiod_get(&pdev->dev, "rtc-data",
 					       GPIOD_IN);
 	ret = PTR_ERR_OR_ZERO(moxart_rtc->gpio_data);
-	if (ret) {
-		dev_err(&pdev->dev, "can't get rtc data gpio: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "can't get rtc data gpio\n");
 
 	moxart_rtc->gpio_sclk = devm_gpiod_get(&pdev->dev, "rtc-sclk",
 					       GPIOD_ASIS);
 	ret = PTR_ERR_OR_ZERO(moxart_rtc->gpio_sclk);
-	if (ret) {
-		dev_err(&pdev->dev, "can't get rtc sclk gpio: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "can't get rtc sclk gpio\n");
 
 	moxart_rtc->gpio_reset = devm_gpiod_get(&pdev->dev, "rtc-reset",
 						GPIOD_ASIS);
 	ret = PTR_ERR_OR_ZERO(moxart_rtc->gpio_reset);
-	if (ret) {
-		dev_err(&pdev->dev, "can't get rtc reset gpio: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "can't get rtc reset gpio\n");
 
 	spin_lock_init(&moxart_rtc->rtc_lock);
 	platform_set_drvdata(pdev, moxart_rtc);
@@ -280,10 +274,9 @@ static int moxart_rtc_probe(struct platform_device *pdev)
 	moxart_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
 						   &moxart_rtc_ops,
 						   THIS_MODULE);
-	if (IS_ERR(moxart_rtc->rtc)) {
-		dev_err(&pdev->dev, "devm_rtc_device_register failed\n");
-		return PTR_ERR(moxart_rtc->rtc);
-	}
+	if (IS_ERR(moxart_rtc->rtc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(moxart_rtc->rtc),
+				     "devm_rtc_device_register failed\n");
 
 	return 0;
 }

-- 
2.34.1


^ permalink raw reply related

* [PATCH 1/4] rtc: palmas: convert to dev_err_probe()
From: Balakrishnan Sambath @ 2026-05-28  3:46 UTC (permalink / raw)
  To: Alexandre Belloni, Baolin Wang, Chunyan Zhang, Orson Zhai
  Cc: linux-kernel, linux-rtc, Balakrishnan Sambath
In-Reply-To: <20260528-cleanup-dev-err-probe-rtc-v1-0-29dc9cb6c3f0@microchip.com>

Use dev_err_probe() in place of dev_err() and return, which
communicates the error type and helps debugging hardware issues.

No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
 drivers/rtc/rtc-palmas.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/rtc/rtc-palmas.c b/drivers/rtc/rtc-palmas.c
index aecada6bcf8..25fe7a8b73a 100644
--- a/drivers/rtc/rtc-palmas.c
+++ b/drivers/rtc/rtc-palmas.c
@@ -242,10 +242,8 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 
 	/* Clear pending interrupts */
 	ret = palmas_clear_interrupts(&pdev->dev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "clear RTC int failed, err = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "clear RTC int failed\n");
 
 	palmas_rtc->dev = &pdev->dev;
 	platform_set_drvdata(pdev, palmas_rtc);
@@ -280,10 +278,8 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 	ret = palmas_update_bits(palmas, PALMAS_RTC_BASE, PALMAS_RTC_CTRL_REG,
 			PALMAS_RTC_CTRL_REG_STOP_RTC,
 			PALMAS_RTC_CTRL_REG_STOP_RTC);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "RTC_CTRL write failed, err = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "RTC_CTRL write failed\n");
 
 	palmas_rtc->irq = platform_get_irq(pdev, 0);
 
@@ -292,18 +288,15 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 				&palmas_rtc_ops, THIS_MODULE);
 	if (IS_ERR(palmas_rtc->rtc)) {
 		ret = PTR_ERR(palmas_rtc->rtc);
-		dev_err(&pdev->dev, "RTC register failed, err = %d\n", ret);
-		return ret;
+		return dev_err_probe(&pdev->dev, ret, "RTC register failed\n");
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, palmas_rtc->irq, NULL,
 			palmas_rtc_interrupt,
 			IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 			dev_name(&pdev->dev), palmas_rtc);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "IRQ request failed, err = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "IRQ request failed\n");
 
 	return 0;
 }

-- 
2.34.1


^ permalink raw reply related

* [PATCH 0/4] rtc: convert several drivers to dev_err_probe()
From: Balakrishnan Sambath @ 2026-05-28  3:46 UTC (permalink / raw)
  To: Alexandre Belloni, Baolin Wang, Chunyan Zhang, Orson Zhai
  Cc: linux-kernel, linux-rtc, Balakrishnan Sambath

Use dev_err_probe() in place of dev_err() and return across four rtc
drivers, which communicates the error type and helps debugging
hardware issues.

Build-tested with x86_64 allmodconfig. No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
Balakrishnan Sambath (4):
      rtc: palmas: convert to dev_err_probe()
      rtc: moxart: convert to dev_err_probe()
      rtc: sc27xx: convert to dev_err_probe()
      rtc: s35390a: convert to dev_err_probe()

 drivers/rtc/rtc-moxart.c  | 25 +++++++++----------------
 drivers/rtc/rtc-palmas.c  | 21 +++++++--------------
 drivers/rtc/rtc-s35390a.c | 18 ++++++------------
 drivers/rtc/rtc-sc27xx.c  | 24 ++++++++----------------
 4 files changed, 30 insertions(+), 58 deletions(-)
---
base-commit: b72386864481cf7fb6153842d22561ac3032302f
change-id: 20260528-cleanup-dev-err-probe-rtc-bc44f6ccbc01

Best regards,
-- 
Balakrishnan Sambath <balakrishnan.s@microchip.com>


^ permalink raw reply

* [PATCH] rtc: remove unused pcap driver
From: Arnd Bergmann @ 2026-05-27 19:39 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: Arnd Bergmann, Lee Jones, linux-kernel, linux-rtc

From: Arnd Bergmann <arnd@arndb.de>

The platform was removed a few years ago, and the mfd driver
is also gone now, so it is impossible to build or use it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/rtc/Kconfig    |   7 --
 drivers/rtc/Makefile   |   1 -
 drivers/rtc/rtc-pcap.c | 179 -----------------------------------------
 3 files changed, 187 deletions(-)
 delete mode 100644 drivers/rtc/rtc-pcap.c

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 364afc73f8ab..01def8231873 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1763,13 +1763,6 @@ config RTC_DRV_STMP
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-stmp3xxx.
 
-config RTC_DRV_PCAP
-	tristate "PCAP RTC"
-	depends on EZX_PCAP
-	help
-	  If you say Y here you will get support for the RTC found on
-	  the PCAP2 ASIC used on some Motorola phones.
-
 config RTC_DRV_MC13XXX
 	depends on MFD_MC13XXX
 	tristate "Freescale MC13xxx RTC"
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 6cf7e066314e..0347645b021f 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -128,7 +128,6 @@ obj-$(CONFIG_RTC_DRV_OMAP)	+= rtc-omap.o
 obj-$(CONFIG_RTC_DRV_OPAL)	+= rtc-opal.o
 obj-$(CONFIG_RTC_DRV_OPTEE)	+= rtc-optee.o
 obj-$(CONFIG_RTC_DRV_PALMAS)	+= rtc-palmas.o
-obj-$(CONFIG_RTC_DRV_PCAP)	+= rtc-pcap.o
 obj-$(CONFIG_RTC_DRV_PCF2123)	+= rtc-pcf2123.o
 obj-$(CONFIG_RTC_DRV_PCF2127)	+= rtc-pcf2127.o
 obj-$(CONFIG_RTC_DRV_PCF85063)	+= rtc-pcf85063.o
diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c
deleted file mode 100644
index d6651611a0c6..000000000000
--- a/drivers/rtc/rtc-pcap.c
+++ /dev/null
@@ -1,179 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *  pcap rtc code for Motorola EZX phones
- *
- *  Copyright (c) 2008 guiming zhuo <gmzhuo@gmail.com>
- *  Copyright (c) 2009 Daniel Ribeiro <drwyrm@gmail.com>
- *
- *  Based on Motorola's rtc.c Copyright (c) 2003-2005 Motorola
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/mfd/ezx-pcap.h>
-#include <linux/rtc.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-
-struct pcap_rtc {
-	struct pcap_chip *pcap;
-	struct rtc_device *rtc;
-};
-
-static irqreturn_t pcap_rtc_irq(int irq, void *_pcap_rtc)
-{
-	struct pcap_rtc *pcap_rtc = _pcap_rtc;
-	unsigned long rtc_events;
-
-	if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ))
-		rtc_events = RTC_IRQF | RTC_UF;
-	else if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA))
-		rtc_events = RTC_IRQF | RTC_AF;
-	else
-		rtc_events = 0;
-
-	rtc_update_irq(pcap_rtc->rtc, 1, rtc_events);
-	return IRQ_HANDLED;
-}
-
-static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
-{
-	struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
-	struct rtc_time *tm = &alrm->time;
-	unsigned long secs;
-	u32 tod;	/* time of day, seconds since midnight */
-	u32 days;	/* days since 1/1/1970 */
-
-	ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TODA, &tod);
-	secs = tod & PCAP_RTC_TOD_MASK;
-
-	ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, &days);
-	secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY;
-
-	rtc_time64_to_tm(secs, tm);
-
-	return 0;
-}
-
-static int pcap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
-{
-	struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
-	unsigned long secs = rtc_tm_to_time64(&alrm->time);
-	u32 tod, days;
-
-	tod = secs % SEC_PER_DAY;
-	ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TODA, tod);
-
-	days = secs / SEC_PER_DAY;
-	ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, days);
-
-	return 0;
-}
-
-static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
-	struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
-	unsigned long secs;
-	u32 tod, days;
-
-	ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TOD, &tod);
-	secs = tod & PCAP_RTC_TOD_MASK;
-
-	ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAY, &days);
-	secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY;
-
-	rtc_time64_to_tm(secs, tm);
-
-	return 0;
-}
-
-static int pcap_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
-	struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
-	unsigned long secs = rtc_tm_to_time64(tm);
-	u32 tod, days;
-
-	tod = secs % SEC_PER_DAY;
-	ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TOD, tod);
-
-	days = secs / SEC_PER_DAY;
-	ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_DAY, days);
-
-	return 0;
-}
-
-static int pcap_rtc_irq_enable(struct device *dev, int pirq, unsigned int en)
-{
-	struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
-
-	if (en)
-		enable_irq(pcap_to_irq(pcap_rtc->pcap, pirq));
-	else
-		disable_irq(pcap_to_irq(pcap_rtc->pcap, pirq));
-
-	return 0;
-}
-
-static int pcap_rtc_alarm_irq_enable(struct device *dev, unsigned int en)
-{
-	return pcap_rtc_irq_enable(dev, PCAP_IRQ_TODA, en);
-}
-
-static const struct rtc_class_ops pcap_rtc_ops = {
-	.read_time = pcap_rtc_read_time,
-	.set_time = pcap_rtc_set_time,
-	.read_alarm = pcap_rtc_read_alarm,
-	.set_alarm = pcap_rtc_set_alarm,
-	.alarm_irq_enable = pcap_rtc_alarm_irq_enable,
-};
-
-static int __init pcap_rtc_probe(struct platform_device *pdev)
-{
-	struct pcap_rtc *pcap_rtc;
-	int timer_irq, alarm_irq;
-	int err = -ENOMEM;
-
-	pcap_rtc = devm_kzalloc(&pdev->dev, sizeof(struct pcap_rtc),
-				GFP_KERNEL);
-	if (!pcap_rtc)
-		return err;
-
-	pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent);
-
-	platform_set_drvdata(pdev, pcap_rtc);
-
-	pcap_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
-	if (IS_ERR(pcap_rtc->rtc))
-		return PTR_ERR(pcap_rtc->rtc);
-
-	pcap_rtc->rtc->ops = &pcap_rtc_ops;
-	pcap_rtc->rtc->range_max = (1 << 14) * 86400ULL - 1;
-
-	timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ);
-	alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA);
-
-	err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq, 0,
-				"RTC Timer", pcap_rtc);
-	if (err)
-		return err;
-
-	err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq, 0,
-				"RTC Alarm", pcap_rtc);
-	if (err)
-		return err;
-
-	return devm_rtc_register_device(pcap_rtc->rtc);
-}
-
-static struct platform_driver pcap_rtc_driver = {
-	.driver = {
-		.name  = "pcap-rtc",
-	},
-};
-
-module_platform_driver_probe(pcap_rtc_driver, pcap_rtc_probe);
-
-MODULE_DESCRIPTION("Motorola pcap rtc driver");
-MODULE_AUTHOR("guiming zhuo <gmzhuo@gmail.com>");
-MODULE_LICENSE("GPL");
-- 
2.39.5


^ permalink raw reply related

* Re: [PATCH v5 02/11] dt-bindings: hwmon: Add Apple System Management Controller hwmon schema
From: Guenter Roeck @ 2026-05-25 13:33 UTC (permalink / raw)
  To: James Calligeros
  Cc: Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alexandre Belloni, Jean Delvare, Dmitry Torokhov, Jonathan Corbet,
	asahi, linux-arm-kernel, devicetree, linux-kernel, linux-rtc,
	linux-hwmon, linux-input, linux-doc
In-Reply-To: <20251112-macsmc-subdevs-v5-2-728e4b91fe81@gmail.com>

On Wed, Nov 12, 2025 at 09:16:48PM +1000, James Calligeros wrote:
> Apple Silicon devices integrate a vast array of sensors, monitoring
> current, power, temperature, and voltage across almost every part of
> the system. The sensors themselves are all connected to the System
> Management Controller (SMC). The SMC firmware exposes the data
> reported by these sensors via its standard FourCC-based key-value
> API. The SMC is also responsible for monitoring and controlling any
> fans connected to the system, exposing them in the same way.
> 
> For reasons known only to Apple, each device exposes its sensors with
> an almost totally unique set of keys. This is true even for devices
> which share an SoC. An M1 Mac mini, for example, will report its core
> temperatures on different keys to an M1 MacBook Pro. Worse still, the
> SMC does not provide a way to enumerate the available keys at runtime,
> nor do the keys follow any sort of reasonable or consistent naming
> rules that could be used to deduce their purpose. We must therefore
> know which keys are present on any given device, and which function
> they serve, ahead of time.
> 
> Add a schema so that we can describe the available sensors for a given
> Apple Silicon device in the Devicetree.
> 
> Reviewed-by: Neal Gompa <neal@gompa.dev>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
> ---
>  .../bindings/hwmon/apple,smc-hwmon.yaml  | 86 +++++++++++++++++++++++++
>  .../bindings/mfd/apple,smc.yaml          | 36 +++++++++++

I see that the rest of this series is going to be applied. This patch
touches bindings in mfd, which I can not apply.

With the assumption that the patch will be applied through some other tree,
presumably mfd:

Acked-by: Guenter Roeck <linux@roeck-us.net>

Guenter

>  MAINTAINERS                              |  1 +
>  3 files changed, 123 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml
> new file mode 100644
> index 000000000000..2eec317bc4b3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml
> @@ -0,0 +1,86 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/apple,smc-hwmon.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Apple SMC Hardware Monitoring
> +
> +description:
> +  Apple's System Management Controller (SMC) exposes a vast array of
> +  hardware monitoring sensors, including temperature probes, current and
> +  voltage sense, power meters, and fan speeds. It also provides endpoints
> +  to manually control the speed of each fan individually. Each Apple
> +  Silicon device exposes a different set of endpoints via SMC keys. This
> +  is true even when two machines share an SoC. The CPU core temperature
> +  sensor keys on an M1 Mac mini are different to those on an M1 MacBook
> +  Pro, for example.
> +
> +maintainers:
> +  - James Calligeros <jcalligeros99@gmail.com>
> +
> +$defs:
> +  sensor:
> +    type: object
> +
> +    properties:
> +      apple,key-id:
> +        $ref: /schemas/types.yaml#/definitions/string
> +        pattern: "^[A-Za-z0-9]{4}$"
> +        description: The SMC FourCC key of the desired sensor.
> +          Must match the node's suffix.
> +
> +      label:
> +        description: Human-readable name for the sensor
> +
> +    required:
> +      - apple,key-id
> +
> +properties:
> +  compatible:
> +    const: apple,smc-hwmon
> +
> +patternProperties:
> +  "^current-[A-Za-z0-9]{4}$":
> +    $ref: "#/$defs/sensor"
> +    unevaluatedProperties: false
> +
> +  "^fan-[A-Za-z0-9]{4}$":
> +    $ref: "#/$defs/sensor"
> +    unevaluatedProperties: false
> +
> +    properties:
> +      apple,fan-minimum:
> +        $ref: /schemas/types.yaml#/definitions/string
> +        pattern: "^[A-Za-z0-9]{4}$"
> +        description: SMC key containing the fan's minimum speed
> +
> +      apple,fan-maximum:
> +        $ref: /schemas/types.yaml#/definitions/string
> +        pattern: "^[A-Za-z0-9]{4}$"
> +        description: SMC key containing the fan's maximum speed
> +
> +      apple,fan-target:
> +        $ref: /schemas/types.yaml#/definitions/string
> +        pattern: "^[A-Za-z0-9]{4}$"
> +        description: Writeable endpoint for setting desired fan speed
> +
> +      apple,fan-mode:
> +        $ref: /schemas/types.yaml#/definitions/string
> +        pattern: "^[A-Za-z0-9]{4}$"
> +        description: Writeable key to enable/disable manual fan control
> +
> +
> +  "^power-[A-Za-z0-9]{4}$":
> +    $ref: "#/$defs/sensor"
> +    unevaluatedProperties: false
> +
> +  "^temperature-[A-Za-z0-9]{4}$":
> +    $ref: "#/$defs/sensor"
> +    unevaluatedProperties: false
> +
> +  "^voltage-[A-Za-z0-9]{4}$":
> +    $ref: "#/$defs/sensor"
> +    unevaluatedProperties: false
> +
> +additionalProperties: false
> diff --git a/Documentation/devicetree/bindings/mfd/apple,smc.yaml b/Documentation/devicetree/bindings/mfd/apple,smc.yaml
> index 0410e712c900..34ce048619f5 100644
> --- a/Documentation/devicetree/bindings/mfd/apple,smc.yaml
> +++ b/Documentation/devicetree/bindings/mfd/apple,smc.yaml
> @@ -49,6 +49,9 @@ properties:
>    rtc:
>      $ref: /schemas/rtc/apple,smc-rtc.yaml
>  
> +  hwmon:
> +    $ref: /schemas/hwmon/apple,smc-hwmon.yaml
> +
>  additionalProperties: false
>  
>  required:
> @@ -89,5 +92,38 @@ examples:
>            nvmem-cells = <&rtc_offset>;
>            nvmem-cell-names = "rtc_offset";
>         };
> +
> +        hwmon {
> +          compatible = "apple,smc-hwmon";
> +
> +          current-ID0R {
> +            apple,key-id = "ID0R";
> +            label = "AC Input Current";
> +          };
> +
> +          fan-F0Ac {
> +            apple,key-id = "F0Ac";
> +            apple,fan-minimum = "F0Mn";
> +            apple,fan-maximum = "F0Mx";
> +            apple,fan-target = "F0Tg";
> +            apple,fan-mode = "F0Md";
> +            label = "Fan 1";
> +          };
> +
> +          power-PSTR {
> +            apple,key-id = "PSTR";
> +            label = "Total System Power";
> +          };
> +
> +          temperature-TW0P {
> +            apple,key-id = "TW0P";
> +            label = "WiFi/BT Module Temperature";
> +          };
> +
> +          voltage-VD0R {
> +            apple,key-id = "VD0R";
> +            label = "AC Input Voltage";
> +          };
> +        };
>        };
>      };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 51942a9a9b43..6e5e219c5fe6 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2422,6 +2422,7 @@ F:	Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml
>  F:	Documentation/devicetree/bindings/dma/apple,admac.yaml
>  F:	Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml
>  F:	Documentation/devicetree/bindings/gpu/apple,agx.yaml
> +F:	Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml
>  F:	Documentation/devicetree/bindings/i2c/apple,i2c.yaml
>  F:	Documentation/devicetree/bindings/input/touchscreen/apple,z2-multitouch.yaml
>  F:	Documentation/devicetree/bindings/interrupt-controller/apple,*

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox