Skip to contentSkip to conversation

Unify NVIDIA Tegra ASoC machine drivers

PATCH In review Dmitry Osipenko 2 participants 7 messages May 29, 2021 – Jun 15, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v6 cover Unify NVIDIA Tegra ASoC machine drivers

This series squashes all the ASoC machine drivers into a single one, this change was suggested by Jon Hunter. It also sets driver_name and components string of each card, allowing userspace alsa-lib to find UCMs at predictable path.

Changelog:

v6: - Fixed missed configuration of AC97 clock rate for the WM9712 codec
in the unified driver.

- Added new patch that removes now obsolete "utils" helpers and moves code into the unified driver.

ASoC: tegra: Squash utils into common machine driver

v5: - The v4 removed the customization of components string for Nexus 7,
but I missed to remove the "components" hook which is unused now, it's removed in v5 for consistency.

- Slightly improved naming of the common 12MHz MCLK rate function to make it more consistent with the rest of the driver functions.

v4: - Moved out mclk_rate callback that is currently used only by WM8903
machine driver from the common driver. This was suggested by Jon Hunter.

- Dropped patch which was setting custom components string for Nexus 7. Jaroslav Kysela wants it to be specified in a device-tree, but the components string doesn't have a firm specification for today. It's better to drop this change for now since it's optional anyways.

- Fixed compilation error that was reported by kernel robot for v3.

- Jaroslav Kysela merged alsa-ucm-conf PR [1] which added UCMs for Nexus 7 and Acer A500. The UCMs are fully working using a combination of updated kernel + alsa-ucm-conf master + alsa-lib master, meaning that they will work with the next releases of kernel and ALSA userspace upstream packages.

- Added ack from Jaroslav Kysela to the "Specify components string for each card" patch that he gave to v3.

v3: - Added components string as was suggested by Jaroslav Kysela to v2.

- Renamed MCLK rate function that is used by max98090 and other codecs to make it look more generic. Added option for specifying CLK ID per device. This all was suggested by Jon Hunter to v2.

v2: - Dropped use of of_device_compatible_match(), like it was suggested
by Rob Herring in a review comment to v1.

- Added patch that sets card's driver_name of as Tegra ASoC drivers. In a comment to v1 Jaroslav Kysela suggested that the Tegra drivers don't set the card name properly and he was right.

I opened pull request with the new Tegra UCMs and updated lookup paths for older UCMs [1].

[1] https://github.com/alsa-project/alsa-ucm-conf/pull/92

Dmitry Osipenko (4):
ASoC: tegra: Set driver_name=tegra for all machine drivers
ASoC: tegra: Unify ASoC machine drivers
ASoC: tegra: Specify components string for each card
ASoC: tegra: Squash utils into common machine driver

 sound/soc/tegra/Kconfig              |  12 +
 sound/soc/tegra/Makefile             |  19 +-
 sound/soc/tegra/tegra_alc5632.c      | 259 --------
 sound/soc/tegra/tegra_asoc_machine.c | 854 +++++++++++++++++++++++++++
 sound/soc/tegra/tegra_asoc_machine.h |  49 ++
 sound/soc/tegra/tegra_asoc_utils.c   | 225 -------
 sound/soc/tegra/tegra_asoc_utils.h   |  38 --
 sound/soc/tegra/tegra_max98090.c     | 276 ---------
 sound/soc/tegra/tegra_rt5640.c       | 222 -------
 sound/soc/tegra/tegra_rt5677.c       | 324 ----------
 sound/soc/tegra/tegra_sgtl5000.c     | 211 -------
 sound/soc/tegra/tegra_wm8753.c       | 185 ------
 sound/soc/tegra/tegra_wm8903.c       | 351 +++--------
 sound/soc/tegra/tegra_wm9712.c       | 166 ------
 sound/soc/tegra/trimslice.c          | 172 ------
 15 files changed, 996 insertions(+), 2367 deletions(-)
 delete mode 100644 sound/soc/tegra/tegra_alc5632.c
 create mode 100644 sound/soc/tegra/tegra_asoc_machine.c
 create mode 100644 sound/soc/tegra/tegra_asoc_machine.h
 delete mode 100644 sound/soc/tegra/tegra_asoc_utils.c
 delete mode 100644 sound/soc/tegra/tegra_asoc_utils.h
 delete mode 100644 sound/soc/tegra/tegra_max98090.c
 delete mode 100644 sound/soc/tegra/tegra_rt5640.c
 delete mode 100644 sound/soc/tegra/tegra_rt5677.c
 delete mode 100644 sound/soc/tegra/tegra_sgtl5000.c
 delete mode 100644 sound/soc/tegra/tegra_wm8753.c
 delete mode 100644 sound/soc/tegra/tegra_wm9712.c
 delete mode 100644 sound/soc/tegra/trimslice.c
