Commit a6409bb8 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

ALSA: hda-codec - Add array terminator for dmic in STAC codec

patch f6e9852a in mainline.

[ALSA] hda-codec - Add array terminator for dmic in STAC codec

Reported by Jan-Marek Glogowski.

The dmic array is passed to snd_hda_parse_pin_def_config() and
should be zero-terminated.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 70ad1f56
...@@ -162,8 +162,9 @@ static hda_nid_t stac925x_dac_nids[1] = { ...@@ -162,8 +162,9 @@ static hda_nid_t stac925x_dac_nids[1] = {
0x02, 0x02,
}; };
static hda_nid_t stac925x_dmic_nids[1] = { #define STAC925X_NUM_DMICS 1
0x15, static hda_nid_t stac925x_dmic_nids[STAC925X_NUM_DMICS + 1] = {
0x15, 0
}; };
static hda_nid_t stac922x_adc_nids[2] = { static hda_nid_t stac922x_adc_nids[2] = {
...@@ -190,8 +191,9 @@ static hda_nid_t stac9205_mux_nids[2] = { ...@@ -190,8 +191,9 @@ static hda_nid_t stac9205_mux_nids[2] = {
0x19, 0x1a 0x19, 0x1a
}; };
static hda_nid_t stac9205_dmic_nids[2] = { #define STAC9205_NUM_DMICS 2
0x17, 0x18, static hda_nid_t stac9205_dmic_nids[STAC9205_NUM_DMICS + 1] = {
0x17, 0x18, 0
}; };
static hda_nid_t stac9200_pin_nids[8] = { static hda_nid_t stac9200_pin_nids[8] = {
...@@ -2063,7 +2065,7 @@ static int patch_stac925x(struct hda_codec *codec) ...@@ -2063,7 +2065,7 @@ static int patch_stac925x(struct hda_codec *codec)
case 0x83847633: /* STAC9202D */ case 0x83847633: /* STAC9202D */
case 0x83847636: /* STAC9251 */ case 0x83847636: /* STAC9251 */
case 0x83847637: /* STAC9251D */ case 0x83847637: /* STAC9251D */
spec->num_dmics = 1; spec->num_dmics = STAC925X_NUM_DMICS;
spec->dmic_nids = stac925x_dmic_nids; spec->dmic_nids = stac925x_dmic_nids;
break; break;
default: default:
...@@ -2307,7 +2309,7 @@ static int patch_stac9205(struct hda_codec *codec) ...@@ -2307,7 +2309,7 @@ static int patch_stac9205(struct hda_codec *codec)
spec->mux_nids = stac9205_mux_nids; spec->mux_nids = stac9205_mux_nids;
spec->num_muxes = ARRAY_SIZE(stac9205_mux_nids); spec->num_muxes = ARRAY_SIZE(stac9205_mux_nids);
spec->dmic_nids = stac9205_dmic_nids; spec->dmic_nids = stac9205_dmic_nids;
spec->num_dmics = ARRAY_SIZE(stac9205_dmic_nids); spec->num_dmics = STAC9205_NUM_DMICS;
spec->dmux_nid = 0x1d; spec->dmux_nid = 0x1d;
spec->init = stac9205_core_init; spec->init = stac9205_core_init;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment