All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Holland <samuel@sholland.org>
To: u-boot@lists.denx.de
Subject: [PATCH 1/6] clk: sunxi: Add a dummy clock driver for the RTC
Date: Sun,  7 Feb 2021 23:57:19 -0600	[thread overview]
Message-ID: <20210208055724.58673-2-samuel@sholland.org> (raw)
In-Reply-To: <20210208055724.58673-1-samuel@sholland.org>

The 32kHz clock ("LOSC") on sunxi SoCs is provided by the RTC. It is
used, among other things, by the XHCI controller in the H6. To be able
to call clk_get_bulk() on the XHCI controller, some device needs to
provide all referenced clocks.

Since LOSC is a fixed-rate always-on clock, implementation is trivial.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/clk/sunxi/Makefile        |  2 ++
 drivers/clk/sunxi/clk_sun6i_rtc.c | 35 +++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 drivers/clk/sunxi/clk_sun6i_rtc.c

diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
index 0dfc0593fb1..4f9282a8b9b 100644
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -6,6 +6,8 @@
 
 obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o
 
+obj-$(CONFIG_CLK_SUNXI) += clk_sun6i_rtc.o
+
 obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o
 obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o
 obj-$(CONFIG_CLK_SUN6I_A31) += clk_a31.o
diff --git a/drivers/clk/sunxi/clk_sun6i_rtc.c b/drivers/clk/sunxi/clk_sun6i_rtc.c
new file mode 100644
index 00000000000..0c280d221ba
--- /dev/null
+++ b/drivers/clk/sunxi/clk_sun6i_rtc.c
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2018 Amarula Solutions.
+ * Copyright (C) 2020 Samuel Holland <samuel@sholland.org>
+ */
+
+#include <clk-uclass.h>
+#include <dm.h>
+
+static int clk_sun6i_rtc_enable(struct clk *clk)
+{
+	return 0;
+}
+
+static const struct clk_ops clk_sun6i_rtc_ops = {
+	.enable = clk_sun6i_rtc_enable,
+};
+
+static const struct udevice_id sun6i_rtc_ids[] = {
+	{ .compatible = "allwinner,sun6i-a31-rtc" },
+	{ .compatible = "allwinner,sun8i-a23-rtc" },
+	{ .compatible = "allwinner,sun8i-h3-rtc" },
+	{ .compatible = "allwinner,sun8i-r40-rtc" },
+	{ .compatible = "allwinner,sun8i-v3-rtc" },
+	{ .compatible = "allwinner,sun50i-h5-rtc" },
+	{ .compatible = "allwinner,sun50i-h6-rtc" },
+	{ }
+};
+
+U_BOOT_DRIVER(clk_sun6i_rtc) = {
+	.name		= "clk_sun6i_rtc",
+	.id		= UCLASS_CLK,
+	.of_match	= sun6i_rtc_ids,
+	.ops		= &clk_sun6i_rtc_ops,
+};
-- 
2.26.2

  reply	other threads:[~2021-02-08  5:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  5:57 [PATCH 0/6] Allwinner H6 USB3 support Samuel Holland
2021-02-08  5:57 ` Samuel Holland [this message]
2021-03-28 22:51   ` [PATCH 1/6] clk: sunxi: Add a dummy clock driver for the RTC Andre Przywara
2021-02-08  5:57 ` [PATCH 2/6] clk: sunxi: h6: Add XHCI clocks Samuel Holland
2021-02-09  1:33   ` Andre Przywara
2021-02-08  5:57 ` [PATCH 3/6] phy: sun50i-usb3: Add a driver for the H6 USB3 PHY Samuel Holland
2021-02-09  1:33   ` Andre Przywara
2021-02-08  5:57 ` [PATCH 4/6] usb: xhci-pci: Move reset logic out of XHCI core Samuel Holland
2021-02-08 11:43   ` Marek Vasut
2021-02-09  1:42     ` Andre Przywara
2021-02-09  2:27     ` Samuel Holland
2021-02-09  2:28       ` Samuel Holland
2021-02-09  9:45         ` Marek Vasut
2021-02-08  5:57 ` [PATCH 5/6] usb: xhci-dwc3: Add support for clocks/resets Samuel Holland
2021-02-09  1:42   ` Andre Przywara
2021-02-09  3:01     ` Samuel Holland
2021-02-08  5:57 ` [PATCH 6/6] configs: Enable USB3 on Allwinner H6 boards Samuel Holland
2021-02-09  1:42   ` Andre Przywara
2021-02-09  1:42 ` [PATCH 0/6] Allwinner H6 USB3 support Andre Przywara
2021-02-09 10:46 ` Andre Heider
2021-04-17 14:17   ` Samuel Holland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210208055724.58673-2-samuel@sholland.org \
    --to=samuel@sholland.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.