From d8302aa6b53acbe421fe615b9d704fd813623e96 Mon Sep 17 00:00:00 2001 From: Lori Hikichi Date: Thu, 28 Sep 2017 15:29:32 -0700 Subject: ASoC: cygnus: Add EXPORT_SYMBOL for helper function The helper function cygnus_ssp_set_custom_fsync_width() is intended to be called from an ASoC machine driver, need to export symbol if using modules. Signed-off-by: Lori Hikichi Signed-off-by: Mark Brown --- sound/soc/bcm/cygnus-ssp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/soc/bcm') diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index 15c438f..e9c73a4 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -842,6 +842,7 @@ int cygnus_ssp_set_custom_fsync_width(struct snd_soc_dai *cpu_dai, int len) return -EINVAL; } } +EXPORT_SYMBOL_GPL(cygnus_ssp_set_custom_fsync_width); static int cygnus_ssp_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) { -- cgit v1.1 From fcf30f3b4377d2475aa709ce28964461990c3caa Mon Sep 17 00:00:00 2001 From: Lori Hikichi Date: Thu, 28 Sep 2017 15:29:34 -0700 Subject: ASoC: cygnus: Remove set_fmt from SPDIF dai ops The SPDIF port cannot modify its format so a set_fmt function is not needed. Previously, we used a generic set_fmt for all ports and returned an error code for the SPDIF port. It is cleaner to not populate the set_fmt field. Signed-off-by: Lori Hikichi Signed-off-by: Mark Brown --- sound/soc/bcm/cygnus-ssp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sound/soc/bcm') diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index e9c73a4..da14fac 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -1137,6 +1137,13 @@ static const struct snd_soc_dai_ops cygnus_ssp_dai_ops = { .set_tdm_slot = cygnus_set_dai_tdm_slot, }; +static const struct snd_soc_dai_ops cygnus_spdif_dai_ops = { + .startup = cygnus_ssp_startup, + .shutdown = cygnus_ssp_shutdown, + .trigger = cygnus_ssp_trigger, + .hw_params = cygnus_ssp_hw_params, + .set_sysclk = cygnus_ssp_set_sysclk, +}; #define INIT_CPU_DAI(num) { \ .name = "cygnus-ssp" #num, \ @@ -1175,7 +1182,7 @@ static const struct snd_soc_dai_driver cygnus_spdif_dai_info = { .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, }, - .ops = &cygnus_ssp_dai_ops, + .ops = &cygnus_spdif_dai_ops, .suspend = cygnus_ssp_suspend, .resume = cygnus_ssp_resume, }; -- cgit v1.1 From 934e4885cb958566a34124e5a1dad2f9212a8ec6 Mon Sep 17 00:00:00 2001 From: Lori Hikichi Date: Thu, 28 Sep 2017 15:29:35 -0700 Subject: ASoC: cygnus: Remove support for 8 bit audio and for mono These modes of operation were not working properly and it is unclear if the hardware could fully support these modes properly. There is little to be gained by enabling these modes, therefore, we will just remove support. Signed-off-by: Lori Hikichi Signed-off-by: Mark Brown --- sound/soc/bcm/cygnus-ssp.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'sound/soc/bcm') diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index da14fac..cd8aef8 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -655,23 +655,10 @@ static int cygnus_ssp_hw_params(struct snd_pcm_substream *substream, if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { value = readl(aio->cygaud->audio + aio->regs.bf_sourcech_cfg); value &= ~BIT(BF_SRC_CFGX_BUFFER_PAIR_ENABLE); - /* Configure channels as mono or stereo/TDM */ - if (params_channels(params) == 1) - value |= BIT(BF_SRC_CFGX_SAMPLE_CH_MODE); - else - value &= ~BIT(BF_SRC_CFGX_SAMPLE_CH_MODE); + value &= ~BIT(BF_SRC_CFGX_SAMPLE_CH_MODE); writel(value, aio->cygaud->audio + aio->regs.bf_sourcech_cfg); switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S8: - if (aio->port_type == PORT_SPDIF) { - dev_err(aio->cygaud->dev, - "SPDIF does not support 8bit format\n"); - return -EINVAL; - } - bitres = 8; - break; - case SNDRV_PCM_FORMAT_S16_LE: bitres = 16; break; @@ -1148,11 +1135,10 @@ static const struct snd_soc_dai_ops cygnus_spdif_dai_ops = { #define INIT_CPU_DAI(num) { \ .name = "cygnus-ssp" #num, \ .playback = { \ - .channels_min = 1, \ + .channels_min = 2, \ .channels_max = 16, \ .rates = SNDRV_PCM_RATE_KNOT, \ - .formats = SNDRV_PCM_FMTBIT_S8 | \ - SNDRV_PCM_FMTBIT_S16_LE | \ + .formats = SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S32_LE, \ }, \ .capture = { \ @@ -1160,7 +1146,7 @@ static const struct snd_soc_dai_ops cygnus_spdif_dai_ops = { .channels_max = 16, \ .rates = SNDRV_PCM_RATE_KNOT, \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \ - SNDRV_PCM_FMTBIT_S32_LE, \ + SNDRV_PCM_FMTBIT_S32_LE, \ }, \ .ops = &cygnus_ssp_dai_ops, \ .suspend = cygnus_ssp_suspend, \ -- cgit v1.1 From 4c75968a1bbfb3f190e2e624c83929451e4730ac Mon Sep 17 00:00:00 2001 From: Christos Gkekas Date: Sun, 8 Oct 2017 19:20:30 +0100 Subject: ASoC: cygnus: Remove unnecessary active_slots check Variable active_slots is unsigned so checking whether it is less than zero is not necessary. Signed-off-by: Christos Gkekas Signed-off-by: Mark Brown --- sound/soc/bcm/cygnus-ssp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/bcm') diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index cd8aef8..abafadc 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -986,7 +986,7 @@ static int cygnus_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, active_slots = hweight32(tx_mask); - if ((active_slots < 0) || (active_slots > 16)) + if (active_slots > 16) return -EINVAL; /* Slot value must be even */ -- cgit v1.1