Merge remote-tracking branches 'asoc/topic/topology', 'asoc/topic/wm2000', 'asoc...
authorMark Brown <broonie@kernel.org>
Mon, 26 Oct 2015 02:16:18 +0000 (11:16 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 26 Oct 2015 02:16:18 +0000 (11:16 +0900)
include/uapi/sound/asoc.h
sound/soc/codecs/wm2000.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8903.c
sound/soc/soc-topology.c

index 247c50bd60f0d067ad8884dbe4574adf0bfcf596..26539a7e488081933f151c570220ff4561deec40 100644 (file)
@@ -83,7 +83,7 @@
 #define SND_SOC_TPLG_NUM_TEXTS         16
 
 /* ABI version */
-#define SND_SOC_TPLG_ABI_VERSION       0x3
+#define SND_SOC_TPLG_ABI_VERSION       0x4
 
 /* Max size of TLV data */
 #define SND_SOC_TPLG_TLV_SIZE          32
 #define SND_SOC_TPLG_TYPE_PCM          7
 #define SND_SOC_TPLG_TYPE_MANIFEST     8
 #define SND_SOC_TPLG_TYPE_CODEC_LINK   9
-#define SND_SOC_TPLG_TYPE_PDATA                10
+#define SND_SOC_TPLG_TYPE_BACKEND_LINK 10
+#define SND_SOC_TPLG_TYPE_PDATA                11
 #define SND_SOC_TPLG_TYPE_MAX  SND_SOC_TPLG_TYPE_PDATA
 
 /* vendor block IDs - please add new vendor types to end */
@@ -198,7 +199,7 @@ struct snd_soc_tplg_ctl_hdr {
 struct snd_soc_tplg_stream_caps {
        __le32 size;            /* in bytes of this structure */
        char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
-       __le64 formats[SND_SOC_TPLG_MAX_FORMATS];       /* supported formats SNDRV_PCM_FMTBIT_* */
+       __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
        __le32 rates;           /* supported rates SNDRV_PCM_RATE_* */
        __le32 rate_min;        /* min rate */
        __le32 rate_max;        /* max rate */
@@ -217,23 +218,12 @@ struct snd_soc_tplg_stream_caps {
  */
 struct snd_soc_tplg_stream {
        __le32 size;            /* in bytes of this structure */
+       char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* Name of the stream */
        __le64 format;          /* SNDRV_PCM_FMTBIT_* */
        __le32 rate;            /* SNDRV_PCM_RATE_* */
        __le32 period_bytes;    /* size of period in bytes */
        __le32 buffer_bytes;    /* size of buffer in bytes */
        __le32 channels;        /* channels */
-       __le32 tdm_slot;        /* optional BE bitmask of supported TDM slots */
-       __le32 dai_fmt;         /* SND_SOC_DAIFMT_  */
-} __attribute__((packed));
-
-/*
- * Duplex stream configuration supported by SW/FW.
- */
-struct snd_soc_tplg_stream_config {
-       __le32 size;            /* in bytes of this structure */
-       char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
-       struct snd_soc_tplg_stream playback;
-       struct snd_soc_tplg_stream capture;
 } __attribute__((packed));
 
 /*
@@ -366,11 +356,11 @@ struct snd_soc_tplg_dapm_widget {
        __le32 shift;           /* bits to shift */
        __le32 mask;            /* non-shifted mask */
        __le32 subseq;          /* sort within widget type */
-       __u32 invert;           /* invert the power bit */
-       __u32 ignore_suspend;   /* kept enabled over suspend */
-       __u16 event_flags;
-       __u16 event_type;
-       __u16 num_kcontrols;
+       __le32 invert;          /* invert the power bit */
+       __le32 ignore_suspend;  /* kept enabled over suspend */
+       __le16 event_flags;
+       __le16 event_type;
+       __le32 num_kcontrols;
        struct snd_soc_tplg_private priv;
        /*
         * kcontrols that relate to this widget
@@ -378,30 +368,46 @@ struct snd_soc_tplg_dapm_widget {
         */
 } __attribute__((packed));
 
-struct snd_soc_tplg_pcm_cfg_caps {
-       struct snd_soc_tplg_stream_caps caps;
-       struct snd_soc_tplg_stream_config configs[SND_SOC_TPLG_STREAM_CONFIG_MAX];
-       __le32 num_configs;     /* number of configs */
-} __attribute__((packed));
 
 /*
- * Describes SW/FW specific features of PCM or DAI link.
+ * Describes SW/FW specific features of PCM (FE DAI & DAI link).
  *
- * File block representation for PCM/DAI-Link :-
+ * File block representation for PCM :-
  * +-----------------------------------+-----+
  * | struct snd_soc_tplg_hdr           |  1  |
  * +-----------------------------------+-----+
- * | struct snd_soc_tplg_dapm_pcm_dai  |  N  |
+ * | struct snd_soc_tplg_pcm           |  N  |
  * +-----------------------------------+-----+
  */
-struct snd_soc_tplg_pcm_dai {
+struct snd_soc_tplg_pcm {
        __le32 size;            /* in bytes of this structure */
-       char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
-       __le32 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_pcm_cfg_caps capconf[2];    /* capabilities and configs */
+       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 */
+       __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 caps[2]; /* playback and capture for DAI */
 } __attribute__((packed));
 
+
+/*
+ * Describes the BE or CC link runtime supported configs or params
+ *
+ * File block representation for BE/CC link config :-
+ * +-----------------------------------+-----+
+ * | struct snd_soc_tplg_hdr           |  1  |
+ * +-----------------------------------+-----+
+ * | struct snd_soc_tplg_link_config   |  N  |
+ * +-----------------------------------+-----+
+ */
+struct snd_soc_tplg_link_config {
+       __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 */
+} __attribute__((packed));
 #endif
index 786abd02b1406af3a6b653d22b70742686f2650d..a67ea10f41a1adce51e3625986e1170904429837 100644 (file)
@@ -620,7 +620,7 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol,
 {
        struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
        struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
-       int anc_active = ucontrol->value.integer.value[0];
+       unsigned int anc_active = ucontrol->value.integer.value[0];
        int ret;
 
        if (anc_active > 1)
@@ -653,7 +653,7 @@ static int wm2000_speaker_put(struct snd_kcontrol *kcontrol,
 {
        struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
        struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
-       int val = ucontrol->value.integer.value[0];
+       unsigned int val = ucontrol->value.integer.value[0];
        int ret;
 
        if (val > 1)
index ace8645245a0c1765bde0d516a4a1067dec2a755..07cf1bd7913a8dfe4667e310fcb44536f8e4004c 100644 (file)
@@ -132,7 +132,7 @@ static int wm8731_put_deemph(struct snd_kcontrol *kcontrol,
 {
        struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
        struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
-       int deemph = ucontrol->value.integer.value[0];
+       unsigned int deemph = ucontrol->value.integer.value[0];
        int ret = 0;
 
        if (deemph > 1)
index b011253459af98f57fd87b574fa02164cf38830a..e4cc41e6c23e333cbb771d6f1da91c19c5ff6079 100644 (file)
@@ -452,7 +452,7 @@ static int wm8903_put_deemph(struct snd_kcontrol *kcontrol,
 {
        struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
        struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
-       int deemph = ucontrol->value.integer.value[0];
+       unsigned int deemph = ucontrol->value.integer.value[0];
        int ret = 0;
 
        if (deemph > 1)
index 69d01cd925ce28fb5fc5e798880f391ec207fff0..8d7ec80af51b499738dc2032356896a08144078a 100644 (file)
@@ -1558,7 +1558,7 @@ static int soc_tplg_pcm_dai_elems_load(struct soc_tplg *tplg,
        pcm_dai = (struct snd_soc_tplg_pcm_dai *)tplg->pos;
 
        if (soc_tplg_check_elem_count(tplg,
-               sizeof(struct snd_soc_tplg_pcm_dai), count,
+               sizeof(struct snd_soc_tplg_pcm), count,
                hdr->payload_size, "PCM DAI")) {
                dev_err(tplg->dev, "ASoC: invalid count %d for PCM DAI elems\n",
                        count);
@@ -1566,7 +1566,7 @@ static int soc_tplg_pcm_dai_elems_load(struct soc_tplg *tplg,
        }
 
        dev_dbg(tplg->dev, "ASoC: adding %d PCM DAIs\n", count);
-       tplg->pos += sizeof(struct snd_soc_tplg_pcm_dai) * count;
+       tplg->pos += sizeof(struct snd_soc_tplg_pcm) * count;
 
        dobj = kzalloc(sizeof(struct snd_soc_dobj), GFP_KERNEL);
        if (dobj == NULL)