* [PATCH 0/2] cs35l56: Log tuning unique identifiers during firmware load
@ 2025-05-13 13:39 Simon Trimmer
2025-05-13 13:39 ` [PATCH 1/2] ASoC: " Simon Trimmer
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Simon Trimmer @ 2025-05-13 13:39 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches, Simon Trimmer
These two patches introduce a log message when provisioning the cs35l56
family of devices that uniquely identifies the firmware tuning.
Simon Trimmer (2):
ASoC: cs35l56: Log tuning unique identifiers during firmware load
ALSA: hda: cs35l56: Log tuning unique identifiers during firmware load
include/sound/cs35l56.h | 1 +
sound/pci/hda/cs35l56_hda.c | 2 ++
sound/soc/codecs/cs35l56-shared.c | 28 ++++++++++++++++++++++++++++
sound/soc/codecs/cs35l56.c | 1 +
4 files changed, 32 insertions(+)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ASoC: cs35l56: Log tuning unique identifiers during firmware load
2025-05-13 13:39 [PATCH 0/2] cs35l56: Log tuning unique identifiers during firmware load Simon Trimmer
@ 2025-05-13 13:39 ` Simon Trimmer
2025-05-13 13:39 ` [PATCH 2/2] ALSA: hda: " Simon Trimmer
2025-05-15 12:08 ` [PATCH 0/2] " Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Simon Trimmer @ 2025-05-13 13:39 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches, Simon Trimmer
The cs35l56 smart amplifier has some informational firmware controls
that are populated by a tuning bin file to unique values - logging these
during firmware load identifies the specific configuration being used on
that device instance.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
---
include/sound/cs35l56.h | 1 +
sound/soc/codecs/cs35l56-shared.c | 28 ++++++++++++++++++++++++++++
sound/soc/codecs/cs35l56.c | 1 +
3 files changed, 30 insertions(+)
diff --git a/include/sound/cs35l56.h b/include/sound/cs35l56.h
index 63f2c63f7c59..e17c4cadd04d 100644
--- a/include/sound/cs35l56.h
+++ b/include/sound/cs35l56.h
@@ -360,6 +360,7 @@ void cs35l56_init_cs_dsp(struct cs35l56_base *cs35l56_base, struct cs_dsp *cs_ds
int cs35l56_get_calibration(struct cs35l56_base *cs35l56_base);
int cs35l56_read_prot_status(struct cs35l56_base *cs35l56_base,
bool *fw_missing, unsigned int *fw_version);
+void cs35l56_log_tuning(struct cs35l56_base *cs35l56_base, struct cs_dsp *cs_dsp);
int cs35l56_hw_init(struct cs35l56_base *cs35l56_base);
int cs35l56_get_speaker_id(struct cs35l56_base *cs35l56_base);
int cs35l56_get_bclk_freq_id(unsigned int freq);
diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index 7f768718b69b..d0831d609584 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -909,6 +909,33 @@ int cs35l56_read_prot_status(struct cs35l56_base *cs35l56_base,
}
EXPORT_SYMBOL_NS_GPL(cs35l56_read_prot_status, "SND_SOC_CS35L56_SHARED");
+void cs35l56_log_tuning(struct cs35l56_base *cs35l56_base, struct cs_dsp *cs_dsp)
+{
+ __be32 pid, sid, tid;
+ int ret;
+
+ scoped_guard(mutex, &cs_dsp->pwr_lock) {
+ ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(cs_dsp, "AS_PRJCT_ID",
+ WMFW_ADSP2_XM, 0x9f212),
+ 0, &pid, sizeof(pid));
+ if (!ret)
+ ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(cs_dsp, "AS_CHNNL_ID",
+ WMFW_ADSP2_XM, 0x9f212),
+ 0, &sid, sizeof(sid));
+ if (!ret)
+ ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(cs_dsp, "AS_SNPSHT_ID",
+ WMFW_ADSP2_XM, 0x9f212),
+ 0, &tid, sizeof(tid));
+ }
+
+ if (ret)
+ dev_warn(cs35l56_base->dev, "Can't read tuning IDs");
+ else
+ dev_info(cs35l56_base->dev, "Tuning PID: %#x, SID: %#x, TID: %#x\n",
+ be32_to_cpu(pid), be32_to_cpu(sid), be32_to_cpu(tid));
+}
+EXPORT_SYMBOL_NS_GPL(cs35l56_log_tuning, "SND_SOC_CS35L56_SHARED");
+
int cs35l56_hw_init(struct cs35l56_base *cs35l56_base)
{
int ret;
@@ -1249,3 +1276,4 @@ MODULE_AUTHOR("Richard Fitzgerald <rf@opensource.cirrus.com>");
MODULE_AUTHOR("Simon Trimmer <simont@opensource.cirrus.com>");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS("SND_SOC_CS_AMP_LIB");
+MODULE_IMPORT_NS("FW_CS_DSP");
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index cdb283ed938c..c78e4746e428 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -847,6 +847,7 @@ static void cs35l56_dsp_work(struct work_struct *work)
else
cs35l56_patch(cs35l56, firmware_missing);
+ cs35l56_log_tuning(&cs35l56->base, &cs35l56->dsp.cs_dsp);
err:
pm_runtime_mark_last_busy(cs35l56->base.dev);
pm_runtime_put_autosuspend(cs35l56->base.dev);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ALSA: hda: cs35l56: Log tuning unique identifiers during firmware load
2025-05-13 13:39 [PATCH 0/2] cs35l56: Log tuning unique identifiers during firmware load Simon Trimmer
2025-05-13 13:39 ` [PATCH 1/2] ASoC: " Simon Trimmer
@ 2025-05-13 13:39 ` Simon Trimmer
2025-05-14 8:29 ` Mark Brown
2025-05-15 12:08 ` [PATCH 0/2] " Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Simon Trimmer @ 2025-05-13 13:39 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches, Simon Trimmer
The cs35l56 smart amplifier has some informational firmware controls
that are populated by a tuning bin file to unique values - logging these
during firmware load identifies the specific configuration being used on
that device instance.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
---
sound/pci/hda/cs35l56_hda.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
index b6fecf119261..aed7d7284231 100644
--- a/sound/pci/hda/cs35l56_hda.c
+++ b/sound/pci/hda/cs35l56_hda.c
@@ -676,6 +676,8 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
if (ret)
cs_dsp_stop(&cs35l56->cs_dsp);
+ cs35l56_log_tuning(&cs35l56->base, &cs35l56->cs_dsp);
+
err_powered_up:
if (!cs35l56->base.fw_patched)
cs_dsp_power_down(&cs35l56->cs_dsp);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ALSA: hda: cs35l56: Log tuning unique identifiers during firmware load
2025-05-13 13:39 ` [PATCH 2/2] ALSA: hda: " Simon Trimmer
@ 2025-05-14 8:29 ` Mark Brown
2025-05-14 8:51 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2025-05-14 8:29 UTC (permalink / raw)
To: Simon Trimmer; +Cc: linux-sound, linux-kernel, patches, tiwai
[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]
On Tue, May 13, 2025 at 01:39:24PM +0000, Simon Trimmer wrote:
> The cs35l56 smart amplifier has some informational firmware controls
> that are populated by a tuning bin file to unique values - logging these
> during firmware load identifies the specific configuration being used on
> that device instance.
Adding Takashi since this is an ALSA patch (and not deleting context for
him), Takashi is this OK to go via ASoC?
As documented in submitting-patches.rst please send patches to the
maintainers for the code you would like to change. The normal kernel
workflow is that people apply patches from their inboxes, if they aren't
copied they are likely to not see the patch at all and it is much more
difficult to apply patches.
>
> Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
> ---
> sound/pci/hda/cs35l56_hda.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
> index b6fecf119261..aed7d7284231 100644
> --- a/sound/pci/hda/cs35l56_hda.c
> +++ b/sound/pci/hda/cs35l56_hda.c
> @@ -676,6 +676,8 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
> if (ret)
> cs_dsp_stop(&cs35l56->cs_dsp);
>
> + cs35l56_log_tuning(&cs35l56->base, &cs35l56->cs_dsp);
> +
> err_powered_up:
> if (!cs35l56->base.fw_patched)
> cs_dsp_power_down(&cs35l56->cs_dsp);
> --
> 2.43.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ALSA: hda: cs35l56: Log tuning unique identifiers during firmware load
2025-05-14 8:29 ` Mark Brown
@ 2025-05-14 8:51 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2025-05-14 8:51 UTC (permalink / raw)
To: Mark Brown; +Cc: Simon Trimmer, linux-sound, linux-kernel, patches, tiwai
On Wed, 14 May 2025 10:29:53 +0200,
Mark Brown wrote:
>
> On Tue, May 13, 2025 at 01:39:24PM +0000, Simon Trimmer wrote:
> > The cs35l56 smart amplifier has some informational firmware controls
> > that are populated by a tuning bin file to unique values - logging these
> > during firmware load identifies the specific configuration being used on
> > that device instance.
>
> Adding Takashi since this is an ALSA patch (and not deleting context for
> him), Takashi is this OK to go via ASoC?
Sure, it's a simple logging, feel free to pick it up.
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
> As documented in submitting-patches.rst please send patches to the
> maintainers for the code you would like to change. The normal kernel
> workflow is that people apply patches from their inboxes, if they aren't
> copied they are likely to not see the patch at all and it is much more
> difficult to apply patches.
>
> >
> > Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
> > ---
> > sound/pci/hda/cs35l56_hda.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
> > index b6fecf119261..aed7d7284231 100644
> > --- a/sound/pci/hda/cs35l56_hda.c
> > +++ b/sound/pci/hda/cs35l56_hda.c
> > @@ -676,6 +676,8 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
> > if (ret)
> > cs_dsp_stop(&cs35l56->cs_dsp);
> >
> > + cs35l56_log_tuning(&cs35l56->base, &cs35l56->cs_dsp);
> > +
> > err_powered_up:
> > if (!cs35l56->base.fw_patched)
> > cs_dsp_power_down(&cs35l56->cs_dsp);
> > --
> > 2.43.0
> >
> Verifying...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] cs35l56: Log tuning unique identifiers during firmware load
2025-05-13 13:39 [PATCH 0/2] cs35l56: Log tuning unique identifiers during firmware load Simon Trimmer
2025-05-13 13:39 ` [PATCH 1/2] ASoC: " Simon Trimmer
2025-05-13 13:39 ` [PATCH 2/2] ALSA: hda: " Simon Trimmer
@ 2025-05-15 12:08 ` Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-05-15 12:08 UTC (permalink / raw)
To: Simon Trimmer; +Cc: linux-sound, linux-kernel, patches
On Tue, 13 May 2025 13:39:22 +0000, Simon Trimmer wrote:
> These two patches introduce a log message when provisioning the cs35l56
> family of devices that uniquely identifies the firmware tuning.
>
> Simon Trimmer (2):
> ASoC: cs35l56: Log tuning unique identifiers during firmware load
> ALSA: hda: cs35l56: Log tuning unique identifiers during firmware load
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: cs35l56: Log tuning unique identifiers during firmware load
commit: 823a036f049f5ea4afc55a2bc2e7f80a1acdef4a
[2/2] ALSA: hda: cs35l56: Log tuning unique identifiers during firmware load
commit: db13e3d58c682e0bfc08410e4961b23f4bdbc2e5
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-15 12:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 13:39 [PATCH 0/2] cs35l56: Log tuning unique identifiers during firmware load Simon Trimmer
2025-05-13 13:39 ` [PATCH 1/2] ASoC: " Simon Trimmer
2025-05-13 13:39 ` [PATCH 2/2] ALSA: hda: " Simon Trimmer
2025-05-14 8:29 ` Mark Brown
2025-05-14 8:51 ` Takashi Iwai
2025-05-15 12:08 ` [PATCH 0/2] " Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox