linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] device tree support for ST M48T86
@ 2023-08-25  8:43 Nikita Shubin via B4 Relay
  2023-08-25  8:43 ` [PATCH v2 1/2] dt-bindings: rtc: Add " Nikita Shubin via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-08-25  8:43 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-rtc, devicetree, linux-kernel, Nikita Shubin,
	Krzysztof Kozlowski, Arnd Bergmann, Linus Walleij

Add device tree support for ST M48T86.

The reason it can't go to trivial-rtc.yaml, is that it has 2 registers
instead of a single one. The registers are 1 byte wide.

Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
Changes in v2:
- add links to mailthreads where the actual tags were recieved:
  - dt-bindings: rtc: Add ST M48T86 was Reviewed-by Krzysztof in v3 "ep93xx device tree conversion"
  - rtc: m48t86: add DT support for m48t86:
     - Acked-by Arnd in very first "ep93xx device tree conversion"
     - Reviewed-by Linus in v1 "ep93xx device tree conversion"

Was asked by Krzysztof to send this part separately.

Link: https://lore.kernel.org/lkml/61b9e036-7864-65c6-d43b-463fff896ddc@linaro.org/
Link: https://lore.kernel.org/lkml/20230601054549.10843-12-nikita.shubin@maquefel.me/

---
Nikita Shubin (2):
      dt-bindings: rtc: Add ST M48T86
      rtc: m48t86: add DT support for m48t86

 .../devicetree/bindings/rtc/st,m48t86.yaml         | 38 ++++++++++++++++++++++
 drivers/rtc/rtc-m48t86.c                           |  8 +++++
 2 files changed, 46 insertions(+)
---
base-commit: 89bf6209cad66214d3774dac86b6bbf2aec6a30d
change-id: 20230823-m48t86_device_tree-a72eaa294798

Best regards,
-- 
Nikita Shubin <nikita.shubin@maquefel.me>


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

* [PATCH v2 1/2] dt-bindings: rtc: Add ST M48T86
  2023-08-25  8:43 [PATCH v2 0/2] device tree support for ST M48T86 Nikita Shubin via B4 Relay
@ 2023-08-25  8:43 ` Nikita Shubin via B4 Relay
  2023-08-25  8:43 ` [PATCH v2 2/2] rtc: m48t86: add DT support for m48t86 Nikita Shubin via B4 Relay
  2023-08-27 22:02 ` [PATCH v2 0/2] device tree support for ST M48T86 Alexandre Belloni
  2 siblings, 0 replies; 4+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-08-25  8:43 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-rtc, devicetree, linux-kernel, Nikita Shubin, Krzysztof Kozlowski

From: Nikita Shubin <nikita.shubin@maquefel.me>

Add YAML bindings for ST M48T86 / Dallas DS12887 RTC.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/lkml/61b9e036-7864-65c6-d43b-463fff896ddc@linaro.org/
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 .../devicetree/bindings/rtc/st,m48t86.yaml         | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/Documentation/devicetree/bindings/rtc/st,m48t86.yaml b/Documentation/devicetree/bindings/rtc/st,m48t86.yaml
new file mode 100644
index 000000000000..e3e12fa23380
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/st,m48t86.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/st,m48t86.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ST M48T86 / Dallas DS12887 RTC with SRAM
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+allOf:
+  - $ref: rtc.yaml
+
+properties:
+  compatible:
+    enum:
+      - st,m48t86
+
+  reg:
+    items:
+      - description: index register
+      - description: data register
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    rtc@10800000 {
+      compatible = "st,m48t86";
+      reg = <0x10800000 0x1>, <0x11700000 0x1>;
+    };
+
+...

-- 
2.39.2


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

* [PATCH v2 2/2] rtc: m48t86: add DT support for m48t86
  2023-08-25  8:43 [PATCH v2 0/2] device tree support for ST M48T86 Nikita Shubin via B4 Relay
  2023-08-25  8:43 ` [PATCH v2 1/2] dt-bindings: rtc: Add " Nikita Shubin via B4 Relay
@ 2023-08-25  8:43 ` Nikita Shubin via B4 Relay
  2023-08-27 22:02 ` [PATCH v2 0/2] device tree support for ST M48T86 Alexandre Belloni
  2 siblings, 0 replies; 4+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-08-25  8:43 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-rtc, devicetree, linux-kernel, Nikita Shubin,
	Arnd Bergmann, Linus Walleij

From: Nikita Shubin <nikita.shubin@maquefel.me>

Add OF ID match table.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/lkml/20230601054549.10843-12-nikita.shubin@maquefel.me/
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 drivers/rtc/rtc-m48t86.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c
index 481c9525b1dd..dd4a62e2d39c 100644
--- a/drivers/rtc/rtc-m48t86.c
+++ b/drivers/rtc/rtc-m48t86.c
@@ -11,6 +11,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/rtc.h>
 #include <linux/platform_device.h>
 #include <linux/bcd.h>
@@ -269,9 +270,16 @@ static int m48t86_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id m48t86_rtc_of_ids[] = {
+	{ .compatible = "st,m48t86" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, m48t86_rtc_of_ids);
+
 static struct platform_driver m48t86_rtc_platform_driver = {
 	.driver		= {
 		.name	= "rtc-m48t86",
+		.of_match_table = m48t86_rtc_of_ids,
 	},
 	.probe		= m48t86_rtc_probe,
 };

-- 
2.39.2


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

* Re: [PATCH v2 0/2] device tree support for ST M48T86
  2023-08-25  8:43 [PATCH v2 0/2] device tree support for ST M48T86 Nikita Shubin via B4 Relay
  2023-08-25  8:43 ` [PATCH v2 1/2] dt-bindings: rtc: Add " Nikita Shubin via B4 Relay
  2023-08-25  8:43 ` [PATCH v2 2/2] rtc: m48t86: add DT support for m48t86 Nikita Shubin via B4 Relay
@ 2023-08-27 22:02 ` Alexandre Belloni
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2023-08-27 22:02 UTC (permalink / raw)
  To: Alessandro Zummo, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Nikita Shubin
  Cc: linux-rtc, devicetree, linux-kernel, Krzysztof Kozlowski,
	Arnd Bergmann, Linus Walleij


On Fri, 25 Aug 2023 11:43:24 +0300, Nikita Shubin wrote:
> Add device tree support for ST M48T86.
> 
> The reason it can't go to trivial-rtc.yaml, is that it has 2 registers
> instead of a single one. The registers are 1 byte wide.
> 
> 

Applied, thanks!

[1/2] dt-bindings: rtc: Add ST M48T86
      commit: a5aeccabb53673331f78a97ce492ce6d01f1e036
[2/2] rtc: m48t86: add DT support for m48t86
      commit: 6ec3f5ec2eecabab065a39f5e04562c8c3c81ece

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2023-08-27 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25  8:43 [PATCH v2 0/2] device tree support for ST M48T86 Nikita Shubin via B4 Relay
2023-08-25  8:43 ` [PATCH v2 1/2] dt-bindings: rtc: Add " Nikita Shubin via B4 Relay
2023-08-25  8:43 ` [PATCH v2 2/2] rtc: m48t86: add DT support for m48t86 Nikita Shubin via B4 Relay
2023-08-27 22:02 ` [PATCH v2 0/2] device tree support for ST M48T86 Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).