Skip to contentSkip to conversation

ASoC: CX2072X codec support (revised, v6)

PATCH In review Takashi Iwai 2 participants 6 messages May 21, 2019 – May 23, 2019

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

v6 cover ASoC: CX2072X codec support (revised, v6)

Hi,

the merge window was closed, and now it's time for fun again. This is a v6 revision of ASoC CX2072X codec support patchset for Intel platforms.

Takashi

===

v5->v6: Drop buggy&untested EQ and DRC codes
Lots of code reduction/cleanup in codec driver Add more comments about platform-specific stuff

v4->v5: Move clk management to runtime PM
Sparse warning fixes
Some more code simplification
Drop tricky regcache fiddling
Apply mutex locks around possible racy sequences Move exported jack detection stuff into set_jack callback

v3->v4: Fix the wrong endianess conversion in reg write
Minor code cleanups

v2->v3: CX2072X codec driver:
* Move register tables to appropriate place
* Remove some confusing codes
* Set snd_ctl_boolean_* helpers directly
* Fix EQ put callback
* Rename to "DAC1 Switch" from "DAC1 Mute Switch"
* Drop superfluous regmap calls at shutdown
* Avoid regmap_register_patch()
* Add missing register definitions
* Fix register access on big-endian machine
* Remove regcache messes
CX2072X machine driver:
* Add Pierre's ack
* Drop superfluous ssp0 routes

v1->v2: Uncomment SOF entries in ACPI binding
Move snd_soc_dai_set_bclk_ratio() call into init callback

The original cover letter is below:

===

It's been long time ago the first version of CX2072X codec patch was submitted, and I hoped that it'd be resubmitted, but never happened, as the original author seems to have left, unfortunately.

Since I have such a laptop (ASUS E200HA), I took some time to cook and brush up the patches. The patches are for 5.2, should be applicable to ASoC tree for-next branch.

Will post the corresponding UCM profile patch once when this gets accepted.

thanks,

Takashi

===

Simon Ho (1):
ASoC: Add support for Conexant CX2072X CODEC

Takashi Iwai (1):
ASoC: Intel: Add machine driver for CX2072X on BYT/CHT platforms

 sound/soc/codecs/Kconfig                          |    7 +
 sound/soc/codecs/Makefile                         |    2 +
 sound/soc/codecs/cx2072x.c                        | 1727 +++++++++++++++++++++
 sound/soc/codecs/cx2072x.h                        |  314 ++++
 sound/soc/intel/boards/Kconfig                    |   11 +
 sound/soc/intel/boards/Makefile                   |    2 +
 sound/soc/intel/boards/bytcht_cx2072x.c           |  262 ++++
 sound/soc/intel/common/soc-acpi-intel-byt-match.c |    8 +
 sound/soc/intel/common/soc-acpi-intel-cht-match.c |    8 +
 9 files changed, 2341 insertions(+)
 create mode 100644 sound/soc/codecs/cx2072x.c
 create mode 100644 sound/soc/codecs/cx2072x.h
 create mode 100644 sound/soc/intel/boards/bytcht_cx2072x.c
Signature · 1 line
2.16.4
#1 lore raw

PATCH v6 1/2 ASoC: Add support for Conexant CX2072X CODEC

From: Simon Ho <[email protected]>

Initial commit of the Conexant CX2072X CODEC driver. Some features are not present.

The CX2072X is a ultra low power stereo audio codec supports I2S/TDM host interface with EQ, DRC features in playback mode.

Featues of CX2072X codec:

* Two 24 bits DACs and DACs.
* Stereo Headphone AMP.
* 2.8W per channel class-D output.
* Integrated seven bands per channel EQ and DRC.
* Fully integrated headset support with detect/switch.
* Stereo digital microphone for array applications.
* S/PDIF output.
* Bi-directional GPIOs.
* Support analog and digital PC Beeep.
* One headset button support.
* Supports a wide variety of host interfaces. -wide variety of I2S and similar bit-stream formats with word lengths of up to 24 bits.
-TDM stream supports up to 4 channels.
* AEC loopback support.

Further fixes by tiwai:
* Rebase to 5.2+
* Missing DAPM entry definitions
* Missing power hooks
* Fix uninitialized variable warning
* Rewrite jack detection stuff to use set_jack callback
* Plumbing jack detection code for Intel ASoC
* Move clk management into runtime PM
* Drop incorrect regcache usages
* Drop untested stuff: OF table, EQ/DRC handling
* Lots of code cleanups and minor refactoring

