It depends on L3 support from 2.4 kernel (CONFIG_L3) that never got
merged into mainline. Since there's no way to use it on any of
supported machines (iPaq h3100 or h3600), better drop it for now.
It can be reimplemented later using ASoC infrastructure (there's
already a driver for uda1341 codec in mainline, so only CPU and machine
parts need to be written).
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
As the PXA27x series allow 2 gpios to reset the ac97 bus,
allow through platform data configuration the definition of
the correct gpio which will reset the AC97 bus.
This comes from a silicon defect on the PXA27x series, where
the gpio must be manually controlled in warm reset cases.
Signed-off-by: Robert Jarzmik <rjarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Merge Eric Maio's patch to merge snd_soc_dai_ops out of line. Fixed
merge issues and updated drivers, plus an issue with the ops for the two
s3c2443 AC97 DAIs having been merged.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Use define instead of enum for ioctl definitions since strace can't
parse ioctls defined via enum properly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use the standard linked list for snd_monitor_file management.
Also, move the list deletion of shutdown_list element into
snd_disconnect_release() (for simplification).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added snd_ctl_add_slave_uncached() function to add a slave element
with volatile controls. The values of normal slave elements are
supposed to be cachable, i.e. they are changed only via the put
callbacks. OTOH, when a slave element is volatile and its values may
be changed by other reason (e.g. hardware status change), the values
will get inconsistent.
The new function allows the slave elements with volatile changes.
When the slave is tied with this call, the native get callback is
issued at each time so that the values are always updated.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The timer callbacks are called in the protected status by the lock
of the timer instance, so there is no need for an extra lock in the
PCM substream.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Considering the fact that most cpu_dai or codec_dai are using a same
'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better
made a pointer instead, to make sharing easier and code a bit cleaner.
The patch below is rather preliminary since the asoc tree is being
actively developed, and this touches almost every piece of code,
(and possibly many others in development need to be changed as
well). Building of all codecs are OK, yet to every SoC, I didn't test
that.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add GPIO support to jack reporting framework in ASoC using gpiolib calls.
The gpio support exports two new functions: snd_soc_jack_add_gpios and
snd_soc_jack_free_gpios.
Client drivers using gpio feature must pass an array of jack_gpio pins
belonging to a specific jack to the snd_soc_jack_add_gpios function. The
framework will request the gpios, set the data direction and request irq.
The framework will update power status of related jack_pins when an event on
the gpio pins comes according to the reporting bits defined for each gpio.
All gpio resources allocated when adding jack_gpio pins can be released
using snd_soc_jack_free_gpios function.
Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
On some systems it is desirable for control for DAPM pins to be provided
to user space. This is the case with things like GSM modems which are
controlled primarily from user space, for example. Provide a helper which
exposes the state of a DAPM pin to user space for use in cases like this.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
cs4232 and cs4236 driver merge to solve PnP BIOS detection.
Also, the patch adds recognition if the chip is cs4236b+
or earlier part. This unifies drivers for both cs4232
and cs4236+ chips. It allows to use the PnP BIOS
detection for the cs4236+ chips. Previously, only
the snd-cs4232 could be detected by the PnP BIOS.
The cs4232+ cards reports two separate PnP BIOS ids.
The patch adds search for the second id to find out
resources assigned to a control port.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds ALSA support for the AC97 controller found on Atmel
AVR32 devices.
Tested on ATSTK1006 + ATSTK1000 with a development board with a AC97
codec.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds ALSA support for the Audio Bistream DAC found on Atmel
AVR32 devices. The ABDAC is an Atmel IP which might show up on AT91
devices in the future, hence making a generic driver which can be
utilized by AT91 arch if needed.
Datasheet describing the ABDAC peripheral is available in the AT32AP7000
datasheet, http://www.atmel.com/dyn/products/datasheets.asp?family_id=682
Tested on ATSTK1006 + ATSTK1000 with a class D amplifier stage.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Impact: cleanup
snd_pcm_new takes a char *id argument, although it is not modifying
the string. it can therefore be declared as const char *id.
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
fix the following 'make headers_check' warning:
usr/include/sound/hdsp.h:33: found __[us]{8,16,32,64} type without #include <linux/types.h>
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Introduced snd_card_create() function as a replacement of snd_card_new().
The new function returns a negative error code so that the probe callback
can return the proper error code, while snd_card_new() can give only NULL
check.
The old snd_card_new() is still provided as an inline function but with
__deprecated attribute. It'll be removed soon later.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Many codec drivers were implementing cookie-cutter copies of the function
that adds kcontrols to the codec.
This patch moves this code to a common function snd_soc_add_controls() in
soc-core.c and updates all drivers using copies of this function to use the
new common version.
[Edited to raise priority of error log message and document parameters.
-- broonie]
Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds a jack reporting interface to ASoC. This wraps the ALSA
core jack detection functionality and provides integration with DAPM to
automatically update the power state of pins based on the jack state.
Since embedded platforms can have multiple detecton methods used for a
single jack (eg, separate microphone and headphone detection) the report
function allows specification of which bits are being updated on a given
report.
The expected usage is that machine drivers will create jack objects and
then configure jack detection methods to update that jack.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Merge the recently introduced soc_value_enum structure to the soc_enum.
The value based enums are still handled separately from the normal enum types,
but with the merge some of the newly introduced functions can be removed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch allows you to define the mixer paths as having the same name as the
paths they represent.
This is required to support codecs such as the wm9705 neatly without extra
controls in the alsa mixer.
Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Add support for reporting new jack types SND_JACK_VIDEOOUT and
SND_JACK_AVOUT (a combination of LINEOUT and VIDEOOUT) to the jack
reporting API.
Also add the corresponding SW_VIDEOOUT_INSERT switch to the input system
header.
Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch introduces a new enum type.
In this enum type each enumerated items referred with a value.
This new enum type can handle enums encoded in bitfield, or any other
weird ways. twl4030 codec has several mux selection register, where the
input/output mux is coded in a bitfield. With the normal enum type this type
of mux can not be handled in a clean way.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Use a lookup table rather than explicit code to map input subsystem jack
types into ASoC ones, implemented as suggested by Takashi Iwai.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Introduce a struct v4l2_file_operations for v4l2 drivers.
Remove the unnecessary inode argument.
Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.
Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
We'd like to use the High Pass Filter and V_REFOUT bitshift values elsewhere,
so stick them into a ac97_codec.h.
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Another part of the backporting of Liam's ASoC v2 work. Using this is
more complicated than the other registration types since currently the
codec is instantiated during the probe of the ASoC device so we can't
currently readily wait for the codec to register.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Some systems support both mechanical and electrical jack detection,
allowing them to report that a jack is physically present but does
not have any functioning connections. Add a new jack type for these,
allowing user space to report faulty connections.
Thanks to Guillem Jover for the suggestion.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ASoC v2 allows platform drivers to instantiate independantly of the
overall ASoC card. This API allows drivers to notify the core when
they are registered.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add API calls to register and unregister DAIs with the core. Currently
these APIs are ineffective. Since multiple DAIs for a given device are
a common case bulk variants are provided.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC v2 allows cards, codecs and platforms to instantiate separately,
with the overall ASoC device only being instantiated once all the
required components have registered. As part of backporting Liam's work
introduce an initial version of the card registration functions. At
present these do nothing active and are internal only, they will be
exposed to machine drivers after further backporting. Adding this now
allows the datastructures used for dynamic card instantiation to be
built up gradually.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
None of the platforms are actually using the SoC device so remove it
(only atmel actually has a suspend method).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This is in preparation for the removal of struct snd_soc_device.
The pop time configuration should really be a property of the card not
the codec but since DAPM currently uses the codec rather than the card
using the codec is fine for now.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
As part of the deprecation of snd_soc_device push the registration of
the platform down into the card structure.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC v2 does not use the struct snd_soc_device at runtime, using struct
snd_soc_card as the root of the card. Begin removing data from
snd_soc_device by pushing the workqueue data into snd_soc_card, using a
backpointer to the snd_soc_device to keep things going for the time
being.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Currently ASoC card initialisation is completed by a function called
snd_soc_register_card(). As part of the work to allow independant
registration of cards, codecs and machines in ASoC v2 a new function of
the same name has been added so rename the existing function to
facilitate the merge of v2.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
DAI type information is only ever used within ASoC in order to special
case AC97 and for diagnostic purposes. Since modern CPUs and codecs
support multi function DAIs which can be configured for several modes
it is more trouble than it's worth to maintain anything other than a
flag identifying AC97 DAIs so remove the type field and replace it with
an ac97_control flag.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Liam Girdwood's ASoC v2 work avoids having two different ops structures
for DAIs by merging the members of struct snd_soc_ops into struct
snd_soc_dai_ops, allowing per DAI configuration for everything.
Backport this change.
This paves the way for future work allowing any combination of DAIs to
be connected rather than having fixed purpose CODEC and CPU DAIs and
only allowing CODEC<->CPU interconnections.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC v2 factors most of the contents of soc.h out into separate headers,
including soc-dai.h for the DAI. Factor the existing DAI API out into
this file in order to prepare for backporting of the ASoC v2 DAI API.
Also backport some of Liam's improvements to the documentation.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
One of the issues with the ASoC v1 API which has been addressed in the
ASoC v2 work that Liam Girdwood has done is that the ALSA card provided
by ASoC is distributed around the ASoC structures. For example, machine
wide data such as the struct snd_card are maintained as part of the
CODEC data structure, preventing the use of multiple codecs. This has
been addressed by refactoring the data structures so that all the data
for the ALSA card is contained in a single structure snd_soc_card which
replaces the existing snd_soc_machine and snd_soc_device.
Begin the process of backporting this by renaming struct snd_soc_machine
to struct snd_soc_card, better reflecting its function and bringing it
closer to standard ALSA terminology.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Change coding style to be more acceptable by checkpatch.pl.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Change snd_BUG_ON() to evaluate the given condition, at least, in syntax
for avoiding compile warnings such as unused variables. The compiler
should optimize out the condition evaluation in the real code, though.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/pcxhr/pcxhr_core.c: In function 'pcxhr_set_pipe_cmd_params':
sound/pci/pcxhr/pcxhr_core.c:700: warning: statement with no effect
sound/pci/pcxhr/pcxhr_core.c:706: warning: statement with no effect
sound/pci/pcxhr/pcxhr_core.c:710: warning: statement with no effect
Due to
try to fix this, and be more conventional about the empty stubs.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Rather than try to remember to keep the core version number updated
(which hasn't been happening) just remove it. It was much more useful
when ASoC was out of tree.
Signed-off-by: Mark brown <broonie@opensource.wolfsonmicro.com>
i.e. echo 6 59 >/sys/kernel/debug/soc-audio.0/codec_reg
will set register 0x06 to a value of 0x59.
Also, pop_time debugfs interface setup is moved so that it
is setup in the same function as codec_reg
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
When ASoC was converted to support full int width masks SOC_SINGLE_VALUE()
omitted the assignment of rshift, causing the control operatins to report
some mono controls as stereo. This happened to work some of the time due
to a confusion between shift and min in snd_soc_info_volsw().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch introduces support for reporting SW_LINEOUT_INSERT detection events
via the jack abstraction layer.
Also adds a SND_JACK_LINEOUT define to the input system header.
Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This was marked as deprecated in 2.6.27 and all users except for
playpaq_wm8510 fixed in that release.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (313 commits)
V4L/DVB (9186): Added support for Prof 7300 DVB-S/S2 cards
V4L/DVB (9185): S2API: Ensure we have a reasonable ROLLOFF default
V4L/DVB (9184): cx24116: Change the default SNR units back to percentage by default.
V4L/DVB (9183): S2API: Return error of the caller provides 0 commands.
V4L/DVB (9182): S2API: Added support for DTV_HIERARCHY
V4L/DVB (9181): S2API: Add support fot DTV_GUARD_INTERVAL and DTV_TRANSMISSION_MODE
V4L/DVB (9180): S2API: Added support for DTV_CODE_RATE_HP/LP
V4L/DVB (9179): S2API: frontend.h cleanup
V4L/DVB (9178): cx24116: Add module parameter to return SNR as ESNO.
V4L/DVB (9177): S2API: Change _8PSK / _16APSK to PSK_8 and APSK_16
V4L/DVB (9176): Add support for DvbWorld USB cards with STV0288 demodulator.
V4L/DVB (9175): Remove NULL pointer in stb6000 driver.
V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator.
V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation
V4L/DVB (9172): S2API: Bugfix related to DVB-S / DVB-S2 tuning for the legacy API.
V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API.
V4L/DVB (9170): cx24116: Sanity checking to data input via S2API to the cx24116 demod.
V4L/DVB (9169): uvcvideo: Support two new Bison Electronics webcams.
V4L/DVB (9168): Add support for MSI TV@nywhere Plus remote
V4L/DVB: v4l2-dev: remove duplicated #include
...
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (33 commits)
ALSA: ASoC codec: remove unused #include <version.h>
ALSA: ASoC: update email address for Liam Girdwood
ALSA: hda: corrected invalid mixer values
ALSA: hda: add mixers for analog mixer on 92hd75xx codecs
ALSA: ASoC: Add destination and source port for DMA on OMAP1
ALSA: ASoC: Drop device registration from GTA01 lm4857 driver
ALSA: ASoC: Fix build of GTA01 audio driver
ALSA: ASoC: Add widgets before setting endpoints on GTA01
ALSA: ASoC: Fix inverted input PGA mute bits in WM8903
ALSA: ASoC: OMAP: Set DMA stream name at runtime in McBSP DAI driver
ALSA: ASoC: OMAP: Add support for OMAP2430 and OMAP34xx in McBSP DAI driver
ALSA: ASoC: OMAP: Add multilink support to McBSP DAI driver
ALSA: ASoC: Make TLV320AIC26 user-visible
ALSA: ASoC - clean up Kconfig for TLV320AIC2
ALSA: ASoC: Make WM8510 microphone input a DAPM mixer
ALSA: ASoC: Implement WM8510 bias level control
ALSA: ASoC: Remove unused AUDIO_NAME define from codec drivers
ALSA: ASoC: tlv320aic3x: Use uniform tlv320aic naming
ALSA: ASoC: Add WM8510 SPI support
ALSA: ASoC: Add WM8753 SPI support
...
Add a new API call snd_soc_dapm_nc_pin() which allows machine drivers to
mark pins as being permanently disabled. At present this is identical
to snd_soc_dapm_disable_pin() except in terms of improving the internal
documentation of machine drivers that use it. The intention is that in
future it will be extended to provide additional features such as hiding
controls that are only relevant to paths using the disconnected pin.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the video_exclusive_open/release functionality into the
driver itself.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Increase the card components[] (and thus snd_card_info.components[],
too) array size from 80 to 128 chars so that more strings can be
stored. The 80 chars aren't enough for more than 2 HD-audio codecs,
and this hits an ugly snd_BUG() as reported by Wu Fegguang for HP
2230s.
The control protocol number is increased to 2.0.6 as well, in case
it matters.
Reported-by: Wu Fengguang <wfg@linux.intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
We have some arithmetic operations against snd_pcm_hw_param_t, thus
bitwise isn't correct for it. Better to remove the flag to shut up
sparse warnings.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ASoC and non-ASoC drivers for PCM DMA on PXA share lots of common code.
Move it to pxa2xx-lib.
[Fixed some checkpatch warnings -- broonie]
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ASoC and non-ASoC drivers for ACLINK on PXA share lot's of common code.
Move all common code into separate module snd-pxa2xx-lib.
[Fixed handing of SND_AC97_CODEC in Kconfig and some checkpatch warnings
-- broonie]
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Empty files remained likely due to wrong patching.
Remove them now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- more register naming work
- finally figured out that weird CR register stuff
(and did I mention that I hate _really_ undecipherable open-coded values?)
- fix handling of IRQ sharing in interrupt handler
(hopefully properly, otherwise I'd be grateful to hear your
pedantic comments ;)
- add handy SPECS_PAGE references wherever useful
- comments, cleanup
- add me as module author
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Most hardwares have limited buffer-descriptor table length. This
also restricts the max buffer size of the sound driver.
For example, snd-hda-intel has 1MB buffer size limit, and this is
because it can have at most 256 BDL entries. For supporting larger
buffers, we need to allocate larger pages even for sg-buffers.
This patch changes the sgbuf allocation code to try to allocate
larger pages first. At each head of the allocated pages, the
number of allocated pages is stored in the lowest bits of the
corresponding entry of the table addr field. This change isn't
visible as long as the driver uses snd_sgbuf_get_addr() helper.
Also, the patch adds a new function, snd_pcm_sgbuf_get_chunk_size().
This returns the size of the chunk on continuous pages starting at
the given position offset. If the chunk reaches to a non-continuous
page, it returns the size to the boundary.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Clean up SG-buffer helper functions and macros. Helpers take substream
as arguments now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Kill snd_assert() in other places, either removed or replaced with
if () with snd_BUG_ON().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Kill snd_assert() in sound/core/*, either removed or replaced with
if () with snd_BUG_ON().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Introduced snd_BUG_ON() macro as a replacement of snd_assert() macro.
snd_assert() is pretty ugly as it has the control flow in its argument.
OTOH, snd_BUG_ON() behaves like a normal conditional, thus it's much
easier to read the flow.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use the wss detection code and kill the ad1848 library.
The library is fully assimilated into the new wss library.
This required reworking of the AD1848 family code
so the code is changed to correctly detect chips from
the AD1848 and CS4231 families.
I have tested it on following cards:
Gallant SC-6600 (codec: AD1848, driver: snd-sc6600)
SoundScape VIVO/90 (codec: AD1845, driver: snd-sscape)
SG Waverider (codec: CS4231A, driver: Rene Herman's snd-galaxy)
Opti930 (codec: built-in - CS4231 compatible, driver: snd-opti93x)
Opti931 (codec: built-in - CS4231 compatible, driver: snd-opti93x)
Gallant SC-70P (chip/codec: CS4237B, driver: snd-cs4236)
Audio Plus 3D (chip/codec: CMI8330A, driver: snd-cmi8330)
Dell Latitude CP (chip/codec: cs4236, driver snd-cs4232)
Sound playback and recording works on all these cards.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use the wss pcm code and kill the ad1848 pcm code.
The AD1848 chip is much slower than CS4231 chips
so the waiting loop was increased 100x (10x is not
enough).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use the wss mixer code and kill the ad1848 mixer code.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use CS4231P instead of AD1848P (kill the AD1848P).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use the wss macros instead of ad1848 ones.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use wss constants for mode.
Move ad1848 hardware constants to the wss.h.
Move mixer tlv macros into the ad1848_lib.c from the ad1848.h.
Drop the MODE_RUNNING spurious IRQ guard on AD1848 as it doesn not seem
to be needed.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The snd_wss is superset of the snd_ad1848 so kill
the latter and replace it with the snd_wss.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Rename functions and structures from the former
cs4321_lib to names more corresponding with the
new name: wss_lib.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Rename file include/sound/cs4231.h
into include/sound/wss.h
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reviewed-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine
to have more than 8 PCM devices per card, except one place - the
SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate
devices > 7. This patch fixes the issue, changing the devices list
organisation.
Instead of adding new device to the tail, the list is now kept always
ordered (by card number, then device number). Thus, during enumeration,
it is easy to discover the fact that there is no more given card's
devices.
Additionally the device field of struct snd_pcm had to be changed to int,
as its "unsignednity" caused a lot of problems when comparing it to
potentially negative signed values. (-1 is 0xffffffff or even more then ;-)
Signed-off-by: Pawel Moll <pawel.moll@st.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Added a new US122L usb-audio driver. This driver works together with a
dedicated alsa-lib plugin.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This reverts commit fb3d6f2b77bdec75d45aa9d4464287ed87927866.
New, updated patch with same subject replaces this commit.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Updated IEC958 consumer status channel definitions according
to the third edition of IEC60958-3 spec.
Signed-off-by: Pawel Moll <pawel.moll@st.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine
to have more than 8 PCM devices per card, except one place - the
SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate
devices > 7. This patch fixes the issue, changing the devices list
organisation.
Instead of adding new device to the tail, the list is now kept always
ordered (by card number, then device number). Thus, during enumeration,
it is easy to discover the fact that there is no more given card's
devices. The same limit was present in OSS emulation code. It has
been fixed as well.
Additionally the device field of struct snd_pcm is now int, instead of
unsigned int, as there is no obvious reason for keeping it unsigned.
This caused a lot of problems with comparing this value with other
(almost always signed) variables. There is just one more place where
device number is unsigned - in struct snd_pcm_info, which should be
also sorted out in future.
Signed-off-by: Pawel MOLL <pawel.moll@st.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ASOC: convert use of uint to unsigned int
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The OpenFirmware API headers don't build on all platforms so ensure
that they are not included unless they are being used.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Simple utility layer for creating ASoC machine instances based on data
in the OpenFirmware device tree. OF aware platform drivers and codec
drivers register themselves with this framework and the framework
automatically instantiates a machine driver. At the moment, the driver
is not very capable and it is expected to be extended as more features
are needed for specifying the configuration in the device tree.
This is most likely temporary glue code to work around limitations in
the ASoC v1 framework. When v2 is merged, most of this driver will
need to be reworked.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Most of the ASoC controls refer to the maximum value that can be set for
a control as mask but there is no actual requirement for all bits to be
set at the highest possible value making the name mask misleading.
Change the code to use max instead.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Convert bitfields in ASoC into full int width. This is a
simple mechanical conversion. Two places in the DAPM code
were fixed to properly use mask.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Some codecs have unusual features in their register maps such as very
large registers representing arrays of coefficients. Support these
codecs in the register cache sysfs file by allowing them to provide a
function register_display() overriding the default output for register
contents.
Also ensure that we don't overflow PAGE_SIZE while writing out the
register dump.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Currently very few systems provide information about jack status to user
space, even though many have hardware facilities to do detection. Those
systems that do use an input device with the existing SW_HEADPHONE_INSERT
switch type to do so, often independently of ALSA.
This patch introduces a standard method for representing jacks to user
space into ALSA. It allows drivers to register jacks for a sound card with
the input subsystem, binding the input device to the card to help user
space associate the input devices with their sound cards. The created
input devices are named in the form "card longname jack" where jack is
provided by the driver when allocating a jack. By default the parent for
the input device is the sound card but this can be overridden by the
card driver.
The existing user space API with SW_HEADPHONE_INSERT is preserved.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
dapm_reg_event() is used by devices using SND_SOC_DAPM_REG() so needs to
be exported to support building them as modules and prototyped to avoid
sparse warnings and potential build issues.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds a new ALSA driver for the audio device found inside
most of the SGI O2 workstation. The hardware uses a SGI custom chip,
which feeds a AD codec chip.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
A bunch of things in alsa depend on CONFIG_KMOD,
use CONFIG_MODULES instead where the dependency
is needed at all.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This patch adds several functions for DAI control and config
and replaces the current method of calling function pointers within
the DAI struct.
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This patch series merges struct snd_soc_codec_dai and struct
snd_soc_cpu_dai into struct snd_soc_dai in preparation for further
ASoC v2 patches.
This merger removes duplication in both DAI structures and simplifies
the API for other users.
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This generic register modifier widget is for updating multiple codec
register bits at once when the widget changes its power state.
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This reverts commit 36b34d2437104f323e09d7c6af6451d3c0b9c0cd.
From: Al Viro <viro@ZenIV.linux.org.uk>
WIW, *all* this stuff is not bitwise at all. For crying out loud, half
of these types are routinely used as array indices and loop variables...
If anything, we want a different set of allowed operations - subtraction
between elements of type (yielding integer), addition/subtraction of
integer types not bigger than ours (yielding our type), comparisons,
assignments (=, +=, -=, passing to function as argument, return from
function, initializers) and second/third arguments in ?:. With 0 *not*
being allowed as a constant of such type.
It's not bitwise; we may use the same infrastructure in sparse, but it
should be a separate class of types (__attribute__((affine))).
dma_addr_t is another candidate for the same treatment, but there we'll
need helpers for conversions to hw-acceptable form (dma_to_le32(), etc.)
and gradual conversion of drivers.
ALSA ones and pm mess are absolutely straightforward cases, though.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Fully half of all alsa sparse warnings are from snd_pcm_hw_param_t degrading
to integer type, this goes a long way towards eliminating them.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
On OpenMoko soc-audio resume is taking 700ms of the whole resume time of
1.3s, dominated by writes to the codec over I2C. This patch shunts the
resume guts into a workqueue which then is done asynchronously.
The "card" is locked using the ALSA power state APIs as suggested by
Mark Brown.
[Added fix for race with resume to suspend and fixed a couple of nits
from checkpatch -- broonie.]
Signed-off-by: Andy Green <andy@openmoko.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
snd_ctl_elem_read() and snd_ctl_elem_write() are no longer used by
any other drivers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Mike Montour <mail@mmontour.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>