diff options
| author | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
|---|---|---|
| committer | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
| commit | c74a7469f97c0f40b46e82ee979f9fb1bb6e847c (patch) | |
| tree | f2690a1a916b73ef94657fbf0e0141ae57701825 /sound/soc/soc-topology.c | |
| parent | 6f15a7de86c8cf2dc09fc9e6d07047efa40ef809 (diff) | |
| parent | 500775074f88d9cf5416bed2ca19592812d62c41 (diff) | |
Merge drm/drm-next into drm-intel-next-queued
We need a backmerge to get DP_DPCD_REV_14 before we push other
i915 changes to dinq that could break compilation.
Signed-off-by: Rodrigo Vivi <[email protected]>
Diffstat (limited to 'sound/soc/soc-topology.c')
| -rw-r--r-- | sound/soc/soc-topology.c | 95 | 
1 files changed, 31 insertions, 64 deletions
| diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 986b8b2f90fb..53f121a50c97 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -54,62 +54,6 @@  #define SOC_TPLG_PASS_START	SOC_TPLG_PASS_MANIFEST  #define SOC_TPLG_PASS_END	SOC_TPLG_PASS_LINK -/* - * Old version of ABI structs, supported for backward compatibility. - */ - -/* Manifest v4 */ -struct snd_soc_tplg_manifest_v4 { -	__le32 size;		/* in bytes of this structure */ -	__le32 control_elems;	/* number of control elements */ -	__le32 widget_elems;	/* number of widget elements */ -	__le32 graph_elems;	/* number of graph elements */ -	__le32 pcm_elems;	/* number of PCM elements */ -	__le32 dai_link_elems;	/* number of DAI link elements */ -	struct snd_soc_tplg_private priv; -} __packed; - -/* Stream Capabilities v4 */ -struct snd_soc_tplg_stream_caps_v4 { -	__le32 size;		/* in bytes of this structure */ -	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; -	__le64 formats;	/* supported formats SNDRV_PCM_FMTBIT_* */ -	__le32 rates;		/* supported rates SNDRV_PCM_RATE_* */ -	__le32 rate_min;	/* min rate */ -	__le32 rate_max;	/* max rate */ -	__le32 channels_min;	/* min channels */ -	__le32 channels_max;	/* max channels */ -	__le32 periods_min;	/* min number of periods */ -	__le32 periods_max;	/* max number of periods */ -	__le32 period_size_min;	/* min period size bytes */ -	__le32 period_size_max;	/* max period size bytes */ -	__le32 buffer_size_min;	/* min buffer size bytes */ -	__le32 buffer_size_max;	/* max buffer size bytes */ -} __packed; - -/* PCM v4 */ -struct snd_soc_tplg_pcm_v4 { -	__le32 size;		/* in bytes of this structure */ -	char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; -	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; -	__le32 pcm_id;		/* unique ID - used to match with DAI link */ -	__le32 dai_id;		/* unique ID - used to match */ -	__le32 playback;	/* supports playback mode */ -	__le32 capture;		/* supports capture mode */ -	__le32 compress;	/* 1 = compressed; 0 = PCM */ -	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */ -	__le32 num_streams;	/* number of streams */ -	struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */ -} __packed; - -/* Physical link config v4 */ -struct snd_soc_tplg_link_config_v4 { -	__le32 size;            /* in bytes of this structure */ -	__le32 id;              /* unique ID - used to match */ -	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */ -	__le32 num_streams;     /* number of streams */ -} __packed; -  /* topology context */  struct soc_tplg {  	const struct firmware *fw; @@ -941,7 +885,7 @@ static int soc_tplg_denum_create_texts(struct soc_enum *se,  	int i, ret;  	se->dobj.control.dtexts = -		kzalloc(sizeof(char *) * ec->items, GFP_KERNEL); +		kcalloc(ec->items, sizeof(char *), GFP_KERNEL);  	if (se->dobj.control.dtexts == NULL)  		return -ENOMEM; @@ -1754,6 +1698,9 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,  		set_stream_info(stream, caps);  	} +	if (pcm->compress) +		dai_drv->compress_new = snd_soc_new_compress; +  	/* pass control to component driver for optional further init */  	ret = soc_tplg_dai_load(tplg, dai_drv);  	if (ret < 0) { @@ -2006,6 +1953,21 @@ static void set_link_hw_format(struct snd_soc_dai_link *link,  		link->dai_fmt = hw_config->fmt & SND_SOC_DAIFMT_FORMAT_MASK; +		/* clock gating */ +		switch (hw_config->clock_gated) { +		case SND_SOC_TPLG_DAI_CLK_GATE_GATED: +			link->dai_fmt |= SND_SOC_DAIFMT_GATED; +			break; + +		case SND_SOC_TPLG_DAI_CLK_GATE_CONT: +			link->dai_fmt |= SND_SOC_DAIFMT_CONT; +			break; + +		default: +			/* ignore the value */ +			break; +		} +  		/* clock signal polarity */  		invert_bclk = hw_config->invert_bclk;  		invert_fsync = hw_config->invert_fsync; @@ -2019,13 +1981,15 @@ static void set_link_hw_format(struct snd_soc_dai_link *link,  			link->dai_fmt |= SND_SOC_DAIFMT_IB_IF;  		/* clock masters */ -		bclk_master = hw_config->bclk_master; -		fsync_master = hw_config->fsync_master; -		if (!bclk_master && !fsync_master) +		bclk_master = (hw_config->bclk_master == +			       SND_SOC_TPLG_BCLK_CM); +		fsync_master = (hw_config->fsync_master == +				SND_SOC_TPLG_FSYNC_CM); +		if (bclk_master && fsync_master)  			link->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; -		else if (bclk_master && !fsync_master) -			link->dai_fmt |= SND_SOC_DAIFMT_CBS_CFM;  		else if (!bclk_master && fsync_master) +			link->dai_fmt |= SND_SOC_DAIFMT_CBS_CFM; +		else if (bclk_master && !fsync_master)  			link->dai_fmt |= SND_SOC_DAIFMT_CBM_CFS;  		else  			link->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; @@ -2293,8 +2257,11 @@ static int manifest_new_ver(struct soc_tplg *tplg,  	*manifest = NULL;  	if (src->size != sizeof(*src_v4)) { -		dev_err(tplg->dev, "ASoC: invalid manifest size\n"); -		return -EINVAL; +		dev_warn(tplg->dev, "ASoC: invalid manifest size %d\n", +			 src->size); +		if (src->size) +			return -EINVAL; +		src->size = sizeof(*src_v4);  	}  	dev_warn(tplg->dev, "ASoC: old version of manifest\n"); |