The OF code was dropped due to the lack of testability. It should be easy to re-add once if someone can test it.

v1->v2: No change
v2->v3: Move register tables to appropriate place
Remove some confusing codes
Set snd_ctl_boolean_* helpers directly
Fix EQ put callback
Rename to "DAC1 Switch" from "DAC1 Mute Switch" Drop superfluous regmap calls at shutdown
Avoid regmap_register_patch()
Add missing register definitions
Fix register access on big-endian machine Remove regcache messes
v3->v4: Fix the wrong endianess conversion in reg write
Minor code cleanups
v4->v5: Move clk management to runtime PM
Sparse warning fixes
Some more code simplification
Drop tricky regcache fiddling
Apply mutex locks around possible racy sequences Move exported jack detection stuff into set_jack callback
v5->v6: Drop buggy&untested EQ and DRC codes
Lots of code reduction/cleanup
Add more comments about platform-specific stuff

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115531

---
 sound/soc/codecs/Kconfig   |    7 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cx2072x.c | 1727 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cx2072x.h |  314 ++++++++
 4 files changed, 2050 insertions(+)
 create mode 100644 sound/soc/codecs/cx2072x.c
 create mode 100644 sound/soc/codecs/cx2072x.h
sound/soc/codecs/Kconfig +7 -0
index 8f577258080b..472bde124ebe 100644
@@ -72,6 +72,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS47L24 if MFD_CS47L24
 	select SND_SOC_CS53L30 if I2C
 	select SND_SOC_CX20442 if TTY
+	select SND_SOC_CX2072X if I2C
 	select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI
 	select SND_SOC_DA7213 if I2C
 	select SND_SOC_DA7218 if I2C
@@ -584,6 +585,12 @@ config SND_SOC_CX20442
 	tristate
 	depends on TTY
 
+config SND_SOC_CX2072X
+	tristate "Conexant CX2072X CODEC"
+	depends on I2C
+	help
+	  Enable support for Conexant CX20721 and CX20723 codec chips.
+
 config SND_SOC_JZ4740_CODEC
 	depends on MIPS || COMPILE_TEST
 	select REGMAP_MMIO
sound/soc/codecs/Makefile +2 -0
index aa7720a7a0aa..454b8087a5bd 100644
@@ -67,6 +67,7 @@ snd-soc-cs4349-objs := cs4349.o
 snd-soc-cs47l24-objs := cs47l24.o
 snd-soc-cs53l30-objs := cs53l30.o
 snd-soc-cx20442-objs := cx20442.o
+snd-soc-cx2072x-objs := cx2072x.o
 snd-soc-da7210-objs := da7210.o
 snd-soc-da7213-objs := da7213.o
 snd-soc-da7218-objs := da7218.o
@@ -341,6 +342,7 @@ obj-$(CONFIG_SND_SOC_CS4349)	+= snd-soc-cs4349.o
 obj-$(CONFIG_SND_SOC_CS47L24)	+= snd-soc-cs47l24.o
 obj-$(CONFIG_SND_SOC_CS53L30)	+= snd-soc-cs53l30.o
 obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
+obj-$(CONFIG_SND_SOC_CX2072X)	+= snd-soc-cx2072x.o
 obj-$(CONFIG_SND_SOC_DA7210)	+= snd-soc-da7210.o
 obj-$(CONFIG_SND_SOC_DA7213)	+= snd-soc-da7213.o
 obj-$(CONFIG_SND_SOC_DA7218)	+= snd-soc-da7218.o
sound/soc/codecs/cx2072x.c new file +1727 -0

1,727 lines not on this page · raw message

sound/soc/codecs/cx2072x.h new file +314 -0

314 lines not on this page · raw message

Signature · 1 line
2.16.4
maintainer
#2 lore raw

Applied "ASoC: Add support for Conexant CX2072X CODEC" to the asoc tree

The patch

ASoC: Add support for Conexant CX2072X CODEC

has been applied to the asoc tree at

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

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

Quoted 1 line

From a497a4363706b3eb208c64e66e5b485bb3b186ac Mon Sep 17 00:00:00 2001

From: Simon Ho <[email protected]>
Date: Tue, 21 May 2019 08:26:52 +0200
Subject: [PATCH] ASoC: Add support for Conexant CX2072X CODEC

