Merge remote-tracking branch 'asoc/topic/ux500' into for-3.7
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 22 Sep 2012 22:47:58 +0000 (18:47 -0400)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 22 Sep 2012 22:47:58 +0000 (18:47 -0400)
1  2 
sound/soc/codecs/ab8500-codec.c
sound/soc/ux500/ux500_msp_dai.c
sound/soc/ux500/ux500_msp_i2s.c

@@@ -2405,8 -2462,35 +2462,32 @@@ static int ab8500_codec_probe(struct sn
        dev_dbg(dev, "%s: Enter.\n", __func__);
  
        /* Setup AB8500 according to board-settings */
 -      pdata = (struct ab8500_platform_data *)dev_get_platdata(dev->parent);
 -
 -      /* Inform SoC Core that we have our own I/O arrangements. */
 -      codec->control_data = (void *)true;
 +      pdata = dev_get_platdata(dev->parent);
  
+       if (np) {
+               if (!pdata)
+                       pdata = devm_kzalloc(dev,
+                                       sizeof(struct ab8500_platform_data),
+                                       GFP_KERNEL);
+               if (pdata && !pdata->codec)
+                       pdata->codec
+                               = devm_kzalloc(dev,
+                                       sizeof(struct ab8500_codec_platform_data),
+                                       GFP_KERNEL);
+               if (!(pdata && pdata->codec))
+                       return -ENOMEM;
+               ab8500_codec_of_probe(dev, np, pdata->codec);
+       } else {
+               if (!(pdata && pdata->codec)) {
+                       dev_err(dev, "No codec platform data or DT found\n");
+                       return -EINVAL;
+               }
+       }
        status = ab8500_audio_setup_mics(codec, &pdata->codec->amics);
        if (status < 0) {
                pr_err("%s: Failed to setup mics (%d)!\n", __func__, status);
Simple merge
@@@ -665,20 -684,31 +684,33 @@@ int ux500_msp_i2s_init_msp(struct platf
  {
        struct resource *res = NULL;
        struct i2s_controller *i2s_cont;
+       struct device_node *np = pdev->dev.of_node;
        struct ux500_msp *msp;
  
-       dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__,
-               pdev->name, platform_data->id);
        *msp_p = devm_kzalloc(&pdev->dev, sizeof(struct ux500_msp), GFP_KERNEL);
        msp = *msp_p;
 +      if (!msp)
 +              return -ENOMEM;
  
+       if (np) {
+               if (!platform_data) {
+                       platform_data = devm_kzalloc(&pdev->dev,
+                               sizeof(struct msp_i2s_platform_data), GFP_KERNEL);
+                       if (!platform_data)
+                               ret = -ENOMEM;
+               }
+       } else
+               if (!platform_data)
+                       ret = -EINVAL;
+       if (ret)
+               goto err_res;
+       dev_dbg(&pdev->dev, "%s: Enter (name: %s, id: %d).\n", __func__,
+               pdev->name, platform_data->id);
        msp->id = platform_data->id;
        msp->dev = &pdev->dev;
-       msp->plat_init = platform_data->msp_i2s_init;
-       msp->plat_exit = platform_data->msp_i2s_exit;
        msp->dma_cfg_rx = platform_data->msp_i2s_dma_rx;
        msp->dma_cfg_tx = platform_data->msp_i2s_dma_tx;