diff mbox series

ASoC: rt5682: Register wclk with its parent_hws instead of parent_data

Message ID 20211227055446.27563-1-derek.fang@realtek.com
State Accepted
Commit cc5c9788106fb1b9e03c8c57d8d7166073a54416
Headers show
Series ASoC: rt5682: Register wclk with its parent_hws instead of parent_data | expand

Commit Message

Derek [方德義] Dec. 27, 2021, 5:54 a.m. UTC
From: Derek Fang <derek.fang@realtek.com>

The mclk might not be registered as a fixed clk name "mclk" on some
platforms.
In those platforms, if the mclk needed to be controlled by codec driver
and acquired by a fixed name, it would be a problem.

This patch to fix the issue that wclk becomes an orphan due to the fixed
mclk's name.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
---
 sound/soc/codecs/rt5682.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Mark Brown Dec. 29, 2021, 1:29 p.m. UTC | #1
On Mon, 27 Dec 2021 13:54:46 +0800, derek.fang@realtek.com wrote:
> From: Derek Fang <derek.fang@realtek.com>
> 
> The mclk might not be registered as a fixed clk name "mclk" on some
> platforms.
> In those platforms, if the mclk needed to be controlled by codec driver
> and acquired by a fixed name, it would be a problem.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rt5682: Register wclk with its parent_hws instead of parent_data
      commit: cc5c9788106fb1b9e03c8c57d8d7166073a54416

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 5224123d0d3b..4709c0628804 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -2858,7 +2858,6 @@  int rt5682_register_dai_clks(struct rt5682_priv *rt5682)
 
 	for (i = 0; i < RT5682_DAI_NUM_CLKS; ++i) {
 		struct clk_init_data init = { };
-		struct clk_parent_data parent_data;
 		const struct clk_hw *parent;
 
 		dai_clk_hw = &rt5682->dai_clks_hw[i];
@@ -2867,10 +2866,8 @@  int rt5682_register_dai_clks(struct rt5682_priv *rt5682)
 		case RT5682_DAI_WCLK_IDX:
 			/* Make MCLK the parent of WCLK */
 			if (rt5682->mclk) {
-				parent_data = (struct clk_parent_data){
-					.fw_name = "mclk",
-				};
-				init.parent_data = &parent_data;
+				parent = __clk_get_hw(rt5682->mclk);
+				init.parent_hws = &parent;
 				init.num_parents = 1;
 			}
 			break;