Loading Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +10 −0 Original line number Diff line number Diff line Loading @@ -323,6 +323,16 @@ Optional properties: - qcom,codec-mclk-clk-freq: Codec mclk frequency in Hz. - qcom,lpass-mclk-id AFE mclk id needed to enable the mclk to drive 11.288MHz clok frequency which is needed to render the samples at 44.1KHz frequency, this mclk will run in parallel to the codec mclk this clock supply to the codec depends on the target following are the different possibilities to this node. "pri_mclk" "sec_mclk" "spk_i2s_mclk" * audio_slimslave Required properties: Loading arch/arm/boot/dts/qcom/msmtitanium-audio.dtsi +8 −0 Original line number Diff line number Diff line Loading @@ -67,7 +67,11 @@ &clock_audio { qcom,audio-ref-clk-gpio = <&pmtitanium_gpios 1 0>; qcom,lpass-mclk-id = "pri_mclk"; clocks = <&clock_gcc clk_div_clk2>; pinctrl-names = "sleep", "active"; pinctrl-0 = <&cdc_mclk2_sleep>; pinctrl-1 = <&cdc_mclk2_active>; }; &pmtitanium_1 { Loading Loading @@ -139,6 +143,10 @@ }; &wcd9335 { clock-names = "wcd_clk", "wcd_native_clk"; clocks = <&clock_audio clk_audio_pmi_clk>, <&clock_audio clk_audio_ap_clk2>; qcom,cdc-reset-gpio = <&tlmm 67 0>; cdc-vdd-buck-supply = <&eldo2_titanium>; Loading arch/arm/boot/dts/qcom/msmtitanium-pinctrl.dtsi +25 −0 Original line number Diff line number Diff line Loading @@ -863,6 +863,31 @@ }; }; cdc_mclk2_pin { cdc_mclk2_sleep: cdc_mclk2_sleep { mux { pins = "gpio66"; function = "pri_mi2s"; }; config { pins = "gpio66"; drive-strength = <2>; /* 2 mA */ bias-pull-down; /* PULL DOWN */ }; }; cdc_mclk2_active: cdc_mclk2_active { mux { pins = "gpio66"; function = "pri_mi2s"; }; config { pins = "gpio66"; drive-strength = <8>; /* 8 mA */ bias-disable; /* NO PULL */ }; }; }; cdc-pdm-2-lines { cdc_pdm_lines_2_act: pdm_lines_2_on { mux { Loading include/dt-bindings/clock/msm-clocks-titanium.h +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -313,6 +313,7 @@ #define clk_audio_ap_clk 0x312ac429 #define clk_audio_pmi_clk 0xb7ba2274 #define clk_audio_ap_clk2 0xf0fbaf5b /* external multimedia clocks */ #define clk_dsi0pll_pixel_clk_mux 0x792379e1 #define clk_dsi0pll_byte_clk_mux 0x60e83f06 Loading sound/soc/codecs/audio-ext-clk.c +28 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -329,12 +329,30 @@ err: return -EINVAL; } static void audio_ref_update_afe_mclk_id(const char *ptr) { if (!strcmp(ptr, "pri_mclk")) { pr_debug("%s: updating the mclk id with primary mclk\n", __func__); clk2_config.clk_id = Q6AFE_LPASS_CLK_ID_MCLK_1; } else if (!strcmp(ptr, "sec_mclk")) { pr_debug("%s: updating the mclk id with secondary mclk\n", __func__); clk2_config.clk_id = Q6AFE_LPASS_CLK_ID_MCLK_2; } else { pr_debug("%s: updating the mclk id with default\n", __func__); } pr_debug("%s: clk_id = 0x%x\n", __func__, clk2_config.clk_id); } static int audio_ref_clk_probe(struct platform_device *pdev) { int clk_gpio; int ret; struct clk *div_clk1; u32 mclk_freq; const char *mclk_id = "qcom,lpass-mclk-id"; const char *mclk_str = NULL; ret = of_property_read_u32(pdev->dev.of_node, "qcom,codec-mclk-clk-freq", Loading @@ -353,6 +371,15 @@ static int audio_ref_clk_probe(struct platform_device *pdev) return ret; } ret = of_property_read_string(pdev->dev.of_node, mclk_id, &mclk_str); if (ret) dev_dbg(&pdev->dev, "%s:of read string %s not present %d\n", __func__, mclk_id, ret); if (mclk_str) audio_ref_update_afe_mclk_id(mclk_str); clk_gpio = of_get_named_gpio(pdev->dev.of_node, "qcom,audio-ref-clk-gpio", 0); if (clk_gpio < 0) { Loading Loading
Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +10 −0 Original line number Diff line number Diff line Loading @@ -323,6 +323,16 @@ Optional properties: - qcom,codec-mclk-clk-freq: Codec mclk frequency in Hz. - qcom,lpass-mclk-id AFE mclk id needed to enable the mclk to drive 11.288MHz clok frequency which is needed to render the samples at 44.1KHz frequency, this mclk will run in parallel to the codec mclk this clock supply to the codec depends on the target following are the different possibilities to this node. "pri_mclk" "sec_mclk" "spk_i2s_mclk" * audio_slimslave Required properties: Loading
arch/arm/boot/dts/qcom/msmtitanium-audio.dtsi +8 −0 Original line number Diff line number Diff line Loading @@ -67,7 +67,11 @@ &clock_audio { qcom,audio-ref-clk-gpio = <&pmtitanium_gpios 1 0>; qcom,lpass-mclk-id = "pri_mclk"; clocks = <&clock_gcc clk_div_clk2>; pinctrl-names = "sleep", "active"; pinctrl-0 = <&cdc_mclk2_sleep>; pinctrl-1 = <&cdc_mclk2_active>; }; &pmtitanium_1 { Loading Loading @@ -139,6 +143,10 @@ }; &wcd9335 { clock-names = "wcd_clk", "wcd_native_clk"; clocks = <&clock_audio clk_audio_pmi_clk>, <&clock_audio clk_audio_ap_clk2>; qcom,cdc-reset-gpio = <&tlmm 67 0>; cdc-vdd-buck-supply = <&eldo2_titanium>; Loading
arch/arm/boot/dts/qcom/msmtitanium-pinctrl.dtsi +25 −0 Original line number Diff line number Diff line Loading @@ -863,6 +863,31 @@ }; }; cdc_mclk2_pin { cdc_mclk2_sleep: cdc_mclk2_sleep { mux { pins = "gpio66"; function = "pri_mi2s"; }; config { pins = "gpio66"; drive-strength = <2>; /* 2 mA */ bias-pull-down; /* PULL DOWN */ }; }; cdc_mclk2_active: cdc_mclk2_active { mux { pins = "gpio66"; function = "pri_mi2s"; }; config { pins = "gpio66"; drive-strength = <8>; /* 8 mA */ bias-disable; /* NO PULL */ }; }; }; cdc-pdm-2-lines { cdc_pdm_lines_2_act: pdm_lines_2_on { mux { Loading
include/dt-bindings/clock/msm-clocks-titanium.h +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -313,6 +313,7 @@ #define clk_audio_ap_clk 0x312ac429 #define clk_audio_pmi_clk 0xb7ba2274 #define clk_audio_ap_clk2 0xf0fbaf5b /* external multimedia clocks */ #define clk_dsi0pll_pixel_clk_mux 0x792379e1 #define clk_dsi0pll_byte_clk_mux 0x60e83f06 Loading
sound/soc/codecs/audio-ext-clk.c +28 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -329,12 +329,30 @@ err: return -EINVAL; } static void audio_ref_update_afe_mclk_id(const char *ptr) { if (!strcmp(ptr, "pri_mclk")) { pr_debug("%s: updating the mclk id with primary mclk\n", __func__); clk2_config.clk_id = Q6AFE_LPASS_CLK_ID_MCLK_1; } else if (!strcmp(ptr, "sec_mclk")) { pr_debug("%s: updating the mclk id with secondary mclk\n", __func__); clk2_config.clk_id = Q6AFE_LPASS_CLK_ID_MCLK_2; } else { pr_debug("%s: updating the mclk id with default\n", __func__); } pr_debug("%s: clk_id = 0x%x\n", __func__, clk2_config.clk_id); } static int audio_ref_clk_probe(struct platform_device *pdev) { int clk_gpio; int ret; struct clk *div_clk1; u32 mclk_freq; const char *mclk_id = "qcom,lpass-mclk-id"; const char *mclk_str = NULL; ret = of_property_read_u32(pdev->dev.of_node, "qcom,codec-mclk-clk-freq", Loading @@ -353,6 +371,15 @@ static int audio_ref_clk_probe(struct platform_device *pdev) return ret; } ret = of_property_read_string(pdev->dev.of_node, mclk_id, &mclk_str); if (ret) dev_dbg(&pdev->dev, "%s:of read string %s not present %d\n", __func__, mclk_id, ret); if (mclk_str) audio_ref_update_afe_mclk_id(mclk_str); clk_gpio = of_get_named_gpio(pdev->dev.of_node, "qcom,audio-ref-clk-gpio", 0); if (clk_gpio < 0) { Loading