Initial commit of the Conexant CX2072X CODEC driver. Some features are not present.

The CX2072X is a ultra low power stereo audio codec supports I2S/TDM host interface with EQ, DRC features in playback mode.

Featues of CX2072X codec:

* Two 24 bits DACs and DACs.
* Stereo Headphone AMP.
* 2.8W per channel class-D output.
* Integrated seven bands per channel EQ and DRC.
* Fully integrated headset support with detect/switch.
* Stereo digital microphone for array applications.
* S/PDIF output.
* Bi-directional GPIOs.
* Support analog and digital PC Beeep.
* One headset button support.
* Supports a wide variety of host interfaces. -wide variety of I2S and similar bit-stream formats with word lengths of up to 24 bits.
-TDM stream supports up to 4 channels.
* AEC loopback support.

Further fixes by tiwai:
* Rebase to 5.2+
* Missing DAPM entry definitions
* Missing power hooks
* Fix uninitialized variable warning
* Rewrite jack detection stuff to use set_jack callback
* Plumbing jack detection code for Intel ASoC
* Move clk management into runtime PM
* Drop incorrect regcache usages
* Drop untested stuff: OF table, EQ/DRC handling
* Lots of code cleanups and minor refactoring

The OF code was dropped due to the lack of testability. It should be easy to re-add once if someone can test it.

v1->v2: No change
v2->v3: Move register tables to appropriate place
Remove some confusing codes
Set snd_ctl_boolean_* helpers directly
Fix EQ put callback
Rename to "DAC1 Switch" from "DAC1 Mute Switch" Drop superfluous regmap calls at shutdown
Avoid regmap_register_patch()
Add missing register definitions
Fix register access on big-endian machine Remove regcache messes
v3->v4: Fix the wrong endianess conversion in reg write
Minor code cleanups
v4->v5: Move clk management to runtime PM
Sparse warning fixes
Some more code simplification
Drop tricky regcache fiddling
Apply mutex locks around possible racy sequences Move exported jack detection stuff into set_jack callback
v5->v6: Drop buggy&untested EQ and DRC codes
Lots of code reduction/cleanup
Add more comments about platform-specific stuff

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115531

---
 sound/soc/codecs/Kconfig   |    7 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cx2072x.c | 1727 ++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cx2072x.h |  314 +++++++
 4 files changed, 2050 insertions(+)
 create mode 100644 sound/soc/codecs/cx2072x.c
 create mode 100644 sound/soc/codecs/cx2072x.h
sound/soc/codecs/Kconfig +7 -0
index 8f577258080b..472bde124ebe 100644
@@ -72,6 +72,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS47L24 if MFD_CS47L24
 	select SND_SOC_CS53L30 if I2C
 	select SND_SOC_CX20442 if TTY
+	select SND_SOC_CX2072X if I2C
 	select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI
 	select SND_SOC_DA7213 if I2C
 	select SND_SOC_DA7218 if I2C
@@ -584,6 +585,12 @@ config SND_SOC_CX20442
 	tristate
 	depends on TTY
 
+config SND_SOC_CX2072X
+	tristate "Conexant CX2072X CODEC"
+	depends on I2C
+	help
+	  Enable support for Conexant CX20721 and CX20723 codec chips.
+
 config SND_SOC_JZ4740_CODEC
 	depends on MIPS || COMPILE_TEST
 	select REGMAP_MMIO
sound/soc/codecs/Makefile +2 -0
index aa7720a7a0aa..454b8087a5bd 100644
@@ -67,6 +67,7 @@ snd-soc-cs4349-objs := cs4349.o
 snd-soc-cs47l24-objs := cs47l24.o
 snd-soc-cs53l30-objs := cs53l30.o
 snd-soc-cx20442-objs := cx20442.o
+snd-soc-cx2072x-objs := cx2072x.o
 snd-soc-da7210-objs := da7210.o
 snd-soc-da7213-objs := da7213.o
 snd-soc-da7218-objs := da7218.o
@@ -341,6 +342,7 @@ obj-$(CONFIG_SND_SOC_CS4349)	+= snd-soc-cs4349.o
 obj-$(CONFIG_SND_SOC_CS47L24)	+= snd-soc-cs47l24.o
 obj-$(CONFIG_SND_SOC_CS53L30)	+= snd-soc-cs53l30.o
 obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
