Loading sound/soc/msm/mdm9650.c +34 −0 Original line number Diff line number Diff line Loading @@ -702,6 +702,30 @@ static int mdm_sec_mi2s_rate_put(struct snd_kcontrol *kcontrol, return 0; } static inline int param_is_mask(int p) { return (p >= SNDRV_PCM_HW_PARAM_FIRST_MASK) && (p <= SNDRV_PCM_HW_PARAM_LAST_MASK); } static inline struct snd_mask *param_to_mask(struct snd_pcm_hw_params *p, int n) { return &(p->masks[n - SNDRV_PCM_HW_PARAM_FIRST_MASK]); } static void param_set_mask(struct snd_pcm_hw_params *p, int n, unsigned bit) { if (bit >= SNDRV_MASK_MAX) return; if (param_is_mask(n)) { struct snd_mask *m = param_to_mask(p, n); m->bits[0] = 0; m->bits[1] = 0; m->bits[bit >> 5] |= (1 << (bit & 31)); } } static int mdm_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, struct snd_pcm_hw_params *params) { Loading @@ -709,6 +733,8 @@ static int mdm_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_mi2s_rate; channels->min = channels->max = mdm_mi2s_rx_ch; return 0; Loading @@ -721,6 +747,8 @@ static int mdm_sec_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_sec_mi2s_rate; channels->min = channels->max = mdm_sec_mi2s_rx_ch; return 0; Loading @@ -733,6 +761,8 @@ static int mdm_mi2s_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_mi2s_rate; channels->min = channels->max = mdm_mi2s_tx_ch; return 0; Loading @@ -745,6 +775,8 @@ static int mdm_sec_mi2s_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_sec_mi2s_rate; channels->min = channels->max = mdm_sec_mi2s_tx_ch; return 0; Loading @@ -755,6 +787,8 @@ static int mdm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, { struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = MDM_MI2S_RATE; return 0; } Loading Loading
sound/soc/msm/mdm9650.c +34 −0 Original line number Diff line number Diff line Loading @@ -702,6 +702,30 @@ static int mdm_sec_mi2s_rate_put(struct snd_kcontrol *kcontrol, return 0; } static inline int param_is_mask(int p) { return (p >= SNDRV_PCM_HW_PARAM_FIRST_MASK) && (p <= SNDRV_PCM_HW_PARAM_LAST_MASK); } static inline struct snd_mask *param_to_mask(struct snd_pcm_hw_params *p, int n) { return &(p->masks[n - SNDRV_PCM_HW_PARAM_FIRST_MASK]); } static void param_set_mask(struct snd_pcm_hw_params *p, int n, unsigned bit) { if (bit >= SNDRV_MASK_MAX) return; if (param_is_mask(n)) { struct snd_mask *m = param_to_mask(p, n); m->bits[0] = 0; m->bits[1] = 0; m->bits[bit >> 5] |= (1 << (bit & 31)); } } static int mdm_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, struct snd_pcm_hw_params *params) { Loading @@ -709,6 +733,8 @@ static int mdm_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_mi2s_rate; channels->min = channels->max = mdm_mi2s_rx_ch; return 0; Loading @@ -721,6 +747,8 @@ static int mdm_sec_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_sec_mi2s_rate; channels->min = channels->max = mdm_sec_mi2s_rx_ch; return 0; Loading @@ -733,6 +761,8 @@ static int mdm_mi2s_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_mi2s_rate; channels->min = channels->max = mdm_mi2s_tx_ch; return 0; Loading @@ -745,6 +775,8 @@ static int mdm_sec_mi2s_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = mdm_sec_mi2s_rate; channels->min = channels->max = mdm_sec_mi2s_tx_ch; return 0; Loading @@ -755,6 +787,8 @@ static int mdm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rt, { struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_FORMAT_S16_LE); rate->min = rate->max = MDM_MI2S_RATE; return 0; } Loading