Merge remote-tracking branch 'asoc/topic/dapm' into for-tiwai
authorMark Brown <broonie@linaro.org>
Thu, 16 Jan 2014 12:42:53 +0000 (12:42 +0000)
committerMark Brown <broonie@linaro.org>
Thu, 16 Jan 2014 12:42:53 +0000 (12:42 +0000)
1  2 
include/sound/soc-dai.h
include/sound/soc-dapm.h
sound/soc/soc-core.c
sound/soc/soc-utils.c

diff --combined include/sound/soc-dai.h
@@@ -123,6 -123,8 +123,8 @@@ int snd_soc_dai_set_tristate(struct snd
  int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
                             int direction);
  
+ int snd_soc_dai_is_dummy(struct snd_soc_dai *dai);
  struct snd_soc_dai_ops {
        /*
         * DAI clocking configuration, all optional.
@@@ -220,8 -222,6 +222,8 @@@ struct snd_soc_dai_driver 
        struct snd_soc_pcm_stream capture;
        struct snd_soc_pcm_stream playback;
        unsigned int symmetric_rates:1;
 +      unsigned int symmetric_channels:1;
 +      unsigned int symmetric_samplebits:1;
  
        /* probe ordering - for components with runtime dependencies */
        int probe_order;
@@@ -246,8 -246,6 +248,8 @@@ struct snd_soc_dai 
        unsigned int capture_active:1;          /* stream is in use */
        unsigned int playback_active:1;         /* stream is in use */
        unsigned int symmetric_rates:1;
 +      unsigned int symmetric_channels:1;
 +      unsigned int symmetric_samplebits:1;
        struct snd_pcm_runtime *runtime;
        unsigned int active;
        unsigned char probed:1;
  
        /* Symmetry data - only valid if symmetry is being enforced */
        unsigned int rate;
 +      unsigned int channels;
 +      unsigned int sample_bits;
  
        /* parent platform/codec */
        struct snd_soc_platform *platform;
diff --combined include/sound/soc-dapm.h
@@@ -104,8 -104,7 +104,8 @@@ struct device
        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
        .kcontrol_news = wcontrols, .num_kcontrols = 1}
  #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
 -{     .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \
 +{     .id = snd_soc_dapm_mux, .name = wname, \
 +      SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
        .kcontrol_news = wcontrols, .num_kcontrols = 1}
  #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
  {     .id = snd_soc_dapm_virt_mux, .name = wname, \
@@@ -412,6 -411,7 +412,7 @@@ int snd_soc_dapm_new_controls(struct sn
  int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
                                 struct snd_soc_dai *dai);
  int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
+ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
  int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
                         const struct snd_soc_pcm_stream *params,
                         struct snd_soc_dapm_widget *source,
diff --combined sound/soc/soc-core.c
@@@ -1728,6 -1728,7 +1728,7 @@@ static int snd_soc_instantiate_card(str
        }
  
        snd_soc_dapm_link_dai_widgets(card);
+       snd_soc_dapm_connect_dai_link_widgets(card);
  
        if (card->controls)
                snd_soc_add_card_controls(card, card->controls, card->num_controls);
@@@ -3212,11 -3213,11 +3213,11 @@@ int snd_soc_bytes_get(struct snd_kcontr
                        break;
                case 2:
                        ((u16 *)(&ucontrol->value.bytes.data))[0]
 -                              &= ~params->mask;
 +                              &= cpu_to_be16(~params->mask);
                        break;
                case 4:
                        ((u32 *)(&ucontrol->value.bytes.data))[0]
 -                              &= ~params->mask;
 +                              &= cpu_to_be32(~params->mask);
                        break;
                default:
                        return -EINVAL;
@@@ -3484,7 -3485,7 +3485,7 @@@ int snd_soc_dai_set_sysclk(struct snd_s
                return dai->codec->driver->set_sysclk(dai->codec, clk_id, 0,
                                                      freq, dir);
        else
 -              return -EINVAL;
 +              return -ENOTSUPP;
  }
  EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk);
  
@@@ -3505,7 -3506,7 +3506,7 @@@ int snd_soc_codec_set_sysclk(struct snd
                return codec->driver->set_sysclk(codec, clk_id, source,
                                                 freq, dir);
        else
 -              return -EINVAL;
 +              return -ENOTSUPP;
  }
  EXPORT_SYMBOL_GPL(snd_soc_codec_set_sysclk);
  
@@@ -4617,14 -4618,10 +4618,14 @@@ int snd_soc_of_get_dai_name(struct devi
  
                        if (id < 0 || id >= pos->num_dai) {
                                ret = -EINVAL;
 -                      } else {
 -                              *dai_name = pos->dai_drv[id].name;
 -                              ret = 0;
 +                              break;
                        }
 +
 +                      ret = 0;
 +
 +                      *dai_name = pos->dai_drv[id].name;
 +                      if (!*dai_name)
 +                              *dai_name = pos->name;
                }
  
                break;
diff --combined sound/soc/soc-utils.c
@@@ -59,6 -59,10 +59,6 @@@ int snd_soc_params_to_bclk(struct snd_p
  EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk);
  
  static const struct snd_pcm_hardware dummy_dma_hardware = {
 -      .formats                = 0xffffffff,
 -      .channels_min           = 1,
 -      .channels_max           = UINT_MAX,
 -
        /* Random values to keep userspace happy when checking constraints */
        .info                   = SNDRV_PCM_INFO_INTERLEAVED |
                                  SNDRV_PCM_INFO_BLOCK_TRANSFER,
@@@ -119,6 -123,13 +119,13 @@@ static struct snd_soc_dai_driver dummy_
         },
  };
  
+ int snd_soc_dai_is_dummy(struct snd_soc_dai *dai)
+ {
+       if (dai->driver == &dummy_dai)
+               return 1;
+       return 0;
+ }
  static int snd_soc_dummy_probe(struct platform_device *pdev)
  {
        int ret;