All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Jiada Wang <jiada_wang@mentor.com>,
	Timo Wischer <twischer@de.adit-jv.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>,
	Dragos Tarcatu <dragos_tarcatu@mentor.com>
Subject: [PATCH 04/13] ASoC: rsnd: add support for 8 bit S8 format
Date: Mon, 3 Sep 2018 07:06:29 +0000	[thread overview]
Message-ID: <877ek3f4md.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87d0tvf4q0.wl-kuninori.morimoto.gx@renesas.com>


From: Dragos Tarcatu <dragos_tarcatu@mentor.com>

This patch adds support for SNDRV_PCM_FMTBIT_S8 format.

Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
---
 sound/soc/sh/rcar/core.c | 10 +++++++---
 sound/soc/sh/rcar/ssi.c  |  3 +++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 8a41776..cd0ff1e 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -102,7 +102,9 @@
 #include "rsnd.h"
 
 #define RSND_RATES SNDRV_PCM_RATE_8000_192000
-#define RSND_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
+#define RSND_FMTS (SNDRV_PCM_FMTBIT_S8 |\
+		   SNDRV_PCM_FMTBIT_S16_LE |\
+		   SNDRV_PCM_FMTBIT_S24_LE)
 
 static const struct of_device_id rsnd_of_match[] = {
 	{ .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 },
@@ -280,6 +282,8 @@ u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
 	struct device *dev = rsnd_priv_to_dev(priv);
 
 	switch (snd_pcm_format_width(runtime->format)) {
+	case 8:
+		return 16 << 16;
 	case 16:
 		return 8 << 16;
 	case 24:
@@ -331,7 +335,7 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
 		target = cmd ? cmd : ssiu;
 	}
 
-	/* Non target mod or 24bit data needs normal DALIGN */
+	/* Non target mod or non 16bit needs normal DALIGN */
 	if ((snd_pcm_format_width(runtime->format) != 16) ||
 	    (mod != target))
 		return 0x76543210;
@@ -367,7 +371,7 @@ u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod)
 	 * HW    24bit data is located as 0x******00
 	 *
 	 */
-	if (snd_pcm_format_width(runtime->format) == 16)
+	if (snd_pcm_format_width(runtime->format) != 24)
 		return 0;
 
 	for (i = 0; i < ARRAY_SIZE(playback_mods); i++) {
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index f707f53..765ecc0 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -400,6 +400,9 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,
 
 	cr_own &= ~DWL_MASK;
 	switch (snd_pcm_format_width(runtime->format)) {
+	case 8:
+		cr_own |= DWL_8;
+		break;
 	case 16:
 		cr_own |= DWL_16;
 		break;
-- 
2.7.4

  parent reply	other threads:[~2018-09-03  7:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03  7:04 [PATCH 00/13] ASoC: add full BUSIF support Kuninori Morimoto
2018-09-03  7:05 ` [PATCH 01/13] ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime() Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime()" to the asoc tree Mark Brown
2018-09-03  7:05 ` [PATCH 02/13] ASoC: rsnd: add support for 16/24 bit slot widths Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add support for 16/24 bit slot widths" to the asoc tree Mark Brown
2018-09-03  7:06 ` [PATCH 03/13] ASoC: rsnd: add support for the DSP_A/DSP_B formats Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: add support for the DSP_A/DSP_B formats" to the asoc tree Mark Brown
2018-09-03  7:06 ` Kuninori Morimoto [this message]
2018-09-03 13:46   ` Applied "ASoC: rsnd: add support for 8 bit S8 format" " Mark Brown
2018-09-03  7:06 ` [PATCH 05/13] ASoC: rsnd: remove is_play parameter from hw_rule function Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: remove is_play parameter from hw_rule function" to the asoc tree Mark Brown
2018-09-03  7:07 ` [PATCH 06/13] ASoC: rsnd: ssi: Fix issue in dma data address assignment Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssi: Fix issue in dma data address assignment" to the asoc tree Mark Brown
2018-09-03  7:07 ` [PATCH 07/13] ASoC: rsnd: ssi: Check runtime channel number rather than hw_params Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssi: Check runtime channel number rather than hw_params" to the asoc tree Mark Brown
2018-09-03  7:07 ` [PATCH 08/13] ASoc: rsnd: dma: Calculate dma address with consider of BUSIF Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoc: rsnd: dma: Calculate dma address with consider of BUSIF" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 09/13] ASoc: rsnd: dma: Calculate PDMACHCRE with consider of BUSIF Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoc: rsnd: dma: Calculate PDMACHCRE with consider of BUSIF" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 10/13] ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0 Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 11/13] ASoC: rsnd: ssiu: Support to init different BUSIF instance Kuninori Morimoto
2018-09-03 13:45   ` Applied "ASoC: rsnd: ssiu: Support to init different BUSIF instance" to the asoc tree Mark Brown
2018-09-03  7:08 ` [PATCH 12/13] ASoC: rsnd: fixup not to call clk_get/set under non-atomic Kuninori Morimoto
2018-09-03 13:36   ` Mark Brown
2018-09-04  0:15     ` Kuninori Morimoto
2018-09-03 13:46   ` Applied "ASoC: rsnd: fixup not to call clk_get/set under non-atomic" to the asoc tree Mark Brown
2018-09-03 13:46     ` Mark Brown
2018-09-03  7:09 ` [PATCH 13/13] ASoC: rsnd: merge .nolock_start and .prepare Kuninori Morimoto
2018-09-03 13:44   ` Applied "ASoC: rsnd: merge .nolock_start and .prepare" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ek3f4md.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dragos_tarcatu@mentor.com \
    --cc=hiroyuki.yokoyama.vx@renesas.com \
    --cc=jiada_wang@mentor.com \
    --cc=twischer@de.adit-jv.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.