All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: amd: acp: Add sound support for a line of HUAWEI laptops
@ 2023-03-20 20:35 Marian Postevca
  2023-03-20 20:35 ` [PATCH 1/4] ASoC: es8316: Enable support for S32 LE format and MCLK div by 2 Marian Postevca
                   ` (3 more replies)
  0 siblings, 4 replies; 40+ messages in thread
From: Marian Postevca @ 2023-03-20 20:35 UTC (permalink / raw)
  To: Takashi Iwai, Mark Brown, Liam Girdwood, Jaroslav Kysela
  Cc: linux-kernel, alsa-devel, Marian Postevca

This series adds support for a line of HUAWEI laptops with
AMD CPUs that connect using the ACP3x module to a ES8336 codec.

The codec driver must be extended to support the S32 LE format
and the MCLK div by 2 option. MCLK div by 2 is needed for one specific
SKU which uses a 48Mhz MCLK which seems to be too high of a frequency
for the codec and must be divided by 2.

The acp legacy driver must also be extended by using callbacks so that
the more complicated handling for this specific codec can be moved
outside the more generic ACP code.

The last patch tries to avoid anoying pop sounds when the speaker/headphones
are enabled/disabled by delaying the handling of the GPIOs and using a mutex
to avoid race conditions between the speaker power event callback and the
trigger callback.

Marian Postevca (4):
  ASoC: es8316: Enable support for S32 LE format and MCLK div by 2
  ASoC: amd: acp: Add support for splitting the codec specific code from
    the ACP driver
  ASoC: amd: acp: Add machine driver that enables sound for systems with
    a ES8336 codec
  ASoC: amd: acp: Improve support for speaker power events

 sound/soc/amd/acp-config.c                    |  70 ++
 sound/soc/amd/acp/Makefile                    |   2 +-
 sound/soc/amd/acp/acp-legacy-mach.c           | 105 ++-
 sound/soc/amd/acp/acp-mach-common.c           |   8 +
 sound/soc/amd/acp/acp-mach.h                  |  67 ++
 sound/soc/amd/acp/acp-renoir.c                |   4 +
 sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 615 ++++++++++++++++++
 sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.h |  12 +
 sound/soc/codecs/es8316.c                     |  21 +-
 sound/soc/codecs/es8316.h                     |   3 +
 10 files changed, 886 insertions(+), 21 deletions(-)
 create mode 100644 sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
 create mode 100644 sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.h

-- 
2.39.1


^ permalink raw reply	[flat|nested] 40+ messages in thread
* Re: [PATCH 1/4] ASoC: es8316: Enable support for S32 LE format and MCLK div by 2
@ 2023-03-22  2:00 沈一超
  0 siblings, 0 replies; 40+ messages in thread
From: 沈一超 @ 2023-03-22  2:00 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, lgirdwood, linux-kernel, posteuca, tiwai,
	yangxiaohua, Zhu Ning

> > > This introduces a DT property but there's no documentation for it,
but I
> > > don't see why we'd want this in the bindings - the driver should be
able
> > > to tell from the input clock rate and required output/internal clocks
if
> > > it needs to divide MCLK.
>
> > The problem here is that I have no knowledge what is the maximum MCLK
> > that the codec accepts. According to the datasheet the maximum supported
> > frequency of MCLK is 51.2 Mhz. But this doesn't seem to be the case in
> > practice since a MCLK of 48Mhz causes noises in the sound output.
> > The idea to divide the MCLK by 2 was proposed by a Everest Semiconductor
> > engineer.
> > So I don't know how to make this generic enough to be activated from the
> > codec driver.
>
> The usual constraint would be that MCLK can be at most some multiple of
> LRCLK or something similar (are all the other dividers in the chip set
> sensibly for the full scale MCLK?).  In any case you're clearly aware of
> a specific case where it needs to be divided down which can be
> identified even if you're concerned about dividing down for other cases.

In practice no dt property is needed. We support 48M mclk, based on enabling
MCLK divided by 2 for mclk greater than 24M . You may want code like this:
/* enabling  mclk divided by 2 for mclk > 24M */
if (es8316->sysclk > 24000000)
    mclk_div_option = true;

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

end of thread, other threads:[~2023-08-21 14:09 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 20:35 [PATCH 0/4] ASoC: amd: acp: Add sound support for a line of HUAWEI laptops Marian Postevca
2023-03-20 20:35 ` [PATCH 1/4] ASoC: es8316: Enable support for S32 LE format and MCLK div by 2 Marian Postevca
2023-03-20 20:43   ` Mark Brown
2023-03-20 20:43     ` Mark Brown
2023-03-21 17:09     ` Marian Postevca
2023-03-21 17:09       ` Marian Postevca
2023-03-21 17:21       ` Mark Brown
2023-03-21 17:21         ` Mark Brown
2023-03-20 20:35 ` [PATCH 2/4] ASoC: amd: acp: Add support for splitting the codec specific code from the ACP driver Marian Postevca
2023-03-20 20:35 ` [PATCH 3/4] ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec Marian Postevca
2023-03-20 20:54   ` Mark Brown
2023-03-20 20:54     ` Mark Brown
2023-03-21 22:17     ` Marian Postevca
2023-03-21 22:17       ` Marian Postevca
2023-03-22  1:58       ` Pierre-Louis Bossart
2023-03-22 13:07       ` Mark Brown
2023-03-22 13:07         ` Mark Brown
2023-03-22 20:48         ` Marian Postevca
2023-03-22 20:48           ` Marian Postevca
2023-03-22 21:27           ` Mark Brown
2023-03-22 21:27             ` Mark Brown
2023-03-27 21:20             ` Marian Postevca
2023-03-27 21:20               ` Marian Postevca
2023-03-29 13:52               ` Mark Brown
2023-03-29 13:52                 ` Mark Brown
2023-08-17 21:09                 ` Marian Postevca
2023-08-17 21:47                   ` Mark Brown
2023-08-17 22:20                     ` Marian Postevca
2023-08-18 12:52                       ` Mark Brown
2023-08-20  9:32                         ` Marian Postevca
2023-08-21 14:09                           ` Mark Brown
2023-03-21  0:54   ` kernel test robot
2023-03-20 20:35 ` [PATCH 4/4] ASoC: amd: acp: Improve support for speaker power events Marian Postevca
2023-03-20 21:01   ` Mark Brown
2023-03-20 21:01     ` Mark Brown
2023-03-22 21:01     ` Marian Postevca
2023-03-22 21:01       ` Marian Postevca
2023-03-22 21:35       ` Mark Brown
2023-03-22 21:35         ` Mark Brown
2023-03-22  2:00 [PATCH 1/4] ASoC: es8316: Enable support for S32 LE format and MCLK div by 2 沈一超

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.