This adds skeleton support for the audio DSP hardware found on
NXP i.MX8ULP platform.
On i.MX8ULP resources (clocks, power, etc) are managed by the
System Integration Module in LPAV domain and XRDC which is handled
by arm trusted firmware.
Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1660787634-28550-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add SOF compatile string "fsl,imx8ulp-dsp" for supporting DSP
device on i.MX8ULP platform.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1660787634-28550-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The FIFO reset drops the words in the FIFO, which may cause
channel swap when SAI module is running, especially when the
DMA speed is low. So it is not good to do FIFO reset in ISR,
then remove the operation.
Fixes: e2681a1bf5 ("ASoC: fsl_sai: Add isr to deal with error flag")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1660713867-26921-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
snd_soc_params_to_bclk() calculates the BCLK from only the information in
snd_pcm_hw_params. It is therefore a subset of the functionality of
snd_soc_tdm_params_to_bclk() so can use a subset of the test case table.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817125508.1406651-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:
This patchseries computes pcm_io_frames from the DAI position reported
by SOF firmware. Using pcm_io_frames userspace applications can later
compute timestamps for compressed stream.
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:
we've been stuck with problems in the dual-amplifier configurations where
one of the two devices seems to become UNATTACHED and never regains sync,
see https://github.com/thesofproject/linux/issues/3638.
This is a rather infrequent issue that may happen once or twice per month,
but still it remains a concern.
One possibility is that the device does lose sync but somehow our hardware
detection fails to see it resync.
This series just adds a basic read directly from the PING frames to help
confirm if yes/no the device regain sync.
Use the new snd_soc_tdm_params_to_bclk() helper function to
calculate the bclk. This function handles most of the previous
manipulation and makes the code tidier.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Fix "much change together" to "must change together".
It's probably obvious what was meant but it's nice to fix it.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Make cs42l42.h include the other headers it depends on instead of
assuming that the .c file already included them.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This helper provides an optional delay parameter to wait for devices
to resync in case of errors, and checks that devices are indeed
attached on the bus.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The existing manager ops provide callbacks to transfer read/write
commands, but don't allow for direct access to PING status
register. This is accessible in all existing IP, and would help
diagnose timeouts or resume issues by reporting the 'true' status
instead of the internal status reported by the IP.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
platform_max should not be set by the driver, its intended for machine drivers
or DT to override the max value for platform specific reasons.
So remove setting this from Kcontrol macros.
Setting this to max in these macros would limit the range when min
value is less then zero.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220816172129.6661-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support to new clocks that are added in Q6DSP as part of newer version
of LPASS support on SM8450 and SC8280XP.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220816170118.13470-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
We compute the number of pcm_io_frames by dividing the
dai position to size of a frame (channels * sample size).
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The purpose of this change is to enable the saving of the
channel count and sample container bytes format parameters for later use
to compute the timestamps.
This is done when setting the compress stream parameters
(in sof_compr_set_params).
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This will keep SOF compress stream private data. So far
we used snd_compr_tstamp to hold the private data but this
is no longer enough as we need to hold other info like
number of channels or sample bytes.
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Byte offset is the offset in the ring buffer to the DSP
while posn_offset is an offset inside the stream_box where
we keep position information.
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
Sharing this PR as it touches on cross-driver subjects. Four commits yet
two subject. Given the small delta, decided to combine within single PR
here.
Merge series from Venkata Prasad Potturu <venkataprasad.potturu@amd.com>:
This patch is to add support for linked list to store acp_stream instead
static array and add tdm support for acp I2S stream.
In commit c3ecef21c3 ("ASoC: fsl_sai: add sai master mode support")
the loop was changed to start iterating from 1 instead of 0. The error
message however was not updated, reporting the wrong clock to the user.
Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220813083353.8959-1-pieterjan.camerlynck@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The ES8326 codec is not compatible with ES8316 and requires
a dedicated driver.
------
v6 remove rate 96000 remove HEX suffix
Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
Link: https://lore.kernel.org/r/20220816024456.4475-2-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add device tree binding documentation for Everest ES8326
----
v5 tested by dtschema
Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
Link: https://lore.kernel.org/r/20220816024456.4475-1-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
With board-matching information for legacy solution moved to local
directory, there is no need to expose it globally.
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
catpt-driver does not make use of most of the fields found in the
descriptor table and is the sole user of haswell machines list. Move the
tables to local directory and clean them up so it's clear what's
actually used by the solution.
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Change kernel module name from snd_soc_sst_broadwell to
snd_soc_bdw_rt286 to better reflect its purpose.
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Change kernel module name from snd_soc_sst_haswell to snd_soc_hsw_rt5640
to better reflect its purpose.
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The statement that snd_soc_tdm_params_to_bclk() is equivalent to
snd_soc_params_to_bclk() if tdm_width==tdm_slots==0 is not accurate,
it is only true is slot_multiple is also <2.
However, the description of special-case behaviour in terms of pairs of
tdm_width and tdm_slot values is not particularly helpful so we might as
well take the opportunity to rework the description to say the same thing
in a simpler way. The behaviour of a pair of values is obvious from a
description of each argument. At the same time make a few edits to clarify
the rest of the description.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220815113346.3805075-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Merge series from Sameer Pujar <spujar@nvidia.com>:
DT binding properties are available to fixup rate and channel
parameters of a DAI. This series extends this to sample format
conversion as well. With this now DAI PCM parameters (channels,
sample rate and sample format) can be fixed up as necessary in
an audio path.
Merge series from Takashi Iwai <tiwai@suse.de>:
This is a patch set for rather simple conversions from the plain
sprintf() & co to the new helpers, sysfs_emit() and sysfs_emit_at().
No functional changes are expected.
Some codecs need to configure the sysclk even with slave
mode, otherwise it may not work properly with some case.
wm8960 is the one that need sysclk be configured, so add
late_probe() to call the snd_soc_dai_set_sysclk() of codec
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1659495748-10876-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The platform_get_irq() returns negative error codes. It can't actually
return zero, but if it did that should be treated as success.
Fixes: eef07b9e09 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YvThhr86N3qQM2EO@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
Since the order of the amps in the ACPI determines the device name,
and the ACPI order may change depending on hardware configuration,
use UID to dynamically compute the dai links, allowing dynamic
assignment of the name_prefix.
The UIDs for these amps in ACPI are fixed, and map to a name_prefix,
where:
UID 0x0 -> WL
UID 0x1 -> WR
UID 0x2 -> TL
UID 0x3 -> TR
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220801094034.3927841-1-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The "i2s_priv" pointer cannot be NULL. Some NULL checks were deleted
in commit d7bffbe9cb ("ASoC: mediatek: mt8186: remove unnecessary
judgments") but this one was accidentally left behind.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yuo7LGPk8KnBW6ac@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
A recent change in clang strengthened its -Wbitfield-constant-conversion
to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can
only be 0 or -1, not 1:
sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion]
dev->gclk_enabled = 1;
^ ~
1 error generated.
The actual value of the field is never checked, just that it is not
zero, so there is not a real bug here. However, it is simple enough to
silence the warning by making the bitfield unsigned, which matches the
mchp-spdifrx driver.
Fixes: 06ca24e98e ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller")
Link: https://github.com/ClangBuiltLinux/linux/issues/1686
Link: 82afc9b169
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Convert the NXP SAI binding to DT schema format using json-schema.
The Synchronous Audio Interface (SAI) provides an interface that
supports full-duplex serial interfaces with frame synchronization
formats such as I2S, AC97, TDM, and codec/DSP interfaces.
Beside conversion, 'fsl,shared-interrupt' and '#sound-dai-cells'
are added for they are already used by some dts.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1659443394-9838-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The src4xxx keyword is used for future capability to integrate
other codecs similar to the src4392 to the same code base.
Signed-off-by: Matt Flax <flatmax@flatmax.com>
Link: https://lore.kernel.org/r/20220810013213.1544645-1-flatmax@flatmax.com
Signed-off-by: Mark Brown <broonie@kernel.org>