Current R-Car sound supports only SRC/SSI,
but, other module will be supported.
This patch adds rsnd_path_parse() macro to share code
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The register CLASS_D_CONTROL_1 is marked as volatile because it contains
a bit, DAC_MUTE, which is also mirrored in the ADC_DAC_CONTROL_1
register. This causes problems for the "Speaker Switch" control, which
will report an error if the CODEC is suspended because it relies on a
volatile register.
To resolve this issue mark CLASS_D_CONTROL_1 as non-volatile and
manually keep the register cache in sync by updating both bits when
changing the mute status.
Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
Commit 10df350977 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is
enabled.") caused following regression in Baytrail SST:
baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed
baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware
Fix this by calling dma_coerce_mask_and_coherent() in sst_byt_init() with
the same dma_dev device what is now used in sst_fw_new() when allocating the
DMA buffer.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This follows the same idea than commit 10df350977
("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only
ACPI device for all DMA allocations. Since DMA masking is already done in
firmware loading it can be removed from here.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
We don't need to change those dividers if bclk and mclk remains the same
directions and values.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
According to Reference Manual -- ESAI Initialization chapter, as the
standard procedure of ESAI personal reset, the PCRC and PRRC registers
should be remained in its reset value and then configured after T/RCCR
and T/RCR configurations's done but before TE/RE's enabling.
So this patch moves PCRC and PRRC settings to the end of hw_params().
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
ESAI can only output EXTAL clock source directly. But for FSYS clock source,
ESAI can not output it without getting through PSR PM dividers.
So this patch adds an extra check in the code.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The range here from 1 to 16 is confined to FP divider only while the
sck_div indicates if the calculation contains PSR and PM dividers. So
for the case using PSR and PM since the sck_div is true, the range of
ratio would simply become bigger than 16.
So this patch fixes the condition here and adds one line comments to
make the purpose here clear.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
We may read an unexpected value when detemining which codec is attached.
In that case, either a unsupported codec is attached or something wrong
with I2C. The driver will not work properly on both cases. So we return
an error for that.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This was initially removed in commit 6423c1875 ("ASoC: Remove runtime field from
DAI"), but was, presumably by accident, brought back in commit f0fba2ad1 ("ASoC:
multi-component - ASoC Multi-Component Support"). But has never been
initialized to anything but NULL ever since. This commit removes it again.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Suspend/resume support for the atmel-pcm-pdc driver was broken in commit
f0fba2ad1 ("ASoC: multi-component - ASoC Multi-Component Support"). It
essentially reverted the modifications done in commit 10cab262 ("ASoC: Change
how suspend and resume obtain the PCM runtime"). The suspend and resume handlers
at the beginning check if dai->runtime is not NULL, but dai->runtime is always
NULL, hence the code never runs. Considering that nobody noticed any problems in
the last 4 years since the code was broken and that the driver does not set
SNDRV_PCM_INFO_RESUME, which means applications are expected to stop and restart
the audio stream during suspend/resume, it is probably safe to assume that his
code is not needed and can be removed.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Currently when the DAPM context bias level is SUSPEND and the target bias level
is OFF dapm_pre_sequence_async() will first transition to PREPARE and
dapm_post_sequence_async() will then transition back from PREPARE to STANDBY and
then to OFF.
This patch makes sure that dapm_pre_sequence_async() only transitions to PREPARE
when either going to ON or away from ON. This avoids the extra unnecessary
transitions.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Since there is no support for compressed audio in Baytrail ADSP firmware
there is no need to leave it on during suspend since ALSA PCM buffers are
too small for leaving ADSP on for playing or recording.
Implement PM callbacks to Baytrail byt-rt5640.c machine driver that call
snd_soc_suspend and snd_soc_resume functions and unset the ignore_suspend
fields in DAI links.
This makes soc-core and ALSA core gracefully suspend and resume active
stream and call sst_byt_pcm_trigger() during suspend-resume cycle.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add suspend and resume support to Baytrail SST DSP. This is implemented by
unloading firmware modules and putting DSP into reset prior suspend and
restarting DSP again in normal boot state after resume.
Context restore for running streams is implemented by scheduling a work from
sst_byt_pcm_trigger() that will allocate a stream with existing parameters
and start it from last known buffer position before suspend.
[Jarkko: Squashed together 5 WIP patches from Liam and 1 from me]
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Suspend/resume requires reloading FW to boot state so we need to also make
sure that the driver matches the FW state at boot.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
We have to save the physical address of extended firmware block in the
beginning of mailbox every time when we boot the DSP firmware since that
mailbox address is re-used after DSP firmware is running. Otherwise DSP
firmware will get bogus extended firmware block address during next DSP
boot.
Currently this is not problem but becomes when DSP runtime rebooting is
implemented. Prepare for that by moving extended firmware address saving
from sst_byt_init() to sst_byt_boot().
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Stream start position will be needed in resume code. Prepare for it by
adding start offset argument to sst_byt_stream_start().
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Baytrail ADSP stream IPC simplifies a little by moving IPC_IA_START_STREAM
construction and sending directly into sst_byt_stream_start() from
sst_byt_stream_operations(). This is because IPC_IA_START_STREAM is only
stream IPC with extra message data so this move saves a few code lines.
Main motivation for this is to prepare for passing stream start position
to sst_byt_stream_start() which will be needed in resume code.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This is for preparing suspend/resume support but can give also more
safeguard against concurrent timestamp structure access between DSP firmware
and host.
Now DSP DMA pointer is sampled in each pcm pointer callback in
sst_byt_pcm_pointer() but that is unneeded since DSP updates the timestamp
period basis and can potentially be racy if sst_byt_pcm_pointer() is called
when DSP is updating the timestamp.
By taking DSP DMA pointer only after period elapsed IPC messages in
byt_notify_pointer() and returning stored hw pointer in
sst_byt_pcm_pointer() there is less risk for concurrent access.
The same stored hw pointer can be also used in suspend/resume code for
restarting the stream at the same position.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Commit commit de9ba98b6d ("ASoC: dapm: Make widget power register settings more
flexible") added generic support for on_val/off_val in the DAPM core. With this
in place there is no need anymore for having a special event callback for
SND_SOC_DAPM_REG() widgets.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
If we find a widget who's stream name matches the name of a DAI widget then
thats the one it should be connected to. Based on the widget id we can say in
which direction the path should be. No need to go back to the DAI and check the
stream names.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
We already know the widgets we want to connect, so use snd_soc_dapm_add_path()
instead of snd_soc_dapm_add_route() in snd_soc_dapm_new_pcm().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
We already know which two widgets should be connected, so use
snd_soc_dapm_add_path() instead of snd_soc_dapm_add_route() in
snd_soc_dapm_connect_dai_link_widgets().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
This reverts commit bd23c5b661.
The patch claims that the patch is necessary to avoid double prefix addition
when calling snd_soc_dapm_add_route() from snd_soc_dapm_connect_dai_link_widgets().
But snd_soc_dapm_add_route() is called with the card's DAPM context, which does
not have a prefix, which means there is no prefix that could be added a second
time.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
For CODEC to CODEC DAI links the paths are created in snd_soc_dapm_new_pcm().
Also for CODEC to CODEC links the widgets are connected cross-over via a DAI
link widget, meaning that the capture widget of one CODEC will be connected to
the playback widget of the other and vice versa. Whereas
snd_soc_dapm_connect_dai_link_widgets() directly connects the playback widget of
the CPU DAI to the playback widget of the CODEC DAI and the capture widget of
the CPU DAI to the capture widget of the CODEC DAI. So not skipping
CODEC<->CODEC links in snd_soc_dapm_connect_dai_link_widgets() will create
incorrect connections between the two CODECs which will cause DAPM to detect
active paths where there are none and unnecessarily power up widgets.
Fixes: b893ea5 ("ASoC: sapm: Automatically connect DAI link widgets in DAPM graph.")
Cc: <stable@vger.kernel.org> (for 3.14+)
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The regular state before we execute SNDRV_PCM_TRIGGER_SUSPEND should be
SNDRV_PCM_TRIGGER_START, not SNDRV_PCM_TRIGGER_STOP. Thus fix it.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Since commit 4b68b4e1c5 (ASoC: Intel: split the pcm and compress to
different files) the compressed ops haven't been built causing link
failures on allyesconfig and making the driver unbuildable. Add the
object to the Makefile to fix that.
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by Vinod Koul <vinod.koul@intel.com>
this is for further updates to driver which supports DPCM :)
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
With DPCM we have media dai used and no seperate headset and speaker dai so
remove the speaker dai
The vibra is no longer supported thru audio, so remove
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
For manging them and adding support for more platforms
Code move only
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
as this will be used in compressed split file in subsequent patch
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
to sst-mfld-platform-pcm.c so that we can split pcm and compress to different
files for upcoming changes to support more platforms
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add some SST API calls to unload and reload firmware modules. This can be used
by PM code to restore state and also allow modular FW to unload and release
memory blocks.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now, all platform is using new style rsnd_dai_platform_info.
Keeping compatibility is no longer needed.
We can cleanup code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
All platform which used old style was
switched to new style.
R-Car sound can remove old style clock support,
use device dependent clock now.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Return statements in functions returning bool should use
true/false instead of 1/0.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The patch moves the private register settings from probe() to reg_default
struct.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This include file is about to disapear. In addition it is
useless for this code. So it is time to remove it.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Mark Brown <broonie@linaro.org>
Commit d191bd8de8 ("ASoC: snd_soc_codec includes snd_soc_component") removed the
last user of the num_dai field. Also remove the field itself.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The global card list was removed in commit b19e6e7b7 ("ASoC: core: Use driver
core probe deferral"). The 'list' field of the snd_soc_card struct has been
unused since then. This patch removes the field.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Commit f0fba2ad1 ("ASoC: multi-component - ASoC Multi-Component Support") added
a per card list that keeps track of all the DAIs that have been registered with
the card, but the list has never been used. This patch removes it again.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Block offset calculations are done in the contiguous allocator so
are not required here.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds support for the Cirrus Logic Low Power Stereo I2C CODEC
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add support for RPDNEN, NSHHPEN, BRIDGOFF, CPWMEN and PNDLSL, and add DT
bindings to access them.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch fixes the following dereference check ordering.
sound/soc/intel/sst-haswell-pcm.c:749 hsw_pcm_probe() warn: variable dereferenced before check 'pdata' (see line 746)
git remote add asoc git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
git remote update asoc
git checkout 0b708c87f6
vim +/pdata +749 sound/soc/intel/sst-haswell-pcm.c
a4b12990 Mark Brown 2014-03-12 740 };
a4b12990 Mark Brown 2014-03-12 741
a4b12990 Mark Brown 2014-03-12 742 static int hsw_pcm_probe(struct snd_soc_platform *platform)
a4b12990 Mark Brown 2014-03-12 743 {
a4b12990 Mark Brown 2014-03-12 744 struct sst_pdata *pdata = dev_get_platdata(platform->dev);
a4b12990 Mark Brown 2014-03-12 745 struct hsw_priv_data *priv_data;
0b708c87 Liam Girdwood 2014-05-02 @746 struct device *dma_dev = pdata->dma_dev;
0b708c87 Liam Girdwood 2014-05-02 747 int i, ret = 0;
a4b12990 Mark Brown 2014-03-12 748
a4b12990 Mark Brown 2014-03-12 @749 if (!pdata)
a4b12990 Mark Brown 2014-03-12 750 return -ENODEV;
a4b12990 Mark Brown 2014-03-12 751
a4b12990 Mark Brown 2014-03-12 752 priv_data = devm_kzalloc(platform->dev, sizeof(*priv_data), GFP_KERNEL);
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
When using auto-muted controls it may happen that the register value will not
change when changing a control from enabled to disabled (since the control might
be physically disabled due to the auto-muting). We have to make sure to still
update the DAPM graph and disconnect the mixer input.
Fixes: commit 5729507 ("ASoC: dapm: Implement mixer input auto-disable")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The function is only used locally, make it static.
Fixes the following warning from sparse:
sound/soc/soc-core.c:1644:22: warning: symbol 'soc_find_matching_codec' was not declared. Should it be static?
Fixes: 3ca041ed ("ASoC: dt: Allow Aux Codecs to be specified using DT")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Other people would clearly understand each member and improve if they want.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
People would simply know what the driver gets the best for the current
sample rate playback.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The sysclk is one the clock sources that could be selected to derive
tx clock. But the route for sysclk is a bit different that it does
not only contain txclk df divider but also have an extra sysclk df.
So this patch mainly adds syclk df configuration support so as to
let the driver be able to get clock from sysclk.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
We should have used _df by following the reference manual at the beginning.
So this patch just renames them.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The clock mux for the Freescale S/PDIF controller has eight clock sources
while most of them are from other moudles and even system clocks that do
not allow a rate-changing operation.
So we here only allow the clk_set_rate() and clk_round_rate() happened to
spdif root clock, the private clock for S/PDIF controller.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds the Realtek ALC5645 codec driver. It is the base
version that because the jack detect function is not implemented to
it, the headphone and AMIC1 are not workable. We will fill up the
further functions later.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
we need _EXT version for SND_SOC_BYTES so that DSPs can use this to pass data
for DSP modules
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Read the stream offset and presentation position from DSP memory rather
than using the old estimated position. This fixes timing issues with
pulseaudio.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
hw_params() can be called multiple times. Make sure we release the DSP
stream that was allocated on previous hw_params() calls before allocating
a new DSP stream.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The Intel IOMMU requires that the ACPI device is used to allocate all
DMA memory buffers. This means we need to pass the DMA device pointer into child
component devices that allocate DMA memory.
We also only set the DMA mask for the ACPI device now instead of for each
component device.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Fix page table creation on Haswell and Broadwell to remove unsafe
virt_to_phys mappings and use more portable SG buffer. Use audio buffer
APIs to allocate DMA buffers.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Make sure we add the allocated blocks to the modules list of blocks.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Make sure we dont alloc blocks twice with requests spanning more
than one block.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that INPUT is required for the CS42L52 and WM8962 we can remove the
IS_ENABLED(INPUT) check in the drivers.
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Since commit 204dec93ea "ASoC: fsl: Allow to select individual common
options", it is possible to enable SND_SOC_FSL_SSI and SND_SOC_FSL_SPDIF
manually, either as loadable modules or built-in. This unfortunately
leads to a link error if one or both of them are built-in, while
the imx-pcm-dma framework is a loadable module:
sound/built-in.o: In function `fsl_ssi_probe':
:(.text+0x51fb8): undefined reference to `imx_pcm_dma_init'
sound/built-in.o: In function `fsl_spdif_probe':
:(.text+0x52e20): undefined reference to `imx_pcm_dma_init'
This changes Kconfig to prevent this case by using 'select' to turn
on the imx-pcm-dma code from both drivers. For consistency, we also
turn on the imx-pcm-fiq code, which is an alternative to the dma
implementation.
Note that imx-pcm-fiq is platform dependent, so we must not enable
that unless we are building a kernel for i.MX. Note also the
"if SND_IMX_SOC != n" syntax as opposed to the normal "if SND_IMX_SOC".
This is needed to avoid turning on the options as 'm' if 'SND_IMX_SOC'
is a module.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The cx20442 codec driver used here requires the TTY layer to
be enabled, or we get a link error:
sound/built-in.o: In function `cx20442_codec_remove':
cx20442.c:398: undefined reference to `tty_hangup'
sound/built-in.o: In function `ams_delta_remove':
ams-delta.c:613: undefined reference to `tty_unregister_ldisc'
sound/built-in.o: In function `ams_delta_cx20442_init':
ams-delta.c:559: undefined reference to `tty_register_ldisc'
This adds the missing dependency in the E3 configuration, there
was already one for the codec.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The WM8978 driver needs I2C to be enabled, so the
SND_SIU_MIGOR option also requires this.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This codec requires I2C to be enabled, so any other option
that selects it should also depend on I2C.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The WM8904 codec driver needs I2C to be enabled, so the
SND_ATMEL_SOC_WM8904 option also requires this.
Found using randconfig build testing.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This will be useful for out-of-tree drivers since in-tree drivers
could select it automatically.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This will be useful for out-of-tree drivers since in-tree drivers
could select it automatically.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The missing dependency can lead to build errors, so
make it explicit in Kconfig.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The UDA1380 driver needs I2C to be enabled, so
SND_SOC_SAMSUNG_H1940_UDA1380 and
SND_SOC_SAMSUNG_RX1950_UDA1380 also
require this.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The codec requires I2C to be enabled, so any other option
that selects it should also depend on I2C.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds device tree support to the Nokia N900 audio driver and
adds documentation for the DT binding.
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds support for specifying auxiliary codecs and
codec configuration via device tree phandles.
This change adds new fields to snd_soc_aux_dev and snd_soc_codec_conf
and adds support for the changes to SoC core methods.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add more error messages making it easier to identify problems.
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Update the driver to get GPIO numbers from the
devm gpiod API instead of requesting hardcoded
GPIO numbers.
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This is a preparation for DT based booting where the McBSP id
is set to -1 for all McBSP instances.
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The symbol "nuc900_ac97_data" is used by the nuc900_pcm driver,
which may be a loadable module, so we should export it.
If one tries to build SND_SOC_NUC900 without SND_SOC_NUC900_AC97,
the kernel fails to link because of the reference to nuc900_ac97_data.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
dma_addr_t may be 64 bit wide, which causes a build failure
when doing a division on it. Here it is safe to cast to an
u32 type, which avoids the problem.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Tested-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This adds a missing dependency for SND_SOC_SMDK_WM8580_PCM to
require REGMAP_I2C to be enabled, avoiding possible build
erorrs.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This codec requires I2C to be enabled, so any other option
that selects it should also depend on I2C.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Building ARM randconfig got into a situation where CONFIG_INPUT
is turned off and SND_SOC_ALL_CODECS is turned on, which failed
for two codecs trying to use the input subsystem. Some other
drivers also select one of these codecs and consequently need an
explicit dependency added.
Appending to the dependency list seems the easiest way out,
since this is not a practical limitation. If anyone really
needs to build these codecs for a kernel with no input support,
a more sophisticated solution can be implemented.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
49101a25ac "ASoC: cq93vc: Remove the set_cache_io() entirely from
ASoC probe" introduced the cq93vc_get_regmap function that has an
obvious build error referring to the 'codec' variable that is not
declared anywhere"
sound/soc/codecs/cq93vc.c: In function 'cq93vc_get_regmap':
sound/soc/codecs/cq93vc.c:157:34: error: 'codec' undeclared (first use in this function)
struct davinci_vc *davinci_vc = codec->dev->platform_data;
^
This changes the code to compile again, presumably in the way it was
intended. Not tested.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch correct rt5640's device ID
Signed-off-by: Bard Liao <bardliao@realtek.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch adds devicetree support for mc13783-codec.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch converts the rx51 ASoC module to use
devm_snd_soc_register_card.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add module alias to support driver autoloading.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Mark the array and the string const by using "static const char * const
foo[]" instead of "static const char* foo[]".
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Added machine driver to instantiate I2S based sound card on Snow
board. It has MAX98095 audio codec on board.
There are some other variants for Snow board which have MAX98090
audio codec. Hence support for MAX98090 is also added to this
driver.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The rxclk rate actually uses sysclk, ipg clock for example, as its
reference clock to calculate it. But the driver currently doesn't
pass a correct clock source. So fix it.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Machine specific trigger callback allows to do final stream start/stop
related operations in a machine driver after setting up the codec, DMA and
DAI.
One example could be clock management for linked streams case where machine
driver can start/stop synchronously the linked streams.
Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
This fixes module unload regressions introduced by commits 98e639fb8a
("ASoC: Track which components have been registered with
snd_soc_register_component()") and b37f1d123c ("ASoC: Let snd_soc_platform
subclass snd_soc_component").
First commit causes component_list to be corrupted when removing codec and
second when removing platform. Reason for both is that components associated
with platform or codec are never removed from the list because for them
registered_as_component field in struct snd_soc_component is always false.
Now list becomes corrupted when snd_soc_unregister_platform() or
snd_soc_unregister_codec() frees the platform or codec structure and where
the associated struct snd_soc_component is embedded.
Fix these by moving component unregistration and cleanup to a new local
function __snd_soc_unregister_component() that takes component as its
argument.
Since component is known for platforms and codecs the
__snd_soc_unregister_component() can be called directly and
snd_soc_unregister_component() takes care to find and unregister only
components that were registered using snd_soc_register_component().
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
In soc_dapm_stream_event() we have the same code twice, once for the codec_dai
and once for the cpu_dai. This patch factors the duplicated code out into a
separate function. This will make it easier to modify the implementation (since
there is only one place that needs to be updated) and also easier to add support
for more than two DAIs per DAI link.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The patch adds the rt5639 support to the OF match table.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This was initially removed in commit 6479f15ad ("ASoC: Remove name_prefix unset
during DAI link init hack"), but was brought back in commit 503ae5e0 ("ASoC:
core: Add helpers for dai link and aux dev init") by accident. This patch
removes it again.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Restore correct parsing of dai-link subnodes with more explicit
implementation for applying the "simple-audio-card,"-prefix to
dai-link property and subnode names.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Replace rtd_get_codec_widget() and rtd_get_cpu_widget() by a simple
dai_get_widget() in preparation for DAI-multicodec support, per Lars
suggestion.
No functional change.
Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Separate DAI link and aux dev initialization in preparation for
DAI multicodec support.
Since aux dev will remain using single codecs but DAI links
will be able to support multiple codecs.
No functional change.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
[fparent@baylibre.com: Adapt to 3.14+]
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The current simple-card driver limits the DT node name to "sound".
Any of other names is forbidden while actually we should allow DT
to pass other node names.
And if this function is being called, the node must already have
the compatible "simple-audio-card" in DTB. So there should be no
need to check the name here.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now ASoC core is getting the intersection of supported formats not only
from CPU and CODEC dai's but also from DMA's. However, there should be
no specific width limitation from SDMA side.
So drop it. Otherwise, we would only support S16_LE format for all i.MX
platforms.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Regmap is able to enable/disable the core clock automatically each time
it's going to access the registers. But for DMA cases during playback or
recording, it's totally beyong control of regmap. So we have to open the
clock manually.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
I suppose there is a possibility that hsw_notification_work() may run after
sst_hsw_stream_free() which can lead to a kernel crash since struct
sst_hsw_stream is freed at that point and
stream = container_of(work, struct sst_hsw_stream, notify_work) is not valid
when hsw_notification_work() is run.
Reported-by: Derek Basehore <dbasehore@chromium.org>
Reported-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
audmux_debugfs_init() is marked as __init, but is called from imx_audmux_probe()
which is not marked as __init. This creates a section mismatch and a potential
runtime crash (if imx_audmux_probe() is called after the .init section was
dropped). This patch removes the __init annotation from audmux_debugfs_init(),
which fixes the following warning:
WARNING: sound/soc/built-in.o(.text+0x86960): Section mismatch in reference
from the function imx_audmux_probe() to the function
.init.text:audmux_debugfs_init()
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The commit e41975ed (ASoC: core: Fix the DAI name getting) added a break
within the "if (id < 0 || id >= pos->num_dai)" while the original design
of the search didn't break the loop if that condition contented but only
mark the ret error and let it go on to search the next component.
In a case like dmaengine which's not a dai but as a component sharing an
identical name with a dai, both the id and pos->num_dai here could be 0.
If we break the search, we may never find the dai we want as it might be
placed behind its dmaengine in the component list.
So this patch fixes the issue above by following the original design to
let the search carry on.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The AK4104 has only one power supply, called VDD. Enable it as long as
the codec is in use.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The properties like format, bitclock-master, frame-master,
bitclock-inversion, and frame-inversion should be common to the dais
connected with a dai-link. For bitclock-master and frame-master
properties to be unambiguous they need to indicate the mastering dai
node with a phandle.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
Adds struct device_node **bitclkmaster and struct device_node **framemaster
function parameters. With the new syntax bitclock-master and frame-master
properties can explicitly indicate the dai-link bit-clock and frame masters
with a phandle. This patch also makes the minimal changes to simple-card
for it to work with the updated snd_soc_of_parse_daifmt(). Simple-card appears
to be the only user of snd_soc_of_parse_daifmt() for now.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
In exiting kernel, if DAIFMT flags are set in dai_link and I2S is
set to run in master mode, the I2S clocks are not getting configured
resulting in no output.
Existing code clears the current I2S clock settings during i2s_startup
and requires that the clocks are reconfigured. It then assumes that
sound-card driver would call snd_soc_dai_{set_sysclk/set_fmt} to
configure the root clock.
1. Since I2S clock settings remain fixed for a board, it would be better
to set the clocks once during sound-card probe.
2. Also if the DAIFMT flags are set in dai_link, snd_soc_dai_set_fmt is
called during DAI probe.
If both these conditions are true, then I2S clock remains unconfigured
during audio playback. Fix this by removing the code to clear
rclk_srcrate in i2s_startup. Instead, reset this during DAI probe.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Allow the jz4740 audio drivers to be build when CONFIG_COMPILE_TEST is selected.
This should improve the build test coverage. There is one small piece of
platform dependent code in the jz4740-i2s driver. It uses the DMA request type
constants which are defined in a platform specific header. We can solve this by
moving them from the platform specific header to the I2S driver.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The new GPIO descriptor API is now the preferred way for handling GPIOs. It also
allows us to separate the platform depended code from the platform independent
code (Which will make it possible to increase build test coverage of the
platform independent code).
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
rsnd_soc_dai_trigger() will be called
after rsnd_dai_pointer_update() function
which is using rsnd_lock().
Thus, it should be called from outside of rsnd_lock().
Kernel will be hangup without this patch.
Special thanks to Kataoka-san
Reported-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
There is a race between sst_byt_stream_free() and sst_byt_get_stream()
if sst_byt_get_stream() called from sst_byt_irq_thread() context is
accessing the byt->stream_list while a stream is deleted from the list.
A stream is added to byt->stream_list in sst_byt_stream_new() and deleted in
sst_byt_stream_free(). sst_byt_get_stream() is always protected by
sst->spinlock, but the stream addition and deletion are not protected.
The patch adds spinlock to both stream addition and deletion.
[Jarkko: Same fix added to sst-haswell-ipc.c too]
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Create an explicit of_match_table entry for MAX98095 codec. Also
add a binding Documentation for this compatible string.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
devm_snd_soc_register_platform() is used in drivers which can be build as
modules, so it needs to be exported to avoid linkers errors like:
ERROR: "devm_snd_soc_register_platform" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "devm_snd_soc_register_platform" [sound/soc/davinci/snd-soc-davinci.ko] undefined!
Fixes: 8931bf620 ("ASoC: Add resource managed snd_soc_register_platform()")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Makes the code a bit shorter and will also allow us to remove the drivers
remove() callback eventually.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Rather than calling snd_soc_set_dai_fmt(), just set the dai_fmt field in the
dai_link struct. Both have the same effect, but the later is a bit shorter and
also allows us to remove the now unused init callback.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The routes for this sound card are fully specified, so set the fully_routed
flag. This allows us to remove the manual snd_soc_dapm_nc_pin() calls.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Commit 0406a40a0 ("ASoC: jz4740: Use the generic dmaengine PCM driver")
jz4740-pcm.c file, but neglected to remove the Makefile entries.
Fixes: 0406a40a0 ("ASoC: jz4740: Use the generic dmaengine PCM driver")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
There were occasional ADSP crash during reboot testing:
[ 11.883364] BUG: unable to handle kernel paging request at ffffc90121700000
[ 11.883380] IP: [<ffffffffc024d8bc>] sst_module_insert_fixed_block+0x24f/0x26d [snd_soc_sst_dsp]
[ 11.883397] PGD 7800b067 PUD 0
[ 11.883405] Oops: 0002 [#1] SMP
[ 11.886418] gsmi: Log Shutdown Reason 0x03
The virtual address, ffffc90121700000, was out of range. The virtual
address is calculated by adding LPE base address with an offset:
sst_memcpy32(dsp->addr.lpe + data->offset, data->data, data->size);
The offset is calculated in sst_byt_parse_module, by subtraction of
two virtual addresses dsp->addr.fw_ext and dsp->addr.lpe:
block_data.offset = block->ram_offset + (dsp->addr.fw_ext - dsp->addr.lpe);
These virtual addresses are assigned by kernel from ioremap:
sst->addr.lpe = ioremap(pdata->lpe_base, pdata->lpe_size);
sst->addr.fw_ext = ioremap(pdata->fw_base, pdata->fw_size);
In current driver code, offset is defined as unsigned int32:
struct sst_module_data {
...
u32 offset; /* offset in FW file */
};
Most of the time kernel assigned virtual addresses with addr.fw_ext
greater than addr.lpe. But sometimes it was the other way round.
Fix the problem by declaring offset as signed int32_t.
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
After moving the IO layer inside ASoC to the component level we can now easily
move the standard control helpers also to the component level. This allows to
reuse the same standard helper control implementations for other components.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The ASoC framework is in the process of migrating all IO operations to regmap.
regmap has its own more sophisticated tracing infrastructure for IO operations,
which means that the ASoC level IO tracing becomes redundant, hence this patch
removes them. There are still a handful of ASoC drivers left that do not use
regmap yet, but hopefully the removal of the ASoC IO tracing will be an
additional incentive to switch to regmap.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
There is no unlocked version of soc_widget_update_bits_locked() and there is no
plan to introduce it in the near future, so drop the _locked suffix.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
There are no users of snd_soc_update_bits_locked() left and it is identical to
snd_soc_update_bits(). So it can be removed.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
We currently have two very similar IO abstractions in ASoC, one for CODECs, the
other for platforms. Moving this to the component level will allow us to unify
those two. It will also enable us to move the standard kcontrol helpers as well
as DAPM support to the component level.
The new component level abstraction layer is primarily build around regmap.
There is a per component pointer for the regmap instance for the underlying
device. There are four new function snd_soc_component_read(),
snd_soc_component_write(), snd_soc_component_update_bits() and
snd_soc_component_update_bits_async(). They have the same signature as their
regmap counter-part and will internally forward the call one-to-one to regmap.
If the component it not using regmap it will fallback to using the custom IO
callbacks. This is done to be able to support drivers that haven't been
converted to regmap yet, but it is expected that this will eventually be removed
in the future once all component drivers have been converted to regmap.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
We have been using rt5640.c codec driver with RT5642 codec chip before commit
022d21f004 ("ASoC: rt5640: add rt5639 support"). That commits starts using
device ID reading in reset register for adding device specific controls and
routes runtime.
Now since device ID appears to be different between RT5640 and RT5642 the
driver doesn't add those controls and routes that are valid also on RT5642.
Fix this by adding a device ID found by debugging and minimal code for
supporting RT5642.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Remove the cleanup code related to the platform from the DAI drivers at the
same time to avoid breakage.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Fix the error added by commit:
ASoC: omap-hdmi: Bind the platform driver to the dai driver when loading
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Commit 9e1fda4ae158 ("ASoC: dapm: Implement mixer input auto-disable")
is trying to free the widget it allocated by snd_soc_dapm_new_control()
call in dapm_kcontrol_data_alloc() by adding kfree(data->widget) to
dapm_kcontrol_free().
This is causing a widget double free with auto-disabled DAPM kcontrols
in sound card unregistration because widgets are already freed before
dapm_kcontrol_free() is called.
Reason for that is all widgets are added into dapm->card->widgets list
in snd_soc_dapm_new_control() and freed in dapm_free_widgets() during
execution of snd_soc_dapm_free().
Now snd_soc_dapm_free() calls for different DAPM contexts happens before
snd_card_free() call from where the call chain to dapm_kcontrol_free()
begins:
soc_cleanup_card_resources()
soc_remove_dai_links()
soc_remove_link_dais()
snd_soc_dapm_free(&cpu_dai->dapm)
soc_remove_link_components()
soc_remove_platform()
snd_soc_dapm_free(&platform->dapm)
soc_remove_codec()
snd_soc_dapm_free(&codec->dapm)
snd_soc_dapm_free(&card->dapm)
snd_card_free()
snd_card_do_free()
snd_device_free_all()
snd_device_free()
snd_ctl_dev_free()
snd_ctl_remove()
snd_ctl_free_one()
dapm_kcontrol_free()
This wasn't making harm with ordinary DAPM kcontrols since data->widget is NULL for
them.
Fixes: 9e1fda4ae158 (ASoC: dapm: Implement mixer input auto-disable)
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
The CODEC's write callback can return a negative error code, make sure to pass
that on correctly.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
In preparation for componentisation of the kcontrol helpers use
snd_soc_kcontrol_codec() instead of snd_kcontrol_chip().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Version 4 of McASP is using omap-pcm as platform driver and the omap-pcm
platform need to be registered using the cpu dai's device.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The omap-pcm no longer need to be a platform driver since all cpu_dai will
bind the platform to it's own device which we can use.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same name/node for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that the platform driver is registered with the cpu_dai's device we
can use the same node for it instead of the hardwired name.
We can also remove the cpu_dai_name and platform_name from the dai_link
struct since we only support DT boot on OMAP4/5
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Use the same device for the platform driver when registering as the dai
driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Use the same device for the platform driver when registering as the dai
driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Assign the dai dma data at dai driver probe time, not in startup.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
With the new calls it is going to be possible to bind the platform driver
to a dai device which makes it easier for us in a long run to handle DT
boots, and opens the possibility to move machine driver to generic simple
card.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Use the same device for the platform driver when registering as the dai
driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Assign the dai dma data at dai driver probe time, not in startup.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Use the same device for the platform driver when registering as the dai
driver. This will enable us to clean up some DT booted cases.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Assign the dai dma data at dai driver probe time, not in startup.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Simplify error handling and remove repetitive (and rarely executed) code
for unregistration by providing a devm_snd_soc_register_platform()
platform.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
PTR_RET is deprecated. PTR_ERR_OR_ZERO should be used instead. However,
we already know that IS_ERR is true, and thus PTR_ERR_OR_ZERO would
never yield zero, so we can use PTR_ERR here.
Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Fix an incorrect sizeof() usage in sst_hsw_stream_get_volume(). sst_dsp_read()
is called to read into a variable of type u32, but is passed sizeof(u32 *) for
argument 'size_t bytes'. Detected by Coverity: CID 1195260.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@linaro.org>
The intent was to say "sizeof(*pos)" and not "sizeof(pos)".
The sizeof(*pos) is 8 bytes so the bug won't show up on 64 bit systems.
The sizeof(*dx) is 172 bytes so that will be a bugfix.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The REVID mask was changed by commit a1253ef6d3
"ASoC: cs42l51: split i2c from codec driver". Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch change reg's type from unsigned short to int.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Current code missed a gpio_free() call in cs42l73_i2c_remove().
Convert to use devm_gpio_request_one() to fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Current code missed a gpio_free() call in cs42l52_i2c_remove().
Convert to use devm_gpio_request_one() to fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
It should use STC_SYSCLK_DIV_OFFSET. Thus fix it.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch removes the i2c bus code from the codec driver and creates seperate i2c driver.
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Commit 0cd257bf9b, "ASoC: alc5623:
Convert to direct regmap API usage" broke probing of the codec,
because of wrong endinness of the ID and codec version read from the
device. Fix this by removing the existing flipping of the endiannes,
and extracting the codec type byte from the word from the regmap.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mark Brown <broonie@linaro.org>
Currently the second tlv320aic3x instance fails to
be probed from DT if the reset pin is shared with
the first one.
This patch fixes it by moving the list add of the
reset pin into the i2c_probe method.
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Remove a self assignment in sst_mem_block_alloc_scratch(). When calculating
buffer sizes there is no need for statements without effect. Detected by
Coverity: CID 1195249.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@linaro.org>
Fix an incorrect sizeof() usage in sst_hsw_stream_get_volume(). sst_dsp_read()
is called to read into a variable of type u32, but is passed sizeof(u32 *) for
argument 'size_t bytes'. Detected by Coverity: CID 1195260.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Mark Brown <broonie@linaro.org>
Hopefully fixing a build failure reported by Stephen Rothwell - though
quite why the other OF headers don't include this as well I'm not sure.
Signed-off-by: Mark Brown <broonie@linaro.org>
The macro's name is SOC_ENUM, not SOC_VALUE.
Fixes: e13dd8ce ("ASoC: wm8997: Replace usage deprecated MUX/ENUM macros")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
By doing this, the driver can drop around 50 lines and become neater.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Use the precise definition of 'ret', which will be used for
the error check.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Patch ASoC: fsl_sai: Fix buggy configurations in trigger() doesn't entirely
fix the condition: FRDE of the current substream direction is being cleared
while the code is still using the non-updated one.
Thus this patch fixes this issue by checking the opposite one's FRDE alone
since the current one's is absolutely disabled.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>