This is called from snd_ctl_elem_write() with user supplied data so we
need to add some bounds checking.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
On a mx28 board, running "aplay -l" and "arecord -l" results in the following:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 0: Playback sgtl5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: mxssgtl5000 [mxs_sgtl5000], device 1: Capture sgtl5000-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 0: Playback sgtl5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: mxssgtl5000 [mxs_sgtl5000], device 1: Capture sgtl5000-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
,which is not correct because we got a capture device listed in aplay and a
playback device listed in arecord.
On mx28 there are two serial audio interface ports (SAIF0 and SAIF1) and each
one of them are unidirectional.
Allow to specify a dai link as 'playback_only' or 'capture_only', which suits
well for this case.
After this change we can correctly report the capabilities as follows:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 0: HiFi Playback sgtl5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: mxssgtl5000 [mxs_sgtl5000], device 1: HiFi Capture sgtl5000-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
Also tested playback and capture on the mx28evk board.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add 'playback_only' and 'capture_only' fields that can be used for specifying
that a dai_link has a unidirectional capability.
The motivation for this is for the cases of systems, such as Freescale MX28,
that has two unidirectional DAIs.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The ssm2602 uses regmap for caching not soc-cache, so we need to use
regcache_sync() instead of snd_soc_cache_sync().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The sysfs_registered field was added to the snd_soc_codec struct in commit
f0fba2ad ("ASoC: multi-component - ASoC Multi-Component Support"), but has never
been used.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The DAPM context struct has its own field where it stores the pointer to the
DAPM debugfs entry. The debugfs_dapm field in the snd_soc_platform and
snd_soc_codec structs are completely unused and can be removed.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The control_type field was used by the core to track which raw IO methods to
use, but when switching to regmap this was no longer necessary and so the last
user of the field was removed in commit be3ea3b9 ("ASoC: Use new register map
API for ASoC generic physical I/O"). The field is now completely unused and can
be removed.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
There is a blank space missing between ':=' and 'imx-spdif.o', thus add it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
We need to make sure that the control's cached value is initialized to the same
value as the control's widget->on_val. Otherwise updates might be lost.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
A few more updates for v3.12, mostly small cleanups plus the addition of
the DT bindings for kirkwood and the new i.MX S/PDIF driver.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
iQIcBAABAgAGBQJSIG6zAAoJELSic+t+oim9BLQP/RKhHDnBOPMPjElqnk1K81b3
XWEWMAYibIpMFtq/X/Qp/qJmNzlGeLgpqJZDxLTW7Anc5I+OHuiK3TjrgnXD7LQk
wV9vmPcEbYNHktKWo1OJCshZ7puyx96s+17qyhPAlb1MwxTcwfJ1jtgf3lelKF3Q
NRGQLrTCLvDjLwqh/+10vC5L0il5ZUKRBo0dxam2HKJwdkNvKxfI867LO0JKigVz
GsLWJRr3vDin5P53Co2UKkOJwLFPKXCRdvE/MdY1OFhDMwoDtqRkTJwP4AcACPlE
vqzoT8Bh0hiaEhbe4LcvSKJcSYQQl9BpbBGnz6GAGtWuejE/YvnAEHS6O0h6Xloe
HAvpRy/ZKbcoVAPJDvUNYc/tmN0UFp5kLMrTOi/4JlXyp1079v0yEcqaJaNLAxt8
NAivLfWYbX+oYXpwK6oFifn61uqNVdnM6+PeK51MbArMUl0WhJWl6uXlj6HhAj9D
56S0vhNc8fKXBeSgOXlsZ1bsOXeEcKB8lVJv7o9SZLpia3uvnd0WYqoFBbyXKTr0
W1BmUh+kBy189E4dRzmJGrOSafru8WcDskap4arzIMQ63cJpvqcDPuu4z00eCrrI
2dvPvUrc091ye5Mg+3spb+0GrHebPpM4f65lADavePcT6qnI2JwVMNXkOBjWIi2J
wFmQuW8Xs6hO3zGf7wOY
=/7PB
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.12
A few more updates for v3.12, mostly small cleanups plus the addition of
the DT bindings for kirkwood and the new i.MX S/PDIF driver.
SND_SOC_FSL_UTILS is only used by PowerPC machines, so let's drop it in the
i.mx case.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The legacy S3C-DMA API required every period of a cyclic buffer to be
queued separately. After conversion of Samsung ASoC to Samsung DMA
wrappers somebody made an assumption that the same is needed for DMA
engine API, which is not true.
In effect, Samsung ASoC DMA code was queuing the whole cyclic buffer
multiple times with a shift of one period per iteration, leading to:
a) severe memory waste - up to 13x times more DMA transfer descriptors
are allocated than needed,
b) possible memory corruption, because further cyclic buffers were out
of the original buffers, due to the offset.
This patch fixes this problem by making the legacy S3C-DMA API use the
same semantics as DMA engine (the whole cyclic buffer is enqueued at
once) and modifying users of Samsung DMA wrappers in cyclic mode to
behave appropriately.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Driver core clears the driver data to NULL after device_release or on probe
failure, so just remove it from here.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Driver core clears the driver data to NULL after device_release or on probe
failure, so just remove it from here.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch implements a device-tree-only machine driver for Freescale
i.MX series Soc. It works with spdif_transmitter/spdif_receiver and
fsl_spdif.c drivers.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This patch permits the generation of the Kirkwood audio driver which
may be used in the Dove boards.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
snd_soc_dapm_new_widgets() works on the ASoC card as a whole not on a specific
DAPM context. The DAPM context that is passed as the parameter is only used to
look up the pointer to the card. This patch updates the signature of
snd_soc_dapm_new_widgets() to take the card directly.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Call snd_soc_dapm_new_widgets() before the auto non-connected pins have been
marked as not connected will power the system under the assumption that those
pins are connected. Once the pins have been marked as disconnected the system
there will be an additional power run. This can cause unnecessary power
transitions. Calling snd_soc_dapm_new_widgets() only after the pins have been
marked as non-connected avoids this.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Each time snd_soc_dapm_new_widgets() is called it will instantiate all the
widgets and routes that have been added so far and then power them. Doing this
multiple times before the card is fully initialized and all widgets have been
added can cause unnecessary and even invalid power state transitions which can
result in extra register writes and and also might cause clicks and pops.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
snd_soc_jack_add_pins() does not create any new DAPM widgets, so there is no
need to call snd_soc_dapm_new_widgets().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The core will call snd_soc_dapm_new_widgets() once all components of the card
have been initialized, so there is no need to do this manually in the driver.
Calling it earlier also might result in a partially instantiated system being
powered up which cause undesired side effects.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Let the core take care of instantiating the controls and DAPM widgets and
routes, this makes the code a bit shorter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The current calls to dapm_mark_dirty() in snd_soc_dapm_add_path() are on a path
that is only reached if the sink widget is either a mixer or a mux. Move the
calls further up so they are called for all widget types.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Let the core take care of instantiating the DAPM widgets and routes, this makes
the code a bit shorter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
CONFIG_SND_HDA_I915 doesn't have to be user-selectable as this is almost
mandatory when i915 driver is available. Let's enable it always when
CONFIG_DRM_I915 is set, so that user won't be bothered by useless
questions.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds two fields to unsolicited response, according to spec HDA040-A:
- Device Entry (bit 20:15)
- Inactive (bit 2)
and show the info in debug message.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch is only to allow codec proc file to expose devices list/select info
for Haswell codec pins.
Since Haswell Gfx driver cannot support DP1.2 MST now, so all pins' device list
is empty, meaning no pin is multi-streaming capaple.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If a display codec supports multi-stream transport on the pins, the pin's
device list length and device entries will be exposed to codec proc file.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds flags and routines to get device list & selection info on
a pin.
To support Display Port 1.2 multi-stream transport (MST) over single DP port,
a pin can support multiple devices. Please refer to HD-A spec Document Change
Notificaton HDA040-A.
A display audio codec can set flag "dp_mst" in its patch, indicating its pins
can support MST. But at runtime, a pin may not be multi-streaming capable and
report the device list is empty, depending on Gfx driver configuration.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Driver core clears the driver data to NULL after device_release or on probe
failure, so just remove it from here.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>