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>
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>
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>
The TI STA350 is an integrated 2.1-channel power amplifier that is
controllable over I2C. This patch adds an ASoC driver for it.
At a glance, this chip is very similar to the STA320 for which a driver
already exists. In details, however, the register maps contain subtle
differences which made a whole new driver easier to write and maintain.
[daniel@zonque.org: cleanups, DT property rework, rebased on asoc-next]
Signed-off-by: Sven Brandau <brandau@gmx.de>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Change reg's type from unsigned short to unsigned int. So that we can use
32 bits reg value in snd_soc_update_bits.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
There is an increasing amount of code that is very similar between platforms,
CODECS and other components. Making platforms a component will allow us to
share this code. For now the patch just adds component and component_driver
fields to the platform and platform_driver structs and registers the platform as
a component. Followup patches will be used to consolidate code between the
different types of components.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
snd_soc_unregister_component() takes the parent device of the component as a
parameter and then looks up the component based on this. This is a problem if
multiple components are registered for the same parent device. Currently drivers
do not do this, but some drivers register a CPU DAI component and a platform for
the same parent device. This will become a problem once platforms are also made
components. To make sure that snd_soc_unregister_component() will not
accidentally unregister the platform in such a case only consider components
that were registered with snd_soc_register_component(). This is only meant as
short term stopgap solution to be able to continue componentisation. Long term
we'll need something different.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
There are no ASoC drivers left that use them and new drivers are supposed to use
regmap for this.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
soc-core.c is getting quite crowded. Move all IO related functions that are
still in soc-core.c to soc-io.c
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
SOC_SINGLE_XR_SX controls currently only work with CODECs that set the
'reg_word_size' field in their snd_soc_codec_driver struct. Going forward
support for ASoC level IO will eventually be removed and all drivers will be
converted to regmap. Preparing for the transition this patch adds support for
CODECs using regmap for IO to the SOC_SINGLE_XR_SX control. We already have the
val_bytes field in the CODEC struct which holds the number of bytes per word,
but it is only initialized when regmap is used. Also initialize it for drivers
still using legacy IO and update the SOC_SINGLE_XR_SX handlers to use it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
For platform controls snd_kcontrol_chip() currently returns a pointer to the
platform that registered the control. With the upcoming consolidation of
platform and CODEC controls this will change. Prepare for this by introducing
the snd_soc_kcontrol_platform() helper function that will hide the
implementation details of how the platform for a control can be obtained. This
will allow us to change this easily in the future.
The patch also updates all platforms to use this new helper function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
For CODEC controls snd_kcontrol_chip() currently returns a pointer to the
CODEC that registered the control. With the upcoming consolidation of
platform and CODEC controls this will change. Prepare for this by introducing
the snd_soc_kcontrol_codec() helper function that will hide the implementation
details of how the CODEC for a control can be obtained. This will allow us to
change this easily in the future.
The patch also updates all CODEC drivers to use the new helper function.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Some thing Likes:
reproduce: make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
>> sound/soc/codecs/wm8997.c:1084:15: sparse: symbol \
'wm8997_get_regmap' was not declared. Should it be static?
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add the default regmap I/O setting to snd_soc_register_codec() while
the CODEC is initialising, which will be called by CODEC driver device
probe(), and then we can make XXX_set_cache_io() go away entirely from each
CODEC ASoC probe.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Here is a bunch of small fixes that have been collected since the
previous pull request. In addition to various misc fixes, the
following are included:
- HD-audio quirks for Dell, HP, Chromebook, and ALC28x codecs
- HD-audio AMD HDMI regression fix
- Continued PM support/fixes for ice1712 driver
- Multiplatform fixes for ASoC samsung drivers
- Addition of device id tables to a few ASoC drivers
- Bit clock polarity config and error flag fixes in ASoC fsl_sai
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJTRra6AAoJEGwxgFQ9KSmkovkP/RCDZfQO733wAJGAtbUeRrrp
OaSeM2FJTajttUehTYK3uyCbrM7gOTJasf9icQSGOv+17x0O/EIVc+iBEO6cJc8I
sbEQLk3Uq8cO1+geaC9MX6tbdaXu1GtSVL61Eqo2Gm2pDHb95C+6vAEU4tE+CNaj
HcznS6uyZ/Sd7RMpw58jstcVt6OOZRw1fabEN6a9RmmbcRjaZ5BT4xUScrRnr3t7
hR9e3mMCGwDmufrso6yhd2uYVqjcVGO8NTdj6fbt4aPRkBS8HxYC0lhvTz6CO1oN
VZ75poc6DQgtdVvpi95sBI3DDnkFrV2FwjdZtSQdm4ykF56h51eDDHF9EWbYdomw
7fldHc3iRzg+0OGX2Askl3b4KfePDncWRt0/9XklftBHktyUvVpwLKlZ3nqq6VA5
U2FfKZPuREQUhiKp8s1SXlnXhQ/hQVUMEAwOD1MhcZnIcvKQSCVvYGwdy8rKdt/A
GaZofubIP9FYJ0Cu99A5IDoR85h0lNzYuxa2c0lOi+u1w3egHSS7KRsE07XxKsVM
HgWUZZ7NAsROletcc6E3Zkmq/kwccCVfWyhRPLLoLEEPuaLwz/XoE+ZhtB0XhKZm
PiEiMv2E3OaBMus5sHeXfxjkbnmysvK/3X8fuxkZD5nP9uzex8qPSDlcjC8pWmvW
H6x3WSKbn+5Pm0HtSAun
=7zfG
-----END PGP SIGNATURE-----
Merge tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here is a bunch of small fixes that have been collected since the
previous pull request. In addition to various misc fixes, the
following are included:
- HD-audio quirks for Dell, HP, Chromebook, and ALC28x codecs
- HD-audio AMD HDMI regression fix
- Continued PM support/fixes for ice1712 driver
- Multiplatform fixes for ASoC samsung drivers
- Addition of device id tables to a few ASoC drivers
- Bit clock polarity config and error flag fixes in ASoC fsl_sai"
* tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb()
ALSA: hda - Make full_reset boolean
ALSA: hda - add headset mic detect quirk for a Dell laptop
sound: dmasound: use module_platform_driver_probe()
ALSA: au1x00: use module_platform_driver()
ALSA: hda - Use runtime helper to check active state.
ALSA: ice1712: Fix boundary checks in PCM pointer ops
ASoC: davinci-mcasp: Fix bit clock polarity settings
ASoC: samsung: Fix build on multiplatform
ASoC: fsl_sai: Fix Bit Clock Polarity configurations
ALSA: hda - Do not assign streams in reverse order
ALSA: hda/realtek - Add eapd shutup to ALC283
ALSA: hda/realtek - Change model name alias for ChromeOS
ASoC: da732x: Print correct major id
ALSA: hda/realtek - Improve HP depop when system change power state on Chromebook
ASoC: cs42l52: Fix mask for REVID
sound/oss: Remove uncompilable DBG macro use
ALSA: ice1712: Save/restore routing and rate registers
ALSA: ice1712: restore AK4xxx volumes on resume
ASoC: alc56(23|32): fix undefined return value of probing code
...
BugLink: http://bugs.launchpad.net/bugs/1305133
Malfunctioning or slow devices can cause a flood of dmesg SPAM.
I've ignored checkpatch.pl complaints about the use of printk_ratelimit() in favour
of prior art in sound/usb/pcm.c.
WARNING: Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit
+ if (printk_ratelimit() &&
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Eldad Zack <eldad@fogrefinery.com>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A smattering of device specific fixes, nothing stands out here except
for the multiplatform fixes for Samsung and the device IDs being added
by Stephen Warren - there's no real code changes from those and they
give better robustness to the enumeration with DT.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJTRVqxAAoJELSic+t+oim9Sy8P/06CSOkwoY0ofxkRiusqFUCY
S5lKwRCQrVkMKL7Begjv7L5Dr7xDdjGGl8P36BqysCUUm/hiRHIOwcUtEYdWwmon
XgUt+vdjz9qVoVilqfPjF7PDGqqDwspOJljaC/9dIylx6mXYKcpdkFzloiTlBC+x
hZb34YEc+BdYB0BHH7jYvkUV3U4UOeJbOYbmXY940y6aFngnP9dIRwEDlyw2QFbO
Rpcc+7qmMezALJcKAHBYwv45/08EMZ3OwaZ+4LhUXeeBdP54ZQMJNZiSii4gCAcr
hRe6ox9ixDxLQ4x09Gv8XfTRL5BozrjtiK+9hxMi1tAtfej5W0YJ9bccmka1yXWw
/z3LmqARGJPUoAfhVA/ip5l3rWJT1QJzL008yBgsPNZIbm7Fo3meCYwvrI9igOW9
qpovx4YZoo2edIxMHZAySBnS0WfOJYfwPmZ1wWbS1e+JBu/rIOk8AMQRzNphQ2W+
YJvIIjajX52vvDoXynaZCAfYfivBYzcuoZllgjyhxNWRj+HC8Wer1Prmv9g5bgHU
mWW8g2HnkbYh+TP0oFUANLQrGXRbaVok3kQe2oSoUbFkqovhllI7d9za4+xUjEXo
qZkFaTcn/VjH1Gi2uzZiCWQpy41bLXda0JvRUF9UhWPeKG8OEMN5Lc/aistIiCuh
Z0crLkK3DmM7Ih0dxm3l
=Z3Yl
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.15
A smattering of device specific fixes, nothing stands out here except
for the multiplatform fixes for Samsung and the device IDs being added
by Stephen Warren - there's no real code changes from those and they
give better robustness to the enumeration with DT.
The full_reset argument to azx_init_chip() carries boolean rather than
numerical information, so update the type to reflect that.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0283,
SID: 0x10280667), the headset mic can't be detected, after apply this
patch, the headset mic can work well.
BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Eliminate boilerplate code by using module_platform_driver_probe().
Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Eliminate boilerplate code by using module_platform_driver().
Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
From azx_interrupt, use the helper to check if the device is active
instead of checking the state. This will do the right thing if
runtime pm is disabled in addition to if the device is suspended.
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
PCM pointer callbacks in ice1712 driver check the buffer size boundary
wrongly between bytes and frames. This leads to PCM core warnings
like:
snd_pcm_update_hw_ptr0: 105 callbacks suppressed
ALSA pcm_lib.c:352 BUG: pcmC3D0c:0, pos = 5461, buffer size = 5461, period size = 2730
This patch fixes these checks to be placed after the proper unit
conversions.
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
IB_NF, NB_IF and IB_IF configured the bc polarity incorrectly. The receive
polarity was set to the same edge as the TX in these cases.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
PCM and S/PDIF drivers referenced mach headers for a trivial
data structure. This caused build errors on multiplatform builds
as machine headers are not accessible from driver files. Move the data
structure definition to the driver header and remove the dependency.
While at it rename the structure to avoid multiple definition errors
as the same structure is also used by the platform code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
The BCP bit in TCR4/RCR4 register rules as followings:
0 Bit clock is active high with drive outputs on rising edge
and sample inputs on falling edge.
1 Bit clock is active low with drive outputs on falling edge
and sample inputs on rising edge.
For all formats currently supported in the fsl_sai driver, they're exactly
sending data on the falling edge and sampling on the rising edge.
However, the driver clears this BCP bit for all of them which results click
noise when working with SGTL5000 and big noise with WM8962.
Thus this patch corrects the BCP settings for all the formats here to fix
the nosie issue.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Currently stream numbers are assigned in reverse order.
Unfortunately commit 7546abfb8e ("ALSA: hda - Increment
default stream numbers for AMD HDMI controllers") assumed this was not
the case (specifically, it had the "old cards had single device only"
=> "extra unused stream numbers do not matter" assumption), causing
non-working audio regressions for AMD Radeon HDMI users.
Change the stream numbers to be assigned in forward order.
The benefit is that regular audio playback will still work even if the
assumed stream count is too high, downside is that a too high stream
count may remain hidden.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77002
Reported-by: Christian Güdel <cg@dmesg.ch>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Christian Güdel <cg@dmesg.ch> # 3.14
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add eapd shutup function to alc283_shutup.
It could avoid pop noise from speaker.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Chrome OS was use model name of alc283-dac-wcaps for loading model as default.
Change the model name to same as model name of Chrome OS for future support.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If the renamed symbol is defined lib/iomap.c implements ioport_map and
ioport_unmap and currently (nearly) all platforms define the port
accessor functions outb/inb and friend unconditionally. So
HAS_IOPORT_MAP is the better name for this.
Consequently NO_IOPORT is renamed to NO_IOPORT_MAP.
The motivation for this change is to reintroduce a symbol HAS_IOPORT
that signals if outb/int et al are available. I will address that at
least one merge window later though to keep surprises to a minimum and
catch new introductions of (HAS|NO)_IOPORT.
The changes in this commit were done using:
$ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/'
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
DA732X_ID_MAJOR_MASK is 0xF0, so the major id is
(reg & DA732X_ID_MAJOR_MASK) >> 4.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
It is better to change Mic2-Vref to manual mode.
Manual control Mic2-Vref will solve pop noise issue.
It will improve pop noise for power on, power off, S3 and resume.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
BIT[0:2] of register 01h is REVID, so the mask for REVID should be 0x7.
Also updates the code to use CS42L52_CHIP_REV_MASK.
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>