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

Commit a707d030 authored by Mark Brown's avatar Mark Brown
Browse files

Merge branch 'topic/pcm' of...

Merge branch 'topic/pcm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
parents a1a564ed 3d59400f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ struct snd_soc_dai {
	/* parent platform/codec */
	struct snd_soc_platform *platform;
	struct snd_soc_codec *codec;
	struct snd_soc_component *component;

	struct snd_soc_card *card;

+20 −2
Original line number Diff line number Diff line
@@ -413,6 +413,10 @@ struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
		const char *dai_link);

bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd);
void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream);
void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);

/* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
@@ -656,6 +660,11 @@ struct snd_soc_component {
	const char *name;
	int id;
	struct device *dev;

	unsigned int active;

	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */

	struct list_head list;

	struct snd_soc_dai_driver *dai_drv;
@@ -683,7 +692,6 @@ struct snd_soc_codec {

	/* runtime */
	struct snd_ac97 *ac97;  /* for ad-hoc ac97 devices */
	unsigned int active;
	unsigned int cache_bypass:1; /* Suppress access to the cache */
	unsigned int suspended:1; /* Codec is in suspend PM state */
	unsigned int probed:1; /* Codec has been probed */
@@ -709,7 +717,6 @@ struct snd_soc_codec {

	/* dapm */
	struct snd_soc_dapm_context dapm;
	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */

#ifdef CONFIG_DEBUG_FS
	struct dentry *debugfs_codec_root;
@@ -1168,6 +1175,17 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
	return 1;
}

static inline bool snd_soc_component_is_active(
	struct snd_soc_component *component)
{
	return component->active != 0;
}

static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
{
	return snd_soc_component_is_active(&codec->component);
}

int snd_soc_util_init(void);
void snd_soc_util_exit(void);

+2 −2
Original line number Diff line number Diff line
@@ -722,7 +722,7 @@ static int adav80x_dai_startup(struct snd_pcm_substream *substream,
	struct snd_soc_codec *codec = dai->codec;
	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);

	if (!codec->active || !adav80x->rate)
	if (!snd_soc_codec_is_active(codec) || !adav80x->rate)
		return 0;

	return snd_pcm_hw_constraint_minmax(substream->runtime,
@@ -735,7 +735,7 @@ static void adav80x_dai_shutdown(struct snd_pcm_substream *substream,
	struct snd_soc_codec *codec = dai->codec;
	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);

	if (!codec->active)
	if (!snd_soc_codec_is_active(codec))
		adav80x->rate = 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ static void tlv320aic23_shutdown(struct snd_pcm_substream *substream,
	struct aic23 *aic23 = snd_soc_codec_get_drvdata(codec);

	/* deactivate */
	if (!codec->active) {
	if (!snd_soc_codec_is_active(codec)) {
		udelay(50);
		snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0);
	}
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
	if (dac33->fifo_mode == ucontrol->value.integer.value[0])
		return 0;
	/* Do not allow changes while stream is running*/
	if (codec->active)
	if (snd_soc_codec_is_active(codec))
		return -EPERM;

	if (ucontrol->value.integer.value[0] < 0 ||
Loading