ASoC: add config check for QGKI
Add CONFIG_AUDIO_QGKI check for variables and functions in audio drivers, so they are used only during a QGKI build. Change-Id: Ia04232566367f196f298a49cf3962bb7927bec6a Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
This commit is contained in:

committed by
Sudheer Papothi

父節點
bde9a11153
當前提交
823f0f01fe
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
@@ -1024,8 +1024,10 @@ static irqreturn_t wcd_mbhc_adc_hs_rem_irq(int irq, void *data)
|
||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADSET);
|
||||
else if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADPHONE)
|
||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADPHONE);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
else if (mbhc->current_plug == MBHC_PLUG_TYPE_GND_MIC_SWAP)
|
||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_UNSUPPORTED);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
else if (mbhc->current_plug == MBHC_PLUG_TYPE_HIGH_HPH)
|
||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_LINEOUT);
|
||||
} else {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2015-2018, 2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
@@ -868,10 +868,12 @@ static irqreturn_t wcd_mbhc_hs_rem_irq(int irq, void *data)
|
||||
MBHC_PLUG_TYPE_HEADPHONE)
|
||||
wcd_mbhc_report_plug(
|
||||
mbhc, 0, SND_JACK_HEADPHONE);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
else if (mbhc->current_plug ==
|
||||
MBHC_PLUG_TYPE_GND_MIC_SWAP)
|
||||
wcd_mbhc_report_plug(
|
||||
mbhc, 0, SND_JACK_UNSUPPORTED);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
else if (mbhc->current_plug ==
|
||||
MBHC_PLUG_TYPE_HIGH_HPH)
|
||||
wcd_mbhc_report_plug(
|
||||
|
@@ -33,6 +33,7 @@ void wcd_mbhc_jack_report(struct wcd_mbhc *mbhc,
|
||||
}
|
||||
EXPORT_SYMBOL(wcd_mbhc_jack_report);
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static void __hphocp_off_report(struct wcd_mbhc *mbhc, u32 jack_status,
|
||||
int irq)
|
||||
{
|
||||
@@ -70,6 +71,7 @@ static void hphlocp_off_report(struct wcd_mbhc *mbhc, u32 jack_status)
|
||||
__hphocp_off_report(mbhc, SND_JACK_OC_HPHL,
|
||||
mbhc->intr_ids->hph_left_ocp);
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static void wcd_program_hs_vref(struct wcd_mbhc *mbhc)
|
||||
{
|
||||
@@ -311,8 +313,10 @@ out_micb_en:
|
||||
break;
|
||||
case WCD_EVENT_POST_HPHL_PA_OFF:
|
||||
clear_bit(WCD_MBHC_HPHL_PA_OFF_ACK, &mbhc->hph_pa_dac_state);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (mbhc->hph_status & SND_JACK_OC_HPHL)
|
||||
hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
clear_bit(WCD_MBHC_EVENT_PA_HPHL, &mbhc->event_state);
|
||||
/* check if micbias is enabled */
|
||||
if (micbias2)
|
||||
@@ -329,8 +333,10 @@ out_micb_en:
|
||||
break;
|
||||
case WCD_EVENT_POST_HPHR_PA_OFF:
|
||||
clear_bit(WCD_MBHC_HPHR_PA_OFF_ACK, &mbhc->hph_pa_dac_state);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (mbhc->hph_status & SND_JACK_OC_HPHR)
|
||||
hphrocp_off_report(mbhc, SND_JACK_OC_HPHR);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
clear_bit(WCD_MBHC_EVENT_PA_HPHR, &mbhc->event_state);
|
||||
/* check if micbias is enabled */
|
||||
if (micbias2)
|
||||
@@ -599,8 +605,10 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
||||
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
||||
mbhc->hph_status, WCD_MBHC_JACK_MASK);
|
||||
wcd_mbhc_set_and_turnoff_hph_padac(mbhc);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
hphrocp_off_report(mbhc, SND_JACK_OC_HPHR);
|
||||
hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_NONE;
|
||||
mbhc->force_linein = false;
|
||||
} else {
|
||||
@@ -651,10 +659,15 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
||||
WCD_MBHC_ELEC_HS_REM,
|
||||
true);
|
||||
}
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||
SND_JACK_LINEOUT |
|
||||
SND_JACK_ANC_HEADPHONE |
|
||||
SND_JACK_UNSUPPORTED);
|
||||
#else
|
||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||
SND_JACK_LINEOUT);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
}
|
||||
|
||||
if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET &&
|
||||
@@ -664,15 +677,19 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
||||
/* Report insertion */
|
||||
if (jack_type == SND_JACK_HEADPHONE)
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_HEADPHONE;
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
else if (jack_type == SND_JACK_UNSUPPORTED)
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_GND_MIC_SWAP;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
else if (jack_type == SND_JACK_HEADSET) {
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_HEADSET;
|
||||
mbhc->jiffies_atreport = jiffies;
|
||||
} else if (jack_type == SND_JACK_LINEOUT) {
|
||||
} else if (jack_type == SND_JACK_LINEOUT)
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
||||
} else if (jack_type == SND_JACK_ANC_HEADPHONE)
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
else if (jack_type == SND_JACK_ANC_HEADPHONE)
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_ANC_HEADPHONE;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
if (mbhc->mbhc_cb->hph_pa_on_status)
|
||||
is_pa_on = mbhc->mbhc_cb->hph_pa_on_status(component);
|
||||
@@ -698,9 +715,14 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
||||
mbhc->force_linein = true;
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
||||
if (mbhc->hph_status) {
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||
SND_JACK_LINEOUT |
|
||||
SND_JACK_UNSUPPORTED);
|
||||
#else
|
||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||
SND_JACK_LINEOUT);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
wcd_mbhc_jack_report(mbhc,
|
||||
&mbhc->headset_jack,
|
||||
mbhc->hph_status,
|
||||
@@ -720,9 +742,14 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
||||
jack_type = SND_JACK_LINEOUT;
|
||||
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
||||
if (mbhc->hph_status) {
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||
SND_JACK_LINEOUT |
|
||||
SND_JACK_UNSUPPORTED);
|
||||
#else
|
||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||
SND_JACK_LINEOUT);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
wcd_mbhc_jack_report(mbhc,
|
||||
&mbhc->headset_jack,
|
||||
mbhc->hph_status,
|
||||
@@ -814,15 +841,19 @@ void wcd_mbhc_find_plug_and_report(struct wcd_mbhc *mbhc,
|
||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADPHONE);
|
||||
if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET)
|
||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADSET);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
wcd_mbhc_report_plug(mbhc, 1, SND_JACK_UNSUPPORTED);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
} else if (plug_type == MBHC_PLUG_TYPE_HEADSET) {
|
||||
if (mbhc->mbhc_cfg->enable_anc_mic_detect &&
|
||||
mbhc->mbhc_fn->wcd_mbhc_detect_anc_plug_type)
|
||||
anc_mic_found =
|
||||
mbhc->mbhc_fn->wcd_mbhc_detect_anc_plug_type(mbhc);
|
||||
jack_type = SND_JACK_HEADSET;
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (anc_mic_found)
|
||||
jack_type = SND_JACK_ANC_HEADPHONE;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
/*
|
||||
* If Headphone was reported previously, this will
|
||||
@@ -983,9 +1014,11 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
|
||||
case MBHC_PLUG_TYPE_HEADPHONE:
|
||||
jack_type = SND_JACK_HEADPHONE;
|
||||
break;
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
case MBHC_PLUG_TYPE_GND_MIC_SWAP:
|
||||
jack_type = SND_JACK_UNSUPPORTED;
|
||||
break;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
case MBHC_PLUG_TYPE_HEADSET:
|
||||
/* make sure to turn off Rbias */
|
||||
if (mbhc->mbhc_cb->micb_internal)
|
||||
@@ -1001,13 +1034,19 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
|
||||
mbhc->is_extn_cable = false;
|
||||
jack_type = SND_JACK_LINEOUT;
|
||||
break;
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
case MBHC_PLUG_TYPE_ANC_HEADPHONE:
|
||||
jack_type = SND_JACK_ANC_HEADPHONE;
|
||||
break;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
default:
|
||||
pr_info("%s: Invalid current plug: %d\n",
|
||||
__func__, mbhc->current_plug);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
jack_type = SND_JACK_UNSUPPORTED;
|
||||
#else
|
||||
jack_type = SND_JACK_HEADPHONE;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
break;
|
||||
}
|
||||
wcd_mbhc_hs_elec_irq(mbhc, WCD_MBHC_ELEC_HS_REM, false);
|
||||
@@ -1295,7 +1334,9 @@ static irqreturn_t wcd_mbhc_hphl_ocp_irq(int irq, void *data)
|
||||
mbhc->mbhc_cb->irq_control(mbhc->component,
|
||||
mbhc->intr_ids->hph_left_ocp,
|
||||
false);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
mbhc->hph_status |= SND_JACK_OC_HPHL;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
||||
mbhc->hph_status,
|
||||
WCD_MBHC_JACK_MASK);
|
||||
@@ -1338,7 +1379,9 @@ static irqreturn_t wcd_mbhc_hphr_ocp_irq(int irq, void *data)
|
||||
mbhc->mbhc_cb->irq_control(mbhc->component,
|
||||
mbhc->intr_ids->hph_right_ocp,
|
||||
false);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
mbhc->hph_status |= SND_JACK_OC_HPHR;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
||||
mbhc->hph_status, WCD_MBHC_JACK_MASK);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
@@ -13755,8 +13755,10 @@ static int tasha_device_down(struct wcd9xxx *wcd9xxx)
|
||||
SWR_DEVICE_DOWN, NULL);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (!is_snd_event_fwk_enabled())
|
||||
snd_soc_card_change_online_state(component->card, 0);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
for (count = 0; count < NUM_CODEC_DAIS; count++)
|
||||
priv->dai[count].bus_down_in_recovery = true;
|
||||
|
||||
@@ -13791,8 +13793,10 @@ static int tasha_post_reset_cb(struct wcd9xxx *wcd9xxx)
|
||||
if (tasha->machine_codec_event_cb)
|
||||
tasha->machine_codec_event_cb(component,
|
||||
WCD9335_CODEC_EVENT_CODEC_UP);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (!is_snd_event_fwk_enabled())
|
||||
snd_soc_card_change_online_state(component->card, 1);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
/* Class-H Init*/
|
||||
wcd_clsh_init(&tasha->clsh_d);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
@@ -10334,8 +10334,10 @@ static int tavil_device_down(struct wcd9xxx *wcd9xxx)
|
||||
SWR_DEVICE_DOWN, NULL);
|
||||
}
|
||||
tavil_dsd_reset(priv->dsd_config);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (!is_snd_event_fwk_enabled())
|
||||
snd_soc_card_change_online_state(component->card, 0);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
wcd_dsp_ssr_event(priv->wdsp_cntl, WCD_CDC_DOWN_EVENT);
|
||||
wcd_resmgr_set_sido_input_src_locked(priv->resmgr,
|
||||
SIDO_SOURCE_INTERNAL);
|
||||
@@ -10373,8 +10375,10 @@ static int tavil_post_reset_cb(struct wcd9xxx *wcd9xxx)
|
||||
tavil_slimbus_slave_port_cfg.slave_dev_pgd_la =
|
||||
control->slim->laddr;
|
||||
tavil_init_slim_slave_cfg(component);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
if (!is_snd_event_fwk_enabled())
|
||||
snd_soc_card_change_online_state(component->card, 1);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
for (i = 0; i < TAVIL_MAX_MICBIAS; i++)
|
||||
tavil->micb_ref[i] = 0;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015, 2017-2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015, 2017-2018, 2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
@@ -52,6 +52,7 @@ struct firmware_cal *wcdcal_get_fw_cal(struct fw_info *fw_data,
|
||||
}
|
||||
EXPORT_SYMBOL(wcdcal_get_fw_cal);
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
||||
struct wcdcal_ioctl_buffer fw_user)
|
||||
{
|
||||
@@ -86,6 +87,7 @@ static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
||||
mutex_unlock(&fw_data->lock);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
struct wcdcal_ioctl_buffer32 {
|
||||
@@ -99,6 +101,7 @@ enum {
|
||||
_IOW('U', 0x1, struct wcdcal_ioctl_buffer32),
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int wcdcal_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
@@ -119,10 +122,12 @@ static int wcdcal_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
|
||||
fw_user_compat.cal_type = fw_user32.cal_type;
|
||||
return wcdcal_hwdep_ioctl_shared(hw, fw_user_compat);
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
#else
|
||||
#define wcdcal_hwdep_ioctl_compat NULL
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int wcdcal_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
@@ -213,4 +218,11 @@ end:
|
||||
}
|
||||
return -ENOMEM;
|
||||
}
|
||||
#else
|
||||
int wcd_cal_create_hwdep(void *data, int node,
|
||||
struct snd_soc_component *component)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
EXPORT_SYMBOL(wcd_cal_create_hwdep);
|
||||
|
@@ -871,14 +871,18 @@ static SOC_ENUM_SINGLE_EXT_DECL(afe_loopback_tx_chs, afe_loopback_tx_ch_text);
|
||||
|
||||
static bool is_initial_boot;
|
||||
static bool codec_reg_done;
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static struct snd_soc_aux_dev *msm_aux_dev;
|
||||
static struct snd_soc_codec_conf *msm_codec_conf;
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
static struct snd_soc_card snd_soc_card_lahaina_msm;
|
||||
static int dmic_0_1_gpio_cnt;
|
||||
static int dmic_2_3_gpio_cnt;
|
||||
static int dmic_4_5_gpio_cnt;
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static void *def_wcd_mbhc_cal(void);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
/*
|
||||
* Need to report LINEIN
|
||||
@@ -5429,6 +5433,7 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static void *def_wcd_mbhc_cal(void)
|
||||
{
|
||||
void *wcd_mbhc_cal;
|
||||
@@ -5457,6 +5462,7 @@ static void *def_wcd_mbhc_cal(void)
|
||||
|
||||
return wcd_mbhc_cal;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
/* Digital audio interface glue - connects codec <---> CPU */
|
||||
static struct snd_soc_dai_link msm_common_dai_links[] = {
|
||||
@@ -5465,7 +5471,9 @@ static struct snd_soc_dai_link msm_common_dai_links[] = {
|
||||
.name = MSM_DAILINK_NAME(Media1),
|
||||
.stream_name = "MultiMedia1",
|
||||
.dynamic = 1,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.dpcm_playback = 1,
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
@@ -5522,7 +5530,9 @@ static struct snd_soc_dai_link msm_common_dai_links[] = {
|
||||
.name = MSM_DAILINK_NAME(ULL),
|
||||
.stream_name = "MultiMedia3",
|
||||
.dynamic = 1,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
@@ -5552,7 +5562,9 @@ static struct snd_soc_dai_link msm_common_dai_links[] = {
|
||||
.name = MSM_DAILINK_NAME(Compress1),
|
||||
.stream_name = "Compress1",
|
||||
.dynamic = 1,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.async_ops = ASYNC_DPCM_SND_SOC_HW_PARAMS,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.dpcm_playback = 1,
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
@@ -5582,7 +5594,9 @@ static struct snd_soc_dai_link msm_common_dai_links[] = {
|
||||
.name = MSM_DAILINK_NAME(LowLatency),
|
||||
.stream_name = "MultiMedia5",
|
||||
.dynamic = 1,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.dpcm_playback = 1,
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
@@ -6058,7 +6072,9 @@ static struct snd_soc_dai_link msm_common_be_dai_links[] = {
|
||||
{
|
||||
.name = LPASS_BE_USB_AUDIO_RX,
|
||||
.stream_name = "USB Audio Playback",
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.dynamic_be = 1,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.no_pcm = 1,
|
||||
.dpcm_playback = 1,
|
||||
.id = MSM_BACKEND_DAI_USB_RX,
|
||||
@@ -6640,7 +6656,9 @@ static struct snd_soc_dai_link msm_rx_tx_cdc_dma_be_dai_links[] = {
|
||||
{
|
||||
.name = LPASS_BE_RX_CDC_DMA_RX_0,
|
||||
.stream_name = "RX CDC DMA0 Playback",
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.dynamic_be = 1,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.no_pcm = 1,
|
||||
.dpcm_playback = 1,
|
||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_0,
|
||||
@@ -6653,7 +6671,9 @@ static struct snd_soc_dai_link msm_rx_tx_cdc_dma_be_dai_links[] = {
|
||||
{
|
||||
.name = LPASS_BE_RX_CDC_DMA_RX_1,
|
||||
.stream_name = "RX CDC DMA1 Playback",
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.dynamic_be = 1,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.no_pcm = 1,
|
||||
.dpcm_playback = 1,
|
||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_1,
|
||||
@@ -6666,7 +6686,9 @@ static struct snd_soc_dai_link msm_rx_tx_cdc_dma_be_dai_links[] = {
|
||||
{
|
||||
.name = LPASS_BE_RX_CDC_DMA_RX_2,
|
||||
.stream_name = "RX CDC DMA2 Playback",
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.dynamic_be = 1,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.no_pcm = 1,
|
||||
.dpcm_playback = 1,
|
||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_2,
|
||||
@@ -6679,7 +6701,9 @@ static struct snd_soc_dai_link msm_rx_tx_cdc_dma_be_dai_links[] = {
|
||||
{
|
||||
.name = LPASS_BE_RX_CDC_DMA_RX_3,
|
||||
.stream_name = "RX CDC DMA3 Playback",
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.dynamic_be = 1,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.no_pcm = 1,
|
||||
.dpcm_playback = 1,
|
||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_3,
|
||||
@@ -6907,7 +6931,9 @@ static struct snd_soc_dai_link msm_stub_fe_dai_links[] = {
|
||||
.name = "MSMSTUB Media1",
|
||||
.stream_name = "MultiMedia1",
|
||||
.dynamic = 1,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.dpcm_playback = 1,
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
@@ -7124,6 +7150,7 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
|
||||
return card;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_wsa881x_init(struct snd_soc_component *component)
|
||||
{
|
||||
u8 spkleft_ports[WSA881X_MAX_SWR_PORTS] = {0, 1, 2, 3};
|
||||
@@ -7559,6 +7586,14 @@ aux_dev_register:
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
static int msm_init_aux_dev(struct platform_device *pdev,
|
||||
struct snd_soc_card *card)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static void msm_i2s_auxpcm_init(struct platform_device *pdev)
|
||||
{
|
||||
@@ -7613,7 +7648,9 @@ static int lahaina_ssr_enable(struct device *dev, void *data)
|
||||
dev_dbg(dev, "%s: TODO \n", __func__);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
snd_soc_card_change_online_state(card, 1);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
dev_dbg(dev, "%s: setting snd_card to ONLINE\n", __func__);
|
||||
|
||||
err:
|
||||
@@ -7631,7 +7668,9 @@ static void lahaina_ssr_disable(struct device *dev, void *data)
|
||||
}
|
||||
|
||||
dev_dbg(dev, "%s: setting snd_card to OFFLINE\n", __func__);
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
snd_soc_card_change_online_state(card, 0);
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
if (!strcmp(card->name, "lahaina-stub-snd-card")) {
|
||||
/* TODO */
|
||||
|
@@ -3313,6 +3313,7 @@ static int msm_compr_get_metadata(struct snd_compr_stream *cstream,
|
||||
}
|
||||
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_compr_set_next_track_param(struct snd_compr_stream *cstream,
|
||||
union snd_codec_options *codec_options)
|
||||
{
|
||||
@@ -3362,6 +3363,7 @@ static int msm_compr_set_next_track_param(struct snd_compr_stream *cstream,
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static int msm_compr_volume_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
@@ -5492,7 +5494,9 @@ static struct snd_compr_ops msm_compr_ops = {
|
||||
.set_params = msm_compr_set_params,
|
||||
.set_metadata = msm_compr_set_metadata,
|
||||
.get_metadata = msm_compr_get_metadata,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.set_next_track_param = msm_compr_set_next_track_param,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.ack = msm_compr_ack,
|
||||
.copy = msm_compr_copy,
|
||||
.get_caps = msm_compr_get_caps,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
@@ -2422,6 +2422,7 @@ enum {
|
||||
_IOW('U', 0x0B, struct snd_lsm_module_params_32),
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_cpe_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
||||
unsigned int cmd, void *arg)
|
||||
{
|
||||
@@ -2848,7 +2849,13 @@ done:
|
||||
"lsm_api_lock");
|
||||
return err;
|
||||
}
|
||||
|
||||
#else
|
||||
static int msm_cpe_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
||||
unsigned int cmd, void *arg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
#else
|
||||
#define msm_cpe_lsm_ioctl_compat NULL
|
||||
#endif
|
||||
@@ -3286,7 +3293,9 @@ static const struct snd_pcm_ops msm_cpe_lsm_ops = {
|
||||
.pointer = msm_cpe_lsm_pointer,
|
||||
.copy_user = msm_cpe_lsm_copy,
|
||||
.hw_params = msm_cpe_lsm_hwparams,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.compat_ioctl = msm_cpe_lsm_ioctl_compat,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
};
|
||||
|
||||
static struct snd_soc_component_driver msm_soc_cpe_component = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
@@ -1682,6 +1682,7 @@ enum {
|
||||
_IOW('U', 0x13, struct snd_lsm_module_params_32),
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
||||
unsigned int cmd, void __user *arg)
|
||||
{
|
||||
@@ -2081,6 +2082,7 @@ done:
|
||||
mutex_unlock(&prtd->lsm_api_lock);
|
||||
return err;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
#else
|
||||
#define msm_lsm_ioctl_compat NULL
|
||||
#endif
|
||||
@@ -2913,6 +2915,7 @@ static int msm_lsm_pcm_copy(struct snd_pcm_substream *substream, int ch,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_lsm_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
@@ -2994,7 +2997,14 @@ static int msm_lsm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
kctl->get = msm_lsm_app_type_cfg_ctl_get;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_lsm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_lsm_afe_data_ctl_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
@@ -3058,6 +3068,12 @@ static int msm_lsm_add_afe_data_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_lsm_add_afe_data_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static int msm_lsm_add_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
@@ -3079,7 +3095,9 @@ static const struct snd_pcm_ops msm_lsm_ops = {
|
||||
.close = msm_lsm_close,
|
||||
.ioctl = msm_lsm_ioctl,
|
||||
.prepare = msm_lsm_prepare,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.compat_ioctl = msm_lsm_ioctl_compat,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.hw_params = msm_lsm_hw_params,
|
||||
.copy_user = msm_lsm_pcm_copy,
|
||||
.pointer = msm_lsm_pcm_pointer,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
@@ -526,6 +526,7 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
||||
.trigger = msm_pcm_trigger,
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
@@ -754,6 +755,16 @@ static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_pcm_add_volume_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static struct msm_pcm_channel_mixer *msm_pcm_get_chmixer(
|
||||
struct msm_pcm_pdata *pdata,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
@@ -444,7 +444,7 @@ static int msm_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_mmap_fd(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_mmap_fd *mmap_fd)
|
||||
{
|
||||
@@ -500,6 +500,7 @@ static int msm_pcm_mmap_fd(struct snd_pcm_substream *substream,
|
||||
buf_fd_fail:
|
||||
return rc;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static int msm_pcm_ioctl(struct snd_pcm_substream *substream,
|
||||
unsigned int cmd, void *arg)
|
||||
@@ -525,7 +526,7 @@ static int msm_pcm_ioctl(struct snd_pcm_substream *substream,
|
||||
return snd_pcm_lib_ioctl(substream, cmd, arg);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
#if IS_ENABLED(CONFIG_COMPAT) && IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_compat_ioctl(struct snd_pcm_substream *substream,
|
||||
unsigned int cmd, void *arg)
|
||||
{
|
||||
@@ -699,6 +700,7 @@ static int msm_pcm_close(struct snd_pcm_substream *substream)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_set_volume(struct msm_audio *prtd, uint32_t volume)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -826,6 +828,13 @@ static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd,
|
||||
kctl->tlv.p = msm_pcm_vol_gain;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd,
|
||||
int stream)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static int msm_pcm_channel_map_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
@@ -1051,6 +1060,7 @@ static int msm_pcm_add_fe_topology_control(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
@@ -1208,7 +1218,14 @@ static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
@@ -1304,6 +1321,12 @@ static int msm_pcm_add_hwdep_dev(struct snd_soc_pcm_runtime *runtime)
|
||||
hwdep->ops.ioctl_compat = msm_pcm_hwdep_compat_ioctl;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_pcm_add_hwdep_dev(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_GKI */
|
||||
|
||||
static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
@@ -1356,7 +1379,7 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
||||
.copy_user = msm_pcm_copy,
|
||||
.hw_params = msm_pcm_hw_params,
|
||||
.ioctl = msm_pcm_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
#if IS_ENABLED(CONFIG_COMPAT) && IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.compat_ioctl = msm_pcm_compat_ioctl,
|
||||
#endif
|
||||
.trigger = msm_pcm_trigger,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1268,11 +1268,13 @@ done:
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_compat_ioctl(struct snd_pcm_substream *substream,
|
||||
unsigned int cmd, void __user *arg)
|
||||
{
|
||||
return msm_pcm_ioctl(substream, cmd, arg);
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
#else
|
||||
#define msm_pcm_compat_ioctl NULL
|
||||
#endif
|
||||
@@ -1283,7 +1285,9 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
||||
.hw_params = msm_pcm_hw_params,
|
||||
.close = msm_pcm_close,
|
||||
.ioctl = msm_pcm_ioctl,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.compat_ioctl = msm_pcm_compat_ioctl,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
.prepare = msm_pcm_prepare,
|
||||
.trigger = msm_pcm_trigger,
|
||||
.pointer = msm_pcm_pointer,
|
||||
@@ -1493,6 +1497,7 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_set_volume(struct msm_audio *prtd, uint32_t volume)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -1622,6 +1627,13 @@ static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd,
|
||||
kctl->tlv.p = msm_pcm_vol_gain;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_pcm_add_volume_control(struct snd_soc_pcm_runtime *rtd,
|
||||
int stream)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static int msm_pcm_compress_ctl_info(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
@@ -1912,6 +1924,7 @@ static int msm_pcm_add_chmap_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
@@ -2069,6 +2082,12 @@ static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int msm_pcm_add_app_type_controls(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static struct msm_pcm_channel_mixer *msm_pcm_get_chmixer(
|
||||
struct msm_plat_data *pdata,
|
||||
@@ -2795,6 +2814,7 @@ static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static snd_pcm_sframes_t msm_pcm_delay_blk(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
@@ -2821,12 +2841,15 @@ static snd_pcm_sframes_t msm_pcm_delay_blk(struct snd_pcm_substream *substream,
|
||||
|
||||
return frames;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
static struct snd_soc_component_driver msm_soc_component = {
|
||||
.name = DRV_NAME,
|
||||
.ops = &msm_pcm_ops,
|
||||
.pcm_new = msm_asoc_pcm_new,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.delay_blk = msm_pcm_delay_blk,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
};
|
||||
|
||||
static int msm_pcm_probe(struct platform_device *pdev)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2014, 2016-2017 The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2014, 2016-2017, 2020 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "msm-pcm-routing-devdep.h"
|
||||
#include "msm-ds2-dap-config.h"
|
||||
|
||||
#ifdef CONFIG_SND_HWDEP
|
||||
#if IS_ENABLED(CONFIG_SND_HWDEP) && IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
static int msm_pcm_routing_hwdep_open(struct snd_hwdep *hw, struct file *file)
|
||||
{
|
||||
pr_debug("%s\n", __func__);
|
||||
@@ -125,7 +125,7 @@ int msm_pcm_routing_hwdep_new(struct snd_soc_pcm_runtime *runtime,
|
||||
hwdep->ops.release = msm_pcm_routing_hwdep_release;
|
||||
#ifdef CONFIG_COMPAT
|
||||
hwdep->ops.ioctl_compat = msm_pcm_routing_hwdep_compat_ioctl;
|
||||
#endif
|
||||
#endif /* CONFIG_COMPAT */
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_AUDIO_QGKI && CONFIG_SND_HWDEP */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2014-2015, 2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2015, 2017, 2020 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _MSM_PCM_ROUTING_DEVDEP_H_
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <sound/soc.h>
|
||||
#include "msm-pcm-routing-v2.h"
|
||||
|
||||
#ifdef CONFIG_SND_HWDEP
|
||||
#if IS_ENABLED(CONFIG_SND_HWDEP) && IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
int msm_pcm_routing_hwdep_new(struct snd_soc_pcm_runtime *runtime,
|
||||
struct msm_pcm_routing_bdai_data *msm_bedais);
|
||||
void msm_pcm_routing_hwdep_free(struct snd_pcm *pcm);
|
||||
@@ -19,9 +19,9 @@ static inline int msm_pcm_routing_hwdep_new(struct snd_soc_pcm_runtime *runtime,
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void msm_pcm_routing_hwdep_free(struct snd_pcm *pcm)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
@@ -742,7 +742,9 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
||||
.prepare = msm_pcm_prepare,
|
||||
.trigger = msm_pcm_trigger,
|
||||
.ioctl = msm_pcm_ioctl,
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
.compat_ioctl = msm_pcm_ioctl,
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2014, 2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014, 2018, 2020 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#ifndef __Q6AFECAL_HWDEP_H__
|
||||
#define __Q6AFECAL_HWDEP_H__
|
||||
@@ -26,7 +26,14 @@ struct firmware_cal {
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_AFE_HWDEP)
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
int q6afe_cal_create_hwdep(void *fw, int node, void *card);
|
||||
#else
|
||||
int q6afe_cal_create_hwdep(void *fw, int node, void *card)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
struct firmware_cal *q6afecal_get_fw_cal(struct afe_fw_info *fw_data,
|
||||
enum q6afe_cal_type type);
|
||||
#else /* CONFIG_AFE_HWDEP */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#ifndef __WCD_MBHC_V2_H__
|
||||
#define __WCD_MBHC_V2_H__
|
||||
@@ -121,10 +121,15 @@ do { \
|
||||
(cfg_ptr->_n_rload * \
|
||||
(sizeof(cfg_ptr->_rload[0]) + sizeof(cfg_ptr->_alpha[0]))))
|
||||
|
||||
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||
#define WCD_MBHC_JACK_MASK (SND_JACK_HEADSET | SND_JACK_OC_HPHL | \
|
||||
SND_JACK_OC_HPHR | SND_JACK_LINEOUT | \
|
||||
SND_JACK_MECHANICAL | SND_JACK_MICROPHONE2 | \
|
||||
SND_JACK_UNSUPPORTED)
|
||||
#else
|
||||
#define WCD_MBHC_JACK_MASK (SND_JACK_HEADSET | SND_JACK_LINEOUT | \
|
||||
SND_JACK_MECHANICAL)
|
||||
#endif /* CONFIG_AUDIO_QGKI */
|
||||
|
||||
#define WCD_MBHC_JACK_BUTTON_MASK (SND_JACK_BTN_0 | SND_JACK_BTN_1 | \
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3 | \
|
||||
|
Reference in New Issue
Block a user