From e8883cb61aa0a91980222e5e9d114100783eb7e2 Mon Sep 17 00:00:00 2001 From: Dharageswari R Date: Wed, 31 May 2017 10:30:26 +0530 Subject: ASoC: Intel: Boards: Add 4-channel DMIC fixup. This patch adds a 4-channel dmic fixup so that DMIC copier will receive 4 channel data and further selection will be done by mic-select module. Signed-off-by: Dharageswari R Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/boards/bxt_rt298.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sound/soc/intel/boards/bxt_rt298.c') diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 1a68d04..36ee748 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -222,16 +222,13 @@ static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd, { struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); - if (params_channels(params) == 2) - channels->min = channels->max = 2; - else - channels->min = channels->max = 4; + channels->min = channels->max = 4; return 0; } static unsigned int channels_dmic[] = { - 2, 4, + 1, 2, 3, 4, }; static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { -- cgit v1.1 From 21031d531eb33a6ad0251ff661a539802700c6e5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 14 Jun 2017 09:33:06 +0200 Subject: ASoC: intel: bxt: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- sound/soc/intel/boards/bxt_rt298.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sound/soc/intel/boards/bxt_rt298.c') diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 36ee748..0c3a3cb 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -207,11 +207,11 @@ static const struct snd_soc_ops broxton_rt298_ops = { .hw_params = broxton_rt298_hw_params, }; -static unsigned int rates[] = { +static const unsigned int rates[] = { 48000, }; -static struct snd_pcm_hw_constraint_list constraints_rates = { +static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, @@ -227,11 +227,11 @@ static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } -static unsigned int channels_dmic[] = { +static const unsigned int channels_dmic[] = { 1, 2, 3, 4, }; -static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { +static const struct snd_pcm_hw_constraint_list constraints_dmic_channels = { .count = ARRAY_SIZE(channels_dmic), .list = channels_dmic, .mask = 0, @@ -253,11 +253,11 @@ static const struct snd_soc_ops broxton_dmic_ops = { .startup = broxton_dmic_startup, }; -static unsigned int channels[] = { +static const unsigned int channels[] = { 2, }; -static struct snd_pcm_hw_constraint_list constraints_channels = { +static const struct snd_pcm_hw_constraint_list constraints_channels = { .count = ARRAY_SIZE(channels), .list = channels, .mask = 0, -- cgit v1.1