summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2021-03-31Merge tag 'mute-led-rework' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-5.13 ALSA: control - add generic LED API This patchset tries to resolve the diversity in the audio LED control among the ALSA drivers. A new control layer registration is introduced which allows to run additional operations on top of the elementary ALSA sound controls. A new control access group (three bits in the access flags) was introduced to carry the LED group information for the sound controls. The low-level sound drivers can just mark those controls using this access group. This information is not exported to the user space, but user space can manage the LED sound control associations through sysfs (last patch) per Mark's request. It makes things fully configurable in the kernel and user space (UCM). The actual state ('route') evaluation is really easy (the minimal value check for all channels / controls / cards). If there's more complicated logic for a given hardware, the card driver may eventually export a new read-only sound control for the LED group and do the logic itself. The new LED trigger control code is completely separated and possibly optional (there's no symbol dependency). The full code separation allows eventually to move this LED trigger control to the user space in future. Actually it replaces the already present functionality in the kernel space (HDA drivers) and allows a quick adoption for the recent hardware (ASoC codecs including SoundWire). snd_ctl_led 24576 0 The sound driver implementation is really easy: 1) call snd_ctl_led_request() when control LED layer should be automatically activated / it calls module_request("snd-ctl-led") on demand / 2) mark all related kcontrols with SNDRV_CTL_ELEM_ACCESS_SPK_LED or SNDRV_CTL_ELEM_ACCESS_MIC_LED Link: https://lore.kernel.org/r/20210317172945.842280-1-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-31Merge series "ASoC: simple-card: cleanup and prepare for Multi CPU/Codec ↵Mark Brown
support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: Hi Mark I want to add new audio-graph-card2 driver which can support not only DPCM, but also Multi-CPU/Codec, and Codec2Codec. And it is also supporting user customization. But before supporting such driver, we need to cleanup existing simple-card / audio-graph, because these and new driver are sharing code. This patch-set are cleanup and prepare for Multi-CPU/Codec support. Kuninori Morimoto (6): ASoC: simple-card-utils.c: remove old comment ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform ASoC: audio-graph: count DAI / link numbers as in order ASoC: audio-graph: cleanup graph_for_each_link() ASoC: simple-card: count DAI / link numbers as in order ASoC: simple-card: cleanup graph_for_each_link() include/sound/simple_card_utils.h | 7 +- sound/soc/generic/audio-graph-card.c | 112 +++++++++++++------------ sound/soc/generic/simple-card-utils.c | 20 +++-- sound/soc/generic/simple-card.c | 115 +++++++++++++++----------- 4 files changed, 143 insertions(+), 111 deletions(-) -- 2.25.1
2021-03-31ASoC: tegra: Set driver name explicitlyThierry Reding
The SoC sound core will generate a driver name by normalizing the card name. However, most of the time that name does not tell anything about the driver and is therefore useless for this purpose. Make the driver name more useful by setting it explicitly during card initialization. Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210330180657.1867971-1-thierry.reding@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: Intel: Fix a typoBhaskar Chowdhury
s/struture/structure/ Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Link: https://lore.kernel.org/r/20210322064909.4189290-1-unixbhaskar@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: ak5558: Add support for ak5552Viorel Suman
AK5552 is a 32-bit 2ch ADC and has the same register map as AK5558. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1617176686-25528-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Hi8 tabletHans de Goede
The Chuwi Hi8 tablet is using an analog mic on IN1 and has its jack-detect connected to JD2_IN4N, instead of using the default IN3 for its internal mic and JD1_IN4P for jack-detect. It also only has 1 speaker. Add a quirk applying the correct settings for this configuration. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210325221054.22714-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: simple-card: cleanup graph_for_each_link()Kuninori Morimoto
simple-card checks DT links 2 times. 1st is for counting DAIs / links to allocating memory, 2nd is for detecting DAIs. To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case, it uses loops 2 times. Because of this kind of complex background, it needs to use local varuable for it, and each call-back functions need to care about it. Now, 1st and 2nd DT link check are using same order, thus we can share same code. This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875z1e1tov.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: simple-card: count DAI / link numbers as in orderKuninori Morimoto
simple-card checks DT links 2 times. 1st is for counting DAIs / links to allocating memory, 2nd is for detecting DAIs. To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case, it uses loops 2 times at 2nd DT link check. But it doesn't do it at 1st DT link check. for (li.cpu = 1; li.cpu >= 0; li.cpu--) { /* * Detect all CPU first, and Detect all Codec 2n * * In Normal sound case, all DAIs are detected * as "CPU-Codec". * * In DPCM sound case, * all CPUs are detected as "CPU-dummy", and * all Codecs are detected as "dummy-Codec". * To avoid random sub-device numbering, * detect "dummy-Codec" in last; */ ret = simple_for_each_link(...); ... } To prepare supporting multi-CPU/Codec, and code cleanup, this patch use same loop for 1st DT link check, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877dlu1tp2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: audio-graph: cleanup graph_for_each_link()Kuninori Morimoto
audio-graph checks DT links 2 times. 1st is for counting DAIs / links to allocating memory, 2nd is for detecting DAIs. To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case, it uses loops 2 times. Because of this kind of complex background, it needs to use local varuable for it, and each call-back functions need to care about it. Now, 1st and 2nd DT link check are using same order, thus we can share same code. This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/878s6a1tpf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: audio-graph: count DAI / link numbers as in orderKuninori Morimoto
audio-graph checks DT links 2 times. 1st is for counting DAIs / links to allocating memory, 2nd is for detecting DAIs. To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case, it uses loops 2 times at 2nd DT link check. But it doesn't do it at 1st DT link check. for (li.cpu = 1; li.cpu >= 0; li.cpu--) { /* * Detect all CPU first, and Detect all Codec 2n * * In Normal sound case, all DAIs are detected * as "CPU-Codec". * * In DPCM sound case, * all CPUs are detected as "CPU-dummy", and * all Codecs are detected as "dummy-Codec". * To avoid random sub-device numbering, * detect "dummy-Codec" in last; */ ret = graph_for_each_link(...); ... } To prepare supporting multi-CPU/Codec, and code cleanup, this patch use same loop for 1st DT link check, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a6qq1tpp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/PlatformKuninori Morimoto
simple-card / audio-graph are assuming single CPU/Codec/Platform on dai_link. Because of it, it is difficult to support Multi-CPU/Codec. This patch allocs CPU/Codec/Platform dai_link imformation instead of using existing props information. It can update to multi-CPU/Codec, but is still assuming single-CPU/Codec for now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87blb61tpv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31ASoC: simple-card-utils.c: remove old commentKuninori Morimoto
commit adb76b5b9c474 ("ASoC: soc-core: remove legacy style dai_link") removed snd_soc_init_multicodec(). The comment on asoc_simple_init_priv() is no longer needed. This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87czvm1tq2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-30ALSA: led control - add sysfs kcontrol LED marking layerJaroslav Kysela
We need to manage the kcontrol entries association for the LED trigger from the user space. This patch adds a layer to the sysfs tree like: /sys/devices/virtual/sound/ctl-led/mic + card0 | + attach | + detach | ... + card1 + attach ... Operations: attach and detach - amixer style ID is accepted and easy strings for numid and simple names reset - reset all associated kcontrol entries list - list associated kcontrol entries (numid values only) Additional symlinks: /sys/devices/virtual/sound/ctl-led/mic/card0/card -> /sys/class/sound/card0 /sys/class/sound/card0/controlC0/led-mic -> /sys/devices/virtual/sound/ctl-led/mic/card0 Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-7-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ALSA: control - add sysfs support to the LED trigger moduleJaroslav Kysela
Create SYSFS/devices/virtual/sound/ctl-led tree (with SYSFS/class/sound/ctl-led symlink). speaker/ +-- mode +-- brightness mic/ +-- mode +-- brightness Copy the idea from the HDA driver and allow to set the audio LEDs based on the various modes: - follow mute - follow moute (inverted to follow mute) - off - on Also, the actual LED state is exposed. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-6-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ALSA: HDA - remove the custom implementation for the audio LED triggerJaroslav Kysela
With the new snd-ctl-led module, we have a generic way to trigger audio LEDs based on the sound control changes. Remove the custom implementation from the HDA driver. Move the LED initialization before snd_hda_gen_parse_auto_config() call in all drivers to create marked controls there. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-5-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ALSA: control - add generic LED trigger module as the new control layerJaroslav Kysela
The recent laptops have usually two LEDs assigned to reflect the speaker and microphone mute state. This implementation adds a tiny layer on top of the control API which calculates the state for those LEDs using the driver callbacks. Two new access flags are introduced to describe the controls which affects the audio path settings (an easy code change for drivers). The LED resource can be shared with multiple sound cards with this code. The user space controls may be added to the state chain on demand, too. This code should replace the LED code in the HDA driver and add a possibility to easy extend the other drivers (ASoC codecs etc.). Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-4-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ALSA: control - add layer registration routinesJaroslav Kysela
The layer registration allows to handle an extra functionality on top of the control API. It can be used for the audio LED control for example. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-3-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ALSA: control - introduce snd_ctl_notify_one() helperJaroslav Kysela
This helper is required for the following generic LED mute patch. The helper also simplifies some other functions. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-2-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ASoC: q6afe-clocks: fix reprobing of the driverDmitry Baryshkov
Q6afe-clocks driver can get reprobed. For example if the APR services are restarted after the firmware crash. However currently Q6afe-clocks driver will oops because hw.init will get cleared during first _probe call. Rewrite the driver to fill the clock data at runtime rather than using big static array of clocks. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Fixes: 520a1c396d19 ("ASoC: q6afe-clocks: add q6afe clock controller") Link: https://lore.kernel.org/r/20210327092857.3073879-1-dmitry.baryshkov@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-30ASoC: Intel: add max98390 echo reference supportMac Chiang
load new topology file with speaker capture pipeline. Signed-off-by: Mac Chiang <mac.chiang@intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/1616757689-22014-1-git-send-email-mac.chiang@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-30ASoC: mediatek: mt6359: Fix spelling mistake "reate" -> "create"Colin Ian King
There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210330084710.997731-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29Merge series "Add mediatek MT6359 ASoC accdet jack driver" from Argus Lin ↵Mark Brown
<argus.lin@mediatek.com>: All of 3-pole and 4-pole jack are supported. change since v2: - fixs missing blank at Kconfig. - fixs comment format and spelling mistake. - changes private structure mt6359_accdet to mt6359-accdet.h and uses this data as function parameter. - removes compatible string declaration. - uses regmap_read_poll_timeout as polling timer. - simplify jack detection and key detection report function. - adds mt6359_accdet_enable_jack_detect for sound card jack initialization. change since v1: - adds mt6359 accdet binding document - adds mt6359 accdet driver *** BLURB HERE *** Argus Lin (2): dt-bindings: mediatek: mt6359: add ASoC mt6359 ASoC accdet jack document ASoC: mediatek: mt6359: add MT6359 accdet jack driver .../bindings/sound/mt6359-accdet.yaml | 164 ++ sound/soc/codecs/Kconfig | 8 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/mt6359-accdet.c | 1080 ++++++++++ sound/soc/codecs/mt6359-accdet.h | 128 ++ sound/soc/codecs/mt6359.h | 1864 ++++++++++++++++- 6 files changed, 3139 insertions(+), 107 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/mt6359-accdet.yaml create mode 100644 sound/soc/codecs/mt6359-accdet.c create mode 100644 sound/soc/codecs/mt6359-accdet.h -- 2.18.0
2021-03-29ASoC: SOF: match SSP config with pcm hw paramsJaska Uimonen
This patch adds a function to find a match between pcm hw params and SSP DAI config. Config is matched against sample rate and if match is found current config is set. If match isn't found last matched config is left as current i.e. current config is not touched. Functionality for SSP DAIs with 1 config remains the same as before. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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/20210326165150.255533-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIsJaska Uimonen
Currently SSP DAIs don't have hw params callback function as there wasn't anything to setup after initial topology loading. After enabling multiple DAI configs the current config can be sent in the callback. This patch changes the way SSP config ipc is sent to the dsp. Before it was only sent once in topology loading, but now it will be additionally sent always when stream is opened. Mechanism is similar as with HDA DAIs. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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/20210326165150.255533-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29ASoC: SOF: parse multiple SSP DAI and hw configsJaska Uimonen
ASoC parses multiple hw_configs defined in topology. However currently in SOF only the first config is used and others are discarded. First change SOF driver to parse and save possible multiple configs in ssp case. Also save the default config value provided by ASoC. Functionality with only one defined config stays the same. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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/20210326165150.255533-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29ASoC: fsl_rpmsg: initialise pointers to NULLShengjiu Wang
This fixes the following sparse warnings: sound/soc/fsl/fsl_rpmsg.c:45:45: sparse: sparse: Using plain integer as NULL pointer sound/soc/fsl/fsl_rpmsg.c:45:56: sparse: sparse: Using plain integer as NULL pointer Fixes: b73d9e6225e8 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/1616988868-971-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29ASoC: amd: fix acpi dependency kernel warningVijendar Mukunda
Fix ACPI dependency kernel warning produced by powerpc allyesconfig. sound/soc/amd/acp-da7219-max98357a.c:684:28: warning: 'cz_rt5682_card' defined but not used [-Wunused-variable] sound/soc/amd/acp-da7219-max98357a.c:671:28: warning: 'cz_card' defined but not used [-Wunused-variable] Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/1616777074-5151-2-git-send-email-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29ASoC: amd: update spdx license for acp machine driverVijendar Mukunda
update SPDX license for acp machine driver. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/1616777074-5151-1-git-send-email-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29ASoC: dwc: Fix -Wmissing-prototypes warningsYueHaibing
while CONFIG_SND_DESIGNWARE_PCM is not set, building with W=1 shows this: sound/soc/dwc/local.h:127:6: warning: no previous prototype for ‘dw_pcm_push_tx’ [-Wmissing-prototypes] void dw_pcm_push_tx(struct dw_i2s_dev *dev) { } ^~~~~~~~~~~~~~ sound/soc/dwc/local.h:128:6: warning: no previous prototype for ‘dw_pcm_pop_rx’ [-Wmissing-prototypes] void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { } ^~~~~~~~~~~~~ sound/soc/dwc/local.h:129:5: warning: no previous prototype for ‘dw_pcm_register’ [-Wmissing-prototypes] int dw_pcm_register(struct platform_device *pdev) ^~~~~~~~~~~~~~~ Change these to inline functions to fix the warnings. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210329150524.18184-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: mediatek: mt6359: add MT6359 accdet jack driverArgus Lin
MT6359 audio codec supports jack detection feature, adds MT6359 accdet driver to support jack plugged detection and key detection. Signed-off-by: Argus Lin <argus.lin@mediatek.com> Link: https://lore.kernel.org/r/1615383186-18500-3-git-send-email-argus.lin@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25Merge series "Add audio driver base on rpmsg on i.MX platform" from Shengjiu ↵Mark Brown
Wang <shengjiu.wang@nxp.com>: On Asymmetric multiprocessor, there is Cortex-A core and Cortex-M core, Linux is running on A core, RTOS is running on M core. The audio hardware device can be controlled by Cortex-M device, So audio playback/capture can be handled by M core. Rpmsg is the interface for sending and receiving msg to and from M core, that we can create a virtual sound on Cortex-A core side. A core will tell the Cortex-M core sound format/rate/channel, where is the data buffer, what is the period size, when to start, when to stop and when suspend or resume happen, each of this behavior there is defined rpmsg command. Especially we designed the low power audio case, that is to allocate a large buffer and fill the data, then Cortex-A core can go to sleep mode, Cortex-M core continue to play the sound, when the buffer is consumed, Cortex-M core will trigger the Cortex-A core to wakeup to fill data. changes in v5: - remove unneeded property in binding doc and driver - update binding doc according to Rob's comments. - Fix link issue reported by kernel test robot changes in v4: - remove the sound card node, merge the property to cpu dai node according to Rob's comments. - sound card device will be registered by cpu dai driver. - Fix do_div issue reported by kernel test robot changes in v3: - add local refcount for clk enablement in hw_params() - update the document according Rob's comments changes in v2: - update codes and comments according to Mark's comments Shengjiu Wang (6): ASoC: soc-component: Add snd_soc_pcm_component_ack ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg ASoC: dt-bindings: fsl_rpmsg: Add binding doc for rpmsg audio device ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg ASoC: imx-rpmsg: Add machine driver for audio base on rpmsg .../devicetree/bindings/sound/fsl,rpmsg.yaml | 108 +++ include/sound/soc-component.h | 3 + sound/soc/fsl/Kconfig | 30 + sound/soc/fsl/Makefile | 6 + sound/soc/fsl/fsl_rpmsg.c | 279 ++++++ sound/soc/fsl/fsl_rpmsg.h | 35 + sound/soc/fsl/imx-audio-rpmsg.c | 140 +++ sound/soc/fsl/imx-pcm-rpmsg.c | 918 ++++++++++++++++++ sound/soc/fsl/imx-pcm-rpmsg.h | 512 ++++++++++ sound/soc/fsl/imx-rpmsg.c | 150 +++ sound/soc/soc-component.c | 14 + sound/soc/soc-pcm.c | 2 + 12 files changed, 2197 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml create mode 100644 sound/soc/fsl/fsl_rpmsg.c create mode 100644 sound/soc/fsl/fsl_rpmsg.h create mode 100644 sound/soc/fsl/imx-audio-rpmsg.c create mode 100644 sound/soc/fsl/imx-pcm-rpmsg.c create mode 100644 sound/soc/fsl/imx-pcm-rpmsg.h create mode 100644 sound/soc/fsl/imx-rpmsg.c -- 2.27.0
2021-03-25ASoC: wm8960: Remove bitclk relax condition in wm8960_configure_sysclkShengjiu Wang
The call sequence in wm8960_configure_clocking is ret = wm8960_configure_sysclk(); if (ret >= 0) goto configure_clock; .... ret = wm8960_configure_pll(); configure_clock: ... wm8960_configure_sysclk is called before wm8960_configure_pll, as there is bitclk relax on both functions, so wm8960_configure_sysclk always return success, then wm8960_configure_pll() never be called. With this case: aplay -Dhw:0,0 -d 5 -r 48000 -f S24_LE -c 2 audio48k24b2c.wav the required bitclk is 48000 * 24 * 2 = 2304000, bitclk got from wm8960_configure_sysclk is 3072000, but if go to wm8960_configure_pll. it can get correct bitclk 2304000. So bitclk relax condition should be removed in wm8960_configure_sysclk, then wm8960_configure_pll can be called, and there is also bitclk relax function in wm8960_configure_pll. Fixes: 3c01b9ee2ab9 ("ASoC: codec: wm8960: Relax bit clock computation") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/1614740862-30196-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: fsl-asoc-card: Add support for WM8958 codecShengjiu Wang
WM8958 codec is used on some i.MX based platform. So add it support in this generic driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615986303-27959-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: max98373: Added controls for autorestart configRyan Lee
3 new controls are added. "OVC Autorestart Switch" : controls whether or not the speaker amplifier automatically re-enables after an overcurrent fault condition. "THERM Autorestart Switch" : controls whether or not the device automatically resumes playback when the die temperature recovers from thermal shutdown. "CMON Autorestart Switch" : controls whether or not the device automatically resumes playback when the clock returns after stopping. Above Auto Restart functions are enabled by default. Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com> Link: https://lore.kernel.org/r/20210325033555.29377-3-ryans.lee@maximintegrated.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: rt1015: Add bclk detection and dc detectionJack Yu
Add bclk detection and dc detection before playback. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20210322055053.31797-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: imx-rpmsg: Add machine driver for audio base on rpmsgShengjiu Wang
The platform device is not registered by device tree or cpu dai driver, it is registered by the rpmsg channel, So add a dedicated machine driver to handle this case. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-7-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsgShengjiu Wang
Platform driver based on rpmsg is the interface for sending and receiving rpmsg to and from M core. It will tell the Cortex-M core sound format/rate/channel, where is the data buffer, where is the period size, when to start, when to stop and when suspend or resume happen, each this behavior there is defined rpmsg command. Especially we designed the low power audio case, that is to allocate a large buffer and fill the data, then Cortex-A core can go to sleep mode, Cortex-M core continue to play the sound, when the buffer is consumed, Cortex-M core will trigger the Cortex-A core to wake up. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-6-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channelShengjiu Wang
This driver is used to accept the message from rpmsg audio channel, and if this driver is probed, it will help to register the platform driver, the platform driver will use this audio channel to send and receive messages to and from Cortex-M core. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-5-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsgShengjiu Wang
This is a cpu dai driver for rpmsg audio use case, which is mainly used for getting the user's configuration from devicetree and configure the clocks which is used by Cortex-M core. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: soc-component: Add snd_soc_pcm_component_ackShengjiu Wang
Add snd_soc_pcm_component_ack back, which can be used to get an updated buffer pointer in the platform driver. On Asymmetric multiprocessor, this pointer can be sent to Cortex-M core for audio processing. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24Merge series "MFD/extcon/ASoC: Rework arizona codec jack-detect support" ↵Mark Brown
from Hans de Goede <hdegoede@redhat.com>: Hi All, Here is v4 of my series to rework the arizona codec jack-detect support to use the snd_soc_jack helpers instead of direct extcon reporting. As discussed before here is a resend rebased on 5.12-rc2, making sure that all patches this depends on are in place. Lee, can you pick-up patches 1-6 through the MFD tree and then send a pull-req to Mark so that Mark can merge the Asoc parts throught the ASoC tree ? Patches 2-6 touch drivers/extcon, these all have an Ack from Chanwoo Choi for merging these through the MFD tree. Here is some more generic info on this series from the previous cover-letter: This is done by reworking the extcon driver into an arizona-jackdet library and then modifying the codec drivers to use that directly, replacing the old separate extcon child-devices and extcon-driver. This brings the arizona-codec jack-detect handling inline with how all other ASoC codec driver do this. This was developed and tested on a Lenovo Yoga Tablet 1051L with a WM5102 codec. This was also tested by Charles Keepax, one of the Cirrus Codec folks. Regards, Hans Hans de Goede (13): mfd: arizona: Drop arizona-extcon cells extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged extcon: arizona: Fix various races on driver unbind extcon: arizona: Fix flags parameter to the gpiod_get("wlf,micd-pol") call extcon: arizona: Always use pm_runtime_get_sync() when we need the device to be awake ASoC/extcon: arizona: Move arizona jack code to sound/soc/codecs/arizona-jack.c ASoC: arizona-jack: Move jack-detect variables to struct arizona_priv ASoC: arizona-jack: Use arizona->dev for runtime-pm ASoC: arizona-jack: convert into a helper library for codec drivers ASoC: arizona-jack: Use snd_soc_jack to report jack events ASoC: arizona-jack: Cleanup logging ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use the new jack library ASoC: Intel: bytcr_wm5102: Add jack detect support MAINTAINERS | 3 +- drivers/extcon/Kconfig | 8 - drivers/extcon/Makefile | 1 - drivers/mfd/arizona-core.c | 20 - sound/soc/codecs/Makefile | 2 +- .../soc/codecs/arizona-jack.c | 577 +++++++----------- sound/soc/codecs/arizona.h | 44 ++ sound/soc/codecs/wm5102.c | 12 +- sound/soc/codecs/wm5110.c | 12 +- sound/soc/codecs/wm8997.c | 14 +- sound/soc/codecs/wm8998.c | 9 + sound/soc/intel/boards/bytcr_wm5102.c | 28 +- 12 files changed, 325 insertions(+), 405 deletions(-) rename drivers/extcon/extcon-arizona.c => sound/soc/codecs/arizona-jack.c (76%) -- 2.30.1
2021-03-24ASoC: Intel: bytcr_wm5102: Add jack detect supportHans de Goede
Add jack detect support by creating a jack and calling snd_soc_component_set_jack to register the created jack with the codec. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-14-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use the ↵Hans de Goede
new jack library Make all arizona codec drivers for which drivers/mfd/arizona-core.c used to instantiate a "arizona-extcon" child-device use the new arizona-jack.c library for jack-detection. This has been tested on a Lenovo Yoga Tablet 2 1051L with a WM5102 codec. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-13-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: arizona-jack: Cleanup loggingHans de Goede
Cleanup the use of dev_foo functions used for logging: 1. Many of these are unnecessarily split over multiple lines 2. Use dev_err_probe() in cases where we might get a -EPROBE_DEFER return value Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-12-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: arizona-jack: Use snd_soc_jack to report jack eventsHans de Goede
Use the snd_soc_jack code to report jack events, instead of using extcon for reporting the cable-type + an input_dev for reporting the button presses. The snd_soc_jack code will report the cable-type through both input_dev events and through ALSA controls and the button-presses through input_dev events. Note that this means that when the codec drivers are moved over to use the new arizona-jack.c library code instead of having a separate MFD extcon cell with the extcon-arizona.c driver, we will no longer report extcon events to userspace for cable-type changes. This should not be a problem since "standard" Linux distro userspace does not (and has never) used the extcon class interface for this. Android does have support for the extcon class interface, but that was introduced in the same release as support for input_dev cable-type events, so this should not be a problem for Android either. Note this also reduces ARIZONA_MAX_MICD_RANGE from 8 to 6, this is ok to do since this info is always provided through pdata (or defaults) and cannot be overridden from devicetree. All in-kernel users of the pdata (and the fallback defaults) define 6 or less buttons/ranges. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-11-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: arizona-jack: convert into a helper library for codec driversHans de Goede
Convert the arizona extcon driver into a helper library for direct use from the arizona codec-drivers, rather then being bound to a separate MFD cell. Note the probe (and remove) sequence is split into 2 parts: 1. The arizona_jack_codec_dev_probe() function inits a bunch of jack-detect specific variables in struct arizona_priv and tries to get a number of resources where getting them may fail with -EPROBE_DEFER. 2. Then once the machine driver has create a snd_sock_jack through snd_soc_card_jack_new() it calls snd_soc_component_set_jack() on the codec component, which will call the new arizona_jack_set_jack(), which sets up jack-detection and requests the IRQs. This split is necessary, because the IRQ handlers need access to the arizona->dapm pointer and the snd_sock_jack which are not available when the codec-driver's probe function runs. Note this requires that machine-drivers for codecs which are converted to use the new helper functions from arizona-jack.c are modified to create a snd_soc_jack through snd_soc_card_jack_new() and register this jack with the codec through snd_soc_component_set_jack(). Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-10-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: arizona-jack: Use arizona->dev for runtime-pmHans de Goede
Drivers for MFD child-devices such as the arizona codec drivers and the arizona-extcon driver can choose to either make runtime_pm_get/_put calls on their own child-device, which will then be propagated to their parent; or they can make them directly on their MFD parent-device. The arizona-extcon code was using runtime_pm_get/_put calls on its own child-device where as the codec drivers are using runtime_pm_get/_put calls on their parent. The arizona-extcon MFD cell/child-device has been removed and this commit is part of refactoring the arizona-extcon code into a library to be used directly from the codec drivers. Specifically this commit moves the code over to make runtime_pm_get/_put calls on the parent device (on arizona->dev) bringing the code inline with how the codec drivers do this. Note this also removes the pm_runtime_enable/_disable calls as pm_runtime support has already been enabled on the parent-device by the arizona MFD driver. This is part of a patch series converting the arizona extcon driver into a helper library for letting the arizona codec-drivers directly report jack state through the standard sound/soc/soc-jack.c functions. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-9-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: arizona-jack: Move jack-detect variables to struct arizona_privHans de Goede
Move all the jack-detect variables from struct arizona_extcon_info to struct arizona_priv. This is part of a patch series converting the arizona extcon driver into a helper library for letting the arizona codec-drivers directly report jack state through the standard sound/soc/soc-jack.c functions. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210307151807.35201-8-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: fsl_micfil: Don't use devm_regmap_init_mmio_clkShengjiu Wang
When there is power domain bind with ipg_clk clock, The call flow: devm_regmap_init_mmio_clk - clk_prepare() - clk_pm_runtime_get() cause the power domain of clock always be enabled after regmap_init(). which impact the power consumption. So use devm_regmap_init_mmio instead of devm_regmap_init_mmio_clk,but explicitly enable clock when it is used. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Viorel Suman <viorel.suman@nxp.com> Link: https://lore.kernel.org/r/1616579928-22428-7-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24ASoC: fsl_audmix: Don't use devm_regmap_init_mmio_clkShengjiu Wang
When there is power domain bind with ipg clock, The call flow: devm_regmap_init_mmio_clk - clk_prepare() - clk_pm_runtime_get() cause the power domain of clock always be enabled after regmap_init(). which impact the power consumption. So use devm_regmap_init_mmio instead of devm_regmap_init_mmio_clk,but explicitly enable clock when it is used. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1616579928-22428-6-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>