All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-ucm-conf 1/2] sof-soundwire: Add missing match for cs42l43 speakers
@ 2024-06-24 12:20 Charles Keepax
  2024-06-24 12:20 ` [PATCH alsa-ucm-conf 2/2] sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration Charles Keepax
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Keepax @ 2024-06-24 12:20 UTC (permalink / raw)
  To: perex; +Cc: pierre-louis.bossart, bard.liao, patches, alsa-devel

The cs42l43 reports as cs42l43-spk in the speaker case, the regex in
sof-soundwire needs updated to recognise that.

Fixes: 035d9206cffd ("sof-soundwire: Add basic support for cs42l43's speaker")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 ucm2/sof-soundwire/sof-soundwire.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf
index 31492e3..2f61d11 100644
--- a/ucm2/sof-soundwire/sof-soundwire.conf
+++ b/ucm2/sof-soundwire/sof-soundwire.conf
@@ -21,7 +21,7 @@ Define {
 
 DefineRegex {
 	SpeakerCodec {
-		Regex " spk:([a-z0-9]+(-sdca)?)"
+		Regex " spk:([a-z0-9]+((-sdca)|(-spk))?)"
 		String "${CardComponents}"
 	}
 	SpeakerChannels {
-- 
2.39.2


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

* [PATCH alsa-ucm-conf 2/2] sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration
  2024-06-24 12:20 [PATCH alsa-ucm-conf 1/2] sof-soundwire: Add missing match for cs42l43 speakers Charles Keepax
@ 2024-06-24 12:20 ` Charles Keepax
  2024-06-24 12:41   ` Jaroslav Kysela
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Keepax @ 2024-06-24 12:20 UTC (permalink / raw)
  To: perex; +Cc: pierre-louis.bossart, bard.liao, patches, alsa-devel

The cs42l43 has both a SPI master and an I2S interface, in some
configurations 2 cs35l56 amplifiers are connected to these to provide
bass speakers whilst the cs42l43's internal speaker drivers are used for
the tweeters. Add UCM configuration for this type of system.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 ucm2/sof-soundwire/cs35l56-bridge.conf | 61 ++++++++++++++++++++++++++
 ucm2/sof-soundwire/sof-soundwire.conf  |  2 +-
 2 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 ucm2/sof-soundwire/cs35l56-bridge.conf

diff --git a/ucm2/sof-soundwire/cs35l56-bridge.conf b/ucm2/sof-soundwire/cs35l56-bridge.conf
new file mode 100644
index 0000000..6fafc80
--- /dev/null
+++ b/ucm2/sof-soundwire/cs35l56-bridge.conf
@@ -0,0 +1,61 @@
+# Use case Configuration for sof-soundwire card
+
+LibraryConfig.remap.Config {
+	ctl.default.map {
+		"name='cs42l43 Bridge Switch'" {
+			"name='AMPL Speaker Switch'".vindex.0 0
+			"name='AMPR Speaker Switch'".vindex.1 0
+		}
+		"name='cs42l43 Bridge Volume'" {
+			"name='AMPL Speaker Volume'".vindex.0 0
+			"name='AMPR Speaker Volume'".vindex.1 0
+		}
+	}
+}
+
+SectionDevice."Speaker" {
+	Comment "Speaker"
+
+	ConflictingDevice [
+		"Headphones"
+	]
+
+	EnableSequence [
+		cset "name='cs42l43 Speaker L Input 1' 'ASPRX1'"
+		cset "name='cs42l43 Speaker R Input 1' 'ASPRX2'"
+		cset "name='cs42l43 ASPTX1 Input' 'DP5RX1'"
+		cset "name='cs42l43 ASPTX2 Input' 'DP5RX2'"
+
+		cset "name='AMPL ASP1 TX1 Source' 'DSP1TX1'"
+		cset "name='AMPL ASP1 TX2 Source' 'None'"
+		cset "name='AMPL ASP1 TX3 Source' 'None'"
+		cset "name='AMPL ASP1 TX4 Source' 'None'"
+
+		cset "name='AMPR ASP1 TX1 Source' 'None'"
+		cset "name='AMPR ASP1 TX2 Source' 'DSP1TX1'"
+		cset "name='AMPR ASP1 TX3 Source' 'None'"
+		cset "name='AMPR ASP1 TX4 Source' 'None'"
+
+		cset "name='cs42l43 Speaker Digital Switch' 1"
+		cset "name='cs42l43 Speaker Digital Volume' 128"
+	]
+
+	DisableSequence [
+		cset "name='cs42l43 Speaker Digital Switch' 0"
+
+		cset "name='AMPL ASP1 TX2 Source' 'None'"
+		cset "name='AMPR ASP1 TX1 Source' 'None'"
+
+		cset "name='cs42l43 ASPTX1 Input' 'None'"
+		cset "name='cs42l43 ASPTX2 Input' 'None'"
+		cset "name='cs42l43 Speaker L Input 1' 'None'"
+		cset "name='cs42l43 Speaker R Input 1' 'None'"
+	]
+
+	Value {
+		PlaybackPriority 100
+		PlaybackPCM "hw:${CardId},0"
+		PlaybackMixer "default:${CardId}"
+		PlaybackMixerElem "cs42l43 Bridge"
+	}
+}
diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf
index 2f61d11..2ede1cd 100644
--- a/ucm2/sof-soundwire/sof-soundwire.conf
+++ b/ucm2/sof-soundwire/sof-soundwire.conf
@@ -21,7 +21,7 @@ Define {
 
 DefineRegex {
 	SpeakerCodec {
-		Regex " spk:([a-z0-9]+((-sdca)|(-spk))?)"
+		Regex " spk:([a-z0-9]+((-sdca)|(-spk)|(-bridge))?)"
 		String "${CardComponents}"
 	}
 	SpeakerChannels {
-- 
2.39.2


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

* Re: [PATCH alsa-ucm-conf 2/2] sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration
  2024-06-24 12:20 ` [PATCH alsa-ucm-conf 2/2] sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration Charles Keepax
