Hi All,
This patch series has trivial changes for rz-ssi driver. Patches 1
(partial) & 2 are from series [3].
patch 1/3 is just a cosmetic change which was part of patch [0] where it
uses a do-while instead of while-do. Patch 2/3 is from series [1] where a
helper function is added and patch 3/3 is a new patch which removes
duplicate macros.
All the patches apply to [2] (sound -next)
[0] https://patchwork.kernel.org/project/alsa-devel/patch/
[email protected]/
[1] https://patchwork.kernel.org/project/alsa-devel/patch/
[email protected]/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/
[3] https://patchwork.kernel.org/project/alsa-devel/list/?series=605672
Cheers,
Prabhakar
Lad Prabhakar (3):
ASoC: sh: rz-ssi: Use a do-while loop in rz_ssi_pio_recv()
ASoC: sh: rz-ssi: Add rz_ssi_set_substream() helper function
ASoC: sh: rz-ssi: Remove duplicate macros
sound/soc/sh/rz-ssi.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
--
2.17.1
Use a do-while loop while reading the samples from RX FIFO. The "done"
flag was only changed as an outcome of the last if-statement (last step)
in this entire procedure. This patch moves the condition from if
statement to while and drops the "done" variable for readability.
While at it, also drop the unneeded parentheses around runtime->dma_area.
Signed-off-by: Lad Prabhakar <[email protected]>
---
Hi All,
This change was part of patch [0], as v1 series was applied I am just
sending the cosmetic changes from v2 for readability.
[0] https://patchwork.kernel.org/project/alsa-devel/patch/
[email protected]/
Cheers,
Prabhakar
---
sound/soc/sh/rz-ssi.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index 81e1786b827d..2c8775d37f50 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -408,7 +408,6 @@ static int rz_ssi_pio_recv(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
{
struct snd_pcm_substream *substream = strm->substream;
struct snd_pcm_runtime *runtime;
- bool done = false;
u16 *buf;
int fifo_samples;
int frames_left;
@@ -420,7 +419,7 @@ static int rz_ssi_pio_recv(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
runtime = substream->runtime;
- while (!done) {
+ do {
/* frames left in this period */
frames_left = runtime->period_size -
(strm->buffer_pos % runtime->period_size);
@@ -444,7 +443,7 @@ static int rz_ssi_pio_recv(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
break;
/* calculate new buffer index */
- buf = (u16 *)(runtime->dma_area);
+ buf = (u16 *)runtime->dma_area;
buf += strm->buffer_pos * runtime->channels;
/* Note, only supports 16-bit samples */
@@ -453,11 +452,7 @@ static int rz_ssi_pio_recv(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
rz_ssi_reg_mask_setl(ssi, SSIFSR, SSIFSR_RDF, 0);
rz_ssi_pointer_update(strm, samples / runtime->channels);
-
- /* check if there are no more samples in the RX FIFO */
- if (!(!frames_left && fifo_samples >= runtime->channels))
- done = true;
- }
+ } while (!frames_left && fifo_samples >= runtime->channels);
return 0;
}
--
2.17.1
Remove SSICR_MST and SSICR_CKDV macros which are defined more than once.
Signed-off-by: Lad Prabhakar <[email protected]>
---
sound/soc/sh/rz-ssi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index 1a46c9f3c4e5..e8edaed05d4c 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -28,8 +28,6 @@
/* SSI REGISTER BITS */
#define SSICR_DWL(x) (((x) & 0x7) << 19)
#define SSICR_SWL(x) (((x) & 0x7) << 16)
-#define SSICR_MST BIT(14)
-#define SSICR_CKDV(x) (((x) & 0xf) << 4)
#define SSICR_CKS BIT(30)
#define SSICR_TUIEN BIT(29)
--
2.17.1
Hi Prabhakar,
Thanks for the patch
> -----Original Message-----
> From: Lad Prabhakar <[email protected]>
> Sent: 25 January 2022 13:25
> To: Mark Brown <[email protected]>; Liam Girdwood <[email protected]>;
> Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>; alsa-
> [email protected]; Pavel Machek <[email protected]>
> Cc: [email protected]; [email protected]; Biju
> Das <[email protected]>; Prabhakar <[email protected]>;
> Prabhakar Mahadev Lad <[email protected]>
> Subject: [PATCH 3/3] ASoC: sh: rz-ssi: Remove duplicate macros
>
> Remove SSICR_MST and SSICR_CKDV macros which are defined more than once.
>
> Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Biju Das <[email protected]>
Cheers,
Biju
> ---
> sound/soc/sh/rz-ssi.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c index
> 1a46c9f3c4e5..e8edaed05d4c 100644
> --- a/sound/soc/sh/rz-ssi.c
> +++ b/sound/soc/sh/rz-ssi.c
> @@ -28,8 +28,6 @@
> /* SSI REGISTER BITS */
> #define SSICR_DWL(x) (((x) & 0x7) << 19)
> #define SSICR_SWL(x) (((x) & 0x7) << 16)
> -#define SSICR_MST BIT(14)
> -#define SSICR_CKDV(x) (((x) & 0xf) << 4)
>
> #define SSICR_CKS BIT(30)
> #define SSICR_TUIEN BIT(29)
> --
> 2.17.1
On Tue, 25 Jan 2022 13:24:54 +0000, Lad Prabhakar wrote:
> This patch series has trivial changes for rz-ssi driver. Patches 1
> (partial) & 2 are from series [3].
>
> patch 1/3 is just a cosmetic change which was part of patch [0] where it
> uses a do-while instead of while-do. Patch 2/3 is from series [1] where a
> helper function is added and patch 3/3 is a new patch which removes
> duplicate macros.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: sh: rz-ssi: Use a do-while loop in rz_ssi_pio_recv()
commit: 7276d3f329c633340f3c539ce35ed254d2fe467b
[2/3] ASoC: sh: rz-ssi: Add rz_ssi_set_substream() helper function
commit: 962ff7ecb60b684fe15b135ccbe07628b8bb522a
[3/3] ASoC: sh: rz-ssi: Remove duplicate macros
commit: acfa1e2c2ff5cd7fb7948b0c5c2057acd9dceb14
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark