Merge "asoc: add wcd937x codec support in machine driver"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
47d276273d
85
asoc/kona.c
85
asoc/kona.c
@@ -33,6 +33,8 @@
|
|||||||
#include "codecs/wsa881x.h"
|
#include "codecs/wsa881x.h"
|
||||||
#include "codecs/wsa883x/wsa883x.h"
|
#include "codecs/wsa883x/wsa883x.h"
|
||||||
#include "codecs/wcd938x/wcd938x.h"
|
#include "codecs/wcd938x/wcd938x.h"
|
||||||
|
#include "codecs/wcd937x/wcd937x-mbhc.h"
|
||||||
|
#include "codecs/wcd937x/wcd937x.h"
|
||||||
#include "codecs/bolero/bolero-cdc.h"
|
#include "codecs/bolero/bolero-cdc.h"
|
||||||
#include <dt-bindings/sound/audio-codec-port-types.h>
|
#include <dt-bindings/sound/audio-codec-port-types.h>
|
||||||
#include "codecs/bolero/wsa-macro.h"
|
#include "codecs/bolero/wsa-macro.h"
|
||||||
@@ -861,6 +863,23 @@ static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc85_dma_rx_3_sample_rate,
|
|||||||
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc85_dma_rx_5_sample_rate,
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc85_dma_rx_5_sample_rate,
|
||||||
cdc_dma_sample_rate_text);
|
cdc_dma_sample_rate_text);
|
||||||
|
|
||||||
|
/* WCD937x */
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_0_format, bit_format_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_1_format, bit_format_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_2_format, bit_format_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_3_format, bit_format_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_5_format, bit_format_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_0_sample_rate,
|
||||||
|
cdc_dma_sample_rate_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_1_sample_rate,
|
||||||
|
cdc_dma_sample_rate_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_2_sample_rate,
|
||||||
|
cdc_dma_sample_rate_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_3_sample_rate,
|
||||||
|
cdc_dma_sample_rate_text);
|
||||||
|
static SOC_ENUM_SINGLE_EXT_DECL(rx_cdc_dma_rx_5_sample_rate,
|
||||||
|
cdc_dma_sample_rate_text);
|
||||||
|
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_chs, ch_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_chs, ch_text);
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_format, ext_disp_bit_format_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_format, ext_disp_bit_format_text);
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_sample_rate,
|
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_sample_rate,
|
||||||
@@ -3686,6 +3705,39 @@ static const struct snd_kcontrol_new msm_int_wcd9385_snd_controls[] = {
|
|||||||
cdc_dma_rx_sample_rate_put),
|
cdc_dma_rx_sample_rate_put),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct snd_kcontrol_new msm_int_wcd937x_snd_controls[] = {
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_0 Format", rx_cdc_dma_rx_0_format,
|
||||||
|
cdc_dma_rx_format_get, cdc_dma_rx_format_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_1 Format", rx_cdc_dma_rx_1_format,
|
||||||
|
cdc_dma_rx_format_get, cdc_dma_rx_format_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_2 Format", rx_cdc_dma_rx_2_format,
|
||||||
|
cdc_dma_rx_format_get, cdc_dma_rx_format_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_3 Format", rx_cdc_dma_rx_3_format,
|
||||||
|
cdc_dma_rx_format_get, cdc_dma_rx_format_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_5 Format", rx_cdc_dma_rx_5_format,
|
||||||
|
cdc_dma_rx_format_get, cdc_dma_rx_format_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_0 SampleRate",
|
||||||
|
rx_cdc_dma_rx_0_sample_rate,
|
||||||
|
cdc_dma_rx_sample_rate_get,
|
||||||
|
cdc_dma_rx_sample_rate_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_1 SampleRate",
|
||||||
|
rx_cdc_dma_rx_1_sample_rate,
|
||||||
|
cdc_dma_rx_sample_rate_get,
|
||||||
|
cdc_dma_rx_sample_rate_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_2 SampleRate",
|
||||||
|
rx_cdc_dma_rx_2_sample_rate,
|
||||||
|
cdc_dma_rx_sample_rate_get,
|
||||||
|
cdc_dma_rx_sample_rate_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_3 SampleRate",
|
||||||
|
rx_cdc_dma_rx_3_sample_rate,
|
||||||
|
cdc_dma_rx_sample_rate_get,
|
||||||
|
cdc_dma_rx_sample_rate_put),
|
||||||
|
SOC_ENUM_EXT("RX_CDC_DMA_RX_5 SampleRate",
|
||||||
|
rx_cdc_dma_rx_5_sample_rate,
|
||||||
|
cdc_dma_rx_sample_rate_get,
|
||||||
|
cdc_dma_rx_sample_rate_put),
|
||||||
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new msm_common_snd_controls[] = {
|
static const struct snd_kcontrol_new msm_common_snd_controls[] = {
|
||||||
SOC_ENUM_EXT("USB_AUDIO_RX SampleRate", usb_rx_sample_rate,
|
SOC_ENUM_EXT("USB_AUDIO_RX SampleRate", usb_rx_sample_rate,
|
||||||
usb_audio_rx_sample_rate_get,
|
usb_audio_rx_sample_rate_get,
|
||||||
@@ -7320,18 +7372,24 @@ static int msm_aux_codec_init(struct snd_soc_component *component)
|
|||||||
}
|
}
|
||||||
pdata->codec_root = entry;
|
pdata->codec_root = entry;
|
||||||
}
|
}
|
||||||
wcd938x_info_create_codec_entry(pdata->codec_root, component);
|
if (!strncmp(component->driver->name, "wcd937x", 7)) {
|
||||||
|
wcd937x_info_create_codec_entry(pdata->codec_root, component);
|
||||||
codec_variant = wcd938x_get_codec_variant(component);
|
|
||||||
dev_dbg(component->dev, "%s: variant %d\n", __func__, codec_variant);
|
|
||||||
if (codec_variant == WCD9380)
|
|
||||||
ret = snd_soc_add_component_controls(component,
|
ret = snd_soc_add_component_controls(component,
|
||||||
msm_int_wcd9380_snd_controls,
|
msm_int_wcd937x_snd_controls,
|
||||||
ARRAY_SIZE(msm_int_wcd9380_snd_controls));
|
ARRAY_SIZE(msm_int_wcd937x_snd_controls));
|
||||||
else if (codec_variant == WCD9385)
|
} else {
|
||||||
ret = snd_soc_add_component_controls(component,
|
wcd938x_info_create_codec_entry(pdata->codec_root, component);
|
||||||
msm_int_wcd9385_snd_controls,
|
codec_variant = wcd938x_get_codec_variant(component);
|
||||||
ARRAY_SIZE(msm_int_wcd9385_snd_controls));
|
dev_dbg(component->dev, "%s: variant %d\n", __func__, codec_variant);
|
||||||
|
if (codec_variant == WCD9380)
|
||||||
|
ret = snd_soc_add_component_controls(component,
|
||||||
|
msm_int_wcd9380_snd_controls,
|
||||||
|
ARRAY_SIZE(msm_int_wcd9380_snd_controls));
|
||||||
|
else if (codec_variant == WCD9385)
|
||||||
|
ret = snd_soc_add_component_controls(component,
|
||||||
|
msm_int_wcd9385_snd_controls,
|
||||||
|
ARRAY_SIZE(msm_int_wcd9385_snd_controls));
|
||||||
|
}
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(component->dev, "%s: add codec specific snd controls failed: %d\n",
|
dev_err(component->dev, "%s: add codec specific snd controls failed: %d\n",
|
||||||
@@ -7344,7 +7402,10 @@ mbhc_cfg_cal:
|
|||||||
if (!mbhc_calibration)
|
if (!mbhc_calibration)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
wcd_mbhc_cfg.calibration = mbhc_calibration;
|
wcd_mbhc_cfg.calibration = mbhc_calibration;
|
||||||
ret = wcd938x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
|
if (!strncmp(component->driver->name, "wcd937x", 7))
|
||||||
|
ret = wcd937x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
|
||||||
|
else
|
||||||
|
ret = wcd938x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(component->dev, "%s: mbhc hs detect failed, err:%d\n",
|
dev_err(component->dev, "%s: mbhc hs detect failed, err:%d\n",
|
||||||
__func__, ret);
|
__func__, ret);
|
||||||
|
Reference in New Issue
Block a user