linux-stable/sound/soc
Simon Trimmer b6b62d942b
ASoC: wm_adsp: Expand firmware loading search options
The parts supported by this driver can have product-specific
firmware and tunings files. Typically these have been used on
embedded systems where the manufacturer is responsible for
installing the correct product-specific firmware files into
/lib/firmware. However, the linux-firmware repository places all
available firmwares into /lib/firmware and it is up to the driver to
select the correct product-specific firmware from that directory.

For example a product containing four smart amplifiers may provide
firmware specific for that product and each of the amplifiers may
have coefficient files containing tunings for their placement in the
mechanical design.

This change extends firmware (wmfw) and coefficient (bin) filenames
to be of the general form:

<cirrus/>part-dspN-fwtype<-system_name<-asoc_component_prefix>>.type

Where the cirrus subdirectory, system_name and asoc_component_prefix
are optional.

New files will be placed in the cirrus subdirectory to avoid
polluting the main /lib/firmware/ location. The generic name must be
searched in /lib/firmware before /lib/firmware/cirrus so that a
generic file in the new location does not override existing
product-specific files in the legacy location.

The search order for firmware files is:
  - cirrus/part-dspN-fwtype-system_name-asoc_component_prefix.wmfw
  - cirrus/part-dspN-fwtype-system_name.wmfw
  - part-dspN-fwtype.wmfw
  - cirrus/part-dspN-fwtype.wmfw

- Qualifications are added to the filename so that rightwards is more
  specific.
- The system_name is provided by the codec driver.
- The asoc_component_prefix is used to identify tunings for individual
  parts because it would already exist to disambiguate the controls
  and it makes it obvious which firmware file applies to which device.

The optional coefficient file must have the same filename
construction as the discovered wmfw except:
  - where the wmfw has only system_name then the bin file can
    optionally include the asoc_component_prefix. This is to allow a
    common wmfw for all amps but separate tunings per amp.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220303155016.122125-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:57 +00:00
..
adi
amd ASoC: amd: pcm-dma: Fix signedness bug in acp3x_audio_probe() 2022-03-07 13:14:49 +00:00
atmel ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe 2022-03-07 13:14:50 +00:00
au1x
bcm ASoC: bcm: Use platform_get_irq() to get the interrupt 2021-12-21 18:05:43 +00:00
cirrus ARM: SoC drivers for 5.16 2021-11-03 17:00:52 -07:00
codecs ASoC: wm_adsp: Expand firmware loading search options 2022-03-07 13:14:57 +00:00
dwc ASoC: dwc-i2s: Handle errors for clk_enable 2022-03-02 13:45:24 +00:00
fsl ASoC: fsl: Drop unused argument from imx_pcm_dma_init() 2022-02-28 13:33:57 +00:00
generic ASoC: simple-card-utils: Add new system-clock-fixed flag 2022-01-24 19:45:43 +00:00
hisilicon
img ASoC: img: Use dev_err_probe() helper 2021-12-20 12:47:16 +00:00
intel ASoC: Intel: soc-acpi: add entries in ADL match table 2022-03-02 13:43:44 +00:00
jz4740
kirkwood
mediatek ASoC: mediatek: mt8195: Remove unnecessary print function dev_err() 2022-02-28 13:33:55 +00:00
meson ASoC: Merge fixes 2021-12-31 13:23:28 +00:00
mxs ASoC: mxs-saif: Handle errors for clk_enable 2022-03-02 13:45:21 +00:00
pxa
qcom ASoC: qcom: select correct WCD938X config for SC7280 2022-03-07 13:14:55 +00:00
rockchip ASoC: rk3399_gru_sound: Wire up DP jack detection 2022-01-28 15:59:27 +00:00
samsung ASoC: samsung: Explicitly include gpiolib header 2022-02-03 11:31:00 +00:00
sh ASoC: fsi: Add check for clk_enable 2022-03-07 13:14:56 +00:00
sof ASoC: soc-acpi: remove sof_fw_filename 2022-03-02 13:43:37 +00:00
spear
sprd
sti
stm ASoC: stm: Use dev_err_probe() helper 2021-12-20 12:47:23 +00:00
sunxi ASoC: sun4i-i2s: Add support for the R329/D1 variant 2022-02-03 11:30:57 +00:00
tegra ASoC: tegra20: spdif: make const array rates static 2022-02-15 12:52:44 +00:00
ti ASoC: ti: davinci-i2s: Add check for clk_enable() 2022-02-28 13:33:54 +00:00
uniphier ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA 2021-11-25 11:54:30 +00:00
ux500
xilinx ASoC: xilinx: xlnx_i2s: Handle sysclk setting 2022-01-24 19:45:38 +00:00
xtensa
Kconfig
Makefile
soc-ac97.c
soc-acpi.c ASoC: soc-acpi: Set mach->id field on comp_ids matches 2021-11-22 15:40:01 +00:00
soc-card.c
soc-component.c ASoC: soc-component: add snd_soc_pcm_component_delay() 2021-11-29 12:19:41 +00:00
soc-compress.c ASoC: soc-compress: prevent the potentially use of null pointer 2022-03-02 13:45:26 +00:00
soc-core.c ASoC: soc-core: skip zero num_dai component in searching dai name 2022-02-15 12:52:45 +00:00
soc-dai.c ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay() 2021-11-29 12:19:40 +00:00
soc-dapm.c ASoC: DAPM: Cover regression by kctl change notification fix 2021-11-05 12:58:12 +00:00
soc-devres.c
soc-generic-dmaengine-pcm.c ASoC: soc-generic-dmaengine-pcm: set period_bytes_min based on maxburst 2022-03-02 13:45:25 +00:00
soc-jack.c
soc-link.c
soc-ops.c
soc-pcm.c ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE 2021-12-14 17:15:48 +00:00
soc-topology-test.c
soc-topology.c ASoC: topology: Optimize soc_tplg_dapm_graph_elems_load behavior 2022-01-24 13:31:23 +00:00
soc-utils.c ASoC: Stop dummy from overriding hwparams 2021-10-29 16:49:45 +01:00