mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/3] clk: composite: Give mux/div/gate clks names
Date: Fri, 17 Feb 2023 10:40:54 +0100	[thread overview]
Message-ID: <20230217094056.1894461-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230217094056.1894461-1-s.hauer@pengutronix.de>

The mux/div/gate clks are never registered with the clk framework,
so names are normally not necessary. At least the mux clk might
end up in a call to clk_set_parent() though. This happens when a
mux shall change its rate and then reparents to the most suitable
parent. To get a better clue which being reparented there give the
mux a name and while at it give the other clocks names as well.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/clk/rockchip/clk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
index 6e7bba414f..5c074f526a 100644
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -59,6 +59,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
 		mux->width = mux_width;
 		mux->flags = mux_flags;
 		mux->lock = lock;
+		mux->hw.clk.name = basprintf("%s.mux", name);
 		mux->hw.clk.ops = (mux_flags & CLK_MUX_READ_ONLY) ? &clk_mux_ro_ops
 							: &clk_mux_ops;
 	}
@@ -74,6 +75,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
 		gate->reg = base + gate_offset;
 		gate->shift = gate_shift;
 		gate->lock = lock;
+		gate->hw.clk.name = basprintf("%s.gate", name);
 		gate->hw.clk.ops = &clk_gate_ops;
 	}
 
@@ -93,6 +95,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
 		div->width = div_width;
 		div->lock = lock;
 		div->table = div_table;
+		div->hw.clk.name = basprintf("%s.div", name);
 		div->hw.clk.ops = (div_flags & CLK_DIVIDER_READ_ONLY)
 						? &clk_divider_ro_ops
 						: &clk_divider_ops;
-- 
2.30.2




  reply	other threads:[~2023-02-17  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  9:40 [PATCH 0/3] Fix MMC clocks on RK3568 Sascha Hauer
2023-02-17  9:40 ` Sascha Hauer [this message]
2023-02-17  9:40 ` [PATCH 2/3] clk: composite: Fix enable_count when reparenting mux Sascha Hauer
2023-02-17  9:40 ` [PATCH 3/3] mci: rockchip-dwcmshc-sdhci: Print less errors Sascha Hauer

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=20230217094056.1894461-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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