Skip to content

Commit a06dbfc

Browse files
committed
ALSA: hda - Add multi-headphone NIDs in multiout struct
For supporting both the multiple headphones and the multiple speakers, add the new field in struct hda_multi_out, and evaluate in the standard setup functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent cb4e482 commit a06dbfc

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎sound/pci/hda/hda_codec.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4566,6 +4566,11 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
45664566
snd_hda_codec_setup_stream(codec, mout->hp_nid, stream_tag,
45674567
0, format);
45684568
/* extra outputs copied from front */
4569+
for (i = 0; i < ARRAY_SIZE(mout->hp_out_nid); i++)
4570+
if (!mout->no_share_stream && mout->hp_out_nid[i])
4571+
snd_hda_codec_setup_stream(codec,
4572+
mout->hp_out_nid[i],
4573+
stream_tag, 0, format);
45694574
for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++)
45704575
if (!mout->no_share_stream && mout->extra_out_nid[i])
45714576
snd_hda_codec_setup_stream(codec,
@@ -4598,6 +4603,10 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
45984603
snd_hda_codec_cleanup_stream(codec, nids[i]);
45994604
if (mout->hp_nid)
46004605
snd_hda_codec_cleanup_stream(codec, mout->hp_nid);
4606+
for (i = 0; i < ARRAY_SIZE(mout->hp_out_nid); i++)
4607+
if (mout->hp_out_nid[i])
4608+
snd_hda_codec_cleanup_stream(codec,
4609+
mout->hp_out_nid[i]);
46014610
for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++)
46024611
if (mout->extra_out_nid[i])
46034612
snd_hda_codec_cleanup_stream(codec,

‎sound/pci/hda/hda_local.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,14 @@ int snd_hda_ch_mode_put(struct hda_codec *codec,
267267
enum { HDA_FRONT, HDA_REAR, HDA_CLFE, HDA_SIDE }; /* index for dac_nidx */
268268
enum { HDA_DIG_NONE, HDA_DIG_EXCLUSIVE, HDA_DIG_ANALOG_DUP }; /* dig_out_used */
269269

270+
#define HDA_MAX_OUTS 5
271+
270272
struct hda_multi_out {
271273
int num_dacs; /* # of DACs, must be more than 1 */
272274
const hda_nid_t *dac_nids; /* DAC list */
273275
hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */
274-
hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */
276+
hda_nid_t hp_out_nid[HDA_MAX_OUTS]; /* DACs for multiple HPs */
277+
hda_nid_t extra_out_nid[HDA_MAX_OUTS]; /* other (e.g. speaker) DACs */
275278
hda_nid_t dig_out_nid; /* digital out audio widget */
276279
const hda_nid_t *slave_dig_outs;
277280
int max_channels; /* currently supported analog channels */
@@ -385,7 +388,7 @@ enum {
385388
AUTO_PIN_HP_OUT
386389
};
387390

388-
#define AUTO_CFG_MAX_OUTS 5
391+
#define AUTO_CFG_MAX_OUTS HDA_MAX_OUTS
389392
#define AUTO_CFG_MAX_INS 8
390393

391394
struct auto_pin_cfg_item {

0 commit comments

Comments
 (0)