asoc: set card state to online after snd card registration

AGM might get initialized before sound card is populated
with all pcm nodes. This will lead to AGM parsing fewer
nodes and forms incomplete list of backends.

To avoid this, kernel module sets card status to ONLINE,
and AGM waits till the card status is ONLINE before parsing
for the pcm nodes.

Change-Id: I4b7f7085645706ba4351efe23ba048d3a177312c
Signed-off-by: Srinivas Marka <smarka@codeaurora.org>
This commit is contained in:
Srinivas Marka
2021-08-19 19:08:17 +05:30
committed by Gerrit - the friendly Code Review server
parent 642659b2a3
commit c315833fa3
3 changed files with 20 additions and 4 deletions

View File

@@ -31,6 +31,11 @@ enum {
MI2S_TDM_AUXPCM_MAX,
};
typedef enum snd_card_status_t {
SND_CARD_STATUS_OFFLINE = 0,
SND_CARD_STATUS_ONLINE = 1,
} snd_card_status_t;
struct msm_common_pdata {
uint8_t *aud_dev_state;
struct kobject aud_dev_kobj;
@@ -46,7 +51,8 @@ struct msm_common_pdata {
uint32_t is_audio_hw_vote_required[MI2S_TDM_AUXPCM_MAX];
};
int snd_card_notify_user(int card_status);
int snd_card_notify_user(snd_card_status_t card_status);
int snd_card_set_card_status(snd_card_status_t card_status);
struct msm_common_pdata *msm_common_get_pdata(struct snd_soc_card *card);
void msm_common_set_pdata(struct snd_soc_card *card,