Return-Path: Received: from mail-by2nam03on0105.outbound.protection.outlook.com ([104.47.42.105]:9497 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934909AbeCSQA6 (ORCPT ); Mon, 19 Mar 2018 12:00:58 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 105/281] ASoC: rsnd: SSI PIO adjust to 24bit mode Date: Mon, 19 Mar 2018 15:59:57 +0000 Message-ID: <20180319155742.13731-105-alexander.levin@microsoft.com> References: <20180319155742.13731-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155742.13731-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Kuninori Morimoto [ Upstream commit 7819a942de7b993771bd9377babc80485fe7606b ] commit 90431eb49bff ("ASoC: rsnd: don't use PDTA bit for 24bit on SSI") fixups 24bit mode data alignment, but PIO was not cared. This patch fixes PIO mode 24bit data alignment Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rcar/ssi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index a9a43acce30e..40fc48bc10ae 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -543,6 +543,13 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, struct snd_pcm_runtime *runtime =3D rsnd_io_to_runtime(io); u32 *buf =3D (u32 *)(runtime->dma_area + rsnd_dai_pointer_offset(io, 0)); + int shift =3D 0; + + switch (runtime->sample_bits) { + case 32: + shift =3D 8; + break; + } =20 /* * 8/16/32 data can be assesse to TDR/RDR register @@ -550,9 +557,9 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, * see rsnd_ssi_init() */ if (rsnd_io_is_play(io)) - rsnd_mod_write(mod, SSITDR, *buf); + rsnd_mod_write(mod, SSITDR, (*buf) << shift); else - *buf =3D rsnd_mod_read(mod, SSIRDR); + *buf =3D (rsnd_mod_read(mod, SSIRDR) >> shift); =20 elapsed =3D rsnd_dai_pointer_update(io, sizeof(*buf)); } --=20 2.14.1