mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: hisilicon: Clean up hi6210-i2s
@ 2026-10-29  8:01 phucduc.bui
  2026-10-29  8:01 ` [PATCH 1/2] ASoC: hisilicon: Remove redundant bit clearing phucduc.bui
  2026-10-29  8:01 ` [PATCH 2/2] ASoC: hisilicon: Disable clocks in reverse order phucduc.bui
  0 siblings, 2 replies; 3+ messages in thread
From: phucduc.bui @ 2026-10-29  8:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto,
	linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Hi all,

This series cleans up bit handling and clock cleanup in the
HiSilicon I2S driver.

Compile-tested only.

Best regards,
Phuc

bui duc phuc (2):
  ASoC: hisilicon: Remove redundant bit clearing
  ASoC: hisilicon: Disable clocks in reverse order

 sound/soc/hisilicon/hi6210-i2s.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ASoC: hisilicon: Remove redundant bit clearing
  2026-10-29  8:01 [PATCH 0/2] ASoC: hisilicon: Clean up hi6210-i2s phucduc.bui
@ 2026-10-29  8:01 ` phucduc.bui
  2026-10-29  8:01 ` [PATCH 2/2] ASoC: hisilicon: Disable clocks in reverse order phucduc.bui
  1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-10-29  8:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto,
	linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

The S2_DOUT_RIGHT_SEL and S2_DOUT_TEST_SEL bits are cleared before
being set again immediately afterward.

Remove the redundant bit-clearing operations.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/hisilicon/hi6210-i2s.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c
index 554356f060b0..1c9e235c3a81 100644
--- a/sound/soc/hisilicon/hi6210-i2s.c
+++ b/sound/soc/hisilicon/hi6210-i2s.c
@@ -147,10 +147,6 @@ static int hi6210_i2s_startup(struct snd_pcm_substream *substream,
 	val = hi6210_read_reg(i2s, HII2S_MISC_CFG);
 	/* mux 11/12 = APB not i2s */
 	val &= ~HII2S_MISC_CFG__ST_DL_TEST_SEL;
-	/* BT R ch  0 = mixer op of DACR ch */
-	val &= ~HII2S_MISC_CFG__S2_DOUT_RIGHT_SEL;
-	val &= ~HII2S_MISC_CFG__S2_DOUT_TEST_SEL;
-
 	val |= HII2S_MISC_CFG__S2_DOUT_RIGHT_SEL;
 	/* BT L ch = 1 = mux 7 = "mixer output of DACL */
 	val |= HII2S_MISC_CFG__S2_DOUT_TEST_SEL;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ASoC: hisilicon: Disable clocks in reverse order
  2026-10-29  8:01 [PATCH 0/2] ASoC: hisilicon: Clean up hi6210-i2s phucduc.bui
  2026-10-29  8:01 ` [PATCH 1/2] ASoC: hisilicon: Remove redundant bit clearing phucduc.bui
@ 2026-10-29  8:01 ` phucduc.bui
  1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-10-29  8:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto,
	linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Disable clocks in reverse order in hi6210_i2s_shutdown(), matching
the clock cleanup order in hi6210_i2s_startup().

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/hisilicon/hi6210-i2s.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c
index 1c9e235c3a81..7cede2689ed9 100644
--- a/sound/soc/hisilicon/hi6210-i2s.c
+++ b/sound/soc/hisilicon/hi6210-i2s.c
@@ -168,9 +168,9 @@ static void hi6210_i2s_shutdown(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *cpu_dai)
 {
 	struct hi6210_i2s *i2s = dev_get_drvdata(cpu_dai->dev);
-	int n;
+	int n = i2s->clocks;
 
-	for (n = 0; n < i2s->clocks; n++)
+	while (n--)
 		clk_disable_unprepare(i2s->clk[n]);
 
 	regmap_write(i2s->sysctrl, SC_PERIPH_RSTEN1, BIT(5));
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-29  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29  8:01 [PATCH 0/2] ASoC: hisilicon: Clean up hi6210-i2s phucduc.bui
2026-10-29  8:01 ` [PATCH 1/2] ASoC: hisilicon: Remove redundant bit clearing phucduc.bui
2026-10-29  8:01 ` [PATCH 2/2] ASoC: hisilicon: Disable clocks in reverse order phucduc.bui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®