mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
audio:add lock for aw dynamics set dailink
for aw driver, we use dynamics set dailink. and for fogo5gna ,there are aw8838 also use the interface. but aw8838 & aw882xx are different ko. so add lock for awinic_set_dai_name function to avoid rewrite ,and lost one dailink. Change-Id: I418a0207598486cc9d600a5030410912476a8e60 Signed-off-by: liaohj <liaohj@lenovo.com> Reviewed-on: https://gerrit.mot.com/2765833 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wanlong Zhou <zhouwl@motorola.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
829cbb1de6
commit
d667970a4a
1 changed files with 7 additions and 0 deletions
|
|
@ -6250,15 +6250,18 @@ static const struct of_device_id holi_asoc_machine_of_match[] = {
|
|||
#ifdef CONFIG_AW882XX_STEREO_SMARTPA
|
||||
struct snd_soc_dai_link_component aw_codecs[4];
|
||||
static unsigned int aw_codecs_num;
|
||||
static DEFINE_MUTEX(aw_dailink_mutex);
|
||||
|
||||
void awinic_set_dai_name(const char* drvdainame, const char*drvname)
|
||||
{
|
||||
mutex_lock(&aw_dailink_mutex);
|
||||
if (aw_codecs_num < ARRAY_SIZE(aw_codecs)) {
|
||||
aw_codecs[aw_codecs_num].dai_name = drvdainame;
|
||||
aw_codecs[aw_codecs_num].name = drvname;
|
||||
aw_codecs[aw_codecs_num].of_node = NULL;
|
||||
aw_codecs_num++;
|
||||
}
|
||||
mutex_unlock(&aw_dailink_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL(awinic_set_dai_name);
|
||||
|
||||
|
|
@ -6273,6 +6276,8 @@ static int aw_update_dai_link_name(struct snd_soc_dai_link *dailink, int len1)
|
|||
(!strcmp(dailink[i].stream_name, "Primary MI2S Capture"))){
|
||||
dailink[i].num_codecs = aw_codecs_num;
|
||||
dailink[i].codecs = aw_codecs;
|
||||
pr_info("%s: aw_codecs_num=%d, codec_name[%d]:%s dai_name[%d]:%s\n",
|
||||
__func__, aw_codecs_num, i, dailink[i].codecs[i].name, i, dailink[i].codecs[i].dai_name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -6292,6 +6297,8 @@ static int aw_update_dai_link_name(struct snd_soc_dai_link *dailink, int len1)
|
|||
(!strcmp(dailink[i].stream_name, "Secondary MI2S Capture"))){
|
||||
dailink[i].num_codecs = aw_codecs_num;
|
||||
dailink[i].codecs = aw_codecs;
|
||||
pr_info("%s: aw_codecs_num=%d, codec_name[%d]:%s dai_name[%d]:%s\n",
|
||||
__func__, aw_codecs_num, i, dailink[i].codecs[i].name, i, dailink[i].codecs[i].dai_name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue