linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: broonie@kernel.org
Cc: wenst@chromium.org, lgirdwood@gmail.com, robh@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	matthias.bgg@gmail.com, perex@perex.cz, tiwai@suse.com,
	trevor.wu@mediatek.com, maso.huang@mediatek.com,
	xiazhengqiao@huaqin.corp-partner.google.com, arnd@arndb.de,
	kuninori.morimoto.gx@renesas.com, shraash@google.com,
	amergnat@baylibre.com, nicolas.ferre@microchip.com,
	u.kleine-koenig@pengutronix.de, dianders@chromium.org,
	frank.li@vivo.com, allen-kh.cheng@mediatek.com,
	eugen.hristev@collabora.com, claudiu.beznea@tuxon.dev,
	jarkko.nikula@bitmer.com, jiaxin.yu@mediatek.com,
	alpernebiyasak@gmail.com, ckeepax@opensource.cirrus.com,
	zhourui@huaqin.corp-partner.google.com, nfraprado@collabora.com,
	alsa-devel@alsa-project.org, shane.chien@mediatek.com,
	linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, kernel@collabora.com,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Subject: [PATCH v5 00/18] ASoC: Cleanup MediaTek soundcard machine drivers
Date: Tue, 16 Apr 2024 09:13:52 +0200	[thread overview]
Message-ID: <20240416071410.75620-1-angelogioacchino.delregno@collabora.com> (raw)

Changes in v5:
 - Cleaned up MT8186 soundcard migration commit which erroneously
   had leftovers from development
 - Changed the mtk_pcm_constraints_data structure to hold pointers
   to snd_pcm_hw_constraint_list, as to really reuse the const data
 - Tested again on all of the listed MTK platforms.

Changes in v4:
 - Rebased over next-20240409
 - Dropped the first 4 patches from v3 as were already picked by Mark
 - Fixed W=1 build issue

Changes in v3:
 - Added audio-routing names in enum in all yaml files
 - Added mention of disallowing old and new properties together in
   commit message of bindings patches
 - Fixed validation errors with sound-card-common.yaml inclusion
   due to missing model property in examples
 - Removed `else` enforcing headset-codec/speaker-codecs requirement
   if xxx-dai-link not present to avoid future commit noise as the
   deprecated statement will disallow deprecated properties as required

Changes in v2:
 - Bindings: Changed link-name/codec/clk-provider to remove `items`
   and leave just the enum
 - Moved .*-dai-link pattern additionalProperties after `type: object`
 - Added ref to sound-card-common.yaml
 - Fixed dai-link-xxx -> xxx-dai-link typo in example comment

This series performs a cleanup of most of the MediaTek AFE drivers and
soundcard machine drivers, reducing code duplication and setting a base
to be consistent with their devicetree bindings, as many of those are
using different properties and nodes for no good reason.

Summarizing:
 - Commonizes functions and ops where possible
 - Adds a common probe mechanism, increasing maintainability of
   soundcard drivers for older MediaTek SoCs
 - Migrates all drivers to support the new bindings
   - Obviously retains compatibility with old device trees
 - Reduces machine-specific parameters hardcoding in drivers
   - Can now set machine-specific params in device tree
   - Uses the `audio-routing` and `dai-link` nodes like some
     other non-MediaTek SoC sound drivers
 - Imposes consistency between MediaTek ASoC machine soundcard
   drivers bindings
 - Reduces code size and greatly reduces the amount of code that
   will be required for newer drivers (retaining compatibility with
   the old bindings was costly in terms of code size, otherwise
   this series would've removed ~1000 more lines, or something
   along that line).

This series was (manually) tested on MT8173, MT8192, MT8195 and MT8186
Chromebooks.