+obj-$(CONFIG_SND_SOC_CX2072X)	+= snd-soc-cx2072x.o
 obj-$(CONFIG_SND_SOC_DA7210)	+= snd-soc-da7210.o
 obj-$(CONFIG_SND_SOC_DA7213)	+= snd-soc-da7213.o
 obj-$(CONFIG_SND_SOC_DA7218)	+= snd-soc-da7218.o
sound/soc/codecs/cx2072x.c new file +1727 -0

1,727 lines not on this page · raw message

sound/soc/codecs/cx2072x.h new file +314 -0

314 lines not on this page · raw message

Signature · 1 line
2.20.1
#3 lore raw

PATCH v6 2/2 ASoC: Intel: Add machine driver for CX2072X on BYT/CHT platforms

In reply to Takashi Iwai

This is an implementation of a machine driver needed for Conexant CX2072X codec on Intel Baytrail and Cherrytrail platforms. The current patch is based on the initial work by Pierre-Louis Bossart and the other Intel machine drivers.

The jack detection support (driven via the standard GPIO) was added on top of the original work.

Tested with ASUS E200HA laptop.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115531

---
v1->v2: Uncomment SOF entries in ACPI binding
Move snd_soc_dai_set_bclk_ratio() call into init callback
v2->v3: Add Pierre's ack
Drop superfluous ssp0 routes
v3->v4: No changes
v4->v5: Move some jack detection stuff into codec's set_jack call v5->v6: No changes

 sound/soc/intel/boards/Kconfig                    |  11 +
 sound/soc/intel/boards/Makefile                   |   2 +
 sound/soc/intel/boards/bytcht_cx2072x.c           | 262 ++++++++++++++++++++++
 sound/soc/intel/common/soc-acpi-intel-byt-match.c |   8 +
 sound/soc/intel/common/soc-acpi-intel-cht-match.c |   8 +
 5 files changed, 291 insertions(+)
 create mode 100644 sound/soc/intel/boards/bytcht_cx2072x.c
sound/soc/intel/boards/Kconfig +11 -0
index e39473a6a5d9..59e366edc16b 100644
@@ -155,6 +155,17 @@ config SND_SOC_INTEL_CHT_BSW_NAU8824_MACH
 	  Say Y or m if you have such a device. This is a recommended option.
 	  If unsure select "N".
 
+config SND_SOC_INTEL_BYT_CHT_CX2072X_MACH
+	tristate "Baytrail & Cherrytrail with CX2072X codec"
+	depends on X86_INTEL_LPSS && I2C && ACPI
+	select SND_SOC_ACPI
+	select SND_SOC_CX2072X
+	help
+	  This adds support for ASoC machine driver for Intel(R) Baytrail &
+	  Cherrytrail platforms with Conexant CX2072X audio codec.
+	  Say Y or m if you have such a device. This is a recommended option.
+	  If unsure select "N".
+
 config SND_SOC_INTEL_BYT_CHT_DA7213_MACH
 	tristate "Baytrail & Cherrytrail with DA7212/7213 codec"
 	depends on I2C && ACPI
sound/soc/intel/boards/Makefile +2 -0
index 451b3bd7d9c5..6445f90ea542 100644
@@ -13,6 +13,7 @@ snd-soc-sst-cht-bsw-rt5672-objs := cht_bsw_rt5672.o
 snd-soc-sst-cht-bsw-rt5645-objs := cht_bsw_rt5645.o
 snd-soc-sst-cht-bsw-max98090_ti-objs := cht_bsw_max98090_ti.o
 snd-soc-sst-cht-bsw-nau8824-objs := cht_bsw_nau8824.o
+snd-soc-sst-byt-cht-cx2072x-objs := bytcht_cx2072x.o
 snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o
 snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o
 snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o
@@ -42,6 +43,7 @@ obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH) += snd-soc-sst-cht-bsw-rt5672.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH) += snd-soc-sst-cht-bsw-rt5645.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH) += snd-soc-sst-cht-bsw-max98090_ti.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH) += snd-soc-sst-cht-bsw-nau8824.o
+obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH) += snd-soc-sst-byt-cht-cx2072x.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH) += snd-soc-sst-byt-cht-da7213.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH) += snd-soc-sst-byt-cht-es8316.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) += snd-soc-sst-byt-cht-nocodec.o
sound/soc/intel/boards/bytcht_cx2072x.c new file +262 -0

