ASoC: Audio bringup fixes for SDM660
Update fixes for SDM660 external and internal codec variants from audio. Change-Id: Id2a05700e96f4670181d510d6bce7bccc2919bfc Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
parent
4b3736890b
commit
5faffa091e
10 changed files with 118 additions and 141 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2017, 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
|
||||
|
@ -108,6 +108,7 @@ static const u32 lpi_offset[] = {
|
|||
0x00000000,
|
||||
0x00001000,
|
||||
0x00002000,
|
||||
0x00002010,
|
||||
0x00003000,
|
||||
0x00003010,
|
||||
0x00004000,
|
||||
|
@ -592,7 +593,7 @@ static int lpi_pinctrl_probe(struct platform_device *pdev)
|
|||
goto err_range;
|
||||
}
|
||||
|
||||
lpi_dev_up = false;
|
||||
lpi_dev_up = true;
|
||||
ret = audio_notifier_register("lpi_tlmm", AUDIO_NOTIFIER_ADSP_DOMAIN,
|
||||
&service_nb);
|
||||
if (ret < 0) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015-2017, 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
|
||||
|
@ -2383,6 +2383,7 @@ static int msm_anlg_cdc_codec_enable_dig_clk(struct snd_soc_dapm_widget *w,
|
|||
case SND_SOC_DAPM_PRE_PMU:
|
||||
msm_anlg_cdc_codec_enable_clock_block(codec, 1);
|
||||
snd_soc_update_bits(codec, w->reg, 0x80, 0x80);
|
||||
msm_anlg_cdc_boost_mode_sequence(codec, SPK_PMU);
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
if (sdm660_cdc->rx_bias_count == 0)
|
||||
|
@ -4016,6 +4017,7 @@ int msm_anlg_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
|
|||
struct snd_info_entry *version_entry;
|
||||
struct sdm660_cdc_priv *sdm660_cdc_priv;
|
||||
struct snd_soc_card *card;
|
||||
int ret;
|
||||
|
||||
if (!codec_root || !codec)
|
||||
return -EINVAL;
|
||||
|
@ -4023,7 +4025,7 @@ int msm_anlg_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
|
|||
sdm660_cdc_priv = snd_soc_codec_get_drvdata(codec);
|
||||
card = codec->component.card;
|
||||
sdm660_cdc_priv->entry = snd_register_module_info(codec_root->module,
|
||||
"pmic_analog",
|
||||
"spmi0-03",
|
||||
codec_root);
|
||||
if (!sdm660_cdc_priv->entry) {
|
||||
dev_dbg(codec->dev, "%s: failed to create pmic_analog entry\n",
|
||||
|
@ -4050,6 +4052,16 @@ int msm_anlg_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
|
|||
return -ENOMEM;
|
||||
}
|
||||
sdm660_cdc_priv->version_entry = version_entry;
|
||||
sdm660_cdc_priv->audio_ssr_nb.notifier_call =
|
||||
sdm660_cdc_notifier_service_cb;
|
||||
ret = audio_notifier_register("pmic_analog_cdc",
|
||||
AUDIO_NOTIFIER_ADSP_DOMAIN,
|
||||
&sdm660_cdc_priv->audio_ssr_nb);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: Audio notifier register failed ret = %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(msm_anlg_codec_info_create_codec_entry);
|
||||
|
@ -4176,17 +4188,6 @@ static int msm_anlg_cdc_soc_probe(struct snd_soc_codec *codec)
|
|||
|
||||
/* Set initial cap mode */
|
||||
msm_anlg_cdc_configure_cap(codec, false, false);
|
||||
sdm660_cdc_priv->audio_ssr_nb.notifier_call =
|
||||
sdm660_cdc_notifier_service_cb;
|
||||
ret = audio_notifier_register("pmic_analog_cdc",
|
||||
AUDIO_NOTIFIER_ADSP_DOMAIN,
|
||||
&sdm660_cdc_priv->audio_ssr_nb);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: Audio notifier register failed ret = %d\n",
|
||||
__func__, ret);
|
||||
wcd_mbhc_deinit(&sdm660_cdc_priv->mbhc);
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4586,6 +4587,8 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
|
|||
usleep_range(5, 6);
|
||||
|
||||
dev_set_drvdata(&pdev->dev, sdm660_cdc);
|
||||
wcd9xxx_spmi_set_dev(pdev, 0);
|
||||
wcd9xxx_spmi_set_dev(pdev, 1);
|
||||
if (wcd9xxx_spmi_irq_init()) {
|
||||
dev_err(&pdev->dev,
|
||||
"%s: irq initialization failed\n", __func__);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015-2017, 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
|
||||
|
@ -815,7 +815,7 @@ static int msm_dig_cdc_codec_enable_dmic(struct snd_soc_dapm_widget *w,
|
|||
}
|
||||
snd_soc_update_bits(codec,
|
||||
MSM89XX_CDC_CORE_TX1_DMIC_CTL + (dmic - 1) * 0x20,
|
||||
0x07, 0x01);
|
||||
0x07, 0x02);
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
(*dmic_clk_cnt)--;
|
||||
|
@ -1132,7 +1132,7 @@ int msm_dig_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
|
|||
msm_dig = snd_soc_codec_get_drvdata(codec);
|
||||
card = codec->component.card;
|
||||
msm_dig->entry = snd_register_module_info(codec_root->module,
|
||||
"msm_digital",
|
||||
"msm_digital_codec",
|
||||
codec_root);
|
||||
if (!msm_dig->entry) {
|
||||
dev_dbg(codec->dev, "%s: failed to create msm_digital entry\n",
|
||||
|
@ -1202,9 +1202,8 @@ static int msm_dig_cdc_soc_probe(struct snd_soc_codec *codec)
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
if (msm_dig_cdc->get_cdc_version)
|
||||
dig_cdc->version = msm_dig_cdc->get_cdc_version(
|
||||
msm_dig_cdc->handle);
|
||||
/* Assign to DRAX_CDC for initial version */
|
||||
dig_cdc->version = DRAX_CDC;
|
||||
registered_digcodec = codec;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1557,16 +1556,18 @@ static const struct snd_soc_dapm_widget msm_dig_dapm_widgets[] = {
|
|||
SND_SOC_DAPM_MIXER("RX1 MIX1", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_MIXER("RX2 MIX1", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||
|
||||
SND_SOC_DAPM_MIXER_E("RX1 CHAIN", MSM89XX_CDC_CORE_RX1_B6_CTL,
|
||||
MSM89XX_RX1, 0, NULL, 0,
|
||||
SND_SOC_DAPM_MIXER_E("RX1 CHAIN", SND_SOC_NOPM,
|
||||
0, 0, NULL, 0,
|
||||
msm_dig_cdc_codec_enable_rx_chain,
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MIXER_E("RX2 CHAIN", SND_SOC_NOPM,
|
||||
0, 0, NULL, 0,
|
||||
msm_dig_cdc_codec_enable_rx_chain,
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MIXER_E("RX3 CHAIN", SND_SOC_NOPM,
|
||||
0, 0, NULL, 0,
|
||||
msm_dig_cdc_codec_enable_rx_chain,
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MIXER_E("RX2 CHAIN", MSM89XX_CDC_CORE_RX2_B6_CTL,
|
||||
MSM89XX_RX2, 0, NULL, 0,
|
||||
msm_dig_cdc_codec_enable_rx_chain, SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MIXER_E("RX3 CHAIN", MSM89XX_CDC_CORE_RX3_B6_CTL,
|
||||
MSM89XX_RX3, 0, NULL, 0,
|
||||
msm_dig_cdc_codec_enable_rx_chain, SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
SND_SOC_DAPM_MUX("RX1 MIX1 INP1", SND_SOC_NOPM, 0, 0,
|
||||
&rx_mix1_inp1_mux),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015, 2017 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
|
||||
|
@ -13,6 +13,7 @@
|
|||
#include <linux/bitops.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/slab.h>
|
||||
|
@ -83,7 +84,7 @@ struct wcd9xxx_spmi_map {
|
|||
uint8_t mask[NUM_IRQ_REGS];
|
||||
int linuxirq[MAX_NUM_IRQS];
|
||||
irq_handler_t handler[MAX_NUM_IRQS];
|
||||
struct spmi_device *spmi[NUM_IRQ_REGS];
|
||||
struct platform_device *spmi[NUM_IRQ_REGS];
|
||||
struct snd_soc_codec *codec;
|
||||
|
||||
enum wcd9xxx_spmi_pm_state pm_state;
|
||||
|
@ -99,22 +100,6 @@ struct wcd9xxx_spmi_map map;
|
|||
void wcd9xxx_spmi_enable_irq(int irq)
|
||||
{
|
||||
pr_debug("%s: irqno =%d\n", __func__, irq);
|
||||
if ((irq >= 0) && (irq <= 7)) {
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_DIGITAL_INT_EN_CLR,
|
||||
(0x01 << irq), 0x00);
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_DIGITAL_INT_EN_SET,
|
||||
(0x01 << irq), (0x01 << irq));
|
||||
}
|
||||
if ((irq > 7) && (irq <= 15)) {
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_ANALOG_INT_EN_CLR,
|
||||
(0x01 << (irq - 8)), 0x00);
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_ANALOG_INT_EN_SET,
|
||||
(0x01 << (irq - 8)), (0x01 << (irq - 8)));
|
||||
}
|
||||
|
||||
if (!(map.mask[BIT_BYTE(irq)] & (BYTE_BIT_MASK(irq))))
|
||||
return;
|
||||
|
@ -128,23 +113,6 @@ void wcd9xxx_spmi_enable_irq(int irq)
|
|||
void wcd9xxx_spmi_disable_irq(int irq)
|
||||
{
|
||||
pr_debug("%s: irqno =%d\n", __func__, irq);
|
||||
if ((irq >= 0) && (irq <= 7)) {
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_DIGITAL_INT_EN_SET,
|
||||
(0x01 << (irq)), 0x00);
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_DIGITAL_INT_EN_CLR,
|
||||
(0x01 << irq), (0x01 << irq));
|
||||
}
|
||||
|
||||
if ((irq > 7) && (irq <= 15)) {
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_ANALOG_INT_EN_SET,
|
||||
(0x01 << (irq - 8)), 0x00);
|
||||
snd_soc_update_bits(map.codec,
|
||||
MSM89XX_PMIC_ANALOG_INT_EN_CLR,
|
||||
(0x01 << (irq - 8)), (0x01 << (irq - 8)));
|
||||
}
|
||||
|
||||
if (map.mask[BIT_BYTE(irq)] & (BYTE_BIT_MASK(irq)))
|
||||
return;
|
||||
|
@ -161,6 +129,10 @@ int wcd9xxx_spmi_request_irq(int irq, irq_handler_t handler,
|
|||
int rc;
|
||||
unsigned long irq_flags;
|
||||
|
||||
map.linuxirq[irq] =
|
||||
platform_get_irq_byname(map.spmi[BIT_BYTE(irq)],
|
||||
irq_names[irq]);
|
||||
|
||||
if (strcmp(name, "mbhc sw intr"))
|
||||
irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
|
||||
IRQF_ONESHOT;
|
||||
|
@ -414,7 +386,7 @@ void wcd9xxx_spmi_set_codec(struct snd_soc_codec *codec)
|
|||
map.codec = codec;
|
||||
}
|
||||
|
||||
void wcd9xxx_spmi_set_dev(struct spmi_device *spmi, int i)
|
||||
void wcd9xxx_spmi_set_dev(struct platform_device *spmi, int i)
|
||||
{
|
||||
if (i < NUM_IRQ_REGS)
|
||||
map.spmi[i] = spmi;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015, 2017 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
|
||||
|
@ -24,7 +24,7 @@ extern int wcd9xxx_spmi_request_irq(int irq, irq_handler_t handler,
|
|||
const char *name, void *priv);
|
||||
extern int wcd9xxx_spmi_free_irq(int irq, void *priv);
|
||||
extern void wcd9xxx_spmi_set_codec(struct snd_soc_codec *codec);
|
||||
extern void wcd9xxx_spmi_set_dev(struct spmi_device *spmi, int i);
|
||||
extern void wcd9xxx_spmi_set_dev(struct platform_device *spmi, int i);
|
||||
extern int wcd9xxx_spmi_irq_init(void);
|
||||
extern int wcd9xxx_spmi_suspend(pm_message_t);
|
||||
extern int wcd9xxx_spmi_resume(void);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2017, 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
|
||||
|
@ -452,20 +452,8 @@ bool msm89xx_cdc_core_readable_reg(struct device *dev, unsigned int reg)
|
|||
bool msm89xx_cdc_core_volatile_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
switch (reg) {
|
||||
case MSM89XX_CDC_CORE_RX1_B1_CTL:
|
||||
case MSM89XX_CDC_CORE_RX2_B1_CTL:
|
||||
case MSM89XX_CDC_CORE_RX3_B1_CTL:
|
||||
case MSM89XX_CDC_CORE_RX1_B6_CTL:
|
||||
case MSM89XX_CDC_CORE_RX2_B6_CTL:
|
||||
case MSM89XX_CDC_CORE_RX3_B6_CTL:
|
||||
case MSM89XX_CDC_CORE_TX1_VOL_CTL_CFG:
|
||||
case MSM89XX_CDC_CORE_TX2_VOL_CTL_CFG:
|
||||
case MSM89XX_CDC_CORE_IIR1_COEF_B1_CTL:
|
||||
case MSM89XX_CDC_CORE_IIR2_COEF_B1_CTL:
|
||||
case MSM89XX_CDC_CORE_CLK_MCLK_CTL:
|
||||
case MSM89XX_CDC_CORE_CLK_PDM_CTL:
|
||||
return true;
|
||||
/* cache bypass for initial version */
|
||||
default:
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9383,12 +9383,6 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = {
|
|||
slimbus_8_rx_voice_mixer_controls,
|
||||
ARRAY_SIZE(slimbus_8_rx_voice_mixer_controls)),
|
||||
/* port mixer */
|
||||
SND_SOC_DAPM_MIXER("INT0_MI2S_RX Port Mixer",
|
||||
SND_SOC_NOPM, 0, 0, int0_mi2s_rx_port_mixer_controls,
|
||||
ARRAY_SIZE(int0_mi2s_rx_port_mixer_controls)),
|
||||
SND_SOC_DAPM_MIXER("INT4_MI2S_RX Port Mixer",
|
||||
SND_SOC_NOPM, 0, 0, int4_mi2s_rx_port_mixer_controls,
|
||||
ARRAY_SIZE(int4_mi2s_rx_port_mixer_controls)),
|
||||
SND_SOC_DAPM_MIXER("SLIMBUS_0_RX Port Mixer",
|
||||
SND_SOC_NOPM, 0, 0, sbus_0_rx_port_mixer_controls,
|
||||
ARRAY_SIZE(sbus_0_rx_port_mixer_controls)),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2017, 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
|
||||
|
@ -2937,6 +2937,20 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config,
|
|||
case AFE_PORT_ID_QUINARY_MI2S_RX:
|
||||
case AFE_PORT_ID_QUINARY_MI2S_TX:
|
||||
case AFE_PORT_ID_SENARY_MI2S_TX:
|
||||
case AFE_PORT_ID_INT0_MI2S_RX:
|
||||
case AFE_PORT_ID_INT0_MI2S_TX:
|
||||
case AFE_PORT_ID_INT1_MI2S_RX:
|
||||
case AFE_PORT_ID_INT1_MI2S_TX:
|
||||
case AFE_PORT_ID_INT2_MI2S_RX:
|
||||
case AFE_PORT_ID_INT2_MI2S_TX:
|
||||
case AFE_PORT_ID_INT3_MI2S_RX:
|
||||
case AFE_PORT_ID_INT3_MI2S_TX:
|
||||
case AFE_PORT_ID_INT4_MI2S_RX:
|
||||
case AFE_PORT_ID_INT4_MI2S_TX:
|
||||
case AFE_PORT_ID_INT5_MI2S_RX:
|
||||
case AFE_PORT_ID_INT5_MI2S_TX:
|
||||
case AFE_PORT_ID_INT6_MI2S_RX:
|
||||
case AFE_PORT_ID_INT6_MI2S_TX:
|
||||
cfg_type = AFE_PARAM_ID_I2S_CONFIG;
|
||||
break;
|
||||
case HDMI_RX:
|
||||
|
@ -3316,6 +3330,34 @@ int afe_get_port_index(u16 port_id)
|
|||
return IDX_AFE_PORT_ID_QUATERNARY_TDM_RX_7;
|
||||
case AFE_PORT_ID_QUATERNARY_TDM_TX_7:
|
||||
return IDX_AFE_PORT_ID_QUATERNARY_TDM_TX_7;
|
||||
case AFE_PORT_ID_INT0_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT0_MI2S_RX;
|
||||
case AFE_PORT_ID_INT0_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT0_MI2S_TX;
|
||||
case AFE_PORT_ID_INT1_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT1_MI2S_RX;
|
||||
case AFE_PORT_ID_INT1_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT1_MI2S_TX;
|
||||
case AFE_PORT_ID_INT2_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT2_MI2S_RX;
|
||||
case AFE_PORT_ID_INT2_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT2_MI2S_TX;
|
||||
case AFE_PORT_ID_INT3_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT3_MI2S_RX;
|
||||
case AFE_PORT_ID_INT3_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT3_MI2S_TX;
|
||||
case AFE_PORT_ID_INT4_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT4_MI2S_RX;
|
||||
case AFE_PORT_ID_INT4_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT4_MI2S_TX;
|
||||
case AFE_PORT_ID_INT5_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT5_MI2S_RX;
|
||||
case AFE_PORT_ID_INT5_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT5_MI2S_TX;
|
||||
case AFE_PORT_ID_INT6_MI2S_RX:
|
||||
return IDX_AFE_PORT_ID_INT6_MI2S_RX;
|
||||
case AFE_PORT_ID_INT6_MI2S_TX:
|
||||
return IDX_AFE_PORT_ID_INT6_MI2S_TX;
|
||||
default:
|
||||
pr_err("%s: port 0x%x\n", __func__, port_id);
|
||||
return -EINVAL;
|
||||
|
|
|
@ -349,22 +349,6 @@ static struct afe_clk_set mi2s_clk[MI2S_MAX] = {
|
|||
};
|
||||
|
||||
static struct afe_clk_set mi2s_mclk[MI2S_MAX] = {
|
||||
{
|
||||
AFE_API_VERSION_I2S_CONFIG,
|
||||
Q6AFE_LPASS_CLK_ID_MCLK_1,
|
||||
Q6AFE_LPASS_OSR_CLK_9_P600_MHZ,
|
||||
Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO,
|
||||
Q6AFE_LPASS_CLK_ROOT_DEFAULT,
|
||||
0,
|
||||
},
|
||||
{
|
||||
AFE_API_VERSION_I2S_CONFIG,
|
||||
Q6AFE_LPASS_CLK_ID_MCLK_2,
|
||||
Q6AFE_LPASS_OSR_CLK_9_P600_MHZ,
|
||||
Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO,
|
||||
Q6AFE_LPASS_CLK_ROOT_DEFAULT,
|
||||
0,
|
||||
},
|
||||
{
|
||||
AFE_API_VERSION_I2S_CONFIG,
|
||||
Q6AFE_LPASS_CLK_ID_MCLK_3,
|
||||
|
@ -380,6 +364,22 @@ static struct afe_clk_set mi2s_mclk[MI2S_MAX] = {
|
|||
Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO,
|
||||
Q6AFE_LPASS_CLK_ROOT_DEFAULT,
|
||||
0,
|
||||
},
|
||||
{
|
||||
AFE_API_VERSION_I2S_CONFIG,
|
||||
Q6AFE_LPASS_CLK_ID_MCLK_1,
|
||||
Q6AFE_LPASS_OSR_CLK_9_P600_MHZ,
|
||||
Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO,
|
||||
Q6AFE_LPASS_CLK_ROOT_DEFAULT,
|
||||
0,
|
||||
},
|
||||
{
|
||||
AFE_API_VERSION_I2S_CONFIG,
|
||||
Q6AFE_LPASS_CLK_ID_MCLK_2,
|
||||
Q6AFE_LPASS_OSR_CLK_9_P600_MHZ,
|
||||
Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO,
|
||||
Q6AFE_LPASS_CLK_ROOT_DEFAULT,
|
||||
0,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -181,9 +181,7 @@ static int msm_int_mi2s_snd_startup(struct snd_pcm_substream *substream);
|
|||
static void msm_int_mi2s_snd_shutdown(struct snd_pcm_substream *substream);
|
||||
|
||||
static struct wcd_mbhc_config *mbhc_cfg_ptr;
|
||||
static struct snd_info_entry *msm_sdw_codec_root;
|
||||
static struct snd_info_entry *msm_dig_codec_root;
|
||||
static struct snd_info_entry *pmic_analog_codec_root;
|
||||
static struct snd_info_entry *codec_root;
|
||||
|
||||
static int int_mi2s_get_bit_format_val(int bit_format)
|
||||
{
|
||||
|
@ -916,15 +914,6 @@ static const struct snd_kcontrol_new msm_snd_controls[] = {
|
|||
SOC_ENUM_EXT("INT3_MI2S_TX SampleRate", int3_mi2s_tx_sample_rate,
|
||||
int_mi2s_sample_rate_get,
|
||||
int_mi2s_sample_rate_put),
|
||||
SOC_ENUM_EXT("INT0_MI2S_RX SampleRate", int0_mi2s_rx_sample_rate,
|
||||
int_mi2s_sample_rate_get,
|
||||
int_mi2s_sample_rate_put),
|
||||
SOC_ENUM_EXT("INT2_MI2S_TX SampleRate", int2_mi2s_tx_sample_rate,
|
||||
int_mi2s_sample_rate_get,
|
||||
int_mi2s_sample_rate_put),
|
||||
SOC_ENUM_EXT("INT3_MI2S_TX SampleRate", int3_mi2s_tx_sample_rate,
|
||||
int_mi2s_sample_rate_get,
|
||||
int_mi2s_sample_rate_put),
|
||||
SOC_ENUM_EXT("INT0_MI2S_RX Channels", int0_mi2s_rx_chs,
|
||||
int_mi2s_ch_get, int_mi2s_ch_put),
|
||||
SOC_ENUM_EXT("INT2_MI2S_TX Channels", int2_mi2s_tx_chs,
|
||||
|
@ -1295,7 +1284,6 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
|
||||
struct snd_soc_pcm_runtime *rtd_aux = rtd->card->rtd_aux;
|
||||
struct snd_card *card;
|
||||
struct snd_info_entry *entry;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
pr_debug("%s(),dev_name%s\n", __func__, dev_name(cpu_dai->dev));
|
||||
|
@ -1361,26 +1349,16 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||
}
|
||||
}
|
||||
card = rtd->card->snd_card;
|
||||
entry = snd_register_module_info(card->module, "codecs",
|
||||
card->proc_root);
|
||||
if (!entry) {
|
||||
if (!codec_root)
|
||||
codec_root = snd_register_module_info(card->module, "codecs",
|
||||
card->proc_root);
|
||||
if (!codec_root) {
|
||||
pr_debug("%s: Cannot create codecs module entry\n",
|
||||
__func__);
|
||||
msm_dig_codec_root = NULL;
|
||||
goto done;
|
||||
}
|
||||
msm_dig_codec_root = entry;
|
||||
msm_dig_codec_info_create_codec_entry(msm_dig_codec_root, dig_cdc);
|
||||
entry = snd_register_module_info(card->module, "codecs",
|
||||
card->proc_root);
|
||||
if (!entry) {
|
||||
pr_debug("%s: Cannot create codecs module entry\n",
|
||||
__func__);
|
||||
pmic_analog_codec_root = NULL;
|
||||
goto done;
|
||||
}
|
||||
pmic_analog_codec_root = entry;
|
||||
msm_anlg_codec_info_create_codec_entry(pmic_analog_codec_root, ana_cdc);
|
||||
msm_dig_codec_info_create_codec_entry(codec_root, dig_cdc);
|
||||
msm_anlg_codec_info_create_codec_entry(codec_root, ana_cdc);
|
||||
done:
|
||||
return 0;
|
||||
}
|
||||
|
@ -1391,7 +1369,6 @@ static int msm_sdw_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||
struct snd_soc_dapm_context *dapm =
|
||||
snd_soc_codec_get_dapm(codec);
|
||||
struct snd_card *card;
|
||||
struct snd_info_entry *entry;
|
||||
|
||||
snd_soc_add_codec_controls(codec, msm_sdw_controls,
|
||||
ARRAY_SIZE(msm_sdw_controls));
|
||||
|
@ -1406,16 +1383,15 @@ static int msm_sdw_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||
snd_soc_dapm_sync(dapm);
|
||||
msm_sdw_gpio_cb(msm_config_sdw_gpio, codec);
|
||||
card = rtd->card->snd_card;
|
||||
entry = snd_register_module_info(card->module, "codecs",
|
||||
card->proc_root);
|
||||
if (!entry) {
|
||||
if (!codec_root)
|
||||
codec_root = snd_register_module_info(card->module, "codecs",
|
||||
card->proc_root);
|
||||
if (!codec_root) {
|
||||
pr_debug("%s: Cannot create codecs module entry\n",
|
||||
__func__);
|
||||
msm_sdw_codec_root = NULL;
|
||||
goto done;
|
||||
}
|
||||
msm_sdw_codec_root = entry;
|
||||
msm_sdw_codec_info_create_codec_entry(msm_sdw_codec_root, codec);
|
||||
msm_sdw_codec_info_create_codec_entry(codec_root, codec);
|
||||
done:
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue