static int mcbsp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); struct snd_soc_dai *cpu_dai = rtd->cpu_dai; unsigned int be_id; unsigned int threshold; unsigned int val, min_mask; DBG ("%s: Entered \n", __func__); //DBG ("%s: CPU DAI %s BE_ID %d\n", __func__, cpu_dai->name, rtd->dai_link->be_id); be_id = rtd->dai_link->be_id; switch (be_id) { case OMAP_ABE_DAI_MM_FM: channels->min = 2; threshold = 2; val = SNDRV_PCM_FORMAT_S16_LE; break; case OMAP_ABE_DAI_BT_VX: channels->min = 1; threshold = 1; val = SNDRV_PCM_FORMAT_S16_LE; break; default: threshold = 1; val = SNDRV_PCM_FORMAT_S16_LE; break; } min_mask = snd_mask_min(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK]); //DBG ("%s: Returned min_mask 0x%x Format %x\n", __func__, min_mask, val); snd_mask_reset(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK], min_mask); //DBG ("%s: Returned min_mask 0x%x Format %x\n", __func__, min_mask, val); snd_mask_set(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK], val); omap_mcbsp_set_tx_threshold(cpu_dai->id, threshold); omap_mcbsp_set_rx_threshold(cpu_dai->id, threshold); DBG ("%s: Exiting \n", __func__); return 0; }
static int mcbsp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); unsigned int val, min_mask; val = SNDRV_PCM_FORMAT_S16_LE; min_mask = snd_mask_min(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK]); snd_mask_reset(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK], min_mask); snd_mask_set(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK], val); return 0; }