Signature · 1 line
2.30.2
#1 lore raw

PATCH v6 1/4 ASoC: tegra: Set driver_name=tegra for all machine drivers

The driver_name="tegra" is now required by the newer ALSA UCMs, otherwise Tegra UCMs don't match by the path/name.

All Tegra machine drivers are specifying the card's name, but it has no effect if model name is specified in the device-tree since it overrides the card's name. We need to set the driver_name to "tegra" in order to get a usable lookup path for the updated ALSA UCMs. The new UCM lookup path has a form of driver_name/card_name.

The old lookup paths that are based on driver module name continue to work as before. Note that UCM matching never worked for Tegra ASoC drivers if they were compiled as built-in, this is fixed by supporting the new naming scheme.

---
 sound/soc/tegra/tegra_alc5632.c  | 1 +
 sound/soc/tegra/tegra_max98090.c | 1 +
 sound/soc/tegra/tegra_rt5640.c   | 1 +
 sound/soc/tegra/tegra_rt5677.c   | 1 +
 sound/soc/tegra/tegra_sgtl5000.c | 1 +
 sound/soc/tegra/tegra_wm8753.c   | 1 +
 sound/soc/tegra/tegra_wm8903.c   | 1 +
 sound/soc/tegra/tegra_wm9712.c   | 1 +
 sound/soc/tegra/trimslice.c      | 1 +
 9 files changed, 9 insertions(+)