AngeloGioacchino Del Regno (18):
  ASoC: mediatek: Add common machine soundcard driver probe mechanism
  ASoC: mediatek: common: Constify struct mtk_sof_priv
  ASoC: mediatek: mt8188: Migrate to mtk_soundcard_common_probe
  ASoC: mediatek: mt8195: Migrate to mtk_soundcard_common_probe
  ASoC: mediatek: mt8192: Migrate to mtk_soundcard_common_probe
  ASoC: mediatek: mt8186: Migrate to mtk_soundcard_common_probe
  ASoC: mediatek: Add common snd_soc_ops .startup() callback
  ASoC: mediatek: mt8195: Migrate to the common mtk_soundcard_startup
  ASoC: mediatek: mt8192: Migrate to the common mtk_soundcard_startup
  ASoC: mediatek: mt8186-rt1019: Migrate to the common
    mtk_soundcard_startup
  ASoC: mediatek: Add common mtk_afe_component_probe callback
  ASoC: mediatek: Use common mtk_afe_pcm_platform with common probe cb
  ASoC: mediatek: mt8186: Unify mt8186-mt6366 machine drivers
  ASoC: dt-bindings: mt8195: Document audio-routing and dai-link subnode
  ASoC: dt-bindings: mt8192: Document audio-routing and dai-link subnode
  ASoC: dt-bindings: mt8186: Document audio-routing and dai-link subnode
  arm64: dts: mediatek: mt8195-cherry: Specify sound DAI links and
    routing
  arm64: dts: mediatek: mt8186-corsola: Specify sound DAI links and
    routing

 .../sound/mt8186-mt6366-da7219-max98357.yaml  |  131 +-
 .../sound/mt8186-mt6366-rt1019-rt5682s.yaml   |  120 +-
 .../sound/mt8192-mt6359-rt1015-rt5682.yaml    |  139 +-
 .../bindings/sound/mt8195-mt6359.yaml         |  134 ++
 .../boot/dts/mediatek/mt8186-corsola.dtsi     |   42 +-
 .../boot/dts/mediatek/mt8195-cherry.dtsi      |   45 +
 sound/soc/mediatek/Kconfig                    |   24 +-
 .../mediatek/common/mtk-afe-platform-driver.c |   18 +
 .../soc/mediatek/common/mtk-dsp-sof-common.c  |   15 +-
 .../soc/mediatek/common/mtk-dsp-sof-common.h  |    1 -
 sound/soc/mediatek/common/mtk-soc-card.h      |    7 +-
 .../mediatek/common/mtk-soundcard-driver.c    |  199 +++
 .../mediatek/common/mtk-soundcard-driver.h    |   42 +
 sound/soc/mediatek/mt6797/mt6797-afe-pcm.c    |   14 +-
 sound/soc/mediatek/mt7986/mt7986-afe-pcm.c    |   14 +-
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c    |   14 +-
 sound/soc/mediatek/mt8186/Makefile            |    3 +-
 .../mt8186/mt8186-mt6366-da7219-max98357.c    | 1189 -----------------
 ...t6366-rt1019-rt5682s.c => mt8186-mt6366.c} |  578 ++++----
 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c    |   21 +-
 sound/soc/mediatek/mt8188/mt8188-mt6359.c     |  203 +--
 sound/soc/mediatek/mt8192/mt8192-afe-pcm.c    |   25 +-
 .../mt8192/mt8192-mt6359-rt1015-rt5682.c      |  301 ++---
 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c    |   21 +-
 sound/soc/mediatek/mt8195/mt8195-mt6359.c     |  487 +++----
 25 files changed, 1597 insertions(+), 2190 deletions(-)
 delete mode 100644 sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c
 rename sound/soc/mediatek/mt8186/{mt8186-mt6366-rt1019-rt5682s.c => mt8186-mt6366.c} (72%)

-- 
2.44.0


             reply	other threads:[~2024-04-16  7:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  7:13 AngeloGioacchino Del Regno [this message]
2024-04-16  7:13 ` [PATCH v5 01/18] ASoC: mediatek: Add common machine soundcard driver probe mechanism AngeloGioacchino Del Regno
2024-04-16  7:13 ` [PATCH v5 02/18] ASoC: mediatek: common: Constify struct mtk_sof_priv AngeloGioacchino Del Regno
2024-04-16  7:13 ` [PATCH v5 03/18] ASoC: mediatek: mt8188: Migrate to mtk_soundcard_common_probe AngeloGioacchino Del Regno
2024-04-16  7:13 ` [PATCH v5 04/18] ASoC: mediatek: mt8195: " AngeloGioacchino Del Regno
2024-04-16  7:13 ` [PATCH v5 05/18] ASoC: mediatek: mt8192: " AngeloGioacchino Del Regno
2024-04-16  7:13 ` [PATCH v5 06/18] ASoC: mediatek: mt8186: " AngeloGioacchino Del Regno
2024-04-16  7:13 ` [PATCH v5 07/18] ASoC: mediatek: Add common snd_soc_ops .startup() callback AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 08/18] ASoC: mediatek: mt8195: Migrate to the common mtk_soundcard_startup AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 09/18] ASoC: mediatek: mt8192: " AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 10/18] ASoC: mediatek: mt8186-rt1019: " AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 11/18] ASoC: mediatek: Add common mtk_afe_component_probe callback AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 12/18] ASoC: mediatek: Use common mtk_afe_pcm_platform with common probe cb AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 13/18] ASoC: mediatek: mt8186: Unify mt8186-mt6366 machine drivers AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 14/18] ASoC: dt-bindings: mt8195: Document audio-routing and dai-link subnode AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 15/18] ASoC: dt-bindings: mt8192: " AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 16/18] ASoC: dt-bindings: mt8186: " AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 17/18] arm64: dts: mediatek: mt8195-cherry: Specify sound DAI links and routing AngeloGioacchino Del Regno
2024-04-16  7:14 ` [PATCH v5 18/18] arm64: dts: mediatek: mt8186-corsola: " AngeloGioacchino Del Regno
2024-05-02  9:59   ` Chen-Yu Tsai
2024-04-17  1:07 ` (subset) [PATCH v5 00/18] ASoC: Cleanup MediaTek soundcard machine drivers 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=20240416071410.75620-1-angelogioacchino.delregno@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=allen-kh.cheng@mediatek.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amergnat@baylibre.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=eugen.hristev@collabora.com \
    --cc=frank.li@vivo.com \
    --cc=jarkko.nikula@bitmer.com \
    --cc=jiaxin.yu@mediatek.com \
    --cc=kernel@collabora.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=maso.huang@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=shane.chien@mediatek.com \
    --cc=shraash@google.com \
    --cc=tiwai@suse.com \
    --cc=trevor.wu@mediatek.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wenst@chromium.org \
    --cc=xiazhengqiao@huaqin.corp-partner.google.com \
    --cc=zhourui@huaqin.corp-partner.google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).