mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
ASoC: madera: report QDSP/LPASS SSR to soundcard
Cirrus madera codecs don't have a mechanism to report QDSP/LPASS SSR to AP over soundcard status change. Add logic to reflect LPASS status to soundcard, so AudioHAL can monitor and trigger necessary code on SSR. Change-Id: I93de60b97b8baea0dc6b7cea0fee1f7a4f9219d1 Signed-off-by: Yoon (Seungyoon) Lee <w22905@motorola.com> Reviewed-on: https://gerrit.mot.com/1219154 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Rav(CR) Vembu <raviv@motorola.com> Submit-Approved: Jira Key Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
This commit is contained in:
parent
9f46f92eb9
commit
c8073dc181
1 changed files with 43 additions and 0 deletions
|
|
@ -315,6 +315,15 @@ int madera_set_channel_map(struct snd_soc_dai *dai,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* same reason with stashed_slim_dev, there is no clever way to link
|
||||
* codec and slimbus driver on madera based platform. whenever codec
|
||||
* calls slimbus driver, it will keep its client codec pointer and use
|
||||
* it as a bridge to call codec related functions.
|
||||
*/
|
||||
if (dai->codec != NULL)
|
||||
slim_set_clientdata(stashed_slim_dev, dai->codec);
|
||||
|
||||
if (!priv->slim_logic_addr) {
|
||||
madera_slim_get_la(stashed_slim_dev, &laddr);
|
||||
priv->slim_logic_addr = laddr;
|
||||
|
|
@ -468,6 +477,38 @@ static int madera_slim_audio_probe(struct slim_device *slim)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int madera_slim_device_reset(struct slim_device *slim)
|
||||
{
|
||||
struct snd_soc_codec *codec;
|
||||
|
||||
if (slim == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
codec = slim_get_devicedata(slim);
|
||||
if (codec != NULL) {
|
||||
dev_info(&slim->dev, "%s handle SLIM RESET\n", __func__);
|
||||
snd_soc_card_change_online_state(codec->component.card, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int madera_slim_device_down(struct slim_device *slim)
|
||||
{
|
||||
struct snd_soc_codec *codec;
|
||||
|
||||
if (slim == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
codec = slim_get_devicedata(slim);
|
||||
if (codec != NULL) {
|
||||
dev_info(&slim->dev, "%s handle SLIM DOWN\n", __func__);
|
||||
snd_soc_card_change_online_state(codec->component.card, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct slim_driver madera_slim_audio = {
|
||||
.driver = {
|
||||
.name = "madera-slim-audio",
|
||||
|
|
@ -475,6 +516,8 @@ static struct slim_driver madera_slim_audio = {
|
|||
},
|
||||
.probe = madera_slim_audio_probe,
|
||||
.id_table = madera_slim_id,
|
||||
.reset_device = madera_slim_device_reset,
|
||||
.device_down = madera_slim_device_down,
|
||||
};
|
||||
|
||||
static int __init madera_slim_audio_init(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue