usb audio: Let the usb sound card index from 1

Prop from (CR)

If we have usb digital headphone pulled in during bootup. It will occupy
index 0. primary sound card can only use index 1. But in our most audio
code, We assume the primary sound card is 0. This will cause no sound
issue when we use primary sound card to playback and record.

Change-Id: If6635c4b7adef0925af8145d4b728f3cc481b9ad
Signed-off-by: liaohj <liaohj@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1780715
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuesheng Huang <huangys@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
liaohj 2020-10-21 14:21:16 +08:00 • committed by Xiaojun Ji
commit 9fac50a858
2 changed files with 2 additions and 1 deletions

View file

@ -22,6 +22,7 @@
#define SNDRV_DEFAULT_PTR1 SNDRV_DEFAULT_STR1
#define SNDRV_DEFAULT_IDX { [0 ... (SNDRV_CARDS-1)] = -1 }
#define SNDRV_DEFAULT_IDX_N { 1, [1 ... (SNDRV_CARDS-1)] = -1 }
#define SNDRV_DEFAULT_STR { [0 ... (SNDRV_CARDS-1)] = NULL }
#define SNDRV_DEFAULT_ENABLE { 1, [1 ... (SNDRV_CARDS-1)] = 0 }
#define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 }

View file

@ -62,7 +62,7 @@ MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX_N; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */
/* Vendor/product IDs for this card */