Age | Commit message (Collapse) | Author |
|
register rpmsg wm8960 and cs42xx8 codec
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
The difference of rpmsg_cs42xx8 and cs42xx8 driver is previous one
will send command through rpmsg, others are same.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
The difference of rpmsg_wm8960 and wm8960 driver is previous one
will send command through rpmsg, others are same.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
The format send to M4 through rpmsg is wrong, that make the
driver treat the data as S32_LE, it looks like data is right
shift 8 bit.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Since i.MX8 MQ SPDIF interface is able to capture raw data.
Add support in SPDIF driver for this functionality.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Remove redundant code and use snd_ctl_boolean_mono_info
instead.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
In the imx8qxp, the DMA is EDMA, which require the buffer size
should be divided by burst size with no remainder, otherwise
the remainder is not transferred by EDMA, so the input buffer
is not consumed by ASRC, then there will be dma output timeout
issue. This behavior is different with SDMA.
This patch is to change the input burst size to be 1 to avoid
the issue, and refine the last_period_size for output buffer.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 8e6b6939e7708c6ecd8f8a439a6f19b20cabfd07)
|
|
add regulators for ak5558
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
add regulators for ak4497
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
add regulator for ak4458
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Some platform the rpmsg device only support playback or record. So
Add a property to differentiate them.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
This issue is reported by coverity (4022712).
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Move client freeing later when no one needs it.
This fixes Coverity Issue 3344686.
Note that this also fixes a potential memory leak, if proxy happens to
be NULL.
Reported-by: Ioan-alexandru Palalau <ioan-alexandru.palalau@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
We load DSP firmware from the ARM side at 0x556e8000 but because the
compiler generated memory layout starts at 0x596e8000 we need to do
some fixups.
Thus, each address (in DSP local memory) generated by the compiler
needs to be substracted an offset = 0x596e8000 - 0x556e8000 = 0x4000000.
Because this only happens on QM we will use dts to specify the offset.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
In imx8mm, there is no controls for wm8524, so we use the
dummy codec instead.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Update the read and write function for the send_message function
changes
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Add ack function, which is to info M4 side how many data
has been writen to buffer.
Add timer, which is to get the position of hw pointer in m4.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Add two new message command I2S_TX_POINTER and I2S_RX_POINTER,
which are used to get the hw pointer in m4 side. For in low
power audio mode, m4 won't send notification every period, the
notification only be sent when hw pointer reach end of buffer,
so we need these command to get the position of hw pointer,
user can use it to calculate the timestamp.
Restructure send message and recv message together for i2s_rpmsg,
that every send message has a recv message. so the
i2s_send_message can store the recv message indepedently. one
reason is that the receive message is async withe send message.
The low power audio is disabled in default, user need to enabled
it by add "fsl,enable-lpa" in dts.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
The dma_len is the size that how many data dma should transmit. As
the asrc use channel as unit, so the dma_len should also in channel unit.
Otherwise the output data is not align in channel, there will be noise.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit ed8ee98002cac3ba0ba51aea3dca99344bc7e503)
|
|
Fixes commit feb06839682c ("MLK-16839-1: ASoC: fsl_asrc: selec
a proper clock source from the clock list")
When inclk is INCLK_ASRCK1_CLK, the driver will config module
to be non ideal ration mode, But the divider should be less
than 1024 and exact division. otherwise there will be distortion.
If the divider larger than 1024 or it is not exact division, asrc
should switch to ideal ratio mode, which don't care about the
divider.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit 0659a4726136250a2fba1b8e105e2e9a04a9bf4d)
|
|
The output size of asrc for a dedicate input is uncertain.
For example, if the input size is 1k, the output ratio is
2, so the output size should be 2k. but the actual output
size is not 2k, is less than 2k. if we set the dma size
to be 2k, the dma can't get enough data that can't finish
the transmission, then there will be
"output DMA task timeout"
So we need to set the dma size a proper value but we don't know
how many data less than expected. so we defined the last period
size for assumption of reduced size.
The last period size should not be too large, if it is large
there will be
"input DMA task timeout"
The reason is the output FIFO is full, which will block the
input data comsumption.
In this patch, the last period size is set to the difference
of configured buffer size and the expected output size, plus
a fix size.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
(cherry picked from commit e52f5e08624185919bc794106623e8defb1c4f0e)
|
|
The commit 7f3ff14b7eb1 ("dmaengine: imx-sdma: add 1ms delay
to ensure SDMA channel is stopped") add 1ms delay may cause
the audio underrun/overrun.
But ESAI has an hardware issue in older version which work abnormal
after underrun/overrun, especially there will be channel swap.
To workaround this issue, the ESAI need to be reset. in
imx-pcm-dma.c we include a new callback function for DMA interrupt
which will check the state of cpu dai and reset it in necessary.
So inport same function to imx-pcm-dma-v2.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Move imx-cdnhdmi to end of the list.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Reorder the list of objects in attempt to get
a predictible audio card probe sequence.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Add amixer controls for the following hardware voice activity
detection parameters: initialization mode, initialization time,
frame time, high-pass filter mode, input gain, sound gain, noise
gain, noise filter adjustment, zero-crossing detector(zcd)
enablement, zcd threshold, zcd auto-threshold, zcd filter adjustment
All of those parameters are now saved into micfil private data and
used when hardware voice detection is enabled.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
|
|
Hardware Voice Activity Detector (HWVAD) is a block responsible for
detect voice activity in a channel selected by the user and it can be
configured in Envelope-based or Energy-based mode. Optionally, a
Zero-Crossing Detector can be enabled to improve the voice detection.
To enable hwvad from userspace there is a interface and you should write
the number of channels in /sys/devices/platform/30080000.micfil/hwvad/enable
to enable the hardware voice activity detection for micfil or 0
to disable it.
When voice activity is detected, an udev event will be generated:
"EVENT=PDM_VOICE_DETECT" and hwvad will be disabled afterwards.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
|
|
Remove regmap_cache_only from probe since this should be done
in suspend/resume or when hwvad is enabled/disabled. If regmap
is cached in probe, all volatile registers cannot be read/write
until caching is set to false (which in our case was done only
in resume function).
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
|
|
Changing "arate" type to u64 makes 32-bit kernel build to fail,
so restore the previous type.
Fixes: bb7d18078220 ("MLK-18955-2: ASoC: fsl_spdif: fix sysclk_df type")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
|
|
According to SPDIF spec STC SYSCLK_DF field is 9 bits width, values
being in 0..511 range. So use a proper type to handle sysclk_df.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
For multi p2p instance an ASRC device cannot be closed successfully
when two threads plays streams simultaneously on same ASRC device.
'pair_streams' variable shall be moved to 'struct fsl_asrc_pair'
for multi p2p instance in order to handle pair release properly.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Use a specific compatible string for 850D in order to limit DSD MCLK
frequency for platforms newer than 850D.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
SAI interface now is able to change at runtime the pll parent of the
master clock, so enable both 8k and 11k range of rates for AK codecs.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Currently SAI master clock derives from an audio pll that cannot be
changed at runtime. iMX8 SoC has 2 audio plls usually configured to support
either 8000Hz (8k,16k,32k,48k,etc) or 11025Hz (11k,22k,44.1k,88.2k,etc)
ranges of rates - thus at runtime a SAI interface is able to play only one
range of rates. The patch allows dynamic SAI master clock reparenting to
the appropriate audio pll as function of the audio stream rate to be
played/recorded.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
ALSA API has a standard way to configure DAI BCLK by calling
"snd_soc_dai_set_bclk_ratio" function. So use it to set BCLK ratio
and calculate SAI BCLK frequency.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
ASRC audio routes introduce aditional log noise if ASRC
OF node is missing in DTS, so add them if ASRC node is present only.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
Currently SAI interface sets MCLK rate if provisioned
externally from machine driver through set_sysclk. Let
SAI manage clock frequency without interfering from machine driver.
Aside of this use channels number to set TDM tx and rx masks.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
correct the license issue
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
|
|
specify the spdif in imx8mm for the ipg clock is higher that
it can support 192kHz
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
The ipg clock is higher enough to support 192kHz in imx8
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
|
This block implements the required digital interface to provide a
16-bit audio signal from a PDM microphone bitstream in a
configurable output sampling rate 11025kHz - 48000kHz.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Mark micfil stat register as volatile since status
flags should not be read from cache.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
MICFIL is using multi-fifo dma and maxburst must
be set proportional to number of channels.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Add channels output gain and quality select controls.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Since IP version 3.01 (845s) SAI has support for 1:1
bclk:mclk ratio.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
|
support S32_LE
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
Add machine driver for micfill IP in iMX8MM.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
|
|
Add micfil cpu-dai for iMX8MM.
The MICFIL digital interface provides a 16-bit audio
signal from a PDM microphone bitstream in a configurable
output sampling rate.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
|
|
There is ak4497 audio card even no audio board connected, which
os caused by there is no error return value even the i2c access
failed.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
|
support hdmi rx in machine driver
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|