aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-03-02Merge tag 'tags/sound-sdw-kconfig-fixes' into for-linusTakashi Iwai1-1/+1
ALSA/ASoC/SOF/SoundWire: fix Kconfig issues In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to a) expose ACPI and PCI devices in separate modules, while sof-acpi-dev and sof-pci-dev become helpers. This will result in minor changes required for developers/testers, i.e. modprobe snd-sof-pci will no longer result in a probe. The SOF CI was already updated to deal with this module dependency change and introduction of new modules. b) Fix SOF/SoundWire/DSP_config dependencies by moving the code required to detect SoundWire presence in ACPI tables to sound/hda. Link: https://lore.kernel.org/r/20210302003125.1178419-1-pierre-louis.bossart@linux.intel.com
2021-03-02ASoC: soc-acpi: allow for partial match in parent namePierre-Louis Bossart1-1/+1
To change the module dependencies and simplify Kconfigs, we need to introduce new driver names (sof-audio-acpi-intel-byt and sof-audio-acpi-intel-bdw), and move from an exact string match to a partial one. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Bard Liao <bard.liao@intel.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20210302003125.1178419-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-02ALSA: hda: intel-nhlt: verify config typePierre-Louis Bossart1-0/+5
Multiple bug reports report issues with the SOF and SST drivers when dealing with single microphone cases. We currently read the DMIC array information unconditionally but we don't check that the configuration type is actually a mic array. When the DMIC link does not rely on a mic array configuration, the recommendation is to check the format information to infer the maximum number of channels, and map this to the number of microphones. This leaves a potential for a mismatch between actual microphones available in hardware and what the ACPI table contains, but we have no other source of information. Note that single microphone configurations can alternatively be handled with a 'mic array' configuration along with a 'vendor-defined' geometry. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201251 BugLink: https://github.com/thesofproject/linux/issues/2725 Fixes: 7a33ea70e1868 ('ALSA: hda: intel-nhlt: handle NHLT VENDOR_DEFINED DMIC geometry') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210302000146.1177770-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-17Merge tag 'asoc-v5.12' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai8-9/+29
ASoC: Updates for v5.12 Another quiet release in terms of features, though several of the drivers got quite a bit of work and there were a lot of general changes resulting from Morimoto-san's ongoing cleanup work. - As ever, lots of hard work by Morimoto-san cleaning up the code and making it more consistent. - Many improvements in the Intel drivers including a wide range of quirks and bug fixes. - A KUnit testsuite for the topology code. - Support for Ingenic JZ4760(B), Intel AlderLake-P, DT configured nVidia cards, Qualcomm lpass-rx-macro and lpass-tx-macro - Removal of obsolete SIRF prima/atlas, Txx9 and ZTE zx drivers.
2021-02-17Merge remote-tracking branch 'asoc/for-5.12' into asoc-linusMark Brown8-9/+29
2021-02-10ASoC: SOF: ext_manifest: use explicit number for elem_typeFred Oh1-3/+3
Use explicit number to define elem_type enum instead of using SOF_IPC_EXT_*. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Karol Trzciński <karolx.trzcinski@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210208232149.58899-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-08Merge series "Add HDMI support for Intel KeemBay I2S" from Sia Jee Heng <jee.heng.sia@intel.com>:Mark Brown1-0/+5
The below patch series are to support Audio over HDMI. The modification in this patch series shall allow I2S driver to playback standard PCM format and IEC958 encoded format to the ADV7511 HDMI chip. ALSA IEC958 plugin will be used to compose the IEC958 format. Existing hdmi-codec driver only support standard pcm format. Support of IEC958 encoded format passdown from ALSA IEC958 plugin is needed so that the IEC958 encoded data can be streamed to the HDMI chip. Sia Jee Heng (4): ASoC: codec: hdmi-codec: Support IEC958 encoded PCM format drm: bridge: adv7511: Support I2S IEC958 encoded PCM format dt-bindings: sound: Intel, Keembay-i2s: Add hdmi-i2s compatible string ASoC: Intel: KMB: Support IEC958 encoded PCM format .../bindings/sound/intel,keembay-i2s.yaml | 1 + drivers/gpu/drm/bridge/adv7511/adv7511.h | 1 + .../gpu/drm/bridge/adv7511/adv7511_audio.c | 6 ++ include/sound/hdmi-codec.h | 5 ++ sound/soc/codecs/hdmi-codec.c | 4 +- sound/soc/intel/keembay/kmb_platform.c | 73 ++++++++++++++++++- sound/soc/intel/keembay/kmb_platform.h | 1 + 7 files changed, 89 insertions(+), 2 deletions(-) base-commit: 2557c711b87cd42bb22be9ca6ff3fce038624f30 -- 2.18.0
2021-02-08ALSA: hda: add link_power op to hdac_bus_opsKai Vehmanen2-9/+7
The extended HDA bus (hdac_ext) provides interfaces for more fine-grained control of individual links than what plain HDA provides for. Links can be powered off when they are not used and if all links are released, controller can shut down the command DMA. These interfaces are currently not used by common HDA codec drivers. When a HDA codec is runtime suspended, it calls snd_hdac_codec_link_down(), but there is no link to the HDA extended bus, and on controller side the links are shut down only when all codecs are suspended. This patch adds link_power() to hdac_bus ops. Controllers using the HDA extended core, can use this to plug in snd_hdac_ext_bus_link_power() to implement more fine-grained control of link power. No change is needed for plain HDA controllers nor to existing HDA codec drivers. Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210205184630.1938761-2-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-08ASoC: codec: hdmi-codec: Support IEC958 encoded PCM formatSia Jee Heng1-0/+5
Existing hdmi-codec driver only support standard pcm format. Support of IEC958 encoded format pass from ALSA IEC958 plugin is needed so that the IEC958 encoded data can be streamed to the HDMI chip. Signed-off-by: Sia Jee Heng <jee.heng.sia@intel.com> Link: https://lore.kernel.org/r/20210204014258.10197-2-jee.heng.sia@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-08ASoC: audio-graph: Rename functions needed for exportSameer Pujar1-2/+4
Following functions are renamed for a better global visibility. graph_card_probe() --> audio_graph_card_probe() graph_parse_of() --> audio_graph_parse_of() graph_remove() --> audio_graph_remove() [exported as well] The references of these are updated in audio graph and Tegra audio graph card drivers. Signed-off-by: Sameer Pujar <spujar@nvidia.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/1612719418-5858-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05ASoC: dmaengine_pcm: add peripheral configurationShengjiu Wang1-0/+5
The commit e7bbb7acabf4 ("dmaengine: add peripheral configuration") adds peripheral configuration for dma_slave_config. This configuration is useful for some audio peripherals, for example, the peripheral supports multi fifos, we can let the DMA know which fifos are selected. So also add this configuration for snd_dmaengine_dai_dma_data. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1612509985-11063-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02Merge branch 'for-linus' into for-nextTakashi Iwai1-1/+1
Back-merge the 5.11 devel branch for further patching. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-02ALSA: jack: implement software jack injection via debugfsHui Wang2-0/+7
This change adds audio jack injection feature through debugfs, with this feature, we could validate alsa userspace changes by injecting plugin or plugout events to the non-phantom audio jacks. With this change, the sound core will build the folders $debugfs_mount_dir/sound/cardN if SND_DEBUG and DEBUG_FS are enabled. And if users also enable the SND_JACK_INJECTION_DEBUG, the jack injection nodes will be built in the folder cardN like below: $tree $debugfs_mount_dir/sound $debugfs_mount_dir/sound ├── card0 │   ├── HDMI_DP_pcm_10_Jack │   │   ├── jackin_inject │   │   ├── kctl_id │   │   ├── mask_bits │   │   ├── status │   │   ├── sw_inject_enable │   │   └── type ... │   └── HDMI_DP_pcm_9_Jack │   ├── jackin_inject │   ├── kctl_id │   ├── mask_bits │   ├── status │   ├── sw_inject_enable │   └── type └── card1 ├── HDMI_DP_pcm_5_Jack │   ├── jackin_inject │   ├── kctl_id │   ├── mask_bits │   ├── status │   ├── sw_inject_enable │   └── type ... ├── Headphone_Jack │   ├── jackin_inject │   ├── kctl_id │   ├── mask_bits │   ├── status │   ├── sw_inject_enable │   └── type └── Headset_Mic_Jack ├── jackin_inject ├── kctl_id ├── mask_bits ├── status ├── sw_inject_enable └── type The nodes kctl_id, mask_bits, status and type are read-only, users could check jack or jack_kctl's information through them. The nodes sw_inject_enable and jackin_inject are directly used for injection. The sw_inject_enable is read-write, users could check if software injection is enabled or not on this jack, and users could echo 1 or 0 to enable or disable software injection on this jack. Once the injection is enabled, the jack will not change by hardware events anymore, once the injection is disabled, the jack will restore the last reported hardware events to the jack. The jackin_inject is write-only, if the injection is enabled, users could echo 1 or 0 to this node to inject plugin or plugout events to this jack. For the detailed usage information on these nodes, please refer to Documentation/sound/designs/jack-injection.rst. Reviewed-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20210127085639.74954-2-hui.wang@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-27ASoC: soc-component: add snd_soc_component_read/write_field()Srinivas Kandagatla1-0/+6
It's often the case that we would write or read a particular field in register. With the current soc_component apis, reading a particular field in register would involve first read the register and then perform shift operations. Ex: to read from a field mask of 0xf0 val = snd_soc_component_read(component, reg); field = ((val & 0xf0) >> 0x4); This is sometimes prone to errors and code become less readable! With this new api we could just do field = snd_soc_component_read_field(component, reg, 0xf0); this makes it bit simple, easy to write and less error prone! This also applies to writing! There are various places in kernel which provides such field interfaces however soc_component seems to be missing this. This patch is inspired by FIELD_GET/FIELD_PREP macros in include/linux/bitfield.h Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210126171749.1863-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-23ALSA: pcm: One more dependency for hw constraintsTakashi Iwai1-1/+1
The fix for a long-standing USB-audio bug required one more dependency variable to be added to the hw constraints. Unfortunately I didn't realize at debugging that the new addition may result in the overflow of the dependency array of each snd_pcm_hw_rule (up to three plus a sentinel), because USB-audio driver adds one more dependency only for a certain device and bus, hence it works as is for many devices. But in a bad case, a simple open always results in -EINVAL (with kernel WARNING if CONFIG_SND_DEBUG is set) no matter what is passed. Since the dependencies are real and unavoidable (USB-audio restricts the hw_params per looping over the format/rate/channels combos), the only good solution seems to raise the bar for one more dependency for snd_pcm_hw_rule -- so does this patch: now the hw constraint dependencies can be up to four. Fixes: 506c203cc3de ("ALSA: usb-audio: Fix hw constraints dependencies") Reported-by: Jamie Heilman <jamie@audible.transient.net> Link: https://lore.kernel.org/r/20210123155730.22576-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-21ASoC: soc-dai.h: remove symmetric_rates/samplebitsKuninori Morimoto1-2/+0
All drivers are using new name. Let's remove old one. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bldqn6sr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: sync parameter naming : rate / sample_bitsKuninori Morimoto2-4/+6
snd_pcm_runtime / snd_soc_dai / snd_soc_dai_driver / snd_soc_dai_link have related parameter which is similar but not same naming. struct snd_pcm_runtime { ... (A) unsigned int rate; ... (B) unsigned int sample_bits; ... }; struct snd_soc_dai { ... (A) unsigned int rate; (B) unsigned int sample_bits; ... }; struct snd_soc_dai_driver { ... (A) unsigned int symmetric_rates:1; (B) unsigned int symmetric_samplebits:1; ... }; struct snd_soc_dai_link { ... (A) unsigned int symmetric_rates:1; (B) unsigned int symmetric_samplebits:1; ... }; Because it is similar but not same naming rule, code can be verbose / can't share macro. This patch sync naming rule for framework. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; old name will be removed if all drivers were switched to new naming rule. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wnweolj6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11ASoC: rt5645: add inv_hp_det flagChris Chiu1-0/+2
The ECS EF20EA laptop use gpio for jack detection instead of rt5645 rt5645 JD. However, the GPIO polarity is inverse for hp-detect based on the _DSD property of the RTK2 device. Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package () {"hp-detect-gpio", Package() {^RTK2, 0, 0, 1 }}, } }) This flag will invert the hp-detect gpio polarity. Signed-off-by: Chris Chiu <chiu@endlessos.org> Link: https://lore.kernel.org/r/20210111054141.4668-4-chiu@endlessos.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-14Merge tag 'asoc-v5.11' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai18-171/+350
ASoC: Updates for v5.11 There's a lot of changes here but mostly cleanups and driver specific things, the most user visible change is the support for boot time selection of Intel DSP firmware which will make it easier for people to move over to the preferred modern implementations in distros and other large scale deployments. This also includes a merge of the new auxillary bus which was done in anticipation of use by the Intel DSP drivers which didn't quite make it. - Lots more cleanups and simplifications from Morimoto-san. - Support for some basic DPCM systems in the audio graph card from Sameer Pujar. - Remove some old pre-DT Freescale drivers for platforms that are now DT only. - Move selection of which Intel DSP implementation to use to boot time rather than requiring it to be selected at build time. - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek RT715, Qualcomm SM8250 and simple GPIO based muxes.
2020-12-09ASoC: Intel: common: add ACPI matching tables for Alder LakeKai Vehmanen1-0/+2
Initial support for ADL w/ RT711 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20201209153102.3028310-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09ASoC: soc-pcm: care trigger rollbackKuninori Morimoto4-3/+8
soc_pcm_trigger() calls DAI/Component/Link trigger, but some of them might be failed. static int soc_pcm_trigger(...) { ... switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = snd_soc_link_trigger(substream, cmd); if (ret < 0) break; (*) ret = snd_soc_pcm_component_trigger(substream, cmd); if (ret < 0) break; ret = snd_soc_pcm_dai_trigger(substream, cmd); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ret = snd_soc_pcm_dai_trigger(substream, cmd); if (ret < 0) break; ret = snd_soc_pcm_component_trigger(substream, cmd); if (ret < 0) break; ret = snd_soc_link_trigger(substream, cmd); break; } ... } For example, if soc_pcm_trigger() failed at (*) point, we need to rollback previous succeeded trigger. This patch adds trigger mark for DAI/Component/Link, and do STOP if START/RESUME/PAUSE_RELEASE were failed. Because it need to use new rollback parameter, we need to modify DAI/Component/Link trigger functions in the same time. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07ASoC: SOF: trace: Add runtime trace filtering mechanismKarol Trzcinski2-0/+29
The "filter" debugfs file defines the log levels used by the firmware and reported by sof-logger. The file contains the formatted entry list, where each entry follows the following syntax in plain text: log_level uuid_id pipe_id comp_id; This file may be updated by userspace applications such sof-logger, or directly by the user during debugging process. An unused (wildcard) pipe_id or comp_id value should be set to -1, uuid_id is hexadecimal value, so when unused then should be set to 0. When the file is modified, an IPC command is sent to FW with new trace levels for selected components in filter elements list. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201204165014.2697903-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04Merge tag 'auxbus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core into asoc-5.11Mark Brown3-4/+5
Auxiliary Bus support tag for 5.11-rc1 This is a signed tag for other subsystems to be able to pull in the auxiliary bus support into their trees for the 5.11-rc1 merge. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-30Merge branch 'for-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.11Mark Brown1-0/+15
2020-11-30Merge series "ASoC: SOF: Intel: fix ICL boot sequence" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:Mark Brown1-0/+1
Series introducing a modified boot sequence for the Intel Ice Lake platform. While no bugs are currently open for this, the current DSP boot implementation does not follow the full programming sequence. This patchset is the first instance where SOF driver uses data in the extended manifest (part of the firmware binary), to influence the boot process. IPC cannot be used to get this information, as it is already needed for early boot. This change is backwards compatible with old firmware versions, where extended manifest is not available. Fred Oh (5): ASoC: SOF: ops: add parse_platform_ext_manifest() op ASoC: SOF: Intel: hda: define parse_platform_ext_manifest op ASoC: SOF: ext_manifest: parse cavs extra config data elem ASoC: SOF: ops: modify the signature of stall op ASoC: SOF: Intel: hda: add sof_icl_ops for ICL platforms include/sound/sof/ext_manifest.h | 1 + sound/soc/sof/intel/Makefile | 2 +- sound/soc/sof/intel/apl.c | 3 + sound/soc/sof/intel/cnl.c | 19 +--- sound/soc/sof/intel/ext_manifest.h | 35 +++++++ sound/soc/sof/intel/hda-loader.c | 100 ++++++++++++++++++++ sound/soc/sof/intel/hda.h | 11 +++ sound/soc/sof/intel/icl.c | 145 +++++++++++++++++++++++++++++ sound/soc/sof/intel/tgl.c | 3 + sound/soc/sof/loader.c | 3 + sound/soc/sof/ops.h | 14 ++- sound/soc/sof/sof-pci-dev.c | 2 +- sound/soc/sof/sof-priv.h | 7 +- 13 files changed, 324 insertions(+), 21 deletions(-) create mode 100644 sound/soc/sof/intel/ext_manifest.h create mode 100644 sound/soc/sof/intel/icl.c -- 2.28.0
2020-11-30ASoC: add soc-jack.hKuninori Morimoto2-121/+133
ALSA SoC has soc-jack.c, but doesn't have soc-jack.h. This patch creates new soc-jack.h and moves snd_soc_jack_xxx() from soc.h. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wny3u3zg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-28ALSA: remove trailing semicolon in macro definitionTom Rix1-1/+1
The macro use will already have a semicolon. Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20201127192312.2861127-1-trix@redhat.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-27ALSA: compress: allow pause and resume during drainingGyeongtaek Lee1-0/+16
With a stream with low bitrate, user can't pause or resume the stream near the end of the stream because current ALSA doesn't allow it. If the stream has very low bitrate enough to store whole stream into the buffer, user can't do anything except stop the stream and then restart it from the first because most of applications call draining after sending last frame to the kernel. If pause, resume are allowed during draining, user experience can be enhanced. To prevent malfunction in HW drivers which don't support pause during draining, pause during draining will only work if HW driver enable this feature explicitly by calling snd_compr_use_pause_in_draining(). Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com> Acked-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/000101d6c3f0$89b312b0$9d193810$@samsung.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-27ASoC: SOF: ops: add parse_platform_ext_manifest() opFred Oh1-0/+1
Add parse_platform_ext_manifest() op to parse platform-specific config data in the extended manifest. Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201127164022.2498406-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-26ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()Kuninori Morimoto2-1/+3
soc_compr_open() does rollback when failed (A), but, it is almost same as soc_compr_free(). static int soc_compr_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ machine_err: | ... | out: (A) ... | pm_err: | ... v return ret; } The difference is soc_compr_free() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_compr_free() and rollback. 1) snd_soc_dai_compr_startup/shutdown() 2) snd_soc_component_compr_open/free() => 3) snd_soc_link_compr_startup/shutdown() This patch is for 3) snd_soc_link_compr_startup/shutdown() and adds new cstream mark. It will mark cstream when startup() was suceeded. If rollback happen *after* that, it will check rollback flag and marked cstream. It cares *previous* startup() only now, but we might want to check *whole* marked cstream in the future. This patch is using macro so that it can be easily adjust to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87k0ui5iwf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-26ASoC: soc-component: add mark for snd_soc_component_compr_open/free()Kuninori Morimoto1-3/+3
soc_compr_open() does rollback when failed (A), but, it is almost same as soc_compr_free(). static int soc_compr_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ machine_err: | ... | out: (A) ... | pm_err: | ... v return ret; } The difference is soc_compr_free() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_compr_free() and rollback. 1) snd_soc_dai_compr_startup/shutdown() => 2) snd_soc_component_compr_open/free() 3) snd_soc_link_compr_startup/shutdown() This patch is for 2) snd_soc_component_compr_open/free(), and adds new cstream mark. It will mark cstream when startup() was suceeded. If rollback happen *after* that, it will check rollback flag and marked cstream. It cares *previous* startup() only now, but we might want to check *whole* marked cstream in the future. This patch is using macro so that it can be easily adjust to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87lfey5iwk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-26ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()Kuninori Morimoto1-1/+3
soc_compr_open() does rollback when failed (A), but, it is almost same as soc_compr_free(). static int soc_compr_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ machine_err: | ... | out: (A) ... | pm_err: | ... v return ret; } The difference is soc_compr_free() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_compr_free() and rollback. => 1) snd_soc_dai_compr_startup/shutdown() 2) snd_soc_component_compr_open/free() 3) snd_soc_link_compr_startup/shutdown() This patch is for 1) snd_soc_dai_compr_startup/shutdown(), and adds new cstream mark. It will mark cstream when startup() was suceeded. If rollback happen *after* that, it will check rollback flag and marked cstream. It cares *previous* startup() only now, but we might want to check *whole* marked cstream in the future. This patch is using macro so that it can be easily adjust to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87mtze5iwp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-25ASoC: SOF: Add `memory_info` file to debugfsKarol Trzcinski3-0/+46
This file content describes memory allocation status at run-time, typically to detect memory leaks. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201124180017.2232128-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-25ASoC: SOF: Change section comment for SOF_IPC_TEST_Karol Trzcinski1-1/+1
Section comment should be coherent with IPC prefix from define names. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201124180017.2232128-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-25ASoC: SOF: Improve code alignment in header.hKarol Trzcinski1-3/+3
Each define value in series should be aligned and tabs should be used instead of spaces to follow code-style. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201124180017.2232128-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-25ASoC: SOF: ext_manifest: Parse firmware config dictionaryKarol Trzcinski1-0/+19
Values given in this dictionary describes used firmware configuration, like feature availability, buffer size limits and similar properties. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201124180017.2232128-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-20ASoC: SOF: nocodec: modify DAI link definitionsRanjani Sridharan1-2/+4
The ignore_machine field in the component driver is used to ignore the FE DAI links defined in the machine driver, override BE fixups and set the stream names for the DAI links defined in the machine driver. This is required to make SOF compatible with the legacy machine drivers. In the case of the nocodec machine driver in SOF, there is no need to rely upon this ignore_machine logic in the core. Modify the machine driver to set DAI link stream names and the BE hw_params_fixup callback appropriately. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201120141653.2160134-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-20ASoC: SOF: IPC: fix implicit type overflowCurtis Malainey1-2/+2
Implicit values may have a length of 15bits (s16) so we need to declare the proper size so we don't get undefined behaviour. This appears to be arch and compiler dependent. This commit is to keep the headers aligned between the firmware and kernel. UBSan discovered this bug in the firmware. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201120144025.2166023-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-19Merge tag 'asoc-fix-v5.10-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai1-0/+15
ASoC: Fixes for v5.11 A collection of driver specific fixes, mostly for x86 systems (or CODECs used mostly on x86) and all for relatively minor issues, the biggest one being fixing S24_LE format on Keem Bay systems.
2020-11-19ASoC: soc-acpi: add helper to identify parent driver.Pierre-Louis Bossart1-0/+6
Intel machine drivers are used by parent platform drivers based on closed-source firmware (Atom/SST and catpt) and SOF-based ones. In some cases for ACPI-based platforms, the behavior of machine drivers needs to be modified depending on the parent type, typically for card names and power management. An initial solution based on passing a boolean flag as a platform device parameter was tested earlier. Since it looked overkill, this patch suggests instead a simple string comparison to identify an SOF parent device/driver. Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20201112223825.39765-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-19ALSA: hda: intel-dsp-config: add helper for ACPI DSP driver selectionPierre-Louis Bossart1-0/+7
Mirror capabilities provided for PCI devices, so that distributions can select which ACPI driver is loaded at run-time with kernel parameters and DMI tables instead of forcing a build-time selection. The "legacy" option supported for HDaudio has no meaning here and will be ignored. The 'SST' driver based on closed-source firmware has the priority to avoid any impact on users, and the choice to use SOF is strictly opt-in. This may change at some point when the 'SST' driver is deprecated on Baytrail/Cherrytrail. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20201112223825.39765-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_get_metadata()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_get_metadata(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87zh3l6gl8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_set_metadata()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_set_metadata(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/871rgx7v5t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_copy()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_copy(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87361d7v5z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_pointer()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_pointer(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/874klt7v65.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_ack()Kuninori Morimoto1-0/+1
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_ack(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/875z697v6c.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_get_codec_caps()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_get_codec_caps(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/877dqp7v6i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_get_caps()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_get_caps(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/878sb57v6q.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_get_params()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch adds snd_soc_component_compr_get_params(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87a6vl7v6x.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-18ASoC: soc-component: add snd_soc_component_compr_set_params()Kuninori Morimoto1-0/+2
component related function should be implemented at soc-component.c. This patch moves soc-compress soc_compr_components_set_params() to soc-component as snd_soc_component_compr_set_params(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87blg17v74.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>