262 lines not on this page · raw message

sound/soc/intel/common/soc-acpi-intel-byt-match.c +8 -0
index 0cfab247876a..9cc7b17e0b10 100644
@@ -217,6 +217,14 @@ struct snd_soc_acpi_mach  snd_soc_acpi_intel_baytrail_machines[] = {
 		.sof_fw_filename = "sof-byt.ri",
 		.sof_tplg_filename = "sof-byt-max98090.tplg",
 	},
+	{
+		.id = "14F10720",
+		.drv_name = "bytcht_cx2072x",
+		.fw_filename = "intel/fw_sst_0f28.bin",
+		.board = "bytcht_cx2072x",
+		.sof_fw_filename = "sof-byt.ri",
+		.sof_tplg_filename = "sof-byt-cx2072x.tplg",
+	},
 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
 	/*
 	 * This is always last in the table so that it is selected only when
sound/soc/intel/common/soc-acpi-intel-cht-match.c +8 -0
index ff9c31a39ad4..6d0755f1353a 100644
@@ -175,6 +175,14 @@ struct snd_soc_acpi_mach  snd_soc_acpi_intel_cherrytrail_machines[] = {
 		.sof_fw_filename = "sof-cht.ri",
 		.sof_tplg_filename = "sof-cht-rt5651.tplg",
 	},
+	{
+		.id = "14F10720",
+		.drv_name = "bytcht_cx2072x",
+		.fw_filename = "intel/fw_sst_22a8.bin",
+		.board = "bytcht_cx2072x",
+		.sof_fw_filename = "sof-cht.ri",
+		.sof_tplg_filename = "sof-cht-cx2072x.tplg",
+	},
 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
 	/*
 	 * This is always last in the table so that it is selected only when
Signature · 1 line
2.16.4
maintainer
#4 lore raw

Applied "ASoC: Intel: Add machine driver for CX2072X on BYT/CHT platforms" to the asoc tree

The patch

ASoC: Intel: Add machine driver for CX2072X on BYT/CHT platforms

has been applied to the asoc tree at

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

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

Quoted 1 line

From 3917da94f787e6c907e440653ead0c666a71379e Mon Sep 17 00:00:00 2001

From: Takashi Iwai <[email protected]>
Date: Tue, 21 May 2019 08:26:53 +0200
Subject: [PATCH] ASoC: Intel: Add machine driver for CX2072X on BYT/CHT
platforms

This is an implementation of a machine driver needed for Conexant CX2072X codec on Intel Baytrail and Cherrytrail platforms. The current patch is based on the initial work by Pierre-Louis Bossart and the other Intel machine drivers.

The jack detection support (driven via the standard GPIO) was added on top of the original work.

Tested with ASUS E200HA laptop.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115531

---
 sound/soc/intel/boards/Kconfig                |  11 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/bytcht_cx2072x.c       | 262 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-byt-match.c   |   8 +
 .../intel/common/soc-acpi-intel-cht-match.c   |   8 +
 5 files changed, 291 insertions(+)
 create mode 100644 sound/soc/intel/boards/bytcht_cx2072x.c
sound/soc/intel/boards/Kconfig +11 -0
index e39473a6a5d9..59e366edc16b 100644
@@ -155,6 +155,17 @@ config SND_SOC_INTEL_CHT_BSW_NAU8824_MACH
 	  Say Y or m if you have such a device. This is a recommended option.
 	  If unsure select "N".
 
+config SND_SOC_INTEL_BYT_CHT_CX2072X_MACH
+	tristate "Baytrail & Cherrytrail with CX2072X codec"
+	depends on X86_INTEL_LPSS && I2C && ACPI
+	select SND_SOC_ACPI
+	select SND_SOC_CX2072X
+	help
+	  This adds support for ASoC machine driver for Intel(R) Baytrail &
+	  Cherrytrail platforms with Conexant CX2072X audio codec.
+	  Say Y or m if you have such a device. This is a recommended option.
+	  If unsure select "N".
+
 config SND_SOC_INTEL_BYT_CHT_DA7213_MACH
 	tristate "Baytrail & Cherrytrail with DA7212/7213 codec"
 	depends on I2C && ACPI
sound/soc/intel/boards/Makefile +2 -0
index 451b3bd7d9c5..6445f90ea542 100644
@@ -13,6 +13,7 @@ snd-soc-sst-cht-bsw-rt5672-objs := cht_bsw_rt5672.o
 snd-soc-sst-cht-bsw-rt5645-objs := cht_bsw_rt5645.o
 snd-soc-sst-cht-bsw-max98090_ti-objs := cht_bsw_max98090_ti.o
 snd-soc-sst-cht-bsw-nau8824-objs := cht_bsw_nau8824.o
+snd-soc-sst-byt-cht-cx2072x-objs := bytcht_cx2072x.o
 snd-soc-sst-byt-cht-da7213-objs := bytcht_da7213.o
 snd-soc-sst-byt-cht-es8316-objs := bytcht_es8316.o
 snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o
@@ -42,6 +43,7 @@ obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH) += snd-soc-sst-cht-bsw-rt5672.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH) += snd-soc-sst-cht-bsw-rt5645.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH) += snd-soc-sst-cht-bsw-max98090_ti.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH) += snd-soc-sst-cht-bsw-nau8824.o
+obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH) += snd-soc-sst-byt-cht-cx2072x.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH) += snd-soc-sst-byt-cht-da7213.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH) += snd-soc-sst-byt-cht-es8316.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) += snd-soc-sst-byt-cht-nocodec.o
sound/soc/intel/boards/bytcht_cx2072x.c new file +262 -0

262 lines not on this page · raw message

sound/soc/intel/common/soc-acpi-intel-byt-match.c +8 -0
index 0cfab247876a..9cc7b17e0b10 100644
@@ -217,6 +217,14 @@ struct snd_soc_acpi_mach  snd_soc_acpi_intel_baytrail_machines[] = {
 		.sof_fw_filename = "sof-byt.ri",
 		.sof_tplg_filename = "sof-byt-max98090.tplg",
 	},
+	{
+		.id = "14F10720",
+		.drv_name = "bytcht_cx2072x",
+		.fw_filename = "intel/fw_sst_0f28.bin",
+		.board = "bytcht_cx2072x",
+		.sof_fw_filename = "sof-byt.ri",
+		.sof_tplg_filename = "sof-byt-cx2072x.tplg",
+	},
 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
 	/*
 	 * This is always last in the table so that it is selected only when
sound/soc/intel/common/soc-acpi-intel-cht-match.c +8 -0
index ff9c31a39ad4..6d0755f1353a 100644
@@ -175,6 +175,14 @@ struct snd_soc_acpi_mach  snd_soc_acpi_intel_cherrytrail_machines[] = {
 		.sof_fw_filename = "sof-cht.ri",
 		.sof_tplg_filename = "sof-cht-rt5651.tplg",
 	},
+	{
+		.id = "14F10720",
+		.drv_name = "bytcht_cx2072x",
+		.fw_filename = "intel/fw_sst_22a8.bin",
+		.board = "bytcht_cx2072x",
+		.sof_fw_filename = "sof-cht.ri",
+		.sof_tplg_filename = "sof-cht-cx2072x.tplg",
+	},
 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH)
 	/*
 	 * This is always last in the table so that it is selected only when
Signature · 1 line
2.20.1
#5 lore raw
In reply to Takashi Iwai
Quoted 9 lines · Takashi Iwai

Hi,

the merge window was closed, and now it's time for fun again. This is a v6 revision of ASoC CX2072X codec support patchset for Intel platforms.

Takashi

Since Debian seems to take my patches, I post the corresponding patch for UCM below, too. It should be applicable to the latest alsa-lib git repo.

Takashi

-- 8< --
From: Takashi Iwai <[email protected]>
Subject: [PATCH alsa-lib] ucm: Add UCM profile for CX2072X codec on
Baytrail/Cherrytrail profiles

Adding a new Conexant CX2072X codec profile and reusing the existing BYT/CHT platform snippets.

Currently tested only on ASUS E200HA laptop.

---
 configure.ac                                    |  2 ++
 src/conf/ucm/Makefile.am                        |  1 +
 src/conf/ucm/bytcht-cx2072x/HiFi.conf           | 24 ++++++++++++++++++++++++
 src/conf/ucm/bytcht-cx2072x/Makefile.am         |  4 ++++
 src/conf/ucm/bytcht-cx2072x/bytcht-cx2072x.conf |  8 ++++++++
 src/conf/ucm/codecs/Makefile.am                 |  1 +
 src/conf/ucm/codecs/cx2072x/DisableSeq.conf     |  7 +++++++
 src/conf/ucm/codecs/cx2072x/EnableSeq.conf      | 13 +++++++++++++
 src/conf/ucm/codecs/cx2072x/HeadPhones.conf     | 24 ++++++++++++++++++++++++
 src/conf/ucm/codecs/cx2072x/HeadsetMic.conf     | 25 +++++++++++++++++++++++++
 src/conf/ucm/codecs/cx2072x/InternalMic.conf    | 24 ++++++++++++++++++++++++
 src/conf/ucm/codecs/cx2072x/Makefile.am         |  6 ++++++
 src/conf/ucm/codecs/cx2072x/Speaker.conf        | 23 +++++++++++++++++++++++
 13 files changed, 162 insertions(+)
 create mode 100644 src/conf/ucm/bytcht-cx2072x/HiFi.conf
 create mode 100644 src/conf/ucm/bytcht-cx2072x/Makefile.am
 create mode 100644 src/conf/ucm/bytcht-cx2072x/bytcht-cx2072x.conf
 create mode 100644 src/conf/ucm/codecs/cx2072x/DisableSeq.conf
 create mode 100644 src/conf/ucm/codecs/cx2072x/EnableSeq.conf
 create mode 100644 src/conf/ucm/codecs/cx2072x/HeadPhones.conf
 create mode 100644 src/conf/ucm/codecs/cx2072x/HeadsetMic.conf
 create mode 100644 src/conf/ucm/codecs/cx2072x/InternalMic.conf
 create mode 100644 src/conf/ucm/codecs/cx2072x/Makefile.am
 create mode 100644 src/conf/ucm/codecs/cx2072x/Speaker.conf
configure.ac +2 -0
index e9e1a3698bed..d451e5970b03 100644
@@ -720,6 +720,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 	  src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile \
 	  src/conf/ucm/broadwell-rt286/Makefile \
 	  src/conf/ucm/broxton-rt298/Makefile \
+	  src/conf/ucm/bytcht-cx2072x/Makefile \
 	  src/conf/ucm/bytcht-es8316/Makefile \
 	  src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/Makefile \
 	  src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/Makefile \
@@ -765,6 +766,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 	  src/conf/ucm/tegraalc5632/Makefile \
 	  src/conf/ucm/VEYRON-I2S/Makefile \
 	  src/conf/ucm/codecs/Makefile \
+	  src/conf/ucm/codecs/cx2072x/Makefile \
 	  src/conf/ucm/codecs/es8316/Makefile \
 	  src/conf/ucm/codecs/nau8824/Makefile \
 	  src/conf/ucm/codecs/rt5640/Makefile \
src/conf/ucm/Makefile.am +1 -0
index e9f88ed683a2..02257048860f 100644
@@ -4,6 +4,7 @@ platforms \
 ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN \
 broadwell-rt286 \
 broxton-rt298 \
+bytcht-cx2072x \
 bytcht-es8316 \
 bytcht-es8316-mono-spk-in1-mic \
 bytcht-es8316-mono-spk-in2-mic \
src/conf/ucm/bytcht-cx2072x/HiFi.conf new file +24 -0
new file mode 100644
index 000000000000..e9c1f7573d50
@@ -0,0 +1,24 @@
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytchtcx2072x"
+		<platforms/bytcr/PlatformEnableSeq.conf>
+		<codecs/cx2072x/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytchtcx2072x"
+		<codecs/cx2072x/DisableSeq.conf>
+		<platforms/bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytchtcx2072x"
+		CapturePCM "hw:bytchtcx2072x"
+	}
+}
+
+<codecs/cx2072x/Speaker.conf>
+<codecs/cx2072x/HeadPhones.conf>
+
+<codecs/cx2072x/InternalMic.conf>
+<codecs/cx2072x/HeadsetMic.conf>
src/conf/ucm/bytcht-cx2072x/Makefile.am new file +4 -0
new file mode 100644
index 000000000000..373b2a77079a
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcht-cx2072x
+ucm_DATA = bytcht-cx2072x.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcht-cx2072x/bytcht-cx2072x.conf new file +8 -0
new file mode 100644
index 000000000000..fce04456c678
@@ -0,0 +1,8 @@
+SectionUseCase."HiFi" {
+	File "HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytchtcx2072x"
+]
src/conf/ucm/codecs/Makefile.am +1 -0
index f78fd0817f75..5987b9cf89a4 100644
@@ -1,4 +1,5 @@
 SUBDIRS=\
+cx2072x \
 es8316 \
 rt5640 \
 rt5645 \
src/conf/ucm/codecs/cx2072x/DisableSeq.conf new file +7 -0
new file mode 100644
index 000000000000..1e3d5489da3f
@@ -0,0 +1,7 @@
+# Output Configuration
+cset "name='I2S DAC1L Switch' off"
+cset "name='I2S DAC1R Switch' off"
+
+# Input Configuration
+cset "name='I2S ADC1L Switch' off"
+cset "name='I2S ADC1R Switch' off"
src/conf/ucm/codecs/cx2072x/EnableSeq.conf new file +13 -0
new file mode 100644
index 000000000000..fb8e3fe23c4d
@@ -0,0 +1,13 @@
+# Disable all inputs / outputs
+cset "name='Ext Spk Switch' off"
+cset "name='Headphone Switch' off"
+cset "name='Headset Mic Switch' off"
+cset "name='Int Mic Switch' off"
+
+# Output Configuration
+cset "name='I2S DAC1L Switch' on"
+cset "name='I2S DAC1R Switch' on"
+
+# Input Configuration
+cset "name='I2S ADC1L Switch' on"
+cset "name='I2S ADC1R Switch' on"
src/conf/ucm/codecs/cx2072x/HeadPhones.conf new file +24 -0
new file mode 100644
index 000000000000..4e3ff950c130
@@ -0,0 +1,24 @@
+SectionDevice."Headphones" {
+	Comment "Headphones"
+
+	ConflictingDevice [
+		"Speaker"
+	]
+
+	EnableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Headphone Switch' on"
+		cset "name='PortA Out En Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Headphone Switch' off"
+		cset "name='PortA Out En Switch' off"
+	]
+
+	Value {
+		PlaybackChannels "2"
+		JackControl "Headphone Jack"
+	}
+}
src/conf/ucm/codecs/cx2072x/HeadsetMic.conf new file +25 -0
new file mode 100644
index 000000000000..26b8df160385
@@ -0,0 +1,25 @@
+SectionDevice."HeadsetMic" {
+	Comment "Headset Microphone"
+
+	ConflictingDevice [
+		"InternalMic"
+	]
+
+	EnableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Headset Mic Switch' on"
+		cset "name='ADC1 Mux' 'PortD Switch'"
+		cset "name='PortD In En Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Headset Mic Switch' off"
+		cset "name='PortD In En Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+		JackControl "Headset Mic Jack"
+	}
+}
src/conf/ucm/codecs/cx2072x/InternalMic.conf new file +24 -0
new file mode 100644
index 000000000000..a3e14538fe58
@@ -0,0 +1,24 @@
+SectionDevice."InternalMic" {
+	Comment "Internal Microphone"
+
+	ConflictingDevice [
+		"HeadsetMic"
+	]
+
+	EnableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Int Mic Switch' on"
+		cset "name='ADC1 Mux' 'PortC Switch'"
+		cset "name='PortC In En Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Int Mic Switch' off"
+		cset "name='PortC In En Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+	}
+}
src/conf/ucm/codecs/cx2072x/Makefile.am new file +6 -0
new file mode 100644
index 000000000000..2990fd096178
@@ -0,0 +1,6 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/codecs/cx2072x
+ucm_DATA = EnableSeq.conf DisableSeq.conf \
+	HeadPhones.conf Speaker.conf \
+	InternalMic.conf HeadsetMic.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/codecs/cx2072x/Speaker.conf new file +23 -0
new file mode 100644
index 000000000000..55e2b2ba33e4
@@ -0,0 +1,23 @@
+SectionDevice."Speaker" {
+	Comment "Speakers"
+
+	ConflictingDevice [
+		"Headphones"
+	]
+
+	EnableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Ext Spk Switch' on"
+		cset "name='PortG Out En Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytchtcx2072x"
+		cset "name='Ext Spk Switch' off"
+		cset "name='PortG Out En Switch' off"
+	]
+
+	Value {
+		PlaybackChannels "2"
+	}
+}
Signature · 1 line
2.16.4