From: <gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Maxime Coquelin
<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
Michael Turquette
<mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Gabriel Fernandez
<gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
gabriel.fernandez.st-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
olivier.bideau-qxv4g6HH51o@public.gmane.org
Subject: [PATCH 12/14] clk: stm32mp1: add RTC clock
Date: Fri, 2 Feb 2018 15:03:40 +0100 [thread overview]
Message-ID: <1517580222-23301-13-git-send-email-gabriel.fernandez@st.com> (raw)
In-Reply-To: <1517580222-23301-1-git-send-email-gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
From: Gabriel Fernandez <gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
This patch adds the RTC clock.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
---
drivers/clk/clk-stm32mp1.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index 5a1142c..1cb06b0 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -1179,6 +1179,15 @@ static struct clk_hw *_clk_register_cktim(struct device *dev,
_MUX(_mux_offset, _mux_bit, _mux_width, 0),\
}
+#define _GATEMUX(_gate_offset,\
+ _bit_idx,\
+ _mux_offset, _mux_bit, _mux_width)\
+{\
+ _NO_DIV,\
+ _GATE(_gate_offset, _bit_idx, 0),\
+ _MUX(_mux_offset, _mux_bit, _mux_width, 0),\
+}
+
#define _MP1_GATE(_gate_offset, _bit_idx, _flags)\
_GATE_OPS(_gate_offset, _bit_idx, _flags, &mp1_gate_clk_ops)
@@ -1526,6 +1535,14 @@ static struct clk_hw *_clk_register_cktim(struct device *dev,
RCC_APB4ENSETR, 0, 0),
MP1_GATE(GPU_K, "gpu_k", "pll2_q", 0, RCC_AHB6ENSETR, 5, 0),
+
+ /* RTC clock */
+ DIV(NO_ID, "ck_hse_rtc", "ck_hse", 0, RCC_RTCDIVR, 0, 7,
+ CLK_DIVIDER_ALLOW_ZERO),
+
+ COMPOSITE(RTC, "ck_rtc", rtc_src, CLK_OPS_PARENT_ENABLE |
+ CLK_SET_RATE_PARENT,
+ _GATEMUX(RCC_BDCR, 20, RCC_BDCR, 16, 2)),
};
struct stm32_clock_match_data {
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-02-02 14:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 14:03 [PATCH 00/14] Introduce STM32MP1 clock driver gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` [PATCH 02/14] dt-bindings: clock: add STM32MP1 clocks gabriel.fernandez
[not found] ` <1517580222-23301-3-git-send-email-gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
2018-02-05 6:09 ` Rob Herring
2018-02-05 7:02 ` Gabriel FERNANDEZ
2018-02-02 14:03 ` [PATCH 04/14] clk: stm32mp1: add MP1 gate for osc hse/hsi/csi oscillators gabriel.fernandez
[not found] ` <1517580222-23301-1-git-send-email-gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
2018-02-02 14:03 ` [PATCH 01/14] dt-bindings: Document STM32MP1 Reset Clock Controller (RCC) bindings gabriel.fernandez-qxv4g6HH51o
2018-02-05 6:09 ` Rob Herring
2018-02-05 7:01 ` Gabriel FERNANDEZ
2018-02-07 18:03 ` Rob Herring
2018-02-13 14:36 ` Gabriel FERNANDEZ
2018-02-05 7:15 ` Gabriel FERNANDEZ
2018-02-02 14:03 ` [PATCH 03/14] clk: stm32mp1: Introduce STM32MP1 clock driver gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` [PATCH 05/14] clk: stm32mp1: add Source Clocks for PLLs gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` [PATCH 06/14] clk: stm32mp1: add PLL clocks gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` [PATCH 07/14] clk: stm32mp1: add Post-dividers for PLL gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` [PATCH 08/14] clk: stm32mp1: add Sub System clocks gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` [PATCH 11/14] clk: stm32mp1: add Kernel clocks gabriel.fernandez-qxv4g6HH51o
2018-02-02 14:03 ` gabriel.fernandez-qxv4g6HH51o [this message]
2018-02-02 14:03 ` [PATCH 09/14] clk: stm32mp1: add Kernel timers gabriel.fernandez
2018-02-02 14:03 ` [PATCH 10/14] clk: stm32mp1: add Peripheral clocks gabriel.fernandez
2018-02-02 14:03 ` [PATCH 13/14] clk: stm32mp1: add MCO clocks gabriel.fernandez
2018-02-02 14:03 ` [PATCH 14/14] clk: stm32mp1: add Debug clocks gabriel.fernandez
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=1517580222-23301-13-git-send-email-gabriel.fernandez@st.com \
--to=gabriel.fernandez-qxv4g6hh51o@public.gmane.org \
--cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gabriel.fernandez.st-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=olivier.bideau-qxv4g6HH51o@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
/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 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).