sound/soc/tegra/tegra_alc5632.c +1 -0
index 0a0efd24e4b0..81ea6ceba689 100644
@@ -139,6 +139,7 @@ static struct snd_soc_dai_link tegra_alc5632_dai = {
 
 static struct snd_soc_card snd_soc_tegra_alc5632 = {
 	.name = "tegra-alc5632",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_alc5632_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_max98090.c +1 -0
index 00c19704057b..5a649810c0c8 100644
@@ -182,6 +182,7 @@ static struct snd_soc_dai_link tegra_max98090_dai = {
 
 static struct snd_soc_card snd_soc_tegra_max98090 = {
 	.name = "tegra-max98090",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_max98090_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_rt5640.c +1 -0
index 9afba37a3b08..3344f16258be 100644
@@ -132,6 +132,7 @@ static struct snd_soc_dai_link tegra_rt5640_dai = {
 
 static struct snd_soc_card snd_soc_tegra_rt5640 = {
 	.name = "tegra-rt5640",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_rt5640_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_rt5677.c +1 -0
index d30f8b6deda4..0f03e97d9355 100644
@@ -175,6 +175,7 @@ static struct snd_soc_dai_link tegra_rt5677_dai = {
 
 static struct snd_soc_card snd_soc_tegra_rt5677 = {
 	.name = "tegra-rt5677",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_rt5677_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_sgtl5000.c +1 -0
index 885332170c77..ef6a553e0b7d 100644
@@ -97,6 +97,7 @@ static struct snd_soc_dai_link tegra_sgtl5000_dai = {
 
 static struct snd_soc_card snd_soc_tegra_sgtl5000 = {
 	.name = "tegra-sgtl5000",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_sgtl5000_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_wm8753.c +1 -0
index efd793886689..27089077f2ea 100644
@@ -101,6 +101,7 @@ static struct snd_soc_dai_link tegra_wm8753_dai = {
 
 static struct snd_soc_card snd_soc_tegra_wm8753 = {
 	.name = "tegra-wm8753",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_wm8753_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_wm8903.c +1 -0
index e4863fa37b0c..f219c26d66a3 100644
@@ -235,6 +235,7 @@ static struct snd_soc_dai_link tegra_wm8903_dai = {
 
 static struct snd_soc_card snd_soc_tegra_wm8903 = {
 	.name = "tegra-wm8903",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_wm8903_dai,
 	.num_links = 1,
sound/soc/tegra/tegra_wm9712.c +1 -0
index 4f09a178049d..c66da161c85a 100644
@@ -54,6 +54,7 @@ static struct snd_soc_dai_link tegra_wm9712_dai = {
 
 static struct snd_soc_card snd_soc_tegra_wm9712 = {
 	.name = "tegra-wm9712",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_wm9712_dai,
 	.num_links = 1,
sound/soc/tegra/trimslice.c +1 -0
index 6c1cc3d0ac33..cb4c8f72e4e6 100644
@@ -94,6 +94,7 @@ static struct snd_soc_dai_link trimslice_tlv320aic23_dai = {
 
 static struct snd_soc_card snd_soc_trimslice = {
 	.name = "tegra-trimslice",
+	.driver_name = "tegra",
 	.owner = THIS_MODULE,
 	.dai_link = &trimslice_tlv320aic23_dai,
 	.num_links = 1,
Signature · 1 line
2.30.2
#2 lore raw

PATCH v6 2/4 ASoC: tegra: Unify ASoC machine drivers

In reply to Dmitry Osipenko

Squash all machine drivers into a single-universal one. This reduces code duplication, eases addition of a new drivers and upgrades older code to a modern Linux kernel APIs.

---
 sound/soc/tegra/Kconfig              |  12 +
 sound/soc/tegra/Makefile             |  18 +-
 sound/soc/tegra/tegra_alc5632.c      | 260 ----------
 sound/soc/tegra/tegra_asoc_machine.c | 712 +++++++++++++++++++++++++++
 sound/soc/tegra/tegra_asoc_machine.h |  46 ++
 sound/soc/tegra/tegra_max98090.c     | 277 -----------
 sound/soc/tegra/tegra_rt5640.c       | 223 ---------
 sound/soc/tegra/tegra_rt5677.c       | 325 ------------
 sound/soc/tegra/tegra_sgtl5000.c     | 212 --------
 sound/soc/tegra/tegra_wm8753.c       | 186 -------
 sound/soc/tegra/tegra_wm8903.c       | 351 +++----------
 sound/soc/tegra/tegra_wm9712.c       | 167 -------
 sound/soc/tegra/trimslice.c          | 173 -------
 13 files changed, 850 insertions(+), 2112 deletions(-)
 delete mode 100644 sound/soc/tegra/tegra_alc5632.c
 create mode 100644 sound/soc/tegra/tegra_asoc_machine.c
 create mode 100644 sound/soc/tegra/tegra_asoc_machine.h
 delete mode 100644 sound/soc/tegra/tegra_max98090.c
 delete mode 100644 sound/soc/tegra/tegra_rt5640.c
 delete mode 100644 sound/soc/tegra/tegra_rt5677.c
 delete mode 100644 sound/soc/tegra/tegra_sgtl5000.c
 delete mode 100644 sound/soc/tegra/tegra_wm8753.c
 delete mode 100644 sound/soc/tegra/tegra_wm9712.c
 delete mode 100644 sound/soc/tegra/trimslice.c
sound/soc/tegra/Kconfig +12 -0
index a4e6760944d0..83c87f35a7d3 100644
@@ -117,9 +117,13 @@ config SND_SOC_TEGRA_AUDIO_GRAPH_CARD
 	  few things for Tegra audio. Most of the code is re-used from
 	  audio graph driver and the same DT bindings are used.
 
+config SND_SOC_TEGRA_MACHINE_DRV
+	tristate
+
 config SND_SOC_TEGRA_RT5640
 	tristate "SoC Audio support for Tegra boards using an RT5640 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_RT5640
 	help
 	  Say Y or M here if you want to add support for SoC audio on Tegra
@@ -128,6 +132,7 @@ config SND_SOC_TEGRA_RT5640
 config SND_SOC_TEGRA_WM8753
 	tristate "SoC Audio support for Tegra boards using a WM8753 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_WM8753
 	help
 	  Say Y or M here if you want to add support for SoC audio on Tegra
@@ -136,6 +141,7 @@ config SND_SOC_TEGRA_WM8753
 config SND_SOC_TEGRA_WM8903
 	tristate "SoC Audio support for Tegra boards using a WM8903 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_WM8903
 	help
 	  Say Y or M here if you want to add support for SoC audio on Tegra
@@ -145,6 +151,7 @@ config SND_SOC_TEGRA_WM8903
 config SND_SOC_TEGRA_WM9712
 	tristate "SoC Audio support for Tegra boards using a WM9712 codec"
 	depends on GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_TEGRA20_AC97
 	select SND_SOC_WM9712
 	help
@@ -154,6 +161,7 @@ config SND_SOC_TEGRA_WM9712
 config SND_SOC_TEGRA_TRIMSLICE
 	tristate "SoC Audio support for TrimSlice board"
 	depends on I2C
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_TLV320AIC23_I2C
 	help
 	  Say Y or M here if you want to add support for SoC audio on the
@@ -162,6 +170,7 @@ config SND_SOC_TEGRA_TRIMSLICE
 config SND_SOC_TEGRA_ALC5632
 	tristate "SoC Audio support for Tegra boards using an ALC5632 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_ALC5632
 	help
 	  Say Y or M here if you want to add support for SoC audio on the
@@ -170,6 +179,7 @@ config SND_SOC_TEGRA_ALC5632
 config SND_SOC_TEGRA_MAX98090
 	tristate "SoC Audio support for Tegra boards using a MAX98090 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_MAX98090
 	help
 	  Say Y or M here if you want to add support for SoC audio on Tegra
@@ -178,6 +188,7 @@ config SND_SOC_TEGRA_MAX98090
 config SND_SOC_TEGRA_RT5677
 	tristate "SoC Audio support for Tegra boards using a RT5677 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_RT5677
 	help
 	  Say Y or M here if you want to add support for SoC audio on Tegra
@@ -186,6 +197,7 @@ config SND_SOC_TEGRA_RT5677
 config SND_SOC_TEGRA_SGTL5000
 	tristate "SoC Audio support for Tegra boards using a SGTL5000 codec"
 	depends on I2C && GPIOLIB
+	select SND_SOC_TEGRA_MACHINE_DRV
 	select SND_SOC_SGTL5000
 	help
 	  Say Y or M here if you want to add support for SoC audio on Tegra
sound/soc/tegra/Makefile +2 -16
index b17dd6eef92a..b930ea7c75f1 100644
@@ -29,24 +29,10 @@ obj-$(CONFIG_SND_SOC_TEGRA186_DSPK) += snd-soc-tegra186-dspk.o
 obj-$(CONFIG_SND_SOC_TEGRA210_ADMAIF) += snd-soc-tegra210-admaif.o
 
 # Tegra machine Support
-snd-soc-tegra-rt5640-objs := tegra_rt5640.o
-snd-soc-tegra-rt5677-objs := tegra_rt5677.o
-snd-soc-tegra-wm8753-objs := tegra_wm8753.o
 snd-soc-tegra-wm8903-objs := tegra_wm8903.o
-snd-soc-tegra-wm9712-objs := tegra_wm9712.o
-snd-soc-tegra-trimslice-objs := trimslice.o
-snd-soc-tegra-alc5632-objs := tegra_alc5632.o
-snd-soc-tegra-max98090-objs := tegra_max98090.o
-snd-soc-tegra-sgtl5000-objs := tegra_sgtl5000.o
+snd-soc-tegra-machine-objs := tegra_asoc_machine.o
 snd-soc-tegra-audio-graph-card-objs := tegra_audio_graph_card.o
 
-obj-$(CONFIG_SND_SOC_TEGRA_RT5640) += snd-soc-tegra-rt5640.o
-obj-$(CONFIG_SND_SOC_TEGRA_RT5677) += snd-soc-tegra-rt5677.o
-obj-$(CONFIG_SND_SOC_TEGRA_WM8753) += snd-soc-tegra-wm8753.o
 obj-$(CONFIG_SND_SOC_TEGRA_WM8903) += snd-soc-tegra-wm8903.o
-obj-$(CONFIG_SND_SOC_TEGRA_WM9712) += snd-soc-tegra-wm9712.o
-obj-$(CONFIG_SND_SOC_TEGRA_TRIMSLICE) += snd-soc-tegra-trimslice.o
-obj-$(CONFIG_SND_SOC_TEGRA_ALC5632) += snd-soc-tegra-alc5632.o
-obj-$(CONFIG_SND_SOC_TEGRA_MAX98090) += snd-soc-tegra-max98090.o
-obj-$(CONFIG_SND_SOC_TEGRA_SGTL5000) += snd-soc-tegra-sgtl5000.o
+obj-$(CONFIG_SND_SOC_TEGRA_MACHINE_DRV) += snd-soc-tegra-machine.o
 obj-$(CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD) += snd-soc-tegra-audio-graph-card.o
sound/soc/tegra/tegra_alc5632.c deleted +0 -260

260 lines not on this page · raw message

sound/soc/tegra/tegra_asoc_machine.c new file +712 -0

712 lines not on this page · raw message

sound/soc/tegra/tegra_asoc_machine.h new file +46 -0

46 lines not on this page · raw message

sound/soc/tegra/tegra_max98090.c deleted +0 -277

277 lines not on this page · raw message

sound/soc/tegra/tegra_rt5640.c deleted +0 -223

223 lines not on this page · raw message

sound/soc/tegra/tegra_rt5677.c deleted +0 -325

325 lines not on this page · raw message

sound/soc/tegra/tegra_sgtl5000.c deleted +0 -212

212 lines not on this page · raw message

sound/soc/tegra/tegra_wm8753.c deleted +0 -186

186 lines not on this page · raw message

sound/soc/tegra/tegra_wm8903.c +78 -273

426 lines not on this page · raw message

sound/soc/tegra/tegra_wm9712.c deleted +0 -167

167 lines not on this page · raw message

sound/soc/tegra/trimslice.c deleted +0 -173

71 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.30.2

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH v6 3/4 ASoC: tegra: Specify components string for each card

In reply to Dmitry Osipenko

Specify components string for each card of each supported device. It's a free form string that describes audio hardware configuration. This information is useful for ALSA UCM rules. It allows to generalize UCM rules, potentially removing a need to add new UCM rule for each device.

---
 sound/soc/tegra/tegra_asoc_machine.c | 7 +++++++
 sound/soc/tegra/tegra_wm8903.c       | 1 +
 2 files changed, 8 insertions(+)
sound/soc/tegra/tegra_asoc_machine.c +7 -0
index f052ad2a1f38..31ab7123945b 100644
@@ -412,6 +412,7 @@ static struct snd_soc_dai_link tegra_wm8753_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_wm8753 = {
+	.components = "codec:wm8753",
 	.dai_link = &tegra_wm8753_dai,
 	.num_links = 1,
 	.fully_routed = true,
@@ -444,6 +445,7 @@ static struct snd_soc_dai_link tegra_wm9712_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_wm9712 = {
+	.components = "codec:wm9712",
 	.dai_link = &tegra_wm9712_dai,
 	.num_links = 1,
 	.fully_routed = true,
@@ -506,6 +508,7 @@ static struct snd_soc_dai_link tegra_sgtl5000_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_sgtl5000 = {
+	.components = "codec:sgtl5000",
 	.dai_link = &tegra_sgtl5000_dai,
 	.num_links = 1,
 	.fully_routed = true,
@@ -548,6 +551,7 @@ static struct snd_soc_dai_link tegra_tlv320aic23_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_trimslice = {
+	.components = "codec:tlv320aic23",
 	.dai_link = &tegra_tlv320aic23_dai,
 	.num_links = 1,
 	.dapm_widgets = trimslice_dapm_widgets,
@@ -595,6 +599,7 @@ static struct snd_soc_dai_link tegra_rt5677_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_rt5677 = {
+	.components = "codec:rt5677",
 	.dai_link = &tegra_rt5677_dai,
 	.num_links = 1,
 	.fully_routed = true,
@@ -628,6 +633,7 @@ static struct snd_soc_dai_link tegra_rt5640_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_rt5640 = {
+	.components = "codec:rt5640",
 	.dai_link = &tegra_rt5640_dai,
 	.num_links = 1,
 	.fully_routed = true,
@@ -660,6 +666,7 @@ static struct snd_soc_dai_link tegra_rt5632_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_rt5632 = {
+	.components = "codec:rt5632",
 	.dai_link = &tegra_rt5632_dai,
 	.num_links = 1,
 	.fully_routed = true,
sound/soc/tegra/tegra_wm8903.c +1 -0
index 74101d2c7785..5751fb398c1a 100644
@@ -129,6 +129,7 @@ static struct snd_soc_dai_link tegra_wm8903_dai = {
 };
 
 static struct snd_soc_card snd_soc_tegra_wm8903 = {
+	.components = "codec:wm8903",
 	.owner = THIS_MODULE,
 	.dai_link = &tegra_wm8903_dai,
 	.num_links = 1,
Signature · 1 line
2.30.2
#4 lore raw

PATCH v6 4/4 ASoC: tegra: Squash utils into common machine driver

In reply to Dmitry Osipenko

There no users left of the utils other than the new common machine driver. Squash the utils into the common machine driver in order to simplify code.

---
 sound/soc/tegra/Makefile             |   1 -
 sound/soc/tegra/tegra_asoc_machine.c | 153 ++++++++++++++++--
 sound/soc/tegra/tegra_asoc_machine.h |   9 +-
 sound/soc/tegra/tegra_asoc_utils.c   | 225 ---------------------------
 sound/soc/tegra/tegra_asoc_utils.h   |  38 -----
 5 files changed, 150 insertions(+), 276 deletions(-)
 delete mode 100644 sound/soc/tegra/tegra_asoc_utils.c
 delete mode 100644 sound/soc/tegra/tegra_asoc_utils.h
sound/soc/tegra/Makefile +0 -1
index b930ea7c75f1..e2cec9ae31c9 100644
@@ -15,7 +15,6 @@ snd-soc-tegra186-dspk-objs := tegra186_dspk.o
 snd-soc-tegra210-admaif-objs := tegra210_admaif.o
 
 obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-pcm.o
-obj-$(CONFIG_SND_SOC_TEGRA) += snd-soc-tegra-utils.o
 obj-$(CONFIG_SND_SOC_TEGRA20_AC97) += snd-soc-tegra20-ac97.o
 obj-$(CONFIG_SND_SOC_TEGRA20_DAS) += snd-soc-tegra20-das.o
 obj-$(CONFIG_SND_SOC_TEGRA20_I2S) += snd-soc-tegra20-i2s.o
sound/soc/tegra/tegra_asoc_machine.c +144 -9

176 lines not on this page · raw message

sound/soc/tegra/tegra_asoc_machine.h +6 -3
index f3a087a7548b..8ee0ec814f67 100644
@@ -3,8 +3,7 @@
 #ifndef __TEGRA_ASOC_MACHINE_H__
 #define __TEGRA_ASOC_MACHINE_H__
 
-#include "tegra_asoc_utils.h"
-
+struct clk;
 struct gpio_desc;
 struct snd_soc_card;
 struct snd_soc_jack;
@@ -27,7 +26,11 @@ struct tegra_asoc_data {
 };
 
 struct tegra_machine {
-	struct tegra_asoc_utils_data util_data;
+	struct clk *clk_pll_a_out0;
+	struct clk *clk_pll_a;
+	struct clk *clk_cdev1;
+	unsigned int set_baseclock;
+	unsigned int set_mclk;
 	const struct tegra_asoc_data *asoc;
 	struct gpio_desc *gpiod_ext_mic_en;
 	struct gpio_desc *gpiod_int_mic_en;
sound/soc/tegra/tegra_asoc_utils.c deleted +0 -225

225 lines not on this page · raw message

sound/soc/tegra/tegra_asoc_utils.h deleted +0 -38
deleted file mode 100644
index a34439587d59..000000000000
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * tegra_asoc_utils.h - Definitions for Tegra DAS driver
- *
- * Author: Stephen Warren <[email protected]>
- * Copyright (C) 2010,2012 - NVIDIA, Inc.
- */
-
-#ifndef __TEGRA_ASOC_UTILS_H__
-#define __TEGRA_ASOC_UTILS_H__
-
-struct clk;
-struct device;
-
-enum tegra_asoc_utils_soc {
-	TEGRA_ASOC_UTILS_SOC_TEGRA20,
-	TEGRA_ASOC_UTILS_SOC_TEGRA30,
-	TEGRA_ASOC_UTILS_SOC_TEGRA114,
-	TEGRA_ASOC_UTILS_SOC_TEGRA124,
-};
-
-struct tegra_asoc_utils_data {
-	struct device *dev;
-	enum tegra_asoc_utils_soc soc;
-	struct clk *clk_pll_a;
-	struct clk *clk_pll_a_out0;
-	struct clk *clk_cdev1;
-	int set_baseclock;
-	int set_mclk;
-};
-
-int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
-			      int mclk);
-int tegra_asoc_utils_set_ac97_rate(struct tegra_asoc_utils_data *data);
-int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
-			  struct device *dev);
-
-#endif
Signature · 1 line
2.30.2
#5 lore raw
In reply to Dmitry Osipenko

29.05.2021 18:46, Dmitry Osipenko пишет:

Quoted 7 lines

This series squashes all the ASoC machine drivers into a single one, this change was suggested by Jon Hunter. It also sets driver_name and components string of each card, allowing userspace alsa-lib to find UCMs at predictable path.

Changelog:

Quoted 7 lines

v6: - Fixed missed configuration of AC97 clock rate for the WM9712 codec
in the unified driver.

- Added new patch that removes now obsolete "utils" helpers and moves code into the unified driver.

ASoC: tegra: Squash utils into common machine driver

Jon, please feel free to give yours ack if v6 patches are good to you.

maintainer
#6 lore raw
In reply to Dmitry Osipenko
Quoted 8 lines · Dmitry Osipenko

This series squashes all the ASoC machine drivers into a single one, this change was suggested by Jon Hunter. It also sets driver_name and components string of each card, allowing userspace alsa-lib to find UCMs at predictable path.

Changelog:

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: tegra: Set driver_name=tegra for all machine drivers

      commit: f6eb84fa596abf28959fc7e0b626f925eb1196c7
[2/4] ASoC: tegra: Unify ASoC machine drivers
      commit: cc8f70f5603986a99e7775f3cc4a10d337b82a4d
[3/4] ASoC: tegra: Specify components string for each card
      commit: c16aab8ddc645f129880a266c1626b07b41f7c55
[4/4] ASoC: tegra: Squash utils into common machine driver
      commit: 8c1b3b159300cc5ef6ba0d4b039ef68e766d46e3

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