Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7696eb78 authored by Shuai Zhang's avatar Shuai Zhang
Browse files

ASOC: ext-clk: Fix hw init issue caused by CLK upgrade



CLK driver upgrade causes hw->init to be NULL.
Unable to get hw->init from CLK core.
Modify to obtain hw->init from local static data.

Change-Id: I2ffc3e7dfd356cfcb2735336dd67ff70a35328c4
Signed-off-by: default avatarShuai Zhang <quic_shuzhan@quicinc.com>
parent 1858731c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/kernel.h>
@@ -58,6 +59,8 @@ struct audio_ext_clk_priv {
	uint32_t lpass_audio_hwvote_client_handle;
};

static struct audio_ext_clk audio_clk_array[];

static inline struct audio_ext_clk_priv *to_audio_clk(struct clk_hw *hw)
{
	return container_of(hw, struct audio_ext_clk_priv, audio_clk.fact.hw);
@@ -137,8 +140,8 @@ static u8 audio_ext_clk_get_parent(struct clk_hw *hw)
{
	struct audio_ext_clk_priv *clk_priv = to_audio_clk(hw);
	int num_parents = clk_hw_get_num_parents(hw);
	const char * const *parent_names = hw->init->parent_names;
	u8 i = 0, ret = hw->init->num_parents + 1;
	const char * const *parent_names = audio_clk_array[clk_priv->clk_src].fact.hw.init->parent_names;
	u8 i = 0, ret = num_parents + 1;

	if ((clk_priv->clk_src == AUDIO_EXT_CLK_PMI) && clk_priv->clk_name) {
		for (i = 0; i < num_parents; i++) {