Improve DMA transfers by enabling Burst transaction.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
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>
> Then it's a driver bug. If unaligned period size is allowed, it means
> that the irq is really generated in that period, not at the buffer
> boundary. Otherwise, it must have a proper hw-constraint to align the
> period size to the buffer size.
This patch will fix the bug metioned in the above mail. Force the peroid
size to be aligned with the buffer size.
Based and tested on linux-2.6.31-rc6.
Signed-off-by: Shine Liu <shinel@foxmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The current PCM core has the following problems regarding PCM draining
in non-blocking mode:
- the current f_flags isn't checked in snd_pcm_drain(), thus changing
the mode dynamically via snd_pcm_nonblock() after open doesn't work.
- calling drain in non-blocking mode just return -EAGAIN error, but
doesn't provide any way to sync with draining.
This patch fixes these issues.
- check file->f_flags in snd_pcm_drain() properly
- when O_NONBLOCK is set, PCM core sets the stream(s) to DRAIN state
but quits ioctl immediately without waiting the whole drain; the
caller can sync the drain manually via poll()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Used for applications such as direct bluetooth connections on
smartphones which don't go via the CPU. This used to be supported
before the refactoring to share code but this check was removed
during that move.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
There are many variants of Toshiba laptops with ALC268 codec, and
it seems that a few of them don't work with model=toshiba preset
since they have the secondary ALC268 codec just for HDMI output.
This is a regression due to the previous clean-up work to merge all
Toshiba quirk entries into a single check.
This patch adds the identification of such laptops to apply the
standard BIOS-probing method. Unfortunately, Toshiba laptops have
all the same PCI SSID, so we need to check the codec SSID to identify
each device.
Tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If the CODEC does not provide a set_bias_level() then update the
bias_level variable for it since other parts of the system expect
that to be maintained.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The BIOS pin configs are in fact correct and shall not be overwritten.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
HP Compaq 6530s and 6531s internal speaker is silence or becomes silence
within 1 minute after fresh boot. It is found that pin 0x1c must be set to
PIN_OUT mode to make the speaker work. This is weird - line-in pin 0x1c and
speaker pin 0x16 seem to be unrelated.
The codec differences before/after patch are:
@@ Node 0x17 [Pin Complex] wcaps 0x40020b:
Pin Default 0x41a6e130: [N/A] Mic at Ext Rear
Conn = Digital, Color = White
DefAssociation = 0x3, Sequence = 0x0
Misc = NO_PRESENCE
- Pin-ctls: 0x24: IN
+ Pin-ctls: 0x40: OUT
@@ Node 0x1c [Pin Complex] wcaps 0x40018d:
Pin Default 0x41813021: [N/A] Line In at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0x2, Sequence = 0x1
- Pin-ctls: 0x24: IN VREF_80
+ Pin-ctls: 0x40: OUT VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1
0x24
Tests show that it won't impact (external) Mic recording.
Reported-by: "Lin, Ming M" <ming.m.lin@intel.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The auto-mic clean-up patches caused regressions on some ALC268 models
that have no proper input_mux but with "Input Source" mixer elements.
Such a combination results in Oops when accessed.
[A reason why set_capture_mixer() isn't used in patch_alc268() is that
ALC268 codec have HDA_OUTPUT direction for capture volumes unlike other
codecs. Thus it needs own definitions of capture elements.]
This patch fixes the issues:
- Add a capture mixer definition without input-source
- Use the new capture mixer appropriately
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The WM8993 provides digital sidetone paths and also allows each
channel on the audio interface to be routed separtately to the
DACs and ADCs.
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>
Joonyoung Shim reports that S3C64xx I2S is working on the NCP boards so
allow it to be selected in Kconfig.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmciro.com>
The data format configuration for S3C64xx IISv2 was hardcoded for IISMOD
register. This patch changes to the defined values it.
And instead of bits 9 and 10 of IISMOD we should clear bits 13 and 14.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Note that the number of slots used internally is specified in terms
of stereo slots while the external API works with mono slots.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
When used without the PLL we were accidentally clearing the MCLK/2
divider, resulting in a double rate SYSCLK when the divider should
have been used.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Speaker and headphone outputs do not need to be handled separately
since they can't be part of the same path.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
If the system doesn't have any DAPM widgets then we can't use their
state to check if the bias level for the codec should be up.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
There is a mistake in current uda134x_mute function: mute_reg has been
changed in line 162 or line 164, so uda134x_write should write
"mute_reg" but not "mute_reg & ~(1<<2)" to
UDA134X_DATA010.
Signed-off-by: Shine Liu <shinel@foxmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ensure that userspace can remove only user controls. Controls created
by kernel drivers must not be removed because they might be referenced
in calls to snd_ctl_notify().
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the decrementing of the user controls counter from
snd_ctl_elem_remove to snd_ctl_remove_unlocked_id; this saves the
separate locking of the controls semaphore, and therefore removes
a harmless race.
Since the purpose of the function is to operate on user controls (the
control being unlocked is just a prerequisite), rename it to
snd_ctl_remove_user_ctl.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use a common exit path to release the mutex and to return a possible
error.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Make sure that no user element that has no values can be added.
The check for count>1024 is not needed because the count is checked
later for the individual control types.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Enhance period_index accuracy, particularly just before buffer rewind, by
making use of DMA interrupt status flags in addition to simply counting up
interrupts.
Created against linux-2.6.31-rc5.
Tested on Amstrad Delta.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Use newly implemented DMA channel self linking on OMAP1510 like on other OMAP
models. Remove unnecessary DMA transfer restart from interrupt handler
routine.
The interrupt routine used to maintain a period index, originally needed for
counting up periods up to a full buffer in order to restart the DMA transfer.
For some time, this counter is also used as a replacement for hardware DMA
progress counter that has been found unusable on OMAP1510 in case of playback.
Thus, the period index calculation cannot be omitted completely. However, the
accuracy of this counter can still suffer from missing DMA interrupts.
In order to work correctly, it requires patch 1 from this series also applied:
[RFC][PATCH 1/3] ARM: OMAP: DMA: Add support for DMA channel self linking on OMAP1510
Created against linux-2.6.31-rc5.
Tested on Amstrad Delta.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The previous fix removed the definition of num_adc_nids wrongly, and
this resulted in the missing input-source control. Now readded again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Change the strings related to capture in order to be
interpreted correctly by alsamixer and possible other
UI based mixer applications.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Move the definition of the "generic" IRQ in the process.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
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>
There is one instance of McASP on DA850/OMAP-L138 SoC. This is
connected to TLV320AIC3106 codec for audio playback and capture.
This patch adds audio support on this platform. Some of the
structure prefix names which are common for DA830/OMAP-L137 EVM and
DA850/OMAP-L138 EVM have been renamed to da8xx from da830.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The patch adds a DAI format: Codec bit clock master and frame sync slave,
to the driver.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
On DA830/OMAP-L137 and DA850/OMAP-L138 SoCs, the McASP peripheral has FIFO
support. This FIFO provides additional data buffering. It also provides
tolerance to variation in host/DMA controller response times.
The read and write FIFO sizes are 256 bytes each. If FIFO is enabled,
the DMA events from McASP are sent to the FIFO which in turn sends DMA requests
to the host CPU according to the thresholds programmed.
More details of the FIFO operation can be found at
http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=
sprufm1&fileType=pdf
This patch adds support for FIFO configuration. The platform data has a
version field which differentiates the McASP on different SoCs.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The WM8993 analogue control is shared with other devices in the same
product line. Since this is a very substantial proportion of the
driver move the definitions of these controls into a new wm_hubs module
which allows them to be shared between the two.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
A few improvements for IDT 92HD83xxx codec pareser:
- Remove unused / deprecated mixer-amp controls
- Handle d-mics as normal inputs since this codec has no separate
MUXes for analog and digital
- Don't create duplicated controls for capture volumes with Mux
capture volumes
Signed-off-by: Takashi Iwai <tiwai@suse.de>
There has been an ad1836 driver in sound/blackfin based on traditional alsa.
The new driver is based on asoc. The architecture of ad1836 codec driver is
very much like ad1938.
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Dynamically control and control only the needed output amplifier
muting/un-muting.
The original code was muting and un-muting the following output
amplifiers: Earpiece PreDrivL/R, CarkitL/R at the same time
regardless which pin is actually in use at the given moment.
Move these as separate PGA so only the needed amplifier will be touched.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
According to the function dapm_dac_check_power() in
sound/soc/soc-dapm.c, dac power can't be on/off stand-alone without any
output widget as sink. And according to dapm_adc_check_power(), adc
power can't be on/off stand-alone without any input widget as source. So
we can't only define some stand-alone SND_SOC_DAPM_DAC/SND_SOC_DAPM_ADC
to hope their power can be managed dynamically.
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Enable line-out detection for IDT/STAC codecs only when speaker pins
exist. In some cases, the speaker itself is identified as line-out,
and this confuses the situation. Only the extra line-outs should do
auto-muting.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
the hdsp driver refuses to report any information via the proc
interface, if the io box is not connected. with this patch, the
content of the control and status registers is printed before the
iobox check.
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
With auto config model of alc268 realtek codec, it allows to select any
of possible available digital microphone inputs when only one is
available. For example, when only digital mic in nid 0x12 is available,
on second input source it will allow you to select unavailable digital
mic in nid 0x13. The problem is that selecting unavailable digital mic
creates a source of noise when recording (I'm not sure if this happens
on all machines with alc268 and only one digital mic input, but testing
on a quanta uw1 netbook a lot of noise is introduced in recording from
digital mic 0x12/first input source, when you select the unavailable
digital mic 0x13 for capture source 0x24 in the second input source in
mixer).
Then to avoid noise when recording from digital mic with auto model in
this case, prevent a digital mic input source to be selected if
microphone is not available.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move static codes to setup from init_hook for each model.
Also, use the common auto-mic selection helper for devices that support
auto-mic selection. They just need to set up ext_mic, int_mic and
auto_mic flag in the setup section.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Store the TDM slot width then if it's set use that rather than the
sample size to calculate BCLK. Leave imposing constraints to the
core (which should do this but doesn't yet) or machine driver.
Also allow 0 TDM slots to be configure (for use when disabling TDM).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Added setup hook to ALC preset struct to be called at in the parser
but not at each init callback.
This can be used for setting up the static pins, etc, while the
init hook should be used for updating the status again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Created a white-list to enable MSI since some devices require MSI
explicitly due to BIOS/ACPI problems. Simply using a quirk list.
As the first case, take HP Compaq CQ40.
Reference: Novell bnc#529971
https://bugzilla.novell.com/show_bug.cgi?id=529971
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix soc build errors when I2C is built as a loadable module:
(.text+0x5d26b): undefined reference to `i2c_master_send'
soc-cache.c:(.text+0x5d32d): undefined reference to `i2c_transfer'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Some Realtek codecs don't provide the full connections for certain pins
from each ADC; e.g. ACL662/ALC272 gives only one of two digital-mic pins
for each ADC. Thus, depending on the digital mic pin, the ADC/MUX to be
used has to be chosen properly.
This patch adds the check of the connectivity of pins at auto-mic mode.
If no proper connectivity is found, auto_mic flag is turned off to be
sure.
Also the mux_idx is determined during this check so it won't be checked
in the unsol event any more.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALC269 and ALC861-VD parsers override the ADC definitions
unconditionally without checking the spec definition. This causes
the problem when any inconsistent ADC is set up in the device quirk
(like ALC272 with digital-mic).
This patch avoids the overriding by adding the proper checks.
Reference: Novell bnc#529467
https://bugzilla.novell.com/show_bug.cgi?id=529467
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the compile warning due to different integer types used in min():
sound/usb/usbaudio.c: In function 'init_substream_urbs':
sound/usb/usbaudio.c:1087: warning: comparison of distinct pointer types lacks a cast
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the support for automatic mic selection via plugging for
Realtek codecs (in auto-probing mode). The auto-mic mode is enabled
only when one internal mic and one external mic are present.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If any OSS support is enabled, regardless of built-in or module,
sound_core claims full OSS major number (that is, the old 0-255
region) to trap open attempts and request sound modules using custom
module aliases. This feature is redundant as chrdev already has such
mechanism. This preemptive claiming prevents alternative OSS
implementation.
The custom module aliases are scheduled to be removed and the previous
patch made soundcore emit the standard chrdev aliases too to help
transition.
This patch schedule the feature for removal in a year and makes it
optional so that developers and distros can try new things in the
meantime without rebuilding the kernel. The pre-claiming can be
turned off by using SOUND_OSS_CORE_PRECLAIM and/or kernel parameter
soundcore.preclaim_oss.
As this allows sound minors to be individually grabbed by other users,
this patch updates sound_insert_unit() such that if registering
individual device region fails, it tries the next available slot.
For details on removal plan, please read the entry added by this patch
in feature-removal-schedule.txt .
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Till now missing OSS devices emitted sound-slot/service-* module
alises instead of the standard char-major-* if a missing device number
is opened if soundcore is loaded. The custom module aliases don't
have any inherent benefit than backward compatibility.
sound-slot/service-* module aliases is scheduled to be removed and to
help the transition this patch makes soundcore emit the standard
module alises along with the custom ones.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In the 2.1.6 kernel, the output loop in midi_poll() was changed to
enable interrupts during the outputc() call. Unfortunately, the check
whether the device has accepted the current byte ("ok") was moved behind
the code that removes the byte from the output queue, so one byte would
be lost every time the hardware FIFO is full.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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>
Using more packets in one URB do avoid interrupts does not make sense
when we have a sync pipe whose packets generate interrupts more often.
Therefore, limit the URB size to the synchronization packet interval.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Without the initialization of vmaster NID, the dB information got
confused for ALC269 codec.
Reference: Novell bnc#527361
https://bugzilla.novell.com/show_bug.cgi?id=527361
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
The previous auto-mic patch for STAC/IDT codecs causes the Oops on
machines without digital mic pins. This patch fixes the problem.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add support for audio on DA830 EVM- here McASP1 is interfaced to
TLV320AIC3106 codec.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This fixes a build failure for 2.6.31-rc4-rt1 (ARCH=arm, s3c2410_defconfig):
CC [M] sound/soc/s3c24xx/s3c2443-ac97.o
sound/soc/s3c24xx/s3c2443-ac97.c:50: warning: type defaults to 'int' in declaration of 'DECLARE_MUTEX'
sound/soc/s3c24xx/s3c2443-ac97.c:50: warning: parameter names (without types) in function declaration
sound/soc/s3c24xx/s3c2443-ac97.c: In function 's3c2443_ac97_read':
sound/soc/s3c24xx/s3c2443-ac97.c:59: error: 'ac97_mutex' undeclared (first use in this function)
sound/soc/s3c24xx/s3c2443-ac97.c:59: error: (Each undeclared identifier is reported only once
sound/soc/s3c24xx/s3c2443-ac97.c:59: error: for each function it appears in.)
sound/soc/s3c24xx/s3c2443-ac97.c: In function 's3c2443_ac97_write':
sound/soc/s3c24xx/s3c2443-ac97.c:93: error: 'ac97_mutex' undeclared (first use in this function)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The patch changes the line discipline name registered in include/linux/tty.h
and updates the ams-delta machine driver to use it.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The dma setup code assumes that the buffer size is a multiple
of the period size.
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
dai is a parameter to the functions, so use it instead of
looking it up.
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Simultaneous audio playback and capture on OMAP1510 can cause that second
stream is stalled if there is enough delay between startup of the audio
streams.
Current implementation of the omap_mcbsp_start is starting both transmitter
and receiver at the same time and it is called only for firstly started
audio stream from the OMAP McBSP based ASoC DAI driver.
Since DMA request lines on OMAP1510 are edge sensitive, the DMA request is
missed if there is no DMA transfer set up at that time when the first word
after McBSP startup is transmitted. The problem hasn't noted before since
later OMAPs are using level sensitive DMA request lines.
Fix the problem by changing API of omap_mcbsp_start and omap_mcbsp_stop by
allowing to start and stop individually McBSP transmitter and receiver
logics. Then call those functions individually for both audio playback
and capture streams. This ensures that DMA transfer is setup before
transmitter or receiver is started.
Thanks to Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> for detailed problem
analysis and Peter Ujfalusi <peter.ujfalusi@nokia.com> for info about DMA
request line behavior differences between the OMAP generations.
Reported-and-tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
This patch is a workaround for the problem of several subsequent control
statements not being applied correctly to the codec controller (modem).
In order to follow the hook switch state change from handset to handsfree
while
in full duplex mode, two consecutive +VLS control commands were sent to the
modem. The first one was M1 (microphone only), the seconds one was M1S1 (both
microphone and speaker). As there was no real modem handshaking procedure
implemented, neither in the codec nor in the machine driver part of the line
discipline, the modem was having the second command missed.
Since a possibility to switch to microphone only mode (and speaker only mode
as well) seams of no value, I have modified the code to issue single M1S1
command only for any of those cases.
Tested on my Amstrad Delta.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds debugging statement that can help in tracing
how the driver is trying to control the codec device.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The WM8776 is a high performance, stereo audio CODEC with five channel
input selector. The WM8776 is ideal for surround sound processing
applications for home hi-fi, DVD-RW and other audio visual equipment.
This driver implements support for most WM8776 features - currently the
ADC automatic level control/limiter functionality is omitted.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This adds support for i.mx27_visstrim_sm10 board machine driver which
uses an i.mx27 processor plus a wm8974 codec.
It has been tested on a visstrim_sm10 board.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This adds support for DAI platform for the SSI present in MXC platforms.
It currently does not support i.MX3, the only thing necessary to do
this is to export DMA data for i.MX3 interface which I haven't done
because I don't have a i.MX3 based board available.
It has been tested on i.MX27 board.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This adds support for DMA platform valid for i.MX1 and i.MX2 platforms.
This is not valid for i.MX3 since it doesn't share the same DMA
interface than i.MX1 and i.MX2.
It has been tested on i.MX27 board.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Power management for the cs4270 codec is currently implemented as part
of the i2c_driver struct. The disadvantage of doing it this way is that
the callbacks registered in the snd_soc_card struct are called _before_
the codec's callbacks.
That doesn't work, because the snd_soc_card callbacks will most likely
switch down the codec's power domains or pull the reset GPIOs, and
hence make the i2c communication bail out.
Fix this by binding the suspend and resume code to the
snd_soc_codec_device driver model and let the I2C functions only call
the SoC core function for resume and suspend, which do nothing currently
but will do later.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The code in psc_dma_bcom_enqueue_tx() didn't account for the fact that
s->runtime->control->appl_ptr can wrap around to the beginning of the
buffer. This change fixes this problem.
Signed-off-by: John Bonesio <bones@secretlab.ca>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Read buffer overflow
ALSA: hda: Correct EAPD for Dell Inspiron 1525
ALSA: hda: warn on spurious response
ALSA: hda: remember last command for each codec
ALSA: hda: read CORBWP inside reg_lock
ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
ALSA: hda: take cmd_mutex in probe_codec()
ALSA: hda: track CIRB/CORB command/response states for each codec
ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527
When the line-out jack is plugged/unplugged, the driver needs to check
the headphone plug, not only the line-out jack itself. Otherwise the
headphone or the speaker may be wrongly muted/unmuted.
As a result, both STAC_HP_EVENT and STAC_LO_EVENT need to call the
same function, stac92xx_hp_detect().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This converts all the Wolfson drivers using this format (the only devices
that do) except WM8753 to use it.
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>
The commit fefd67f31e
ALSA: hda - Add line-out jack detection on IDT/STAC codecs
enabled wrong pins for jack detections. Fixed to the correct ones.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Return STRPIPE instead of EBADF when userspace attempts to rewind
of forward a stream that was suspended in meanwhile, so that it
can be recovered by snd_pcm_recover().
This was causing Pulseaudio to unload the ALSA sink module under a race
condition when it attempted to rewind the stream right after resume from
suspend, before writing to the stream which would cause it to revive the
stream otherwise. Tested to work with Pulseaudio patched to attempt to
snd_pcm_recover() upon receiving an error from snd_pcm_rewind().
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The new IbexPeak HDMI codec has 3 pin nodes and 2 converter nodes.
Here we assume only the first ones will be used.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Check whether index is within bounds before testing the element.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The commit 24918b61b5 statically changes
the model from dell-bios to dell-3stack to solve the sound decreasing
regression (http://lkml.org/lkml/2008/9/12/203), however it leads to another
problem that the 2nd headphone jack doesn't work
(https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3987). So I think
the commit 249**2dc is just a workaround. I would like to give a true solution
here.
The datasheet for STAC9228 says, GPIO2 is the same pin as VOL DOWN, and
the EAPD pin is GPIO0. This is why the sound decreases if we set EAPD as
GPIO2. This patch changes EAPD to GPIO0 to solve the problem.
Signed-off-by: Chengu Wang <wangchengu@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This converts the last CORBWP access outside of reg_lock.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Just for safety. azx_init_cmd_io() and azx_free_cmd_io() may be
called when switching to single command mode.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Now that each codec will have its own module, it is possible
for the user to load one codec while another one is running.
So cmd_mutex would be a safe addition to probe_codec().
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Recently we hit a bug in our dev board, whose HDMI codec#3 may emit
redundant/spurious responses, which were then taken as responses to
command for another onboard Realtek codec#2, and mess up both codecs.
Extend the azx_rb.cmds and azx_rb.res to array and track each codec's
commands/responses separately. This helps keep good codec safe from
broken ones.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use model=lenovo instead of model=dallas for Toshiba Satellite A135-S4527
with ALC861-VD codec.
Reference: Novell bnc#526325
https://bugzilla.novell.com/show_bug.cgi?id=526325
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds machine support for Amstrad E3 (Delta) videophone to ASoC.
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d as well.
Depends on:
1) latest version of the CX20442 codec driver that exposes v253_ops
structure[1],
2) patch 2/3 form this series: TTY: Add definition of a new line
discipline required by Amstrad E3 (Delta) ASoC driver[2].
CPU DAI parameters best matching the codec DAI has been selected out
empirically for best user experience.
Board specific audio function control (with related DAPM widgets) has been
modeled after empirically discovered codec capabilities.
Unlike other ASoC machine drivers, this one makes use of a codec provided line
discipline that is required for talking to a modem chip that can control the
codec behavoiur. As the line discipline operations must call board specific
bits as well, the machine driver registers its own line discipline ops, not
the codec provided, and then calls those codec provided from inside its own
callbacks.
If some kind of a glue, like a bus over a tty, exsited that could help in
runtime detection of a modem (bus adapter) over a more generic line discipline
(bus driver)[3], the line discipline code could be probably designed in a
more generic way.
In order to work at all, this driver requires a working McBSP1. On OMAP1510
based machines (not sure if other OMAP1 variants as well), where McBSP1 is a
DSP public peripheral, that means the kernel must provide basic DSP support,
ie. omap_dsp_init(), in order to power up the DSP. This used to be included in
linux-omap-2.6 tree up to commit 2512fd29db.
Without that, the driver would not work, ie. not shift in/out any bits over
the CPU DAI[4]. This limitation is not board, but CPU specific, and may apply
to other code that makes use of McBSP1/McBSP3 on affected machines. I provide
an extra patch (4/3) as a temporary solution.
To work correctly in playback mode, this driver requires my prevoiusly
submitted patch that corrects pcm pointer calculation for OMAP1510 based
machines[5] (already included in linux-2.6.31-rc3).
To support codec controls, this driver requires my previously submitted patch
that adds support for modem found on Amstrad Delta[6].
[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2009-July/019780.html
[2] http://www.spinics.net/lists/linux-serial/msg01862.html
[3] http://www.spinics.net/lists/linux-serial/msg01856.html
[4] http://www.spinics.net/lists/linux-omap/msg15114.html
[5] http://mailman.alsa-project.org/pipermail/alsa-devel/2009-June/018950.html
[6] http://www.spinics.net/lists/linux-omap/msg15432.html
Credits to:
Mark Underwood - for his initial, omap-alsa based sound driver for
this machine,
Mark Brown - for his help, patience and excellent subsytem maintainer support.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This corrected patch adds machine independent line discipline code, prevoiusly
exsiting inside my Amstrad Delta ASoC machine dirver, to the Conexant CX20442
codec driver. The code can be used as a standalone line discipline, or as a
set of codec specific functions called from machine's line discipline
callbacks. Anyway, the line discipline itself must be registered by a machine
driver.
Applies on top of the followup to my initial driver version:
http://mailman.alsa-project.org/pipermail/alsa-devel/2009-July/019757.html
Suggested by ASoC manintainer Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The irq can fire as soon as it has been requested, thus all fields accessed
from within the irq handler must be initialized prior to requesting the irq.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
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>
Check that the result of kzalloc is not NULL before a dereference.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@
x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
when != x != NULL
when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The name buf with size 16 is too short for some codec names, e.g.
truncated like "ALC861-VD Analo". Now the size is doubled.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the automatic mute of speakers via line-out jack plugging on
STAC/IDT codecs. The feature is enabled when the HP detect is present.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The patch below, to be applied on the latest sound-unstable-2.6.git,
enables headphones output on my MacBookPro 5,5, together with the
automuting feature.
Here is the exact soundcard id:
Vendor Id: 0x10134206
Subsystem Id: 0x106b4d00
Revision Id: 0x100301
Signed-off-by: Takashi Iwai <tiwai@suse.de>
STAC/IDT codecs provide both "Input Source" and "Digital Input Source"
controls to choose the analog input source and the digital input source.
But this is far user-unfriendly.
This patch merges the input source selections into one "Input Source"
control. To have separate digital and analog input source controls,
you can pass "separate_dmux = 1 " hint string.
At the same time, this patch gets rid of analog mixer stuff that was
already disabled in previous patches.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
It auto mutes all 8-channel outputs at rear panel when
the front panel headphone is connected.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This 2-channel mode is useful in that it will broadcast
a 2-channel audio stream to all front/side/... ports.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
1. fix "line over 80 characters" checkpatch warnings
2. ‘DMA_nnBIT_MASK’ is deprecated, use DMA_BIT_MASK instead
3. fix typos
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
With the s3c platform has implementing gpiolib support the s3c_gpio api has been
deprecated.
This patch gets rid of all s3c_gpio calls and replaces them by using gpiolib.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The analog mix is disabled now as default (unless "analog_mixer" hint
is given), so it shoudn't appear in the digital input source as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the missing initialization of DMUX connection (to analog input)
for auto-mic mode with STAC/IDT codecs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We don't need any more static connection to the port F (which is often
used for docking stations) since its connection is done dynamically via
DAC assignment now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
mpu_synth_info[m].name is a char[30], and the minimum length of the data
written by sprintf is 31 bytes including terminating null.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
DSPVersion is declared as char[3], but the sprintf writes at least 4 bytes
including terminating null.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
e->sad[] is declared with size ELD_MAX_SAD=16, but the guard
allows range 0-31.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Support the automatic mic-switching with some devices with IDT/STAC
codecs. The condition is that the device has only two inputs, one
for an external mic and one for an internal mic.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Since only one event can be associated to a (pin) widget, it's safer
to avoid the multiple mapping. This patch fixes the behavior of the
STAC/IDT codec driver.
Now stac_get_event() doesn't take the type argument but simply returns
the first hit element. Then enable_pin_detect() checks the validity
of the type, and returns non-zero only if a valid entry. The caller
can call stac_issue_unsol_event() after checking the return value.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The I2S DAI driver for blackfin SPORT, but works in TDM mode.
I2S is not a special case of TDM with only left and right two slots for
SPORT interface. I2S coordinates with TDM in SPORT, but not a part of
TDM. TDM require different hardware configuration with I2S, not only
different slot number. One is "Stereo Serial Operation" mode of SPORT,
the other one is "Multichannel Operation" mode. They are incompatible
at the same time.
Hardware and DMA description and data transfer flow are much different
for I2S and TDM. Merging them as a whole will be very ugly and difficult
to maintain.
So we don't define a new DAI type, but give two DAI instances for standard
I2S and TDM, both in I2S-family DAI type. The TDM instance still uses the
I2S-family DAI type.
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The patch fixes some checkpatch identified issues and adds a comment about
line discipline interaction to my driver code, as requested by Mark on my
inital submission (thank you Mark for applying my imperfect patch anyway).
It also fixes MODULE_ALIAS mismatch as used in my machine driver.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The analog mixer unit on IDT 92HD71Bxx codecs is almost useless
since we use only the direct connections from DAC to pin.
Remove the controls to avoid unneeded confusion as default now.
This can be still back via "analog_mixer = 1" hint.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of static snd_kcontrol_new arrays, create "Capture Volume"
and "Capture Switch" controls dynamically based on the mixer attr
values (made via HDA_COMPOSE_AMP_VAL()).
This reduces the code size and gives more flexibility to change
the number of controls later.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The current driver creates always the digital input source mixer
elements for IDT 92HD71x codecs no matter whether digital mics are
present. This patch adds the proper check to avoid the creation of
these controls if unnecessary.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The sentense "Unknown model for xxx, ..." makes people too nervous
and drives them to a direction to a wrong "fix" by giving any
mismatching model option.
Let's rephrase the messages to be more nice and easy (at least that
won't make people suspect conspiracies).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Volume-knob widgets may have connections even if they have no CONN_LIST
cap bit. Allow the query exceptionally in snd_hda_get_connections().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* fix/hda:
ALSA: hda - Fix mute control with some ALC262 models
ALSA: hda - Restore GPIO1 properly at resume with AD1984A
ALSA: hda - Use snprintf() to be safer
The master mute switch is wrongly implemented as checking the pointer
instead of its value, thus it can be never muted. This patch fixes
the issue.
Reference: Novell bnc#404873
https://bugzilla.novell.com/show_bug.cgi?id=404873
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
This patch removes the old method of jack detection from palm27x-asoc
driver and adds jack detection api. It also removes some other (now)
useless stuff from the driver and corrects pin configuration for the
codec.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The patch adds a few small enhancements to the ASoC jack handling, as
suggested by Mark in his comments to my Amstrad Delta driver, and a few fixes
for related bugs found while learning Mark's code and testing results.
Enhancements:
1. Update status of an ASoC jack while associating it with new gpios.
2. Really update DAPM pins while associating them with an ASoC jack.
3. Export ASoC jack gpios over gpiolib sysfs for diagnostic purposes.
Fixes:
1. Apply mask on jack status report before using it, just for case.
2. While updating jack associated DAPM pins, use full resulting jack status,
not the status report passed as an argument.
Created and tested on linux-2.6.31-rc3
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This adds support for Native Instrument's freshly announced Audio2DJ
sound device hardware. Version number bumped to 1.3.19.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The fix 79452f0a28 introduced another
bug due to the missing offset for the overlapped hwptr.
When the hwptr goes back to zero, the delta value has to be corrected
with the buffer size. Otherwise this causes looping sounds.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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>
The MAX9877 needs an address of start register when we write values to
registers through i2c_master_send(), but the code for this was missed in
max9877_write_regs().
If the value of control is 0 in the max9877_set_out_mode(), the value is
not increased to 1, but actually the value to write to the register
should be 1.
And the register bits for out_mode and osc_mode should be cleared before
writing.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.
This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.
The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.
Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.
Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.
[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html
Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d as well.
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Here are the new sound enabling patches for IbexPeak.
Summary of tested features:
- playback
- Front Headphone: OK
- 8 channel audio: Front/Rear/CLFE/Side all OK
- recording
- Front Mic/Rear Mic: both OK
(front/rear/line mics are selectable in the "Input source" alsamixer control)
- Line In: not working
(in 6ch mode, its amp/mute, direction and route all looks fine,
so I'm a little puzzled)
(hopefully no one will care this feature)
- digital SPDIF input/output: not tested (no equipment)
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the logging functionality to xrun_debug to record the hwptr
updates via snd_pcm_update_hw_ptr() and snd_pcm_update_hwptr_interrupt(),
corresponding to 16 and 8, respectively.
For example,
# echo 9 > /proc/asound/card0/pcm0p/xrun_debug
will record the position and other parameters at each period interrupt
together with the normal XRUN debugging.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
PLL was not being enabled when it was not bypassed. This patch
enables the PLL when it is used. Additionally, it disables the PLL
when it is bypassed.
Without this patch, the audio on TI DM646x EVM and DM355 EVM
does not work properly. The bit clocks and the frame sync signals
from the codec are not correct and hence the playback/record are faster
than usual for most sample rates. The reason for this was that the PLL
was not enabled when it was not bypassed.
Tested on DM6467 EVM, playback tested on DM355 EVM.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The commit 099db17e66 introduced a
regression at suspend/resume where the GPIO1 bit isn't properly
restored, thus the speaker output gets muted initially after resume.
The fix is simple, use the cached write for storing GPIO data.
Reference: Novell bnc#522764
https://bugzilla.novell.com/show_bug.cgi?id=522764
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a few uninitialized error checks that were introduced recently
mistakenlly during the clean-up:
sound/pci/ctxfi/ctamixer.c: In function ‘get_amixer_rsc’:
sound/pci/ctxfi/ctamixer.c:261: warning: ‘err’ may be used uninitialized in this function
sound/pci/ctxfi/ctamixer.c: In function ‘get_sum_rsc’:
sound/pci/ctxfi/ctamixer.c:415: warning: ‘err’ may be used uninitialized in this function
sound/pci/ctxfi/ctsrc.c: In function ‘get_srcimp_rsc’:
sound/pci/ctxfi/ctsrc.c:742: warning: ‘err’ may be used uninitialized in this function
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds a check to snd_hda_get_connections() routine for
presence of AC_WCAP_CONN_LIST. Also, make sure that negative error
codes from noted route are handled on all places as errors.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
- E3500 report cval->max more than it actually can handel, so if you
set 95% capture level it will be silently muted.
- Betwen cval->min and cval-max(real) is 2940 control units,
but real are only 7 with cval->res = 384.
- Alsa can't handel less than 10 controls, so make it more
and set cval->res = 192.
Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Previous patch used widget type, but the presence flag of the connection
list is in the widget capabilities.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reading node connections for an unknown widget can confuse HDA codec bus.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the logic of ALC861 auto-mode parser for the outputs.
Instead of assuming the fixed DAC list, parse the conection and assign
the DAC dynamically.
Also, unmute the unused output connections to avoid noises on inputs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
VMware tends to report PCM positions and period updates at utterly
wrong timing. This screws up the recent PCM core code that tries
to correct the position based on the irq timing.
Now, when a backward irq position is detected, skip the update
instead of rebasing. (This is almost the old behavior before
2.6.30.)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add some tricks to reduce the click noise at powering down to D3
in the power saving mode on STAC/IDT codecs.
The key seems to be to reset PINs before the power-down, and some
delay before entering D3. The needed delay is significantly long,
but I don't know why.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The callback function to control register was used by whole controls in
MAX9877 driver, but this causes using many if statement for double
register control or invert.
So, the callback function for double register control is separate
differently, and the code for invert is added in the callback function.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This corrects a bug with ADC Inversion Switch in wm8974 codec.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reset was failing with the original udelay(50) between the code in
psc_ac97_cold_reset() and the call to psc_ac97_warm_reset(). Through testing
it was found that a delay of 1ms was necessary for the cold_reset code to
consistently complete successfully.
Signed-off-by: John Bonesio <bones@secretlab.ca>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* fix/misc:
ALSA: ca0106 - Fix the max capture buffer size
ALSA: OSS sequencer should be initialized after snd_seq_system_client_init
ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
* fix/hda:
ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
ALSA: hda - Add quirk for Gateway T6834c laptop
ALSA: hda_codec: Check for invalid zero connections
On Soundblaster X-FI Titanium with emu20k2 the SIDE and SURROUND
channels were swapped and wrong.
I double checked it with connector colors and creative soundblaster
windows drivers.
So I swapped them to the true order.
Now "speaker-test -c6" and "speaker-test -c8" are working fine.
Signed-off-by: Frank Roth <frashman@freenet.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The capture buffer size with 64kB seems broken with CA0106.
At least, either the update timing or the DMA position is wrong,
and this screws up pulseaudio badly.
This patch restricts the max buffer size less than that to make life
a bit easier.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
The recent rewrite of the codec parser for STAC9872 caused a regression
for some Sony VAIO models that don't give proper pin default configs
by BIOS. Even using model=vaio doesn't work because the pin definitions
are set after the pin overrides.
This patch fixes the pin definitions in patch_stac9872() to be put
in the right place before the pin overrides. Also the patch adds the
new quirk entry for VAIO F/S to have the correct pin default configs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
Added the native timer support for emu20k2, which gives much more
accurate update timing than the system timer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Gateway T6834c laptops need EAPD always on while the default behavior
for the STAC9205 reference board is to turn it off upon every HP plug.
By using the special "eapd" model, which is first introduced for Gateway
T1616 laptops for this same reason, this peculiarity can be properly
handled.
Signed-off-by: Hao Song <baritono.tux@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If spin_lock_irqsave is called twice in a row with the same second
argument, the interrupt state at the point of the second call overwrites
the value saved by the first call. Indeed, the second call does not need
to save the interrupt state, so it is changed to a simple spin_lock.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
expression lock1,lock2;
expression flags;
@@
*spin_lock_irqsave(lock1,flags)
... when != flags
*spin_lock_irqsave(lock2,flags)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
To prevent "Too many connections" message and the error path for some HDMI
codecs (which makes onboard audio unusable), check for invalid zero
connections for CONNECT_LIST verb.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
GCC 4.4.0 doesn't appear to be able to spot that we don't apply any FLL
configuration if the output frequency is zero.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
- Parse the mono output pin 0x16 correctly even as the primary output
- Create "Speaker" volume control if the primary output is a speaker
- Fix the wrong direction of (optional) "Mono" switch
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The newly added sanity-check for a codec verb can be better written
with logical ORs. Also, the parameter can be more than 8bit.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Board sdp3430 has hardware support for EXTMUTE using TWL4030 GPIO6
line, controlled by register INTBR_PMBR1. Machine driver takes care
of enabling gpio line through i2c and codec driver manipulates the
line during headset ramp up/down sequence.
Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
A recent bug involves passing auto detected >0x7f NID to codec command,
creating an invalid codec addr field, and finally lead to cmd timeout
and fall back into single command mode. Jaroslav fixed that bug in
alc880_parse_auto_config().
It would be safer to further check the bounds of all cmd fields.
Cc: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add support for new AMD HD audio devices. Use generic driver to detect HD audio
devices with Vendor ID AMD.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This adds support for the Conexant CX20582 codec, based on code from
http://www.linuxant.com/alsa-driver/alsa-driver-linuxant-1.0.19ppch12-1.noarch.rpm.zip
This is the codec to be shipped in the OLPC XO-1.5, so this patch also
includes an XO-specific profile. Resultant configuration:
http://dev.laptop.org/~dsd/20090713/codec0.txthttp://dev.laptop.org/~dsd/20090713/codec0.svg
As the Linuxant code is structured differently to the other codecs,
I was unable to cleanly reimplement everything in the generic and Dell
profiles as more info is needed (e.g. codec graphs). I simplified those
profiles so that hopefully it will not break anyone's audio. If it does,
it may be worth returning -ENODEV from patch_cx5066 on non-OLPC systems,
and then fixing snd_hda_codec_configure() to fall back on the generic
parser, at least until support for other systems is figured out.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
clock name strings are no longer passed on platform_data. Instead,
we rely entirely on struct device and clkdev to find the right clock.
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The MAX9877 combines a high-efficiency Class D audio power amplifier
with a stereo Class AB capacitor-less DirectDrive headphone amplifier.
The max9877_add_controls() is called to register the MAX9877 specific
controls on machine specific init() of the machine driver.
The datasheet for the MAX9877 can find at the following url:
http://datasheets.maxim-ic.com/en/ds/MAX9877.pdf
[Slight edit to sort the ALL_CODECS entries -- broonie.]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
We need to check returning error for pci_register_driver(&joystick_driver)
On failure, we should unregister formerly registered audio drivers
This also fixed the compiler warning :
CC [M] sound/pci/riptide/riptide.o
sound/pci/riptide/riptide.c: In function ‘alsa_card_riptide_init’:
sound/pci/riptide/riptide.c:2200: warning: ignoring return value of ‘__pci_register_driver’, declared with attribute warn_unused_result
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Due to the flexibility of the WM9081 FLL this should never happen
in a real system.
Reported-by: Jaswinder Singh Rajput <jaswinder@kernel.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
- fix my previous codec activity breakage (_non-warned_ variable assignment
issue)
- convert suspend/resume to 32bit I/O access (I/O is painful; to improve
suspend/resume performance)
- change DEBUG_PLAY_REC to DEBUG_CODEC for consistency
- printk cleanup
- some logging improvements
- minor cleanup/improvements
The variable assignment issue above was a conditional assignment to the
call_function variable (this ended with the non-preinitialized variable
not getting assigned in some cases, thus a dangling stack value, yet gcc 4.3.3
unbelievably did _NOT_ warn about it in this case!!),
needed to change this into _always_ assigning the check result.
Practical result of this bug was that when shutting down
_either_ playback or capture, _both_ streams dropped dead :P
Tested, working (plus resume) and checkpatch.pl:ed on 2.6.30-rc5,
applies cleanly to 2.6.30 proper with my previous (committed)
patches applied.
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Sending an Active Sensing message when closing a port can interfere with
the following data if the port is reopened and a note-on is sent before
the device's timeout has elapsed. Therefore, it is better to disable
this setting by default.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of using magic numbers for the controlles sent when resetting
a port, use the symbols from asoundef.h.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Sending a MIDI reset message when closing a port is wrong because we
only want to shut the device up, not to reset all settings.
Furthermore, many devices ignore this message.
Fortunately, the RawMIDI layer already shuts the device up, so we can
ignore this matter here.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When draining, instead of waiting for fifty milliseconds, just wait for
the currently active URBs to complete. This cuts the usual waiting time
down to one USB frame, or zero in the common case when there is no URB.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Some newer USB MIDI interfaces use rather small packet sizes, so to get
enough bandwidth, we have to be able to send multiple packets in one USB
frame, so we have to use multiple URBs.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Some newer USB MIDI interfaces use rather small packet sizes, so to get
enough bandwidth, we have to be able to receive multiple packets in one
USB frame, so we have to use multiple URBs.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
It turns out that the main cause of output buffer overruns is not slow
drivers but applications that generate too many messages. Therefore, it
makes more sense to make that error message always visible, and to
rate-limit it.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add support for the Asus Xonar U1. This device is mostly class compliant, but
the digital output requires a vendor-specific request.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Blue Microphones USB devices have an alternate setting that sends two
channels of data to the computer. Unfortunately, the descriptors of
that altsetting have a wrong channel setting, which means that any
recorded data from such a device has twice the sample rate from what
would be expected.
This patch adds a workaround to ignore that altsetting. Since these
devices have only one actual channel, no data is lost.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We need to use the best value we picked, not the last value we
looked at.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
There is no need to manually start playback/capture ourselves as the PCM
driver will handle things for us.
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
There is no need to manually start playback/capture ourselves as the PCM
driver will handle things for us.
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Without MODULE_LICENCE("GPL"), when built as a module it will fail
to load because it uses other GPL symbols from kernel.
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
In SOC DAPM layer of SOUND subsystem, when add signal route (in the
function snd_soc_dapm_add_route() ), the original code has wrong logic
when dapm layer check each widget whether an external one.
Signed-off-by: Rongrong Cao <rrcao@ambarella.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This is the last in-kernel direct usage of driver_data, replace it with
the proper dev_get/set_drvdata() calls.
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The codec read errors in snd_hda_get_connections() are ignored so far,
and it causes a problem like the bug in the commit
9d30937acc
ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
Better to check errors in the function and returns a proper error code
rather than passing bogus NID values.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
On some IbexPeak systems with ALC889A errors like "azx_get_response
timeout, switching to polling mode: last cmd=0xaf9f000b" are produced,
because non-existent codec #10 is wrongly accessed.
The problem is that snd_hda_get_connections() returns out-of-range result
for NID 0x1c (something like 0xf8f9 or 0xffff).
This patch adds a check to alc880_parse_auto_config() to avoid using
of this out-of-range NIDs. A better fix maybe to improve
snd_hda_get_connections() routine to check for valid NID ranges if
NIDs are expected as result.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the merge error at the commit 305355aad8,
an addition of the missing alc880_gpio3_init_verbs to ALC882_TARGA model.
Signed-off-by: Takashi Iwai <tiwai@suse.de>