From: Daniel Mack <daniel@zonque.org>
To: mturquette@baylibre.com, sboyd@kernel.org
Cc: linux-clk@vger.kernel.org, robh+dt@kernel.org,
devicetree@vger.kernel.org, kuninori.morimoto.gx@renesas.com,
Daniel Mack <daniel@zonque.org>
Subject: [PATCH RESEND v4 5/9] clk: cs2000-cp: Make aux output function controllable
Date: Tue, 25 Jan 2022 10:33:32 +0100 [thread overview]
Message-ID: <20220125093336.226787-6-daniel@zonque.org> (raw)
In-Reply-To: <20220125093336.226787-1-daniel@zonque.org>
The aux output pin can be configured to output either of the two clock
inputs, the generated clock or the pll lock status. Allow access to
this feature through a new optional device-tree property.
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
drivers/clk/clk-cs2000-cp.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c
index 92bc4aca0f95..db7290621cef 100644
--- a/drivers/clk/clk-cs2000-cp.c
+++ b/drivers/clk/clk-cs2000-cp.c
@@ -39,6 +39,8 @@
/* DEVICE_CFG1 */
#define RSEL(x) (((x) & 0x3) << 3)
#define RSEL_MASK RSEL(0x3)
+#define AUXOUTSRC(x) (((x) & 0x3) << 1)
+#define AUXOUTSRC_MASK AUXOUTSRC(0x3)
#define ENDEV1 (0x1)
/* DEVICE_CFG2 */
@@ -421,12 +423,19 @@ static int cs2000_clk_register(struct cs2000_priv *priv)
struct clk_init_data init;
const char *name = np->name;
static const char *parent_names[CLK_MAX];
+ u32 aux_out = 0;
int ch = 0; /* it uses ch0 only at this point */
int rate;
int ret;
of_property_read_string(np, "clock-output-names", &name);
+ of_property_read_u32(np, "cirrus,aux-output-source", &aux_out);
+ ret = cs2000_bset(priv, DEVICE_CFG1,
+ AUXOUTSRC_MASK, AUXOUTSRC(aux_out));
+ if (ret < 0)
+ return ret;
+
/*
* set default rate as 1/1.
* otherwise .set_rate which setup ratio
--
2.31.1
next prev parent reply other threads:[~2022-01-25 9:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 9:33 [PATCH RESEND v4 0/9] clk: cs2000-cp: add dynamic mode and more features Daniel Mack
2022-01-25 9:33 ` [PATCH RESEND v4 1/9] dt-bindings: clock: convert cs2000-cp bindings to yaml Daniel Mack
2022-01-25 22:29 ` Stephen Boyd
2022-02-08 13:46 ` Daniel Mack
2022-01-25 9:33 ` [PATCH RESEND v4 2/9] dt-bindings: clock: cs2000-cp: document aux-output-source Daniel Mack
2022-01-25 22:29 ` Stephen Boyd
2022-01-25 9:33 ` [PATCH RESEND v4 3/9] dt-bindings: clock: cs2000-cp: document cirrus,clock-skip flag Daniel Mack
2022-01-25 22:29 ` Stephen Boyd
2022-01-25 9:33 ` [PATCH RESEND v4 4/9] dt-bindings: clock: cs2000-cp: document cirrus,dynamic-mode Daniel Mack
2022-01-25 22:29 ` Stephen Boyd
2022-01-25 9:33 ` Daniel Mack [this message]
2022-01-25 22:29 ` [PATCH RESEND v4 5/9] clk: cs2000-cp: Make aux output function controllable Stephen Boyd
2022-01-25 9:33 ` [PATCH RESEND v4 6/9] clk: cs2000-cp: add support for dynamic mode Daniel Mack
2022-01-25 22:30 ` Stephen Boyd
2022-01-25 9:33 ` [PATCH RESEND v4 7/9] clk: cs2000-cp: make clock skip setting configurable Daniel Mack
2022-01-25 22:30 ` Stephen Boyd
2022-01-25 9:33 ` [PATCH RESEND v4 8/9] clk: cs2000-cp: freeze config during register fiddling Daniel Mack
2022-01-25 22:30 ` Stephen Boyd
2022-01-25 9:33 ` [PATCH RESEND v4 9/9] clk: cs2000-cp: convert driver to regmap Daniel Mack
2022-01-25 22:30 ` Stephen Boyd
-- strict thread matches above, loose matches on Subject: below --
2021-12-14 12:09 [PATCH RESEND v4 0/9] clk: cs2000-cp: add dynamic mode and more features Daniel Mack
2021-12-14 12:09 ` [PATCH RESEND v4 5/9] clk: cs2000-cp: Make aux output function controllable Daniel Mack
2021-10-15 14:53 [PATCH RESEND v4 0/9] clk: cs2000-cp: add dynamic mode and more features Daniel Mack
2021-10-15 14:53 ` [PATCH RESEND v4 5/9] clk: cs2000-cp: Make aux output function controllable Daniel Mack
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=20220125093336.226787-6-daniel@zonque.org \
--to=daniel@zonque.org \
--cc=devicetree@vger.kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.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).