@ 2024-06-24 12:41   ` Jaroslav Kysela
  2024-06-24 13:28     ` Charles Keepax
  0 siblings, 1 reply; 4+ messages in thread
From: Jaroslav Kysela @ 2024-06-24 12:41 UTC (permalink / raw)
  To: Charles Keepax; +Cc: pierre-louis.bossart, bard.liao, patches, alsa-devel

On 24. 06. 24 14:20, Charles Keepax wrote:
> The cs42l43 has both a SPI master and an I2S interface, in some
> configurations 2 cs35l56 amplifiers are connected to these to provide
> bass speakers whilst the cs42l43's internal speaker drivers are used for
> the tweeters. Add UCM configuration for this type of system.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
>   ucm2/sof-soundwire/cs35l56-bridge.conf | 61 ++++++++++++++++++++++++++
>   ucm2/sof-soundwire/sof-soundwire.conf  |  2 +-
>   2 files changed, 62 insertions(+), 1 deletion(-)
>   create mode 100644 ucm2/sof-soundwire/cs35l56-bridge.conf
> 
> diff --git a/ucm2/sof-soundwire/cs35l56-bridge.conf b/ucm2/sof-soundwire/cs35l56-bridge.conf
> new file mode 100644
> index 0000000..6fafc80
> --- /dev/null
> +++ b/ucm2/sof-soundwire/cs35l56-bridge.conf
> @@ -0,0 +1,61 @@
> +# Use case Configuration for sof-soundwire card
> +
> +LibraryConfig.remap.Config {
> +	ctl.default.map {
> +		"name='cs42l43 Bridge Switch'" {
> +			"name='AMPL Speaker Switch'".vindex.0 0
> +			"name='AMPR Speaker Switch'".vindex.1 0

The logical/abstract names should not contains any chip or specific hardware 
identification. Just use "Speaker Switch" and "Speaker Volume" to not confuse 
users.

For my information - "AMPL/R Speaker Volume" is digital or analog volume control?

				Thanks,
					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


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

* Re: [PATCH alsa-ucm-conf 2/2] sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration
  2024-06-24 12:41   ` Jaroslav Kysela
@ 2024-06-24 13:28     ` Charles Keepax
  0 siblings, 0 replies; 4+ messages in thread
From: Charles Keepax @ 2024-06-24 13:28 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: pierre-louis.bossart, bard.liao, patches, alsa-devel

On Mon, Jun 24, 2024 at 02:41:45PM +0200, Jaroslav Kysela wrote:
> On 24. 06. 24 14:20, Charles Keepax wrote:
> > The cs42l43 has both a SPI master and an I2S interface, in some
> > configurations 2 cs35l56 amplifiers are connected to these to provide
> > bass speakers whilst the cs42l43's internal speaker drivers are used for
> > the tweeters. Add UCM configuration for this type of system.
> > 
> > Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> > ---
> >   ucm2/sof-soundwire/cs35l56-bridge.conf | 61 ++++++++++++++++++++++++++
> >   ucm2/sof-soundwire/sof-soundwire.conf  |  2 +-
> >   2 files changed, 62 insertions(+), 1 deletion(-)
> >   create mode 100644 ucm2/sof-soundwire/cs35l56-bridge.conf
> > 
> > diff --git a/ucm2/sof-soundwire/cs35l56-bridge.conf b/ucm2/sof-soundwire/cs35l56-bridge.conf
> > new file mode 100644
> > index 0000000..6fafc80
> > --- /dev/null
> > +++ b/ucm2/sof-soundwire/cs35l56-bridge.conf
> > @@ -0,0 +1,61 @@
> > +# Use case Configuration for sof-soundwire card
> > +
> > +LibraryConfig.remap.Config {
> > +	ctl.default.map {
> > +		"name='cs42l43 Bridge Switch'" {
> > +			"name='AMPL Speaker Switch'".vindex.0 0
> > +			"name='AMPR Speaker Switch'".vindex.1 0
> 
> The logical/abstract names should not contains any chip or specific hardware
> identification. Just use "Speaker Switch" and "Speaker Volume" to not
> confuse users.
> 

Can do.

> For my information - "AMPL/R Speaker Volume" is digital or analog volume control?
> 

It's a digital volume, although I guess technically its
controlled by firmware in this case, so in the future it could
be updated to actually control the analog volume, but I am not
aware of any plans to do so.

Thanks,
Charles

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

end of thread, other threads:[~2024-06-24 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24 12:20 [PATCH alsa-ucm-conf 1/2] sof-soundwire: Add missing match for cs42l43 speakers Charles Keepax
2024-06-24 12:20 ` [PATCH alsa-ucm-conf 2/2] sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration Charles Keepax
2024-06-24 12:41   ` Jaroslav Kysela
2024-06-24 13:28     ` Charles Keepax

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.