asoc: Add wcd937x support for Cliffs
Add wcd937x support for Cliffs. Change-Id: I21ca52133b40b621a36a82f0caa2366a1461d255 Signed-off-by: Faiz Nabi Kuchay <quic_fkuchay@quicinc.com>
This commit is contained in:
@@ -48,6 +48,10 @@ ifeq ($(KERNEL_BUILD), 0)
|
||||
include $(AUDIO_ROOT)/config/holiauto.conf
|
||||
INCS += -include $(AUDIO_ROOT)/config/holiautoconf.h
|
||||
endif
|
||||
ifeq ($(CONFIG_ARCH_CLIFFS), y)
|
||||
include $(AUDIO_ROOT)/config/pineappleauto.conf
|
||||
INCS += -include $(AUDIO_ROOT)/config/pineappleautoconf.h
|
||||
endif
|
||||
endif
|
||||
|
||||
# As per target team, build is done as follows:
|
||||
|
@@ -2048,6 +2048,29 @@ static int wcd937x_ear_pa_gain_put(struct snd_kcontrol *kcontrol,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* wcd937x_codec_get_dev_num - returns swr device number
|
||||
* @component: Codec instance
|
||||
*
|
||||
* Return: swr device number on success or negative error
|
||||
* code on failure.
|
||||
*/
|
||||
int wcd937x_codec_get_dev_num(struct snd_soc_component *component)
|
||||
{
|
||||
struct wcd937x_priv *wcd937x;
|
||||
|
||||
if (!component)
|
||||
return -EINVAL;
|
||||
|
||||
wcd937x = snd_soc_component_get_drvdata(component);
|
||||
if (!wcd937x || !wcd937x->rx_swr_dev) {
|
||||
pr_err("%s: wcd937x component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return wcd937x->rx_swr_dev->dev_num;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wcd937x_codec_get_dev_num);
|
||||
|
||||
static int wcd937x_get_compander(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
@@ -2794,6 +2817,30 @@ static struct snd_info_entry_ops wcd937x_variant_ops = {
|
||||
.read = wcd937x_variant_read,
|
||||
};
|
||||
|
||||
/*
|
||||
* wcd937x_get_codec_variant
|
||||
* @component: component instance
|
||||
*
|
||||
* Return: codec variant or -EINVAL in error.
|
||||
*/
|
||||
int wcd937x_get_codec_variant(struct snd_soc_component *component)
|
||||
{
|
||||
struct wcd937x_priv *priv = NULL;
|
||||
|
||||
if (!component)
|
||||
return -EINVAL;
|
||||
|
||||
priv = snd_soc_component_get_drvdata(component);
|
||||
if (!priv) {
|
||||
dev_err(component->dev,
|
||||
"%s:wcd937x not probed\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return priv->variant;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wcd937x_get_codec_variant);
|
||||
|
||||
/*
|
||||
* wcd937x_info_create_codec_entry - creates wcd937x module
|
||||
* @codec_root: The parent directory
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (c) 2018, 2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _WCD937X_H
|
||||
@@ -52,6 +52,10 @@ static int wcd937x_swr_master_ch_map[] = {
|
||||
extern int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||
struct snd_soc_component *component);
|
||||
|
||||
extern int wcd937x_get_codec_variant(struct snd_soc_component *component);
|
||||
|
||||
int wcd937x_codec_get_dev_num(struct snd_soc_component *component);
|
||||
|
||||
static inline int wcd937x_slave_get_master_ch_val(int ch)
|
||||
{
|
||||
int i;
|
||||
@@ -95,6 +99,14 @@ static inline int wcd937x_slave_get_slave_ch_val(int ch)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int wcd937x_get_codec_variant(struct snd_soc_component *component)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int wcd937x_codec_get_dev_num(struct snd_soc_component *component)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_SND_SOC_WCD937X */
|
||||
|
||||
#endif
|
||||
|
@@ -144,30 +144,35 @@ SND_SOC_DAILINK_DEFS(wsa_wsa2_dma_tx1,
|
||||
SND_SOC_DAILINK_DEFS(rx_dma_rx0,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx1"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(rx_dma_rx1,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx2"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(rx_dma_rx2,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx3"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(rx_dma_rx3,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx4"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(rx_dma_rx5,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx5"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
@@ -180,12 +185,14 @@ SND_SOC_DAILINK_DEFS(rx_dma_rx6,
|
||||
SND_SOC_DAILINK_DEFS(tx_dma_tx3,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "tx_macro_tx1"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(tx_dma_tx4,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "tx_macro_tx2"),
|
||||
COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
|
||||
COMP_CODEC("wcd939x_codec", "wcd939x_cdc"),
|
||||
COMP_CODEC("swr-dmic.01", "swr_dmic_tx0"),
|
||||
COMP_CODEC("swr-dmic.02", "swr_dmic_tx1"),
|
||||
|
Reference in New Issue
Block a user