Merge branch 'fix/intel' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorMark Brown <broonie@kernel.org>
Thu, 5 Feb 2015 20:18:39 +0000 (20:18 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 5 Feb 2015 20:18:39 +0000 (20:18 +0000)
Conflicts:
sound/soc/intel/sst/sst_acpi.c

1  2 
sound/soc/intel/Kconfig
sound/soc/intel/bytcr_dpcm_rt5640.c
sound/soc/intel/sst-firmware.c
sound/soc/intel/sst-haswell-ipc.c

diff --combined sound/soc/intel/Kconfig
@@@ -46,7 -46,7 +46,7 @@@ config SND_SOC_INTEL_BAYTRAI
  
  config SND_SOC_INTEL_HASWELL_MACH
        tristate "ASoC Audio DSP support for Intel Haswell Lynxpoint"
 -      depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && I2C && \\
 +      depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && I2C && \
                   I2C_DESIGNWARE_PLATFORM
        select SND_SOC_INTEL_HASWELL
        select SND_SOC_RT5640
@@@ -76,7 -76,7 +76,7 @@@ config SND_SOC_INTEL_BYT_MAX98090_MAC
  
  config SND_SOC_INTEL_BROADWELL_MACH
        tristate "ASoC Audio DSP support for Intel Broadwell Wildcatpoint"
 -      depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && DW_DMAC && \\
 +      depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && DW_DMAC && \
                   I2C_DESIGNWARE_PLATFORM
        select SND_SOC_INTEL_HASWELL
        select SND_COMPRESS_OFFLOAD
@@@ -89,7 -89,7 +89,7 @@@
  
  config SND_SOC_INTEL_BYTCR_RT5640_MACH
        tristate "ASoC Audio DSP Support for MID BYT Platform"
-       depends on X86
+       depends on X86 && I2C
        select SND_SOC_RT5640
        select SND_SST_MFLD_PLATFORM
        select SND_SST_IPC_ACPI
  
  config SND_SOC_INTEL_CHT_BSW_RT5672_MACH
          tristate "ASoC Audio driver for Intel Cherrytrail & Braswell with RT5672 codec"
-         depends on X86_INTEL_LPSS
+         depends on X86_INTEL_LPSS && I2C
          select SND_SOC_RT5670
          select SND_SST_MFLD_PLATFORM
          select SND_SST_IPC_ACPI
            platforms with RT5672 audio codec.
            Say Y if you have such a device
            If unsure select "N".
 +
 +config SND_SOC_INTEL_CHT_BSW_RT5645_MACH
 +      tristate "ASoC Audio driver for Intel Cherrytrail & Braswell with RT5645 codec"
 +      depends on X86_INTEL_LPSS
 +      select SND_SOC_RT5645
 +      select SND_SST_MFLD_PLATFORM
 +      select SND_SST_IPC_ACPI
 +      help
 +        This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell
 +        platforms with RT5645 audio codec.
 +        If unsure select "N".
@@@ -215,6 -215,7 +215,6 @@@ static int snd_byt_mc_probe(struct plat
  
  static struct platform_driver snd_byt_mc_driver = {
        .driver = {
 -              .owner = THIS_MODULE,
                .name = "bytt100_rt5640",
                .pm = &snd_soc_pm_ops,
        },
@@@ -226,4 -227,4 +226,4 @@@ module_platform_driver(snd_byt_mc_drive
  MODULE_DESCRIPTION("ASoC Intel(R) Baytrail CR Machine driver");
  MODULE_AUTHOR("Subhransu S. Prusty <subhransu.s.prusty@intel.com>");
  MODULE_LICENSE("GPL v2");
- MODULE_ALIAS("platform:bytrt5640-audio");
+ MODULE_ALIAS("platform:bytt100_rt5640");
@@@ -497,7 -497,6 +497,7 @@@ struct sst_module *sst_module_new(struc
        sst_module->sst_fw = sst_fw;
        sst_module->scratch_size = template->scratch_size;
        sst_module->persistent_size = template->persistent_size;
 +      sst_module->entry = template->entry;
  
        INIT_LIST_HEAD(&sst_module->block_list);
        INIT_LIST_HEAD(&sst_module->runtime_list);
@@@ -707,6 -706,7 +707,7 @@@ static int block_alloc_fixed(struct sst
        struct list_head *block_list)
  {
        struct sst_mem_block *block, *tmp;
+       struct sst_block_allocator ba_tmp = *ba;
        u32 end = ba->offset + ba->size, block_end;
        int err;
  
                if (ba->offset >= block->offset && ba->offset < block_end) {
  
                        /* align ba to block boundary */
-                       ba->size -= block_end - ba->offset;
-                       ba->offset = block_end;
-                       err = block_alloc_contiguous(dsp, ba, block_list);
+                       ba_tmp.size -= block_end - ba->offset;
+                       ba_tmp.offset = block_end;
+                       err = block_alloc_contiguous(dsp, &ba_tmp, block_list);
                        if (err < 0)
                                return -ENOMEM;
  
                /* does block span more than 1 section */
                if (ba->offset >= block->offset && ba->offset < block_end) {
  
+                       /* add block */
+                       list_move(&block->list, &dsp->used_block_list);
+                       list_add(&block->module_list, block_list);
                        /* align ba to block boundary */
-                       ba->offset = block->offset;
+                       ba_tmp.size -= block_end - ba->offset;
+                       ba_tmp.offset = block_end;
  
-                       err = block_alloc_contiguous(dsp, ba, block_list);
+                       err = block_alloc_contiguous(dsp, &ba_tmp, block_list);
                        if (err < 0)
                                return -ENOMEM;
  
@@@ -786,7 -790,6 +791,7 @@@ int sst_module_alloc_blocks(struct sst_
        struct sst_block_allocator ba;
        int ret;
  
 +      memset(&ba, 0, sizeof(ba));
        ba.size = module->size;
        ba.type = module->type;
        ba.offset = module->offset;
@@@ -860,7 -863,6 +865,7 @@@ int sst_module_runtime_alloc_blocks(str
        if (module->persistent_size == 0)
                return 0;
  
 +      memset(&ba, 0, sizeof(ba));
        ba.size = module->persistent_size;
        ba.type = SST_MEM_DRAM;
  
@@@ -94,8 -94,6 +94,8 @@@
  /* Mailbox */
  #define IPC_MAX_MAILBOX_BYTES 256
  
 +#define INVALID_STREAM_HW_ID  0xffffffff
 +
  /* Global Message - Types and Replies */
  enum ipc_glb_type {
        IPC_GLB_GET_FW_VERSION = 0,             /* Retrieves firmware version */
@@@ -277,6 -275,7 +277,6 @@@ struct sst_hsw 
        /* FW config */
        struct sst_hsw_ipc_fw_ready fw_ready;
        struct sst_hsw_ipc_fw_version version;
 -      struct sst_module *scratch;
        bool fw_done;
        struct sst_fw *sst_fw;
  
@@@ -652,11 -651,11 +652,11 @@@ static void hsw_notification_work(struc
        }
  
        /* tell DSP that notification has been handled */
-       sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IPCD,
+       sst_dsp_shim_update_bits(hsw->dsp, SST_IPCD,
                SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);
  
        /* unmask busy interrupt */
-       sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
+       sst_dsp_shim_update_bits(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
  }
  
  static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header)
@@@ -1209,7 -1208,6 +1209,7 @@@ struct sst_hsw_stream *sst_hsw_stream_n
                return NULL;
  
        spin_lock_irqsave(&sst->spinlock, flags);
 +      stream->reply.stream_hw_id = INVALID_STREAM_HW_ID;
        list_add(&stream->node, &hsw->stream_list);
        stream->notify_position = notify_position;
        stream->pdata = data;
@@@ -1230,6 -1228,11 +1230,11 @@@ int sst_hsw_stream_free(struct sst_hsw 
        struct sst_dsp *sst = hsw->dsp;
        unsigned long flags;
  
+       if (!stream) {
+               dev_warn(hsw->dev, "warning: stream is NULL, no stream to free, ignore it.\n");
+               return 0;
+       }
        /* dont free DSP streams that are not commited */
        if (!stream->commited)
                goto out;
@@@ -1417,6 -1420,16 +1422,16 @@@ int sst_hsw_stream_commit(struct sst_hs
        u32 header;
        int ret;
  
+       if (!stream) {
+               dev_warn(hsw->dev, "warning: stream is NULL, no stream to commit, ignore it.\n");
+               return 0;
+       }
+       if (stream->commited) {
+               dev_warn(hsw->dev, "warning: stream is already committed, ignore it.\n");
+               return 0;
+       }
        trace_ipc_request("stream alloc", stream->host_id);
  
        header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM);
@@@ -1521,6 -1534,11 +1536,11 @@@ int sst_hsw_stream_pause(struct sst_hs
  {
        int ret;
  
+       if (!stream) {
+               dev_warn(hsw->dev, "warning: stream is NULL, no stream to pause, ignore it.\n");
+               return 0;
+       }
        trace_ipc_request("stream pause", stream->reply.stream_hw_id);
  
        ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE,
@@@ -1537,6 -1555,11 +1557,11 @@@ int sst_hsw_stream_resume(struct sst_hs
  {
        int ret;
  
+       if (!stream) {
+               dev_warn(hsw->dev, "warning: stream is NULL, no stream to resume, ignore it.\n");
+               return 0;
+       }
        trace_ipc_request("stream resume", stream->reply.stream_hw_id);
  
        ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME,
@@@ -1552,6 -1575,11 +1577,11 @@@ int sst_hsw_stream_reset(struct sst_hs
  {
        int ret, tries = 10;
  
+       if (!stream) {
+               dev_warn(hsw->dev, "warning: stream is NULL, no stream to reset, ignore it.\n");
+               return 0;
+       }
        /* dont reset streams that are not commited */
        if (!stream->commited)
                return 0;
@@@ -2104,6 -2132,7 +2134,6 @@@ void sst_hsw_dsp_free(struct device *de
        dma_free_coherent(hsw->dsp->dma_dev, SST_HSW_DX_CONTEXT_SIZE,
                        hsw->dx_context, hsw->dx_context_paddr);
        sst_dsp_free(hsw->dsp);
 -      kfree(hsw->scratch);
        kthread_stop(hsw->tx_thread);
        kfree(hsw->msg);
  }