Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc0db22a authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'fix/hda' into for-linus

parents fdfa6829 54f7190b
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static void snd_hda_generate_beep(struct work_struct *work)
		return;

	/* generate tone */
	snd_hda_codec_write_cache(codec, beep->nid, 0,
	snd_hda_codec_write(codec, beep->nid, 0,
			AC_VERB_SET_BEEP_CONTROL, beep->tone);
}

@@ -119,7 +119,7 @@ static void snd_hda_do_detach(struct hda_beep *beep)
	beep->dev = NULL;
	cancel_work_sync(&beep->beep_work);
	/* turn off beep for sure */
	snd_hda_codec_write_cache(beep->codec, beep->nid, 0,
	snd_hda_codec_write(beep->codec, beep->nid, 0,
				  AC_VERB_SET_BEEP_CONTROL, 0);
}

@@ -192,7 +192,7 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable)
		beep->enabled = enable;
		if (!enable) {
			/* turn off beep */
			snd_hda_codec_write_cache(beep->codec, beep->nid, 0,
			snd_hda_codec_write(beep->codec, beep->nid, 0,
						  AC_VERB_SET_BEEP_CONTROL, 0);
		}
		if (beep->mode == HDA_BEEP_MODE_SWREG) {
@@ -239,8 +239,12 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
	mutex_init(&beep->mutex);

	if (beep->mode == HDA_BEEP_MODE_ON) {
		beep->enabled = 1;
		snd_hda_do_register(&beep->register_work);
		int err = snd_hda_do_attach(beep);
		if (err < 0) {
			kfree(beep);
			codec->beep = NULL;
			return err;
		}
	}

	return 0;
@@ -253,7 +257,7 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
	if (beep) {
		cancel_work_sync(&beep->register_work);
		cancel_delayed_work(&beep->unregister_work);
		if (beep->enabled)
		if (beep->dev)
			snd_hda_do_detach(beep);
		codec->beep = NULL;
		kfree(beep);
+6 −4
Original line number Diff line number Diff line
@@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps);
 */
u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
{
	u32 pincap = snd_hda_query_pin_caps(codec, nid);
	u32 pincap;

	if (!codec->no_trigger_sense) {
		pincap = snd_hda_query_pin_caps(codec, nid);
		if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
			snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);

	}
	return snd_hda_codec_read(codec, nid, 0,
				  AC_VERB_GET_PIN_SENSE, 0);
}
+1 −0
Original line number Diff line number Diff line
@@ -817,6 +817,7 @@ struct hda_codec {
	unsigned int pin_amp_workaround:1; /* pin out-amp takes index
					    * (e.g. Conexant codecs)
					    */
	unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
#ifdef CONFIG_SND_HDA_POWER_SAVE
	unsigned int power_on :1;	/* current (global) power-state */
	unsigned int power_transition :1; /* power-state in transition */
+15 −6
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ struct azx_dev {
					 */
	unsigned char stream_tag;	/* assigned stream */
	unsigned char index;		/* stream index */
	int device;			/* last device number assigned to */

	unsigned int opened :1;
	unsigned int running :1;
@@ -1441,10 +1442,13 @@ static int __devinit azx_codec_configure(struct azx *chip)
 */

/* assign a stream for the PCM */
static inline struct azx_dev *azx_assign_device(struct azx *chip, int stream)
static inline struct azx_dev *
azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream)
{
	int dev, i, nums;
	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
	struct azx_dev *res = NULL;

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
		dev = chip->playback_index_offset;
		nums = chip->playback_streams;
	} else {
@@ -1453,10 +1457,15 @@ static inline struct azx_dev *azx_assign_device(struct azx *chip, int stream)
	}
	for (i = 0; i < nums; i++, dev++)
		if (!chip->azx_dev[dev].opened) {
			chip->azx_dev[dev].opened = 1;
			return &chip->azx_dev[dev];
			res = &chip->azx_dev[dev];
			if (res->device == substream->pcm->device)
				break;
		}
	if (res) {
		res->opened = 1;
		res->device = substream->pcm->device;
	}
	return NULL;
	return res;
}

/* release the assigned stream */
@@ -1505,7 +1514,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
	int err;

	mutex_lock(&chip->open_mutex);
	azx_dev = azx_assign_device(chip, substream->stream);
	azx_dev = azx_assign_device(chip, substream);
	if (azx_dev == NULL) {
		mutex_unlock(&chip->open_mutex);
		return -EBUSY;
+16 −0
Original line number Diff line number Diff line
@@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec)
	 */
	spec->multiout.no_share_stream = 1;

	codec->no_trigger_sense = 1;

	return 0;
}

@@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec)

	codec->patch_ops = ad198x_patch_ops;

	codec->no_trigger_sense = 1;

	return 0;
}

@@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec)
		codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
		break;
	}

	codec->no_trigger_sense = 1;

	return 0;
}

@@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec)
#endif
	spec->vmaster_nid = 0x04;

	codec->no_trigger_sense = 1;

	return 0;
}

@@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec)

	codec->patch_ops = ad198x_patch_ops;

	codec->no_trigger_sense = 1;

	return 0;
}

@@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec)
		break;
	}

	codec->no_trigger_sense = 1;

	return 0;
}

@@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec)
		spec->mixers[2] = ad1882_6stack_mixers;
		break;
	}

	codec->no_trigger_sense = 1;

	return 0;
}

Loading