View | Details | Raw Unified | Return to bug 66621 | Differences between
and this patch

Collapse All | Expand All

(-)a/sound/pci/hda/hda_generic.c (-1 / +21 lines)
Lines 474-479 static void invalidate_nid_path(struct hda_codec *codec, int idx) Link Here
474
	memset(path, 0, sizeof(*path));
474
	memset(path, 0, sizeof(*path));
475
}
475
}
476
476
477
static hda_nid_t get_preferred_dac(struct hda_codec *codec, hda_nid_t pin)
478
{
479
	struct hda_gen_spec *spec = codec->spec;
480
	const hda_nid_t *list = spec->preferred_dacs;
481
482
	if (!list)
483
		return 0;
484
	for (; *list; list += 2)
485
		if (*list == pin)
486
			return list[1];
487
	return 0;
488
}
489
477
/* look for an empty DAC slot */
490
/* look for an empty DAC slot */
478
static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin,
491
static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin,
479
			      bool is_digital)
492
			      bool is_digital)
Lines 1192-1198 static int try_assign_dacs(struct hda_codec *codec, int num_outs, Link Here
1192
			continue;
1205
			continue;
1193
		}
1206
		}
1194
1207
1195
		dacs[i] = look_for_dac(codec, pin, false);
1208
		dacs[i] = get_preferred_dac(codec, pin);
1209
		if (dacs[i]) {
1210
			if (is_dac_already_used(codec, dacs[i]))
1211
				badness += bad->no_dac;
1212
		}
1213
1214
		if (!dacs[i])
1215
			dacs[i] = look_for_dac(codec, pin, false);
1196
		if (!dacs[i] && !i) {
1216
		if (!dacs[i] && !i) {
1197
			/* try to steal the DAC of surrounds for the front */
1217
			/* try to steal the DAC of surrounds for the front */
1198
			for (j = 1; j < num_outs; j++) {
1218
			for (j = 1; j < num_outs; j++) {
(-)a/sound/pci/hda/hda_generic.h (+3 lines)
Lines 249-254 struct hda_gen_spec { Link Here
249
	const struct badness_table *main_out_badness;
249
	const struct badness_table *main_out_badness;
250
	const struct badness_table *extra_out_badness;
250
	const struct badness_table *extra_out_badness;
251
251
252
	/* preferred pin/DAC pairs; an array of paired NIDs */
253
	const hda_nid_t *preferred_dacs;
254
252
	/* loopback mixing mode */
255
	/* loopback mixing mode */
253
	bool aamix_mode;
256
	bool aamix_mode;
254
257
(-)a/sound/pci/hda/patch_analog.c (-1 / +10 lines)
Lines 340-345 static int patch_ad1986a(struct hda_codec *codec) Link Here
340
{
340
{
341
	int err;
341
	int err;
342
	struct ad198x_spec *spec;
342
	struct ad198x_spec *spec;
343
	static hda_nid_t preferred_pairs[] = {
344
		0x1a, 0x03,
345
		0x1b, 0x03,
346
		0x1c, 0x04,
347
		0x1d, 0x05,
348
		0x1e, 0x03,
349
		0
350
	};
343
351
344
	err = alloc_ad_spec(codec);
352
	err = alloc_ad_spec(codec);
345
	if (err < 0)
353
	if (err < 0)
Lines 360-365 static int patch_ad1986a(struct hda_codec *codec) Link Here
360
	 * So, let's disable the shared stream.
368
	 * So, let's disable the shared stream.
361
	 */
369
	 */
362
	spec->gen.multiout.no_share_stream = 1;
370
	spec->gen.multiout.no_share_stream = 1;
371
	/* give fixed DAC/pin pairs */
372
	spec->gen.preferred_dacs = preferred_pairs;
363
373
364
	/* AD1986A can't manage the dynamic pin on/off smoothly */
374
	/* AD1986A can't manage the dynamic pin on/off smoothly */
365
	spec->gen.auto_mute_via_amp = 1;
375
	spec->gen.auto_mute_via_amp = 1;
366
- 

Return to bug 66621