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

parent
bde9a11153
commit
823f0f01fe
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/module.h>
|
||||||
#include <linux/init.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);
|
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADSET);
|
||||||
else if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADPHONE)
|
else if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADPHONE)
|
||||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_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)
|
else if (mbhc->current_plug == MBHC_PLUG_TYPE_GND_MIC_SWAP)
|
||||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_UNSUPPORTED);
|
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_UNSUPPORTED);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
else if (mbhc->current_plug == MBHC_PLUG_TYPE_HIGH_HPH)
|
else if (mbhc->current_plug == MBHC_PLUG_TYPE_HIGH_HPH)
|
||||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_LINEOUT);
|
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_LINEOUT);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/module.h>
|
||||||
#include <linux/init.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)
|
MBHC_PLUG_TYPE_HEADPHONE)
|
||||||
wcd_mbhc_report_plug(
|
wcd_mbhc_report_plug(
|
||||||
mbhc, 0, SND_JACK_HEADPHONE);
|
mbhc, 0, SND_JACK_HEADPHONE);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
else if (mbhc->current_plug ==
|
else if (mbhc->current_plug ==
|
||||||
MBHC_PLUG_TYPE_GND_MIC_SWAP)
|
MBHC_PLUG_TYPE_GND_MIC_SWAP)
|
||||||
wcd_mbhc_report_plug(
|
wcd_mbhc_report_plug(
|
||||||
mbhc, 0, SND_JACK_UNSUPPORTED);
|
mbhc, 0, SND_JACK_UNSUPPORTED);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
else if (mbhc->current_plug ==
|
else if (mbhc->current_plug ==
|
||||||
MBHC_PLUG_TYPE_HIGH_HPH)
|
MBHC_PLUG_TYPE_HIGH_HPH)
|
||||||
wcd_mbhc_report_plug(
|
wcd_mbhc_report_plug(
|
||||||
|
@@ -33,6 +33,7 @@ void wcd_mbhc_jack_report(struct wcd_mbhc *mbhc,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(wcd_mbhc_jack_report);
|
EXPORT_SYMBOL(wcd_mbhc_jack_report);
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static void __hphocp_off_report(struct wcd_mbhc *mbhc, u32 jack_status,
|
static void __hphocp_off_report(struct wcd_mbhc *mbhc, u32 jack_status,
|
||||||
int irq)
|
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,
|
__hphocp_off_report(mbhc, SND_JACK_OC_HPHL,
|
||||||
mbhc->intr_ids->hph_left_ocp);
|
mbhc->intr_ids->hph_left_ocp);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
static void wcd_program_hs_vref(struct wcd_mbhc *mbhc)
|
static void wcd_program_hs_vref(struct wcd_mbhc *mbhc)
|
||||||
{
|
{
|
||||||
@@ -311,8 +313,10 @@ out_micb_en:
|
|||||||
break;
|
break;
|
||||||
case WCD_EVENT_POST_HPHL_PA_OFF:
|
case WCD_EVENT_POST_HPHL_PA_OFF:
|
||||||
clear_bit(WCD_MBHC_HPHL_PA_OFF_ACK, &mbhc->hph_pa_dac_state);
|
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)
|
if (mbhc->hph_status & SND_JACK_OC_HPHL)
|
||||||
hphlocp_off_report(mbhc, 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);
|
clear_bit(WCD_MBHC_EVENT_PA_HPHL, &mbhc->event_state);
|
||||||
/* check if micbias is enabled */
|
/* check if micbias is enabled */
|
||||||
if (micbias2)
|
if (micbias2)
|
||||||
@@ -329,8 +333,10 @@ out_micb_en:
|
|||||||
break;
|
break;
|
||||||
case WCD_EVENT_POST_HPHR_PA_OFF:
|
case WCD_EVENT_POST_HPHR_PA_OFF:
|
||||||
clear_bit(WCD_MBHC_HPHR_PA_OFF_ACK, &mbhc->hph_pa_dac_state);
|
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)
|
if (mbhc->hph_status & SND_JACK_OC_HPHR)
|
||||||
hphrocp_off_report(mbhc, 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);
|
clear_bit(WCD_MBHC_EVENT_PA_HPHR, &mbhc->event_state);
|
||||||
/* check if micbias is enabled */
|
/* check if micbias is enabled */
|
||||||
if (micbias2)
|
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,
|
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
||||||
mbhc->hph_status, WCD_MBHC_JACK_MASK);
|
mbhc->hph_status, WCD_MBHC_JACK_MASK);
|
||||||
wcd_mbhc_set_and_turnoff_hph_padac(mbhc);
|
wcd_mbhc_set_and_turnoff_hph_padac(mbhc);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
hphrocp_off_report(mbhc, SND_JACK_OC_HPHR);
|
hphrocp_off_report(mbhc, SND_JACK_OC_HPHR);
|
||||||
hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
|
hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
mbhc->current_plug = MBHC_PLUG_TYPE_NONE;
|
mbhc->current_plug = MBHC_PLUG_TYPE_NONE;
|
||||||
mbhc->force_linein = false;
|
mbhc->force_linein = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -651,10 +659,15 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
|||||||
WCD_MBHC_ELEC_HS_REM,
|
WCD_MBHC_ELEC_HS_REM,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||||
SND_JACK_LINEOUT |
|
SND_JACK_LINEOUT |
|
||||||
SND_JACK_ANC_HEADPHONE |
|
SND_JACK_ANC_HEADPHONE |
|
||||||
SND_JACK_UNSUPPORTED);
|
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 &&
|
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 */
|
/* Report insertion */
|
||||||
if (jack_type == SND_JACK_HEADPHONE)
|
if (jack_type == SND_JACK_HEADPHONE)
|
||||||
mbhc->current_plug = MBHC_PLUG_TYPE_HEADPHONE;
|
mbhc->current_plug = MBHC_PLUG_TYPE_HEADPHONE;
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
else if (jack_type == SND_JACK_UNSUPPORTED)
|
else if (jack_type == SND_JACK_UNSUPPORTED)
|
||||||
mbhc->current_plug = MBHC_PLUG_TYPE_GND_MIC_SWAP;
|
mbhc->current_plug = MBHC_PLUG_TYPE_GND_MIC_SWAP;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
else if (jack_type == SND_JACK_HEADSET) {
|
else if (jack_type == SND_JACK_HEADSET) {
|
||||||
mbhc->current_plug = MBHC_PLUG_TYPE_HEADSET;
|
mbhc->current_plug = MBHC_PLUG_TYPE_HEADSET;
|
||||||
mbhc->jiffies_atreport = jiffies;
|
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;
|
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;
|
mbhc->current_plug = MBHC_PLUG_TYPE_ANC_HEADPHONE;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
if (mbhc->mbhc_cb->hph_pa_on_status)
|
if (mbhc->mbhc_cb->hph_pa_on_status)
|
||||||
is_pa_on = mbhc->mbhc_cb->hph_pa_on_status(component);
|
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->force_linein = true;
|
||||||
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
||||||
if (mbhc->hph_status) {
|
if (mbhc->hph_status) {
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||||
SND_JACK_LINEOUT |
|
SND_JACK_LINEOUT |
|
||||||
SND_JACK_UNSUPPORTED);
|
SND_JACK_UNSUPPORTED);
|
||||||
|
#else
|
||||||
|
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||||
|
SND_JACK_LINEOUT);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
wcd_mbhc_jack_report(mbhc,
|
wcd_mbhc_jack_report(mbhc,
|
||||||
&mbhc->headset_jack,
|
&mbhc->headset_jack,
|
||||||
mbhc->hph_status,
|
mbhc->hph_status,
|
||||||
@@ -720,9 +742,14 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
|
|||||||
jack_type = SND_JACK_LINEOUT;
|
jack_type = SND_JACK_LINEOUT;
|
||||||
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
|
||||||
if (mbhc->hph_status) {
|
if (mbhc->hph_status) {
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||||
SND_JACK_LINEOUT |
|
SND_JACK_LINEOUT |
|
||||||
SND_JACK_UNSUPPORTED);
|
SND_JACK_UNSUPPORTED);
|
||||||
|
#else
|
||||||
|
mbhc->hph_status &= ~(SND_JACK_HEADSET |
|
||||||
|
SND_JACK_LINEOUT);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
wcd_mbhc_jack_report(mbhc,
|
wcd_mbhc_jack_report(mbhc,
|
||||||
&mbhc->headset_jack,
|
&mbhc->headset_jack,
|
||||||
mbhc->hph_status,
|
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);
|
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADPHONE);
|
||||||
if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET)
|
if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET)
|
||||||
wcd_mbhc_report_plug(mbhc, 0, SND_JACK_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);
|
wcd_mbhc_report_plug(mbhc, 1, SND_JACK_UNSUPPORTED);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
} else if (plug_type == MBHC_PLUG_TYPE_HEADSET) {
|
} else if (plug_type == MBHC_PLUG_TYPE_HEADSET) {
|
||||||
if (mbhc->mbhc_cfg->enable_anc_mic_detect &&
|
if (mbhc->mbhc_cfg->enable_anc_mic_detect &&
|
||||||
mbhc->mbhc_fn->wcd_mbhc_detect_anc_plug_type)
|
mbhc->mbhc_fn->wcd_mbhc_detect_anc_plug_type)
|
||||||
anc_mic_found =
|
anc_mic_found =
|
||||||
mbhc->mbhc_fn->wcd_mbhc_detect_anc_plug_type(mbhc);
|
mbhc->mbhc_fn->wcd_mbhc_detect_anc_plug_type(mbhc);
|
||||||
jack_type = SND_JACK_HEADSET;
|
jack_type = SND_JACK_HEADSET;
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
if (anc_mic_found)
|
if (anc_mic_found)
|
||||||
jack_type = SND_JACK_ANC_HEADPHONE;
|
jack_type = SND_JACK_ANC_HEADPHONE;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If Headphone was reported previously, this will
|
* 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:
|
case MBHC_PLUG_TYPE_HEADPHONE:
|
||||||
jack_type = SND_JACK_HEADPHONE;
|
jack_type = SND_JACK_HEADPHONE;
|
||||||
break;
|
break;
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
case MBHC_PLUG_TYPE_GND_MIC_SWAP:
|
case MBHC_PLUG_TYPE_GND_MIC_SWAP:
|
||||||
jack_type = SND_JACK_UNSUPPORTED;
|
jack_type = SND_JACK_UNSUPPORTED;
|
||||||
break;
|
break;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
case MBHC_PLUG_TYPE_HEADSET:
|
case MBHC_PLUG_TYPE_HEADSET:
|
||||||
/* make sure to turn off Rbias */
|
/* make sure to turn off Rbias */
|
||||||
if (mbhc->mbhc_cb->micb_internal)
|
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;
|
mbhc->is_extn_cable = false;
|
||||||
jack_type = SND_JACK_LINEOUT;
|
jack_type = SND_JACK_LINEOUT;
|
||||||
break;
|
break;
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
case MBHC_PLUG_TYPE_ANC_HEADPHONE:
|
case MBHC_PLUG_TYPE_ANC_HEADPHONE:
|
||||||
jack_type = SND_JACK_ANC_HEADPHONE;
|
jack_type = SND_JACK_ANC_HEADPHONE;
|
||||||
break;
|
break;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
default:
|
default:
|
||||||
pr_info("%s: Invalid current plug: %d\n",
|
pr_info("%s: Invalid current plug: %d\n",
|
||||||
__func__, mbhc->current_plug);
|
__func__, mbhc->current_plug);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
jack_type = SND_JACK_UNSUPPORTED;
|
jack_type = SND_JACK_UNSUPPORTED;
|
||||||
|
#else
|
||||||
|
jack_type = SND_JACK_HEADPHONE;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
wcd_mbhc_hs_elec_irq(mbhc, WCD_MBHC_ELEC_HS_REM, false);
|
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->mbhc_cb->irq_control(mbhc->component,
|
||||||
mbhc->intr_ids->hph_left_ocp,
|
mbhc->intr_ids->hph_left_ocp,
|
||||||
false);
|
false);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
mbhc->hph_status |= SND_JACK_OC_HPHL;
|
mbhc->hph_status |= SND_JACK_OC_HPHL;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
||||||
mbhc->hph_status,
|
mbhc->hph_status,
|
||||||
WCD_MBHC_JACK_MASK);
|
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->mbhc_cb->irq_control(mbhc->component,
|
||||||
mbhc->intr_ids->hph_right_ocp,
|
mbhc->intr_ids->hph_right_ocp,
|
||||||
false);
|
false);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
mbhc->hph_status |= SND_JACK_OC_HPHR;
|
mbhc->hph_status |= SND_JACK_OC_HPHR;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
|
||||||
mbhc->hph_status, WCD_MBHC_JACK_MASK);
|
mbhc->hph_status, WCD_MBHC_JACK_MASK);
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -13755,8 +13755,10 @@ static int tasha_device_down(struct wcd9xxx *wcd9xxx)
|
|||||||
SWR_DEVICE_DOWN, NULL);
|
SWR_DEVICE_DOWN, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
if (!is_snd_event_fwk_enabled())
|
if (!is_snd_event_fwk_enabled())
|
||||||
snd_soc_card_change_online_state(component->card, 0);
|
snd_soc_card_change_online_state(component->card, 0);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
for (count = 0; count < NUM_CODEC_DAIS; count++)
|
for (count = 0; count < NUM_CODEC_DAIS; count++)
|
||||||
priv->dai[count].bus_down_in_recovery = true;
|
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)
|
if (tasha->machine_codec_event_cb)
|
||||||
tasha->machine_codec_event_cb(component,
|
tasha->machine_codec_event_cb(component,
|
||||||
WCD9335_CODEC_EVENT_CODEC_UP);
|
WCD9335_CODEC_EVENT_CODEC_UP);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
if (!is_snd_event_fwk_enabled())
|
if (!is_snd_event_fwk_enabled())
|
||||||
snd_soc_card_change_online_state(component->card, 1);
|
snd_soc_card_change_online_state(component->card, 1);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
/* Class-H Init*/
|
/* Class-H Init*/
|
||||||
wcd_clsh_init(&tasha->clsh_d);
|
wcd_clsh_init(&tasha->clsh_d);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -10334,8 +10334,10 @@ static int tavil_device_down(struct wcd9xxx *wcd9xxx)
|
|||||||
SWR_DEVICE_DOWN, NULL);
|
SWR_DEVICE_DOWN, NULL);
|
||||||
}
|
}
|
||||||
tavil_dsd_reset(priv->dsd_config);
|
tavil_dsd_reset(priv->dsd_config);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
if (!is_snd_event_fwk_enabled())
|
if (!is_snd_event_fwk_enabled())
|
||||||
snd_soc_card_change_online_state(component->card, 0);
|
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_dsp_ssr_event(priv->wdsp_cntl, WCD_CDC_DOWN_EVENT);
|
||||||
wcd_resmgr_set_sido_input_src_locked(priv->resmgr,
|
wcd_resmgr_set_sido_input_src_locked(priv->resmgr,
|
||||||
SIDO_SOURCE_INTERNAL);
|
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 =
|
tavil_slimbus_slave_port_cfg.slave_dev_pgd_la =
|
||||||
control->slim->laddr;
|
control->slim->laddr;
|
||||||
tavil_init_slim_slave_cfg(component);
|
tavil_init_slim_slave_cfg(component);
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
if (!is_snd_event_fwk_enabled())
|
if (!is_snd_event_fwk_enabled())
|
||||||
snd_soc_card_change_online_state(component->card, 1);
|
snd_soc_card_change_online_state(component->card, 1);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
for (i = 0; i < TAVIL_MAX_MICBIAS; i++)
|
for (i = 0; i < TAVIL_MAX_MICBIAS; i++)
|
||||||
tavil->micb_ref[i] = 0;
|
tavil->micb_ref[i] = 0;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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>
|
#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);
|
EXPORT_SYMBOL(wcdcal_get_fw_cal);
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
static int wcdcal_hwdep_ioctl_shared(struct snd_hwdep *hw,
|
||||||
struct wcdcal_ioctl_buffer fw_user)
|
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);
|
mutex_unlock(&fw_data->lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
#ifdef CONFIG_COMPAT
|
#ifdef CONFIG_COMPAT
|
||||||
struct wcdcal_ioctl_buffer32 {
|
struct wcdcal_ioctl_buffer32 {
|
||||||
@@ -99,6 +101,7 @@ enum {
|
|||||||
_IOW('U', 0x1, struct wcdcal_ioctl_buffer32),
|
_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,
|
static int wcdcal_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
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;
|
fw_user_compat.cal_type = fw_user32.cal_type;
|
||||||
return wcdcal_hwdep_ioctl_shared(hw, fw_user_compat);
|
return wcdcal_hwdep_ioctl_shared(hw, fw_user_compat);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
#else
|
#else
|
||||||
#define wcdcal_hwdep_ioctl_compat NULL
|
#define wcdcal_hwdep_ioctl_compat NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int wcdcal_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
|
static int wcdcal_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
@@ -213,4 +218,11 @@ end:
|
|||||||
}
|
}
|
||||||
return -ENOMEM;
|
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);
|
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 is_initial_boot;
|
||||||
static bool codec_reg_done;
|
static bool codec_reg_done;
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static struct snd_soc_aux_dev *msm_aux_dev;
|
static struct snd_soc_aux_dev *msm_aux_dev;
|
||||||
static struct snd_soc_codec_conf *msm_codec_conf;
|
static struct snd_soc_codec_conf *msm_codec_conf;
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
static struct snd_soc_card snd_soc_card_lahaina_msm;
|
static struct snd_soc_card snd_soc_card_lahaina_msm;
|
||||||
static int dmic_0_1_gpio_cnt;
|
static int dmic_0_1_gpio_cnt;
|
||||||
static int dmic_2_3_gpio_cnt;
|
static int dmic_2_3_gpio_cnt;
|
||||||
static int dmic_4_5_gpio_cnt;
|
static int dmic_4_5_gpio_cnt;
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static void *def_wcd_mbhc_cal(void);
|
static void *def_wcd_mbhc_cal(void);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Need to report LINEIN
|
* Need to report LINEIN
|
||||||
@@ -5429,6 +5433,7 @@ err:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static void *def_wcd_mbhc_cal(void)
|
static void *def_wcd_mbhc_cal(void)
|
||||||
{
|
{
|
||||||
void *wcd_mbhc_cal;
|
void *wcd_mbhc_cal;
|
||||||
@@ -5457,6 +5462,7 @@ static void *def_wcd_mbhc_cal(void)
|
|||||||
|
|
||||||
return wcd_mbhc_cal;
|
return wcd_mbhc_cal;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
/* Digital audio interface glue - connects codec <---> CPU */
|
/* Digital audio interface glue - connects codec <---> CPU */
|
||||||
static struct snd_soc_dai_link msm_common_dai_links[] = {
|
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),
|
.name = MSM_DAILINK_NAME(Media1),
|
||||||
.stream_name = "MultiMedia1",
|
.stream_name = "MultiMedia1",
|
||||||
.dynamic = 1,
|
.dynamic = 1,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.dpcm_capture = 1,
|
.dpcm_capture = 1,
|
||||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
.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),
|
.name = MSM_DAILINK_NAME(ULL),
|
||||||
.stream_name = "MultiMedia3",
|
.stream_name = "MultiMedia3",
|
||||||
.dynamic = 1,
|
.dynamic = 1,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||||
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),
|
.name = MSM_DAILINK_NAME(Compress1),
|
||||||
.stream_name = "Compress1",
|
.stream_name = "Compress1",
|
||||||
.dynamic = 1,
|
.dynamic = 1,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.async_ops = ASYNC_DPCM_SND_SOC_HW_PARAMS,
|
.async_ops = ASYNC_DPCM_SND_SOC_HW_PARAMS,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.dpcm_capture = 1,
|
.dpcm_capture = 1,
|
||||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
.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),
|
.name = MSM_DAILINK_NAME(LowLatency),
|
||||||
.stream_name = "MultiMedia5",
|
.stream_name = "MultiMedia5",
|
||||||
.dynamic = 1,
|
.dynamic = 1,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.dpcm_capture = 1,
|
.dpcm_capture = 1,
|
||||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
.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,
|
.name = LPASS_BE_USB_AUDIO_RX,
|
||||||
.stream_name = "USB Audio Playback",
|
.stream_name = "USB Audio Playback",
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.dynamic_be = 1,
|
.dynamic_be = 1,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.no_pcm = 1,
|
.no_pcm = 1,
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.id = MSM_BACKEND_DAI_USB_RX,
|
.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,
|
.name = LPASS_BE_RX_CDC_DMA_RX_0,
|
||||||
.stream_name = "RX CDC DMA0 Playback",
|
.stream_name = "RX CDC DMA0 Playback",
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.dynamic_be = 1,
|
.dynamic_be = 1,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.no_pcm = 1,
|
.no_pcm = 1,
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_0,
|
.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,
|
.name = LPASS_BE_RX_CDC_DMA_RX_1,
|
||||||
.stream_name = "RX CDC DMA1 Playback",
|
.stream_name = "RX CDC DMA1 Playback",
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.dynamic_be = 1,
|
.dynamic_be = 1,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.no_pcm = 1,
|
.no_pcm = 1,
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_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,
|
.name = LPASS_BE_RX_CDC_DMA_RX_2,
|
||||||
.stream_name = "RX CDC DMA2 Playback",
|
.stream_name = "RX CDC DMA2 Playback",
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.dynamic_be = 1,
|
.dynamic_be = 1,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.no_pcm = 1,
|
.no_pcm = 1,
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_2,
|
.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,
|
.name = LPASS_BE_RX_CDC_DMA_RX_3,
|
||||||
.stream_name = "RX CDC DMA3 Playback",
|
.stream_name = "RX CDC DMA3 Playback",
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.dynamic_be = 1,
|
.dynamic_be = 1,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.no_pcm = 1,
|
.no_pcm = 1,
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.id = MSM_BACKEND_DAI_RX_CDC_DMA_RX_3,
|
.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",
|
.name = "MSMSTUB Media1",
|
||||||
.stream_name = "MultiMedia1",
|
.stream_name = "MultiMedia1",
|
||||||
.dynamic = 1,
|
.dynamic = 1,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.dpcm_playback = 1,
|
.dpcm_playback = 1,
|
||||||
.dpcm_capture = 1,
|
.dpcm_capture = 1,
|
||||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||||
@@ -7124,6 +7150,7 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
|
|||||||
return card;
|
return card;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_wsa881x_init(struct snd_soc_component *component)
|
static int msm_wsa881x_init(struct snd_soc_component *component)
|
||||||
{
|
{
|
||||||
u8 spkleft_ports[WSA881X_MAX_SWR_PORTS] = {0, 1, 2, 3};
|
u8 spkleft_ports[WSA881X_MAX_SWR_PORTS] = {0, 1, 2, 3};
|
||||||
@@ -7559,6 +7586,14 @@ aux_dev_register:
|
|||||||
err:
|
err:
|
||||||
return ret;
|
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)
|
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__);
|
dev_dbg(dev, "%s: TODO \n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
snd_soc_card_change_online_state(card, 1);
|
snd_soc_card_change_online_state(card, 1);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
dev_dbg(dev, "%s: setting snd_card to ONLINE\n", __func__);
|
dev_dbg(dev, "%s: setting snd_card to ONLINE\n", __func__);
|
||||||
|
|
||||||
err:
|
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__);
|
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);
|
snd_soc_card_change_online_state(card, 0);
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
if (!strcmp(card->name, "lahaina-stub-snd-card")) {
|
if (!strcmp(card->name, "lahaina-stub-snd-card")) {
|
||||||
/* TODO */
|
/* 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,
|
static int msm_compr_set_next_track_param(struct snd_compr_stream *cstream,
|
||||||
union snd_codec_options *codec_options)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
static int msm_compr_volume_put(struct snd_kcontrol *kcontrol,
|
static int msm_compr_volume_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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_params = msm_compr_set_params,
|
||||||
.set_metadata = msm_compr_set_metadata,
|
.set_metadata = msm_compr_set_metadata,
|
||||||
.get_metadata = msm_compr_get_metadata,
|
.get_metadata = msm_compr_get_metadata,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.set_next_track_param = msm_compr_set_next_track_param,
|
.set_next_track_param = msm_compr_set_next_track_param,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.ack = msm_compr_ack,
|
.ack = msm_compr_ack,
|
||||||
.copy = msm_compr_copy,
|
.copy = msm_compr_copy,
|
||||||
.get_caps = msm_compr_get_caps,
|
.get_caps = msm_compr_get_caps,
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/init.h>
|
||||||
@@ -2422,6 +2422,7 @@ enum {
|
|||||||
_IOW('U', 0x0B, struct snd_lsm_module_params_32),
|
_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,
|
static int msm_cpe_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void *arg)
|
unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
@@ -2848,7 +2849,13 @@ done:
|
|||||||
"lsm_api_lock");
|
"lsm_api_lock");
|
||||||
return err;
|
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
|
#else
|
||||||
#define msm_cpe_lsm_ioctl_compat NULL
|
#define msm_cpe_lsm_ioctl_compat NULL
|
||||||
#endif
|
#endif
|
||||||
@@ -3286,7 +3293,9 @@ static const struct snd_pcm_ops msm_cpe_lsm_ops = {
|
|||||||
.pointer = msm_cpe_lsm_pointer,
|
.pointer = msm_cpe_lsm_pointer,
|
||||||
.copy_user = msm_cpe_lsm_copy,
|
.copy_user = msm_cpe_lsm_copy,
|
||||||
.hw_params = msm_cpe_lsm_hwparams,
|
.hw_params = msm_cpe_lsm_hwparams,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.compat_ioctl = msm_cpe_lsm_ioctl_compat,
|
.compat_ioctl = msm_cpe_lsm_ioctl_compat,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_soc_component_driver msm_soc_cpe_component = {
|
static struct snd_soc_component_driver msm_soc_cpe_component = {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/init.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
@@ -1682,6 +1682,7 @@ enum {
|
|||||||
_IOW('U', 0x13, struct snd_lsm_module_params_32),
|
_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,
|
static int msm_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void __user *arg)
|
unsigned int cmd, void __user *arg)
|
||||||
{
|
{
|
||||||
@@ -2081,6 +2082,7 @@ done:
|
|||||||
mutex_unlock(&prtd->lsm_api_lock);
|
mutex_unlock(&prtd->lsm_api_lock);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
#else
|
#else
|
||||||
#define msm_lsm_ioctl_compat NULL
|
#define msm_lsm_ioctl_compat NULL
|
||||||
#endif
|
#endif
|
||||||
@@ -2913,6 +2915,7 @@ static int msm_lsm_pcm_copy(struct snd_pcm_substream *substream, int ch,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_lsm_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
static int msm_lsm_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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;
|
kctl->get = msm_lsm_app_type_cfg_ctl_get;
|
||||||
return 0;
|
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,
|
static int msm_lsm_afe_data_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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;
|
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)
|
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,
|
.close = msm_lsm_close,
|
||||||
.ioctl = msm_lsm_ioctl,
|
.ioctl = msm_lsm_ioctl,
|
||||||
.prepare = msm_lsm_prepare,
|
.prepare = msm_lsm_prepare,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.compat_ioctl = msm_lsm_ioctl_compat,
|
.compat_ioctl = msm_lsm_ioctl_compat,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.hw_params = msm_lsm_hw_params,
|
.hw_params = msm_lsm_hw_params,
|
||||||
.copy_user = msm_lsm_pcm_copy,
|
.copy_user = msm_lsm_pcm_copy,
|
||||||
.pointer = msm_lsm_pcm_pointer,
|
.pointer = msm_lsm_pcm_pointer,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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/init.h>
|
||||||
@@ -526,6 +526,7 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
|||||||
.trigger = msm_pcm_trigger,
|
.trigger = msm_pcm_trigger,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
|
static int msm_pcm_volume_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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;
|
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(
|
static struct msm_pcm_channel_mixer *msm_pcm_get_chmixer(
|
||||||
struct msm_pcm_pdata *pdata,
|
struct msm_pcm_pdata *pdata,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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>
|
#include <linux/init.h>
|
||||||
@@ -444,7 +444,7 @@ static int msm_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_mmap_fd(struct snd_pcm_substream *substream,
|
static int msm_pcm_mmap_fd(struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_mmap_fd *mmap_fd)
|
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:
|
buf_fd_fail:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
static int msm_pcm_ioctl(struct snd_pcm_substream *substream,
|
static int msm_pcm_ioctl(struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void *arg)
|
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);
|
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,
|
static int msm_pcm_compat_ioctl(struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void *arg)
|
unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
@@ -699,6 +700,7 @@ static int msm_pcm_close(struct snd_pcm_substream *substream)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_set_volume(struct msm_audio *prtd, uint32_t volume)
|
static int msm_pcm_set_volume(struct msm_audio *prtd, uint32_t volume)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
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;
|
kctl->tlv.p = msm_pcm_vol_gain;
|
||||||
return 0;
|
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,
|
static int msm_pcm_channel_map_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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;
|
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,
|
static int msm_pcm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
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;
|
hwdep->ops.ioctl_compat = msm_pcm_hwdep_compat_ioctl;
|
||||||
return 0;
|
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)
|
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,
|
.copy_user = msm_pcm_copy,
|
||||||
.hw_params = msm_pcm_hw_params,
|
.hw_params = msm_pcm_hw_params,
|
||||||
.ioctl = msm_pcm_ioctl,
|
.ioctl = msm_pcm_ioctl,
|
||||||
#ifdef CONFIG_COMPAT
|
#if IS_ENABLED(CONFIG_COMPAT) && IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.compat_ioctl = msm_pcm_compat_ioctl,
|
.compat_ioctl = msm_pcm_compat_ioctl,
|
||||||
#endif
|
#endif
|
||||||
.trigger = msm_pcm_trigger,
|
.trigger = msm_pcm_trigger,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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
|
#ifdef CONFIG_COMPAT
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_compat_ioctl(struct snd_pcm_substream *substream,
|
static int msm_pcm_compat_ioctl(struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void __user *arg)
|
unsigned int cmd, void __user *arg)
|
||||||
{
|
{
|
||||||
return msm_pcm_ioctl(substream, cmd, arg);
|
return msm_pcm_ioctl(substream, cmd, arg);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
#else
|
#else
|
||||||
#define msm_pcm_compat_ioctl NULL
|
#define msm_pcm_compat_ioctl NULL
|
||||||
#endif
|
#endif
|
||||||
@@ -1283,7 +1285,9 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
|||||||
.hw_params = msm_pcm_hw_params,
|
.hw_params = msm_pcm_hw_params,
|
||||||
.close = msm_pcm_close,
|
.close = msm_pcm_close,
|
||||||
.ioctl = msm_pcm_ioctl,
|
.ioctl = msm_pcm_ioctl,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.compat_ioctl = msm_pcm_compat_ioctl,
|
.compat_ioctl = msm_pcm_compat_ioctl,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
.prepare = msm_pcm_prepare,
|
.prepare = msm_pcm_prepare,
|
||||||
.trigger = msm_pcm_trigger,
|
.trigger = msm_pcm_trigger,
|
||||||
.pointer = msm_pcm_pointer,
|
.pointer = msm_pcm_pointer,
|
||||||
@@ -1493,6 +1497,7 @@ done:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_set_volume(struct msm_audio *prtd, uint32_t volume)
|
static int msm_pcm_set_volume(struct msm_audio *prtd, uint32_t volume)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
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;
|
kctl->tlv.p = msm_pcm_vol_gain;
|
||||||
return 0;
|
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,
|
static int msm_pcm_compress_ctl_info(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_info *uinfo)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
static int msm_pcm_playback_app_type_cfg_ctl_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
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;
|
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(
|
static struct msm_pcm_channel_mixer *msm_pcm_get_chmixer(
|
||||||
struct msm_plat_data *pdata,
|
struct msm_plat_data *pdata,
|
||||||
@@ -2795,6 +2814,7 @@ static int msm_asoc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
static snd_pcm_sframes_t msm_pcm_delay_blk(struct snd_pcm_substream *substream,
|
static snd_pcm_sframes_t msm_pcm_delay_blk(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *dai)
|
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;
|
return frames;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
|
|
||||||
static struct snd_soc_component_driver msm_soc_component = {
|
static struct snd_soc_component_driver msm_soc_component = {
|
||||||
.name = DRV_NAME,
|
.name = DRV_NAME,
|
||||||
.ops = &msm_pcm_ops,
|
.ops = &msm_pcm_ops,
|
||||||
.pcm_new = msm_asoc_pcm_new,
|
.pcm_new = msm_asoc_pcm_new,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.delay_blk = msm_pcm_delay_blk,
|
.delay_blk = msm_pcm_delay_blk,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
};
|
};
|
||||||
|
|
||||||
static int msm_pcm_probe(struct platform_device *pdev)
|
static int msm_pcm_probe(struct platform_device *pdev)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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>
|
#include <linux/kernel.h>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "msm-pcm-routing-devdep.h"
|
#include "msm-pcm-routing-devdep.h"
|
||||||
#include "msm-ds2-dap-config.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)
|
static int msm_pcm_routing_hwdep_open(struct snd_hwdep *hw, struct file *file)
|
||||||
{
|
{
|
||||||
pr_debug("%s\n", __func__);
|
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;
|
hwdep->ops.release = msm_pcm_routing_hwdep_release;
|
||||||
#ifdef CONFIG_COMPAT
|
#ifdef CONFIG_COMPAT
|
||||||
hwdep->ops.ioctl_compat = msm_pcm_routing_hwdep_compat_ioctl;
|
hwdep->ops.ioctl_compat = msm_pcm_routing_hwdep_compat_ioctl;
|
||||||
#endif
|
#endif /* CONFIG_COMPAT */
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* CONFIG_AUDIO_QGKI && CONFIG_SND_HWDEP */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* 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_
|
#ifndef _MSM_PCM_ROUTING_DEVDEP_H_
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include "msm-pcm-routing-v2.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,
|
int msm_pcm_routing_hwdep_new(struct snd_soc_pcm_runtime *runtime,
|
||||||
struct msm_pcm_routing_bdai_data *msm_bedais);
|
struct msm_pcm_routing_bdai_data *msm_bedais);
|
||||||
void msm_pcm_routing_hwdep_free(struct snd_pcm *pcm);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void msm_pcm_routing_hwdep_free(struct snd_pcm *pcm)
|
static inline void msm_pcm_routing_hwdep_free(struct snd_pcm *pcm)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// 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>
|
#include <linux/init.h>
|
||||||
@@ -742,7 +742,9 @@ static const struct snd_pcm_ops msm_pcm_ops = {
|
|||||||
.prepare = msm_pcm_prepare,
|
.prepare = msm_pcm_prepare,
|
||||||
.trigger = msm_pcm_trigger,
|
.trigger = msm_pcm_trigger,
|
||||||
.ioctl = msm_pcm_ioctl,
|
.ioctl = msm_pcm_ioctl,
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
.compat_ioctl = msm_pcm_ioctl,
|
.compat_ioctl = msm_pcm_ioctl,
|
||||||
|
#endif /* CONFIG_AUDIO_QGKI */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* 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__
|
#ifndef __Q6AFECAL_HWDEP_H__
|
||||||
#define __Q6AFECAL_HWDEP_H__
|
#define __Q6AFECAL_HWDEP_H__
|
||||||
@@ -26,7 +26,14 @@ struct firmware_cal {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_AFE_HWDEP)
|
#if IS_ENABLED(CONFIG_AFE_HWDEP)
|
||||||
|
#if IS_ENABLED(CONFIG_AUDIO_QGKI)
|
||||||
int q6afe_cal_create_hwdep(void *fw, int node, void *card);
|
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,
|
struct firmware_cal *q6afecal_get_fw_cal(struct afe_fw_info *fw_data,
|
||||||
enum q6afe_cal_type type);
|
enum q6afe_cal_type type);
|
||||||
#else /* CONFIG_AFE_HWDEP */
|
#else /* CONFIG_AFE_HWDEP */
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* 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__
|
#ifndef __WCD_MBHC_V2_H__
|
||||||
#define __WCD_MBHC_V2_H__
|
#define __WCD_MBHC_V2_H__
|
||||||
@@ -121,10 +121,15 @@ do { \
|
|||||||
(cfg_ptr->_n_rload * \
|
(cfg_ptr->_n_rload * \
|
||||||
(sizeof(cfg_ptr->_rload[0]) + sizeof(cfg_ptr->_alpha[0]))))
|
(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 | \
|
#define WCD_MBHC_JACK_MASK (SND_JACK_HEADSET | SND_JACK_OC_HPHL | \
|
||||||
SND_JACK_OC_HPHR | SND_JACK_LINEOUT | \
|
SND_JACK_OC_HPHR | SND_JACK_LINEOUT | \
|
||||||
SND_JACK_MECHANICAL | SND_JACK_MICROPHONE2 | \
|
SND_JACK_MECHANICAL | SND_JACK_MICROPHONE2 | \
|
||||||
SND_JACK_UNSUPPORTED)
|
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 | \
|
#define WCD_MBHC_JACK_BUTTON_MASK (SND_JACK_BTN_0 | SND_JACK_BTN_1 | \
|
||||||
SND_JACK_BTN_2 | SND_JACK_BTN_3 | \
|
SND_JACK_BTN_2 | SND_JACK_BTN_3 | \
|
||||||
|
Reference in New Issue
Block a user