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

Commit 3f05156a authored by Yeleswarapu Nagaradhesh's avatar Yeleswarapu Nagaradhesh Committed by Banajit Goswami
Browse files

ASoC: audio-ext-clk: add parent to div and lnbb clks



Add parents to div_clk1 and ln_bbclk. And register
both the clocks independently.

Change-Id: Ic0435ebad533879e3e0648775956c91cc680644d
Signed-off-by: default avatarYeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
parent afacd8f4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -15,11 +15,11 @@

/* Audio External Clocks */
#define AUDIO_PMI_CLK		0
#define AUDIO_PMIC_LNBB_CLK	1
#define AUDIO_AP_CLK		2
#define AUDIO_AP_CLK2		3
#define AUDIO_LPASS_MCLK	4
#define AUDIO_LPASS_MCLK2	5
#define AUDIO_PMIC_LNBB_CLK	0
#define AUDIO_AP_CLK		1
#define AUDIO_AP_CLK2		2
#define AUDIO_LPASS_MCLK	3
#define AUDIO_LPASS_MCLK2	4

#define clk_audio_ap_clk        0x9b5727cb
#define clk_audio_pmi_clk       0xcbfe416d
+32 −9
Original line number Diff line number Diff line
@@ -296,6 +296,8 @@ static struct audio_ext_pmi_clk audio_pmi_clk = {
		.div = 1,
		.hw.init = &(struct clk_init_data){
			.name = "audio_ext_pmi_clk",
			.parent_names = (const char *[]){ "div_clk1" },
			.num_parents = 1,
			.ops = &clk_dummy_ops,
		},
	},
@@ -308,6 +310,8 @@ static struct audio_ext_pmi_clk audio_pmi_lnbb_clk = {
		.div = 1,
		.hw.init = &(struct clk_init_data){
			.name = "audio_ext_pmi_lnbb_clk",
			.parent_names = (const char *[]){ "ln_bb_clk2" },
			.num_parents = 1,
			.ops = &clk_dummy_ops,
		},
	},
@@ -364,13 +368,16 @@ static struct audio_ext_lpass_mclk audio_lpass_mclk2 = {

static struct clk_hw *audio_msm_hws[] = {
	&audio_pmi_clk.fact.hw,
	&audio_pmi_lnbb_clk.fact.hw,
	&audio_ap_clk.fact.hw,
	&audio_ap_clk2.fact.hw,
	&audio_lpass_mclk.fact.hw,
	&audio_lpass_mclk2.fact.hw,
};

static struct clk_hw *audio_msm_hws1[] = {
	&audio_pmi_lnbb_clk.fact.hw,
};

static int audio_get_pinctrl(struct platform_device *pdev,
			     enum audio_clk_mux mux)
{
@@ -496,16 +503,32 @@ static int audio_ref_clk_probe(struct platform_device *pdev)
	if (!clk_data->clks)
		goto err_clk;


	clk_gpio = of_get_named_gpio(pdev->dev.of_node,
				     "qcom,audio-ref-clk-gpio", 0);
	if (clk_gpio > 0) {
		for (i = 0; i < ARRAY_SIZE(audio_msm_hws); i++) {
			audio_clk = devm_clk_register(dev, audio_msm_hws[i]);
			if (IS_ERR(audio_clk)) {
				dev_err(&pdev->dev,
				"%s: audio ref clock i = %d register failed\n",
					"%s: ref clock: %d register failed\n",
					__func__, i);
				return PTR_ERR(audio_clk);
			}
			clk_data->clks[i] = audio_clk;
		}
	} else {
		for (i = 0; i < ARRAY_SIZE(audio_msm_hws1); i++) {
			audio_clk = devm_clk_register(dev, audio_msm_hws1[i]);
			if (IS_ERR(audio_clk)) {
				dev_err(&pdev->dev,
					"%s: ref clock: %d register failed\n",
					__func__, i);
				return PTR_ERR(audio_clk);
			}
			clk_data->clks[i] = audio_clk;
		}
	}

	ret = of_clk_add_provider(pdev->dev.of_node,
				of_clk_src_onecell_get, clk_data);