* origin/audio/sof: (21 commits)
ASoC: SOF: Read tplg filename from board descriptor
ASoC: SOF: Update fw_filename from board description
ASoC: SOF: Allow probe to continue when we have an actual codec
ASoC: SOF: Hardcode ignore_machine
ASoC: fsl: Add generic DAI driver
...
* origin/audio/fm: (8 commits)
MLK-11429-21: ASoC: fsl: port si476x machine driver from imx_3.10.y
MLK-11305 radio-si476x: support set V4L2_CID_AUDIO_MUTE CTRL
MLK-22355: mfd: si476x: Use system_freezable_wq instead of system_wq
MLK-10055-2: mfd: si476x-i2c: sound is registered when no FM module attached
MLK-10038-1: mfd: si476x-i2c: Add support of si476x-rev4.0 board
...
* origin/audio/esai: (7 commits)
LF-276: ASoC: fsl_easi: constrain period size for edma case
ASoC: fsl_esai: Remove the tasklet
ASoC: fsl_esai: Add spin lock to protect reset, stop and start
ASoC: fsl_esai: Remove expensive print in irq handler
ASoC: fsl_esai: support multi power domain
...
There is limitaion for EDMA, which can only accept the period bytes
that can be divided by maxburst with no remainder. Otherwise EDMA
will not copy the left data in the end, and it will cause noise.
so add constraint for these chips.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
In the end of playback, when the suspend happen, there will be error
in m4 side.
RTM_SaiSdmaAdapter_SetParam: Tx in wrong state 2!
SRTM_SaiSdmaAdapter_SetBuf: Tx in wrong state 2!
SRTM_SaiSdmaAdapter_Start: Tx in wrong state 2!
The reason is that the I2S_TX_TERMINATE happen in the middle of
I2S_TX_SUSPEND and I2S_TX_RESUME, this sequence is not allowed.
So we make the rpmsg message workqueue enter freeze in suspend
to avoid such issue. that the command sequence will be
I2S_TX_SUSPEND->I2S_TX_RESUME->I2S_TX_TERMINATE
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
On i.MX8 platforms that have a DSP the DAI handling is taken care
of by two entities:
* Application Processor (AP), which runs Linux
* DSP, which runs a firmware (typically Sound Open Firmware)
The DSP has access to DAI IP registers, but it cannot easily handle
resources like:
* clock
* power domain management
* pinctrl.
For this reason we introduce a generic FSL DAI driver which will take
care of the resources above.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This reverts commit 9aca4d89de.
Reverting this because the patch suffered a lot of changes and
I don't want to do a first push. This should be squasehd
with 9aca4d89de.
On i.MX8 platforms that have a DSP the DAI handling is taken care
of by two entities:
* Application Processor (AP), which runs Linux
* DSP, which runs a firmware (typically Sound Open Firmware)
The DSP has access to DAI IP registers, but it cannot easily handle
resources like:
* clock
* power domain management
* pinctrl.
For this reason we introduce a generic FSL DAI driver which will take
care of the resources above.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
cherry-pick below patch from imx_3.14.y
ENGR00330403-3: ASoC: fsl: port si476x machine driver from imx_3.10.y
Port si476x machine dirver for i.MX series SoC and binding doc from imx_3.10.y
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
With dual fifo enabled, the case recording mono sound
in the background, playback sound twice in parallal,
the second time playback sound may distort, the possible
reason is using dual fifo to playback mono sound is not
recommended.
This patch is to provide a option to use multi fifo script,
which can be dynamically configured as one fifo or two fifo
mode.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 9d71068cf7d1fc1ec36e5fb34a321c1bdbaad324)
On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Wrap clk set_parent and set_rate operations with
disable_unprepare and prepare_enable.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Allow PLL switch for playback stream only and remove
PLL switch guard with regard to capture stream as the
clock for capture stream is provided externally.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit c8213da5fbcd370acb4d764bef5df5981a517c11)
Set SPDIF master clock frequency as function of rate.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 407430a03994e4acff508afe8c9772680558c1c5)
iMX8 platforms typically have 2 AUDIO PLLs being configured to handle
8k and 11k audio rates. The patch implements the functionality to
select at runtime the appropriate AUDIO PLL as function of audio
file rate.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 3a29374cfbe0bfaf1785fa66163ffd3b9e30aca3)
Use txclk array to keep all 7 TxClk sources instead of keeping clocks per
rate - need to do this in order to avoid multiple prepare_enable /
disable_unprepare of the same clock during suspend/resume.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 61bc5c83af0713a09b520486051a2efcbe852763)
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>
(cherry picked from commit e13a302391f56a6bb547ff89e3fac73941cee429)
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>
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
In imx8 when systerm enter suspend state, the power of subsystem will be
off, the clock enable state will be lost after resume, but the runtime
resume function will be called after resume by pm, so need to move clock
enablement to runtime resume and clock disablement to runtime suspend.
Then after resume the clock enable state can be recovered.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
In imx8qm/imx8qxp, the power domain of IP is enabled when
pm_runtime_get_sync() is called, and disabled when pm_runtime
_put_sync() is called. when power domain is disabled, the value
of registers will lost, so we need to use the regcache_sync()
to restore the registers in fsl_spdif_runtime_resume.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Introduce a SoC data struct which contains the differences between
the different SoCs this driver supports. This makes it easy to support
more differences without having to introduce a new switch/case each
time.
And in imx8qm, the spdif has two interrupt numbers and the burst size
should be 2 for EDMA limitation to support dual FIFO.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Validity bit is set in default, which means the data is not reliable,
The receive device may drop this data. So clear it in default, and
provide a mixer interface for user to control this bit.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Add snd_soc_pm_ops in machine driver to make the trigger suspend/resume
be called in suspend/resume. Remove platform_set_drvdata for redundance,
When register card, it has been called.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit fe21119eed18804b2bc7c47216b6f4478de0268d)
In imx6qp, there is no mega fast. After suspend, but before resume,
there will be spdif interrupt, if set cache only in suspend, then we
can't clear the interrupt, because regmap_write only write to cache.
So the system will hang for the interrupt can't be cleared.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 2a6a522c86d6c0fe80023c4327ca7ce4792035c8)
cherry-pick below patch from imx_3.14.y
ENGR00331799-2 ASoC: fsl_spdif: don't change the root clock rate of spdif in driver
The spdif root clock may be used by other module or defined with
CLK_SET_RATE_GATE, so we can't change the clock rate in driver.
In this patch remove the clk_set_rate and clk_round_rate to protect the
clock.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit c77170b2c9a9737f6fd61a5ea85a43b90e8ef02b)
[ Aisheng: fix incorrectly removing u64 rate_actual ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
This is needed so that at resume will restore the
correct SAI registers.
Looks like the call to regcache_mark_dirty was missed when
porting commit 760bd6187413e37c8 ("MLK-15960-2: ASoC: fsl_sai: refine
the pm runtime function")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
In file included from ../sound/soc/fsl/fsl_sai.c:15:0:
../sound/soc/fsl/fsl_sai.c: In function ‘fsl_sai_startup’:
../sound/soc/fsl/fsl_sai.c:957:51: error: ‘offset’ undeclared (first use in this function)
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, offset),
^
../include/linux/regmap.h:77:31: note: in definition of macro ‘regmap_update_bits’
regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
^
../sound/soc/fsl/fsl_sai.h:84:37: note: in expansion of macro ‘FSL_SAI_TCR3’
#define FSL_SAI_xCR3(tx, off) (tx ? FSL_SAI_TCR3(off) : FSL_SAI_RCR3(off))
^
../sound/soc/fsl/fsl_sai.c:957:34: note: in expansion of macro ‘FSL_SAI_xCR3’
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, offset),
^
../sound/soc/fsl/fsl_sai.c:957:51: note: each undeclared identifier is reported only once for each function it appears in
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, offset),
^
../include/linux/regmap.h:77:31: note: in definition of macro ‘regmap_update_bits’
regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
^
../sound/soc/fsl/fsl_sai.h:84:37: note: in expansion of macro ‘FSL_SAI_TCR3’
#define FSL_SAI_xCR3(tx, off) (tx ? FSL_SAI_TCR3(off) : FSL_SAI_RCR3(off))
^
../sound/soc/fsl/fsl_sai.c:957:34: note: in expansion of macro ‘FSL_SAI_xCR3’
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, offset),
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
The patch enable mapping the number of pins required to play or record
a specific number of channels to a specific dataline mask.
Three consequent elements in "fsl,dataline" and "fsl,dataline,dsd" defines a
particular mapping, for instance for: fsl,dataline = "0 0xff 0xff 2 0x11 0x11"
there are two mappings defined:
default (0 pins) "rx" and "tx" dataline masks: 0 0xff 0xff
2 pins "rx" and "tx" dataline masks: 2 0x11 0x11
In case if property is missing, then default value "0 0x1 0x1" is considered.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Both dataline_off and dataline_off_dsd fields are unsigned,
thus checking negative values make no sense. Use a signed
variable to calculate offset instead.
This fixes Coverity issue: CID1899299
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Commit 786c8bd56324 ("MLK-19734-3: dmaengine: imx-sdma: change
fifo offset of fifo_num") change the offset of fifo_off, so
the sai driver need to be updated.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit c94ce8776e01f1f40a866d4da89603ab042dde0f)
Make fsl_get_pins_state function inline.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit badcb97ebd8c0aae89f76e979bcc801be35c7400)
Similar to DSD512 case we need a PCM pinctrl state option to map SAI BCLK
to codec MCLK pin. Given that bitclock rate is function of slots number and
slot width - pass bclk rate as parameter value from SAI driver.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 826caeae32713cff7ad50de8ebc9915de975edd9)
The FSL_SAI_VERID and FSL_SAI_PARAM only available
when reg_offset is 8
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 0a0695672dc7ecf07a7642ff6f99f0b9d3a26b32)
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>
[ Aisheng: split machine imx-pdm changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
a) Add support for new SAI (VERID, PARAM, MCTL, MDIV) registers
available in i.MX 850d (SAI v3.00) and i.MX 845s (SAI v3.01).
b) Handle SAI MCLK register as function of SAI IP version.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
For some cases (like AMIX) pinctrl may be null - this
breaks SAI functionality. Enforce pinctrl null pointer
checking prior calling any function which involves
pins state changes.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Replace DSD related code with calls to DSD helper functions.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com
Transmit data pins will output zero when slots are masked or channels
are disabled. In CHMOD TDM mode, transmit data pins are tri-stated when
slots are masked or channels are disabled. When data pins are tri-stated,
there is noise on some channels when FS clock value is high and data is
read while fsclk is transitioning from high to low.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
ULP B0 integrate the latest SAI IP, there is version id and
parameter id register in the beginning, so update the offset
for ULP B0
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Set the requested clock rate in "set_sysclk" for specified clock id.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Introduce FSL_SAI_CLK_BIT clock id in order to distinguish
the bit clock and master clocks in "set_sysclk" API.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
The register definition is not completed for SAI support
8 transmit data register and 8 receive data register.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Because fsl_sai_dai rates doesn't have a specific set of
rate values (.rates = SNDRV_PCM_RATE_KNOT) we need to provide
rate_min and rate_max otherwise functions trying to get
supported parameters will get confused and return an error.
Fixes: 1b6f0496e013 ("MLK-17428-8: ASoC: fsl_sai: support 768KHz sample rate")
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
With the existing implementation the SAI pinctrl state is restored to
default after resume - this breaks DSD playback after resume.
Restore DSD pinctrl state in snd_soc_dai_driver resume callback.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Fix build warning
sound/soc/fsl/fsl_sai.c: In function ‘fsl_sai_trigger’:
sound/soc/fsl/fsl_sai.c:736:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
while (tx && i < channels)
^~~~~
sound/soc/fsl/fsl_sai.c:742:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘while’
j++;
^
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
The codec always mux the LRCLK pin to DSD data line, so when
we want to support DSD, the pinmux is different. For two channel
DSD, the DSDL is mapped to TX0, but the DSDR is mapped to TX4,
there is address offset for the fifo address of TX0 and TX4, TX4's
fifo is not adjacent to TX0's.
Usually, if mapping is TX0 and TX1, that will be easy for SAI
and SDMA to handle, that SAI can use the FIFO combine mode, SDMA
can use the normal script.
so for DSD:
1. The SDMA should use the multi-fifo script, and SAI can't
use the FIFO combine mode.
2. driver should to check the dts configuration(fsl,dataline) for
which dataline is used corrently
3. maxburst is the multiply of datalines
4. each channel of DSD occupy one data lane
5. according to data lane, set TRCE bits
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
The filter_data should be used for dma_filter_fn function,
but we used the filter_data wrongly for dma channel name.
This patch is to fix the issue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviwed-by: Daniel Baluta <daniel.baluta@nxp.com>
[ Aisheng: split out esai and pcm changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Allow set SAI bit clock frequency trough snd_soc_dai_set_sysclk
function call on machine sound drivers.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
xMR setting must be set as min(channels,slots) since
both "channels < slots" and "channels > slots" scenarios
are possible.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
When there is multi data line enabled, the xMR setting is
wrong if according to the channel number. which should
according to the slot number
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
If there is only two channels input and slots is 2, then enable one
port is enough for data transfer. so enable the TCE/RCE according to
the input channels and slots configuration.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The patch introduces the master flag handling
as function of direction and the option to provide
the flag value from DTS.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
In imx8qm/imx8qxp, the power domain of IP is enabled when
pm_runtime_get_sync() is called, and disabled when pm_runtime
_put_sync() is called. when power domain is disabled, the value
of registers will lost, so we need to use the regcache_sync()
to restore the registers in fsl_sai_runtime_resume.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The fifo_depth is changed to 64 in imx8qm/imx8qxp, in imx8mq, the
fifo_depth is 128. which is mentioned in their ADD.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
EDMA requires the period size to be multiple of maxburst. Otherwise the
remaining bytes are not transferred and thus noise is produced.
We can handle this issue by adding a constraint on
SNDRV_PCM_HW_PARAM_PERIOD_SIZE to be multiple of tx/rx maxburst value.
This is based on a similar patch we have for ESAI:
commit bd3f3eb2a37c
("MLK-15109-2: ASoC: fsl_esai: add constrain_period_size")
Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
The version of sai is upgrate in imx8mq, which add two register
in beginning, there is VERID and PARAM. the driver need to be
update
Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
When starting a playback the initialization data used to reduce underruns
was send to the transmit data register after the DMA requests were enabled.
This patch moves the initialization phase before enabling the DMA so the
data is transmitted in correct order.
Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
With current clock configuration we cannot derive bitclk for S20_3LE
format in SAI master mode. There was an attempt to fix this in commit
65e6b5f1b4a7 ("MLK-14536: ASoC: wm8960: Fix playback in CPU DAI master mode")
but this broke codec-master mode, thus the patch was partially reverted in
96f0d36e420 ("MLK-14798: arm: dts: imx6ul: Fix wm8960 codec master mode")
So, remove S20_3LE support for SAI master mode. Clients using this
feature should use codec master mode, which is the default one in the
dts anyway.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This reverts commit c768ed336bba ("ASoC: fsl-sai: set xCR4/xCR5/xMR for
SAI master mode")
This change was already introduced by commit 51659ca069 ("ASoC: fsl-sai:
set xCR4/xCR5/xMR for SAI master mode") from upstream.
Manually adjust the code to match the changes introduced by subsequent
commit b2936555bb38 ("MLK-13609: ASoC: fsl_sai: fix for synchronize mode")
by removing updates to FSL_SAI_TMR/FSL_SAI_RMR registers.
Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
which don't request the dma channel in the probe, but request
dma channel when needed. for the dma channel of cpu dai in BE
can be reused by the FE.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Aisheng: split PCM changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Set specific fmt, for i2s xtor receiver is
in slave mode and i2s xtor transmitter is in master mode.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
The SAI interface can be a clock supplier or consummer
as function of stream direction, ie when interacting
with I2S XTOR. Removed FSL_SAI_RFR define as it is now
referred as FSL_SAI_RFR0.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
SAI & ESAI interfaces may share the same interrupt with EDMA,
so that we need a flag to trigger proper shared interrupt
handling. For compatibility the same DT flag, "shared-interrupt",
is introduced as the one used in drivers/dma/fsl-edma-v3.c.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
[ Aisheng: split easi changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
TX synchronous with receiver: the RMR should not be changed and
the RCSR.RE should be set in playback.
RX synchronous with transmitter: the TMR should not be changed and
the TCSR.TE should be set in recording.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
In imx7ulp1, the sai can support two TX channel and two RX
channels, So the usage need to be updated.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
When audio stop, it will first stop dma, then stop cpu_dai.
If there is delay between dma stop and cpu dai stop, there
will be underrun error, the print will cost time, then will
cause another underrun error, it is a infinite loop.
Which will cause the cpu dai can't stop.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
For SAI master mode, when Tx(Rx) sync with Rx(Tx) clock, Rx(Tx) will
generate bclk and frame clock for Tx(Rx), we should set RCR4(TCR4),
RCR5(TCR5) and RMR(TMR) for playback(capture), or there will be sync
error sometimes.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 51659ca069)
After playback audio with sai<->wm8960 sound card, is_slave_mode
will be set, but it will not be cleared. So playback audio with
sai<->sii902x sound card will have no voice.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Just one device can playback(captrue) when using the same SAI.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 7981a488c4da440db21f0544b519b44636a0cabb)
Write initial words to SAI FIFO to reduce underrun error
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 7ba8ae883d84540fac5ed4147d124399537bc0b3)
(cherry picked from commit f4435f35aa2a97551d2c4a12ca316c354a880f85)
IMX RPMSG is still not ready.
In file included from ../sound/soc/codecs/rpmsg_wm8960.c:27:0:
../sound/soc/codecs/../fsl/fsl_rpmsg_i2s.h:278:29: fatal error: linux/imx_rpmsg.h: No such file or directory
#include <linux/imx_rpmsg.h>
^
compilation terminated.
../scripts/Makefile.build:278: recipe for target 'sound/soc/codecs/rpmsg_wm8960.o' failed
make[4]: *** [sound/soc/codecs/rpmsg_wm8960.o] Error 1
make[4]: *** Waiting for unfinished jobs....
AR arch/arm/mach-imx/built-in.a
In file included from ../sound/soc/codecs/rpmsg_cs42xx8.c:25:0:
../sound/soc/codecs/../fsl/fsl_rpmsg_i2s.h:278:29: fatal error: linux/imx_rpmsg.h: No such file or directory
#include <linux/imx_rpmsg.h>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
we can call the snd_pcm_period_elapsed in timer's callback
to achieve pseudo period wake up, so the nonblock constraint
can be removed
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
add more rates in constraint list, Fixes commit ee959e2c9b18
("MLK-19581-3: ASoC: fsl_rpmsg_i2s: support multipul rate and DSD format")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
The rpmsg wm8960 codec driver is completed to support
full function, not only the volume control. which cause
an issue that there is no sound when recording, the reason
is that the MIC Bias not enabled, and it should be enabled
through audio routing.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
The reason is same as commit d4eb8ab26399 ("MLK-19854-1: ASoC:
imx-cs42888: fix error when m4 image is not loaded")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
In LPA mode, the system will be resumed by audio notification, when the
period size is small, there will be occasion that when notification
the underrun is happen, but the substream runtime state is not running
so the aplay won't trigger stop first, then start. just only trigger
the start, which don't comply with the convention.
So in this patch, we change the substream runtime state to running, when
the notification happened at resume.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
With the case that underrun happened, the aplay will trigger
stop and start, if the period index is not reset at stop, the
counter of period will be wrong
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
With LPA mode, if the period size is small, the timer for query
buffer pointer will be triggered immediately after suspend, the MU
interrupt will resume the system quickly.
This patch is to disable timer when suspend.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 9c5e78cf50855bd73f2b5c3dc8bc48f8a0907b39)
register the codec when needed.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 241b6b3275924f3dc63be26d1442b55b80ac53ef)
The Ak4497 support large range rate and DSD format, so increase
the supported scope of cpu dai.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 29155a9161bfb9985918ed9130aebafc2293c734)
For ak4497, the dai fmt should be SND_SOC_DAIFMT_CBS_CFS.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit ecd184c46e2916d2bcdde8db9b2281b89e8b0189)
On imx8qm mek, the cs42888 is connected with i2c in cm41 domain,
but wm8960 is connected with i2c1, which is not in m4 domain.
So we only need to eable rpmsg for cs42888.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 9d2368aef40e4d107e4deee1a2c7e191c1afe644)
support more codecs, codec is specified by compatible string
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 7c92a75fcf83ec0aa3fe6773e4cb5f5e88a1ff09)
register rpmsg wm8960 and cs42xx8 codec
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit c49f8d20c6fd4479ad45d76290bb5c57d4800d9e)
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>
(cherry picked from commit 508550b70e80339d3d49594ffc23946dd80b0c82)
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>
(cherry picked from commit aa8b9304d207e5f00cca8a41772c130dd4c6944b)
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>
(cherry picked from commit 43bcd3a8e9f4c1b2af9974f2082a34beacfba4a1)
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>
(cherry picked from commit 0fd349fbab28d97f8c5501ec635bff053e3b1470)
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>
(cherry picked from commit 753e7b819609ad4791e32069a124d4411c720947)
use the rpmsg_wm8960 codec instead of the dummy codec
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Receive message is only used when the type is B. originally
we copy the receive message to revg_msg all the time, when
the message type is C, which will overide the revg_msg, which
cause the get codec data command return wrong value.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
register rpmsg codec after the rpmsg-audio-channel is
ready.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
rpmsg provide command for A7 side to set the codec value and get
codec value by i2c. In this case, the A7 can control the codec.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
with "echo 1 > /sys/class/graphics/fb0/blank", and there is no
usb connected on board, the system may enter low power mode,
then audio playback will be failed. use pm_qos to prevent A7
core enter low power mode during audio playback and recording.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The pulse audio will set a wrong buffer size which is not the integral
multiple of period size, it will cause the DMA can't work correctly in
M4 side.
The reason is that we always need to add a constraint for
SNDRV_PCM_HW_PARAM_PERIODS, which make it integer.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 54a10a6c2130a69aca4c1923dac3a15137911146)
In suspend and resume, the M4 side will reset hw parameter for tx
and rx, when only tx is working, the parameter of rx is a old value,
which will cause the parameter is not sync with tx and rx.
currently the M4 audio can only work in sync mode, so set both
parameter in same time.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The test case is to playback a bitstream, then repeat ctrl+z and fg,
several times later, the playback is failed to continue.
The reason is if the work is pending in work queue, send second time
of this work, the second work is dropped by work queue. so use one
work for one cmd is not fit for audio case. use a work loop for audio
cmd to fix this issue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Currently the M4 audio driver don't support mono channel, so remove it.
After mono channel is supported in M4 os, this commit should be reverted.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
some cmd is sent by workqueue, others are sent by call send message
function directly, for workqueue may have delay, so there is occasion
that cmd is not sent in order.
Add flush_workqueue before the CLOSE and SUSPEND to make sure previous
cmd is finished in that time.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The M4 audio driver only support 8k/16k/32k/44k/48kHz sample rate.
so remove other rate in supported list.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
This typo issue will cause that wrong cmd send to M4 side.
Fixes: 3e13a631aee0 ("MLK-13904-1: ASoC: fsl: add audio cpu dai driver base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Add machine driver, which is using the dummy codec.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Acked-by: Robin Gong <yibin.gong@nxp.com>
[ Aisheng: clean for a new base ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Add platform driver, each step like set hw param, trigger start
trigger stop, and so on, will call the rpmsg api.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Acked-by: Robin Gong <yibin.gong@nxp.com>
[Aisheng: clean for a new base ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Add the cpu dai driver, as the rpmsg_send api can't be used in
atomic context, so using the workqueue instead of calling
rpmsg_send() directly.
The detail communication stack is defined in header file.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Acked-by: Robin Gong <yibin.gong@nxp.com>
[ Aisheng: split out imx-pcm.h changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
With the case below, there is issue that after recording with
8 channels, the recording of 1 channel will fail.
arecord -Dhw:2,0 -r 32000 -f S16_LE -c 8 -d 5 -t raw /tmp/test1.pcm
arecord -Dhw:2,0 -r 32000 -f S16_LE -c 1 -d 5 -t raw /tmp/test2.pcm
arecord: pcm_read:2143: read error: Input/output error
The reason is that we need to reset channel output data Flag before
we start the recording
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 45ea3acd0c0c67a7b33faee9818401c6fbcc8c96)
Merge the changes from imx_4.19.y
The top commit is:
b5472e3f3dd1 ("MLK-21775-4: ASoC: fsl_micfil: synchronize HWVAD enable/disable")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
As per commit 4cb1ea925e ("ASoC: fsl: dma: replace platform to
component"), replace platform to component.
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
In order to support 44kHz and 48kHz sample rate together, we need to
reconfigure the parent clock of mclk.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
The codec dai name is changed in 4.14,so the machine driver need to
be updated
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
The codec dai name is changed in 4.14,so the machine driver need to
be updated
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
The FB_MX8_HDMI is removed, the dependency is changed
to DRM_IMX_HDP.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
switch to generic hdmi codec, which provide the api for get
the edid information.
Add snd controls which is the interface for user to query
the HDMI capibility. ( channels, rates, formats)
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Constraint rate depends on the clock rata of cpu dai, which is
defined in dts, so we add constraint-rate property in dts, then
driver can get it.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Since commit 3f5780eb4520 ("MLK-16538-2: hdmi api: Relocate hdmi api
soure code") change the api. And hdmi video driver provide a new api
for hdmi audio. Machine driver need to be updated accrodingly
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
-Relocate hdmi api source code from drivers/video/fbdev/mxc/cdn_hdp
to drivers/mxc/hdp.
-Add displayport and hdcp api function.
-Move t28hpc_hdmitx function from api source code folder
to hdmi fb driver folder.
-Update imx8 hdmi fb driver according api source code change.
-Sync api source code with CDN_API_1_0_33 release.
Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
According the HDMI spec, the N value depends on the TMDS
rate, and sample rate. As we set the vic mode in dts file,
use the vic_table to get the TMDS rate, then choose the
proper N value.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
The machine driver will call the API which is provided by
the cadence to configure the audio features.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
[ Aisheng: clean for a new base ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
The calculation "runtime->status->hw_ptr * (runtime->frame_bits / 8)" may
exceed the integer scope, then appl_bytes is no correct.
This patch is to fix this issue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
In the frame_to_bytes(), when hw_ptr*frame_bits exceed the maxmum of unsigned
long, the return value is saturated, so the appl_bytes is wrong.
This patch is to correct the usage of frame_to_bytes().
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 9e66132d9c96305b65aa5fa3ba8a35271a04ded9)
cherry-pick below patch from v3.14.y:
ENGR00330403-2: ASoC: fsl_hdmi: port hdmi audio driver from imx_3.10.y
Port HDMI audio driver (CPU driver, machine driver, platform driver) from
imx_3.10.y.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
During 4.14 rebase converted from snd_pcm_ops.copy to copy_user because
copy was removed by upstream
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
[ Aisheng: fix conflicts for a clean base and merge MLK-12244
file onwership change ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Remove tasklet for it may cause the xrun interrupt not be
handled immediately, that will be endless interrupt.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
xrun may happen at the end of stream, the
trigger->fsl_esai_trigger_stop maybe called in the middle of
fsl_esai_hw_reset, this may cause esai in wrong state
after stop, and there may be endless xrun interrupt.
This issue may also happen with trigger->fsl_esai_trigger_start.
So Add spin lock to lock those functions.
Fixes: 7ccafa2b38 ("ASoC: fsl_esai: recover the channel swap after xrun")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/52e92c4221a83e39a84a6cd92fc3d5479b44894c.1572252321.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When stopping audio, ASoC will first stop DMA then CPU DAI.
Sometimes there is a delay between DMA stop and CPU DAI stop, which
triggers an underrun error. Now, because of the delay introduced
by dev_err another underrun error will occur causing a vicious circle
making impossible to stop CPU DAI.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
With this patch, esai driver can support tx and rx in
different master/slave mode.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Aisheng: split codec cs42xx8 changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
SAI & ESAI interfaces may share the same interrupt with EDMA,
so that we need a flag to trigger proper shared interrupt
handling. For compatibility the same DT flag, "shared-interrupt",
is introduced as the one used in drivers/dma/fsl-edma-v3.c.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
[ Aisheng: split SAI changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Modified parameter msg in dsp, make sure still can transfer right msg
between DSP and user, modified parameter msg in kernel.
Signed-off-by: Zhang Peng <peng_zhang_8@nxp.com>
Because we are re-initializing the proxy at close it might
happen that work is still pending which causes the following crash:
[ 94.699835] Unable to handle kernel NULL pointer dereference at virtual address 00000008
[ 94.707923] Mem abort info:
[ 94.710722] Exception class = DABT (current EL), IL = 32 bits
[ 94.716637] SET = 0, FnV = 0
[ 94.719686] EA = 0, S1PTW = 0
[ 94.722822] Data abort info:
[ 94.725698] ISV = 0, ISS = 0x00000005
[ 94.729530] CM = 0, WnR = 0
[ 94.732504] user pgtable: 4k pages, 48-bit VAs, pgd = ffff8008d9ba3000
[ 94.739035] [0000000000000008] *pgd=0000000938419003, *pud=0000000000000000
[ 94.746015] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 94.751589] Modules linked in:
[ 94.754652] CPU: 0 PID: 2068 Comm: kworker/0:2 Not tainted 4.14.98-dirty #75
[ 94.761700] Hardware name: Freescale i.MX8QM MEK (DT)
[ 94.766768] task: ffff8008f23ae200 task.stack: ffff000014378000
[ 94.772705] PC is at process_one_work+0x34/0x414
[ 94.777325] LR is at process_one_work+0x1e0/0x414
In order to fix this, we make sure that no work is pending before starting
the re-initialization.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 2c00c24be5f8b63636e3f9005e15a3de42058438)
In order to support in parallel FSL DSP and SOF Linux drivers
we will need to use different compatible strings for DSP nodes.
Use fsl,imx8qxp-dsp-v1 for FSL DSP driver. Note that our goal is
to only support SOF Linux driver, so FSL DSP driver will be deprecated.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
API change due to:
adb76b5b9c ("ASoC: soc-core: remove legacy style dai_link")
../sound/soc/fsl/imx-dsp.c: In function ‘imx_dsp_audio_probe’:
../sound/soc/fsl/imx-dsp.c:123:14: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_dai_name’
data->dai[0].codec_dai_name = "snd-soc-dummy-dai";
^
../sound/soc/fsl/imx-dsp.c:124:14: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_name’
data->dai[0].codec_name = "snd-soc-dummy";
^
../sound/soc/fsl/imx-dsp.c:125:14: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_dai_name’
data->dai[0].cpu_dai_name = dev_name(&cpu_pdev->dev);
^
../sound/soc/fsl/imx-dsp.c:126:14: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_of_node’
data->dai[0].cpu_of_node = cpu_np;
^
../sound/soc/fsl/imx-dsp.c:127:14: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_of_node’
data->dai[0].platform_of_node = platform_np;
^
../sound/soc/fsl/imx-dsp.c:140:14: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_dai_name’
data->dai[1].codec_dai_name = "cs42888";
^
../sound/soc/fsl/imx-dsp.c:141:14: error: ‘struct snd_soc_dai_link’ has no member named ‘codec_of_node’
data->dai[1].codec_of_node = codec_np;
^
../sound/soc/fsl/imx-dsp.c:142:14: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_dai_name’
data->dai[1].cpu_dai_name = "snd-soc-dummy-dai";
^
../sound/soc/fsl/imx-dsp.c:143:14: error: ‘struct snd_soc_dai_link’ has no member named ‘cpu_name’
data->dai[1].cpu_name = "snd-soc-dummy";
^
../sound/soc/fsl/imx-dsp.c:144:14: error: ‘struct snd_soc_dai_link’ has no member named ‘platform_name’
data->dai[1].platform_name = "snd-soc-dummy";
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
With non fsl-imx8qxp-mek-dsp.dts, the clock is not assigned
to dsp node, which cause error message when kernel boot up.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Remove the clock operation in cpu dai, all clock will be
moved to platform driver.
The reason is that the suspend and resume of dsp is handled in
platform driver, if the clock is disabled before the suspend,
the dsp framework can't access the registers of device in suspend.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Revert "MLK-18497-13: ASoC: fsl: dsp: Skip SDRAM section update if
fw is already loaded"
This reverts commit a0cffd9a9299362f2b3a4d24b78a8574b736fdfa.
This is just to avoid reconfigure the edma isr handler in dsp
framework, which should be handled by dsp framework.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
We set system address offset select to 0 on QM because of the following reasons:
* SC_C_OFS_PERIPH, it is not available for QM
* SC_C_OFS_AUDIO, it is not used
* SC_C_OFS_IRQ, needs to get outside of the VPU.
A simplified version of the code is:
if (dsp_priv->dsp_board_type == DSP_IMX8QXP_TYPE) {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 1);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_PERIPH, 0x5A);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_IRQ, 0x51);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_AUDIO, 0x80);
}
} else {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 0);
}
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
On QM the DSP is inside the VPU subsystem while in QXP
it is inside the Audio DMA subsystem. For this reason
there are "subtle" differences.
Introduce new compatible string for QM to help us correctly
configure the DSP depending on the board they run.
dsp_mem_msg structure is shared with the DSP, so by introducing
new member dsp_board_type we can let DSP know on which target it runs.
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We enable the ASRC clocks from CPU side. We only need
the following clocks: "mem", "ipg" and "asrc0..3".
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
strtab is always non-null so remove unnecessary check.
This is a follow up of patch
167a6d79f ("ASoC: fsl: Skip checking for string section type")
and finally fixes CID3901026
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
e_shstrndx already contains the section header index, so
shdr->sh_type will always be SHT_STRTAB.
Remove this redundant check and make Coverity happy.
Fixes: CID3901026
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
xf_cmd_send_recv returns with lock taken if waiting was
interrupted by a signal.
This fixes Coverity issues: CID5233120 / CID5233060
Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Bail out if kernel_read returns an error.
Fixes: CID1477415
Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
At this point err is always 0. So, just remove the check.
Fixes: CID1477380
Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Return value is not used so better use atomic_dec.
This also silences coverity warning CID3344689.
Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
xf_cmd_recv will return with lock taken in two cases:
* msg was received
* waiting for msg was interrupted by a signal
Make sure we unlock proxy->lock in both cases.
This fixes Coverity issue: CID3335482.
Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>