Passing pointer to relevant dai_link provides easier reach to the
ASoC tree in suspend/resume of snd_soc_platform. It also provides
direct access to the dai at the other end of the dai_link.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Make the pmdown_time a per-card setting rather than a global one,
initialised before the card initialisation runs. This allows cards
to override the default setting if it makes sense to do so (for
example, due to an unavoidable pop).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
The WM2000 is a low power, high quality handset receiver speaker
driver with Wolfson myZone™ Ambient Noise Cancellation (ANC). It
provides enhanced voice communication quality in a noisy environment
if the handset acoustics are designed appropriately.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Add a bit to the CODEC structure indicating if a cache sync is required.
By default this will be set if a cache only write is done to a soc-cache
register cache. This allows us to avoid syncing the cache back after
using cache only writes if there were no changes.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Currently the soc-cache code will always write to the device, meaning
that we need the device to be powered and active at pretty much all
times the system is active. Allowing cache only writes lays some
groundwork for future enhancements to allow devices to be put into a
full off state when the audio subsystem is idle.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Clemens Ladisch noted for hw_ptr_removal in "cleanup & merge hw_ptr
update functions" commit:
"It is possible for the status/delay ioctls to be called when the sound
card's pointer register alreay shows a position at the beginning of the
new period, but immediately before the interrupt is actually executed.
(This happens regularly on a SMP machine with mplayer.) When that
happens, the code thinks that the position must be at least one period
ahead of the current position and drops an entire buffer of data."
Return back the hw_ptr_interrupt variable. The last interrupt pointer
is always computed from the latest hw_ptr instead of tracking it
separately (in this case all hw_ptr checks and modifications might
influence also hw_ptr_interrupt and it is difficult to keep it
consistent).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Several shortcuts for popular uses of some of SOC_ENUM_* and
SOC_VALUE_ENUM_* macros.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Many macros from include/sound/soc-dapm.h take an array and a number of
elements in it as arguments, whereas most users use static arrays and use
"x, ARRAY_SIZE(x)" as arguments. This patch adds simplified versions of
those macros, calling ARRAY_SIZE() internally.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.oc.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Currently ASoC always maintains the bias of the CODEC while the system
is active. With older mobile CODECs this is required since the outputs
are referenced to a non-zero voltage and enabling or disabling this
voltage without audible pops or clicks in the output takes too long to
do when starting or stopping audio.
As a result of features such as ground referenced outputs and class D
speaker drivers current generation devices are able to power on and off
much more quickly without these system level issues so provide a new
flag idle_bias_off in snd_soc_codec which will cause the core to turn
off the CODEC bias. The distinction between STANDBY and OFF is still
maintained. This is partly for consistency but also allows for
potential future extensions such as per-machine overrides or deferring
the bias removal.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This change fixes the "ALSA: pcm_lib - optimize wake_up() calls for PCM I/O"
commit. New sleeping queue is introduced to separate user space and kernel
space wake_ups. runtime->nowake is renamed to twake (transfer wake).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add possibility to configure the burst mode BCLK divider through platform
data structure.
The BCLK divider changes the actual speed of the serial bus in burst mode,
which is faster than the sampling frequency of the running stream.
In this way platforms can experiment with the optimal burst speed without
the need to modify the codec driver itself.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
pgprot_noncached() can be set for vmalloc'ed buffers safely, and we'd
need non-cached behavior more or less, even for the intermediate ring-
buffers.
Now snd_pcm_lib_mmap_vmalloc() is added as the common PCM mmap callback
that is coupled with snd_pcm_lib_alloc_vmalloc_buffer() & co.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added a new function to look up a quirk entry with the given PCI SSID
instead of a pci device pointer. This can be used when the searched ID
is overridden for debugging or such a purpose.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
tpa6140a2 uses different names for the regulators.
Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
As noted by pl bossart <bossart.nospam@gmail.com>, the PCM I/O routines
(snd_pcm_lib_write1, snd_pcm_lib_read1) should block wake_up() calls
until all samples are not processed.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Do general cleanup in snd_pcm_update_hw_ptr*() routines and merge them.
The main change is hw_ptr_interrupt variable removal to simplify code
logic. This variable can be computed directly from hw_ptr.
Ensure that updated hw_ptr is not lower than previous one (it was possible
with old code in some obscure situations when interrupt was delayed or
the lowlevel driver returns wrong ring buffer position value).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
In some debug cases, it might be usefull to see previous ring buffer
positions to determine position problems from the lowlevel drivers.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This is one of Sound Blaster Pro compatible chipsets which is supported
by Linux OSS driver and was missing native supoort for ALSA.
The Jazz16 audio codec is Crystal CS4216 which is capable
of playback and recording up to 48 kHz stereo.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The WM8955 is a low power, high quality stereo DAC with integrated
headphone and loudspeaker amplifiers, designed to reduce external
component requirements in portable digital audio applications. This is
an initial driver implementing support for the majority of the
functionality in the device, currently OUT3 is not supported.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
There are now five copies of the code to allocate a PCM buffer using
vmalloc(). Add a sixth in the core so that the others can be removed.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The WM8904 is a high performance ultra-low power stereo CODEC
optimised for portable audio applications, with features including
a class W amplifier, FLL with free running mode, Mobile ReTune and
ground referenced headphone and line outputs.
Support for some features, most particularly the digital microphone
interface, is not yet present.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
The ACI mixer is used to control the radio FM module
installed on the Miro PCM20 sound card. Expose ACI mixer
outside the sound card driver.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the miro.h header to the include/sound directory. It can
be used in the Miro PCM20 radio driver (v4l).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Update control names to be more closer to their meaning.
Change the "Mono" name to the "Beep" as this line is usually
used to forward the PC beeper signal to sound card's output.
Update names for both cs423x and wss.
Clean up cs4235 controls according to the cs4235 doc. Rename
some of the cs4235 controls to be consistent with the cs4236's
ones.
Also, delete one misnamed cs4231 register define.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The jack_status_check callback function is the interface to check the
status of the jack. Some target provides the method to distinguish what
is the jack inserted - headphone jack, microphone jack, tvout jack, etc,
so we can implement it using the jack_status_check function.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Many devices need to calculate the bit clock rate desired to
work out the clock configuration required for the device.
Provide utility functions to do this using both hw_params
structures and raw numbers.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Record the pid of the task that opened a RawMIDI substream.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Record the pid of the task that opened a PCM substream. For sound
cards with hardware mixing, this allows determining which process
is associated with a specific substream's volume control.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of storing the PID number, take a reference to the task's pid
structure. This protects against duplicates due to PID overflows, and
using pid_vnr() ensures that the PID returned by snd_ctl_elem_info() is
correct as seen from the current namespace.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We do not need to save the ID of the process that locked a control
because that information is already available in the owner's file data.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The cs4236 was two step detection with call to the snd_wss_free()
between two steps. The snd_wss_free() did not free a sound device
created in the snd_wss_create(). This caused an OOPS during module
removal as the same sound device was released twice. The same OOPS
happened if the cs4236 module loading failed.
Fix this by adapting the snd_cs4236_create() to correctly work with
chips less capable then cs4236. The snd_cs4236_create() behaves the
same as the snd_wss_create() if the chip is less capable than the cs4236.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This is a port of the sound/oss/sh_dac_audio.c driver.
The driver uses an on-chip 8-bit D/A converter, which has a speaker connected
to one of its channels, found in several ancient HP machines.
For interrupts it uses a high-resolution timer (hrtimer).
Tested on SH7709 based hp6xx (HP Jornada 680/690 and HP Palmtop 620lx/660lx).
Also, since OSS Emulation works, the old OSS sound/oss/sh_dac_audio.c driver
would be obsolete soon, and it could be removed.
Signed-off-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
snd_soc_init_card() is always called as the last part of the CODEC probe
function so we can factor it out into the core card setup rather than
have each CODEC replicate the code to do the initialiastation. This will
be required to support multiple CODECs per card.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Driver for Texas Instruments TLV320DAC33 (SLAS546) low power stereo
audio DAC.
TLV320DAC33 is a stereo audio codec with integrated 24KB FIFO for low
power audio playback.
The digital interface can use I2S, DSP (A or B), Right and Left
justified formats.
DAC33 has stereo analog input, which can be bypassed to the analog
outputs.
Regarding to the internal 24KB FIFO the driver implements 'FIFO bypass'
mode (default) and nSample mode (FIFO is in use).
a) In 'FIFO bypass' mode the internal FIFO is not in use, the codec is
working synchronously as a normal codec (it needs constant stream of
data on the digital interface).
b) The nSample mode implementation uses one interrupt line from DAC33 to
the host:
Alarm threshold is set to 10ms of audio data (limit by the driver
implementation).
DAC33 will signal an interrupt, when the FIFO level goes under the
Alarm threshold.
The host will write to nSample register a value (number of stereo
samples), to tell DAC33 how many samples it should read in a burst from
the host. When the DAC33 received the number of samples, it disables the
clocks on the I2S bus. When the FIFO use again goes under the Alarm
threshold, DAC33 signals the host with an interrupt, and the process is
repeated.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The PM core will grow pm_link infrastructure in 2.6.33 which can be
used to implement the intended functionality of the ASoC-specific
device suspend and resume callbacks so drop them.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Driver for Texas Instruments TPA6130A2 stereo headphone
amplifier.
The driver provides playback gain control and also pre-defined
DAPM_HP widgets and DAPM routings for power management.
The DAPM_HP widget names are:
"TPA6130A2 Headphone Left"
"TPA6130A2 Headphone Right"
From soc machine drivers to use with the tpa6130a2 amplifier,
the tpa6130a2_add_controls has to be called, which adds the alsa
controls and the DAPM routing needed for the tpa6130a2.
After that the machine driver can connect the codec's output
with 'TPA6130A2 Left' and 'TPA6130A2 Right':
{"TPA6130A2 Left", NULL, "CODEC LEFT OUT"},
{"TPA6130A2 Right", NULL, "CODEC RIGHT OUT"},
Internally the left and right channels are powered separately.
When none of the channels are needed the amplifier is powered
down:
hard power: valid GPIO number is passed within platform data
soft power: Using the software shutdown of the amplifier
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Sometimes it is desirable to have a mux which does not reflect any
direct register configuration but which will instead only have an
effect implicitly (for example, as a result of changing which parts
of the device are powered up). Provide a virtual mux for this purpose.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
In order to support multiple codecs on the same system in the debugfs
the directory hierarchy need to be changed by adding directory per codec
under the asoc direcorty:
debugfs/asoc/{dev_name(socdev->dev)}-{codec->name}/codec_reg
/dapm_pop_time
/dapm/{widgets}
With the original implementation only the debugfs files are only
created for the first codec, other codecs loaded later would fail to
create the debugfs files (since they are already exist).
Furthermore in this situation any of the codecs has been removed, would
cause the debugfs entries to disappear, regardless if the codec, which
created them are still loaded (the one which loaded first).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The conversion solves the problem that firmware size was set to 64KB
while non PnP cards have 128KB firmware files.
An additional firmware initialization code has been moved from the OSS
driver.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add DAI format definition for PDM interfaces.
Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* complete support for ak4113
* based on code for ak4114 and ak4117
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* complete support for ak4620
* codec regs listed in proc for all codecs/chips
* adding total regs for each codec
* fixing nb. of steps in input attenuation controls
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* the previous version had a typo - values of AK4114_OPS10-12 were
identical with AK4114_OPS00-02
* Since no cards actually use this feature, the bug was not identified earlier
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The patch adds an interface to set the relationship between audio
channel number and slot number. The interface should be really useful
because audio channel n doesn't always use slot n in all platforms. And
for some devices, the relationship even can change with sound mode
switch in 2.1,3.1,4.1,5.1,6.1,7.1 etc.
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* topic/tlv-minmax:
ALSA: usb-audio - Correct bogus volume dB information
ALSA: usb-audio - Use the new TLV_DB_MINMAX type
ALSA: Add new TLV types for dBwith min/max
Some chips with complex internal supply (particularly clocking)
arragements may have multiple options for some of the supply
connections. Since these don't affect user-visible audio routing
the expectation would be that they would be managed automatically
by one of the drivers.
Support these users by allowing routes to have a connected function
which is queried before the connectedness of the path is checked as
normal. Currently this is only done for supplies, other widgets
could be supported but are not currently since the expectation for
them is that audio routing will be under the control of userspace.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add appropriate const prefix to char * arguments in proc helper functions.
Also fixed the caller side to be proper const pointers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Re-export snd_pcm_format_name() function to be used outside the PCM core.
As a first example, usbaudio is changed to use it now again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The struct snd_monitor_file is used locally only in sound/core/init.c,
thus it should be moved there from the public sound/core.h.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
More and more devices feature PLLs and FLLs with the ability to select
between multiple input clocks. In order to better support these devices
a new argument, source, has been added to the set_pll() configuration
API. Using set_clkdiv() is often difficult due to the need to stop the
PLL/FLL before any reconfiguration can be done.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add debug module option to snd core.
This controls the debug print level. When CONFIG_SND_DEBUG_VERBOSE
is set, you can suppress the debug messages by giving or changing this
parameter to a lower value. debug=0 means no debug messsages.
As default, it's set to the verbose level 2.
Since this option can be changed dynamically via sysfs file, you can
suppress the verbose debug messages on the fly, which wasn't possible
before.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Currently when built with DEBUG DAPM will dump information about
the power state decisions it is taking for each widget to dmesg.
This isn't an ideal way of getting the information - it requires
a kernel build to turn it on and off and for large hub CODECs the
volume of information is so large as to be illegible. When the
output goes to the console it can also cause a noticable impact
on performance simply to print it out.
Improve the situation by adding a dapm directory to our debugfs
tree containing a file per widget with the same information in
it. This still requires a decision to build with debugfs support
but is easier to navigate and much less intrusive.
In addition to the previously displayed information active streams
are also shown in these files.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This driver is very simple.
It support playback only now.
This patch is tested by ms7724se board.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Currently DAPM interfaces with the audio streams to and from the
processor at the DAC and ADC widgets. As the digital capabilities
of parts increases this is becoming a less and less able to meet
the needs of parts.
To meet the needs of these devices create new widgets interfacing
with the TDM bus but not integrated into any other functionality.
Audio can then be routed to and from these widgets using existing
routing widgets.
A slot number is provided in the definition but this is currently
not used yet. This is intended to support devices which can use
more than one TDM slot on a single interface.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds support for passing platform data to ac97 bus devices
from PXA2xx-AC97 driver..
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Allow the interval timer to be programmed with its full 96 kHz
precision.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Extend set_tdm_slot to allow the user to arbitrarily set the frame width
and active TX/RX slots.
Updates magician.c and wm9081.c for the new set_tdm_slot(). wm9081.c
still doesn't handle the slot_width override.
While being there, correct an incorrect use of SlotsPerFrm(7) use in
bitmask on pxa-ssp.c (SSCR0_SlotsPerFrm(x) is (((x) - 1) << 24)) ).
(this series is meant for Mark's for-2.6.32 branch)
Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
As part of this refactoring the type of the CODEC hw_read operation
is changed to match the regular read operation.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
While writes tend to be able to use a fairly bus independant format to
do the writes reads are all bus specific. To allow us to factor out
this code include the bus type as a parameter when setting up the
cache.
Initially just use this to factor out hw_write_t for I2C.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This helps CODECs with sparse register maps work better with the
register cache display interface.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch allows passing platform_data to devices attached to AC97 bus
(like touchscreens, battery measurement chips ...).
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>