Archived
14
0
Fork 0
Commit graph

6158 commits

Author SHA1 Message Date
Takashi Iwai
a3f730af7e ALSA: hda - Fix MacBookPro 3,1/4,1 quirk with ALC889A
This patch fixes the wrong headphone output routing for MacBookPro 3,1/4,1
quirk with ALC889A codec, which caused the silent headphone output.
Also, this gives the individual Headphone and Speaker volume controls.

Reference: kernel bug#14078
	http://bugzilla.kernel.org/show_bug.cgi?id=14078

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
2009-08-31 08:23:13 +02:00
Takashi Iwai
0f67a61162 ALSA: hda - Add missing mux check for VT1708
In patch_vt1708(), the check of MUX nids is missing and this results in
the -EINVAL error in accessing Input Source mixer element.  Simpliy
adding the call of get_mux_nids() fixes the problem.

Reference: Novell bnc#534904
	https://bugzilla.novell.com/show_bug.cgi?id=534904

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-31 08:12:29 +02:00
Takashi Iwai
96f845de89 ALSA: hda - Create "Digital Mic Capture Volume" correctly for IDT codecs
So far, the digital mic capture volume wasn't created.  This is because
IDT codecs have output amps for digital mics, not input amps, while
input amps should be used for other analog pins.  Thus the automatic
capture volume creation should check both directions for digital mics.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-29 00:49:36 +02:00
Jarkko Nikula
d2c0bdaa93 ASoC: OMAP: Add functionality to set CLKR and FSR sources in McBSP DAI
The McBSP1 port in OMAP3 processors (I believe OMAP2 too but I don't have
specifications to check it) have additional CLKR and FSR pins for McBSP1
receiver. Reset default is that receiver is using bit clock and frame
sync signal from those pins but it is possible to configure to use
also CLKX and FSX pins as well. In fact, other McBSP ports are doing that
internally that transmitter and receiver share the CLKX and FSX.

Add functionaly that machine drivers can set the CLKR and FSR sources by
using the snd_soc_dai_set_sysclk.

Thanks to "Aggarwal, Anuj" <anuj.aggarwal@ti.com> for reporting the issue.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-28 18:36:43 +01:00
Chaithrika U S
f4890b5c04 ASoC: davinci: i2c device creation moved into board files
Also, the codec setup data structure has to remain for successful
probe.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-28 10:33:10 +01:00
Takashi Iwai
36ce99c1dc ALSA: Add debug module option
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>
2009-08-27 17:42:08 +02:00
Takashi Iwai
286f5875ca ALSA: hda - Add more quirk for HP laptops with AD1984A
More entries for HP laptops to get them working properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-27 14:37:51 +02:00
Takashi Iwai
1b0053a0f0 ALSA: core - strip too long file names in snd_print*()
When modules are built with M= option, they pass long file paths to
__FILE__.  This results in ugly outputs of snd_print*() when
CONFIG_SND_VERBOSE_PRINTK is set.

This patch adds a check of the path and strips the leading path dirs
if the file name is an absolute path to improve the readability of logs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-27 12:39:35 +02:00
Mark Brown
f1e887de2d ASoC: Don't reconfigure WM8350 FLL if not needed
If the requested FLL configuration is the one we're currently running
in it's at best pointless to reconfigure the FLL.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-26 15:27:57 +01:00
Mark Brown
5dc0748182 ASoC: Fix s3c-i2s-v2 build
We now need the PCM header to kick the DMA.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-26 15:27:57 +01:00
Mark Brown
977d49e00d ASoC: Make platform data optional for TLV320AIC3x
Now that we don't need the I2C address for the device the platform data
is redundant so allow it to be omitted.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Chaithrika U S <chaithrika@ti.com>
2009-08-26 15:27:56 +01:00
Mark Brown
bc36681fdc ASoC: Add S3C24xx dependencies for Simtec machines
No point in building them for S3C64xx, certainly no sense in running
into build issues there.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-26 15:27:56 +01:00
Roel Kluin
f1d269bac2 sound: vwsnd: Fix setting of cfgval and ctlval in li_setup_dma()
Since !LI_CCFG_* evaluates to 0, this did not change anything to
cfgval and ctlval.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-26 12:42:43 +02:00
Sudhakar Rajashekhara
60902a2cb1 davinci: EDMA: multiple CCs, channel mapping and API changes
- restructure to support multiple channel controllers by using
  additional struct resources for each CC

- interface changes visible to EDMA clients

  Introduce macros to build IDs from controller and channel number,
  and to extract them. Modify the edma_alloc_slot function to take an
  extra argument for the controller.

  Also update ASoC drivers to use API.  ASoC changes
  Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

- Move queue related mappings to dm<soc>.c

  EDMA in DM355 and DM644x has two transfer controllers while DM646x
  has four transfer controllers. Moving the queue to tc mapping and
  queue priority mapping to dm<soc>.c will be helpful to probe these
  mappings from platform device so that the machine_is_* testing will
  be avoided.

- add channel mapping logic

  Channel mapping logic is introduced in dm646x EDMA. This implies
  that there is no fixed association for a channel number to a
  parameter entry number. In other words, using the DMA channel
  mapping registers (DCHMAPn), a PaRAM entry can be mapped to any
  channel. While in the case of dm644x and dm355 there is a fixed
  mapping between the EDMA channel and Param entry number.

Signed-off-by: Naresh Medisetty <naresh@ti.com>
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Reviewed-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-08-26 10:56:56 +03:00
Candelaria Villareal, Jorge
30cd0c4ad5 ASoC: SDP3430: Fix TWL GPIO6 pin mux request
Fix the write to PMBR1 register through I2C. Also, the constant which
holds the value to write is now called TWL4030_GPIO6_PWM0_MUTE. This
name is based on TRM to avoid confusion.

Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-25 19:30:32 +01:00
Linus Torvalds
a206e9417f Merge branch 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  sound: pcm_lib: fix unsorted list constraint handling
  sound: vx222: fix input level control range check
  ALSA: ali5451: fix timeout handling in snd_ali_{codecs,timer}_ready()
2009-08-25 09:47:06 -07:00
Denis Kuplyakov
fc86f95415 ALSA: hda - Add full audio support on Acer Aspire 7730G notebook
1) Added support of internal subwoofer (it sounds!!!)
2) Auto muting front speakers and internal subwoofer on headphones plug.
3) Internal mic works.
4) 3 channel mods (jack maps):
       black  pink         blue
2ch: front   ext mic     line in
4ch: front   ext mic     surround
6ch: front   CLFE        surround
  Can be changed in mixer.
5) Sound can be recorded from:
 Internal mic
 Ext mic
 Cd
 Line in
6) 2 separate capture channels.

Signed-off-by: Denis Kuplyakov <dener.kup@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 18:16:55 +02:00
Takashi Iwai
0d884cb936 ALSA: hda - Improve auto-cfg mixer name for ALC662
The last patch in this series is for ALC662; pretty similar as the
previous patch for ALC861-VD.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 16:14:35 +02:00
Takashi Iwai
a4fcd49109 ALSA: hda - Improve auto-cfg mixer name for ALC861-VD
One more patch to give a better name for the primary output controls,
this time for ALC861-VD codec.  The change is simple, just checking the
pin connection whether it's a speaker-out.  When both speaker and HP
are assigned, we name the volume as "PCM" as this influences on both
outputs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 16:12:15 +02:00
Takashi Iwai
c3fc1f502a ALSA: hda - Improve auto-cfg mixer name for ALC262
Similar improvements for ALC262 codec like previous two commits:
assign a better name, either Master or Speaker, for the primary output
controls.

However, in the case of ALC262 codec, the necessary changes are larger
than others because we need to check the possibility of different mixer
amps depending on the pins.  The pin 0x16 is mono, and bound with the
dedicated mixer 0x0e while other pins are bound with 0x0c.  Thus, there
are two possible volumes.

When only one of them is used, we can name it as "Master".  OTOH, when
both are used at the same time, they have to be named uniquely.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 16:08:47 +02:00
Takashi Iwai
23112d6d2d ALSA: hda - Improve auto-cfg mixer name for ALC260
Instead of fixed "Front" mixer name, try to assign a better name, e.g.
"Master" or "Speaker" fot the primary output volume controls of ALC260
codec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 16:07:08 +02:00
Takashi Iwai
cb162b6bf2 ALSA: hda - Improve auto-cfg mixer name for ALC880
When there is only one DAC is used for ALC880, try to assign a better
name, either Speaker or Front, depending on the output pin type.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 16:05:03 +02:00
Shine Liu
faf907c7ba ASoC: S3C platform: Fix s3c2410_dma_started() called at improper time
s3c24xx dma has the auto reload feature, when the the trnasfer is done,
CURR_TC(DSTAT[19:0], current value of transfer count) reaches 0, and DMA
ACK becomes 1, and then, TC(DCON[19:0]) will be loaded into CURR_TC. So
the transmission is repeated.

IRQ is issued while auto reload occurs. We change the DISRC and
DCON[19:0] in the ISR, but at this time, the auto reload has been
performed already. The first block is being re-transmitted by the DMA.

So we need rewrite the DISRC and DCON[19:0] for the next block
immediatly after the this block has been started to be transported.

The function s3c2410_dma_started() is for this perpose, which is called
in the form of "s3c2410_dma_ctrl(prtd->params->channel,
S3C2410_DMAOP_STARTED);" in s3c24xx_pcm_trigger().

But it is not correct. DMA transmission won't start until DMA REQ signal
arrived, it is the time s3c24xx_snd_txctrl(1) or s3c24xx_snd_rxctrl(1)
is called in s3c24xx_i2s_trigger().

In the current framework, s3c24xx_pcm_trigger() is always called before
s3c24xx_pcm_trigger(). So the s3c2410_dma_started() should be called in
s3c24xx_pcm_trigger() after s3c24xx_snd_txctrl(1) or
s3c24xx_snd_rxctrl(1) is called in this function.

However, s3c2410_dma_started() is dma related, to call this function we
should provide the channel number, which is given by
substream->runtime->private_data->params->channel. The private_data
points to a struct s3c24xx_runtime_data object, which is define in
s3c24xx_pcm.c, so s3c2410_dma_started() can't be called in s3c24xx_i2s.c

Fix this by moving the call to signal the DMA started to the DAI
drivers.

Signed-off-by: Shine Liu <liuxian@redflag-linux.com>
Signed-off-by: Shine Liu <shinel@foxmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-25 13:09:05 +01:00
Takashi Iwai
05f5f47708 ALSA: hda - Generalize input pin parsing in patch_realtek.c
Provide a standard parser for input pins to create the input mixer
and input source controls instead of having a difference one for each
Realtek codec.  The new helper parses the codec connections dynamically
isntead of fixed indicies.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 13:10:18 +02:00
Jarkko Nikula
d09a2afc93 ARM: OMAP: McBSP: Merge two functions into omap_mcbsp_start/_stop
Functionality of functions omap_mcbsp_xmit_enable and omap_mcbsp_recv_enable
can be merged into omap_mcbsp_start and omap_mcbsp_stop since API of
those omap_mcbsp_start and omap_mcbsp_stop was changed recently allowing
to start and stop individually the transmitter and receiver.

This cleans up the code in arch/arm/plat-omap/mcbsp.c and in
sound/soc/omap/omap-mcbsp.c which was the only user for those removed
functions.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-25 10:20:48 +01:00
Jarkko Nikula
32080af7a6 ASoC: OMAP: Fix setup of XCCR and RCCR registers in McBSP DAI
Commit ca6e2ce086 is setting up few XCCR and
RCCR bits for I2S and DPS_A formats. Part of the bits are already set
for all formats and I believe that XDISABLE and RDISABLE bits are
format independent.

As XCCR and RCCR are found only from OMAP2430 and OMAP34xx, I move setup
of XDISABLE and RDISABLE to where those cpu's are tested and remove format
dependent part for simplicity.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-25 10:20:48 +01:00
Clemens Ladisch
b1ddaf681e sound: pcm_lib: fix unsorted list constraint handling
snd_interval_list() expected a sorted list but did not document this, so
there are drivers that give it an unsorted list.  To fix this, change
the algorithm to work with any list.

This fixes the "Slave PCM not usable" error with USB devices that have
multiple alternate settings with sample rates in decreasing order, such
as the Philips Askey VC010 WebCam.

http://bugzilla.kernel.org/show_bug.cgi?id=14028

Reported-and-tested-by: Andrzej <adkadk@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-25 08:52:34 +02:00
Mark Brown
e4aa8dd5ca Merge branch 'topic/digital-mixing' into for-2.6.32 2009-08-24 20:44:41 +01:00
Mark Brown
239a22aaa9 ASoC: Select core DMA when building for S3C64xx
Ensure that the core DMA support is available when building for
S3C64xx.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-24 20:42:48 +01:00
Takashi Iwai
9d0b71b1cf ALSA: hda - Reuse ALC268 parser for ALC269
Reuse a part of the code of ALC268 parser for ALC269.
This will change the default output volume either to Front or Speaker
depending on the pin configuration.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-24 14:10:30 +02:00
Clemens Ladisch
edd1365e90 sound: vx222: fix input level control range check
Fix a logic error in the range check of the input level control that
would prevent setting any volume less than the maximum.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-24 09:46:08 +02:00
Wu Fengguang
fd72d00846 ALSA: hda: move open coded tricks into get_wcaps_channels()
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-24 09:42:48 +02:00
Takashi Iwai
c6ea2af76a ASoC: Remove unneeded inclusion of linux/regulator/consumer.h
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-24 09:41:32 +02:00
Takashi Iwai
20496ff378 ASoC: add missing inclusion of debugfs.h
To fix compile errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-24 09:41:05 +02:00
Marek Vasut
e2365bf313 ASoC: Pass correct platform data from pxa2xx-ac97
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-23 18:18:01 +01:00
Bartlomiej Zolnierkiewicz
848bffef28 ALSA: ali5451: remove dead code
Remove code covered by #if/endif 0 and #ifdef/endif CODEC_RESET
(CODEC_RESET is never defined).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-23 18:59:14 +02:00
Bartlomiej Zolnierkiewicz
70bdbd3d1a ALSA: ali5451: fix timeout handling in snd_ali_{codecs,timer}_ready()
Modify loops in such way that the register value is checked also after
the timeout condition, just in case the heavy interrupt load etc. caused
the thread to sleep for the time period exceeding the timeout value.

While at it remove an extra ALI_STIMER read from snd_ali_stimer_ready().

Reported-by: Jack Byer <ojbyer@usa.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-23 18:58:07 +02:00
Roel Kluin
821ebc86ef ASoC: free socdev if init_card() fails in wm9705_soc_probe()
Free socdev if snd_soc_init_card() fails.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-23 10:41:06 +01:00
Mark Brown
79fb9387f8 ASoC: Add DAPM widget power decision debugfs files
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>
2009-08-21 17:17:59 +01:00
Kuninori Morimoto
b8e583f601 ASoC: Add FSI-AK4642 sound support for SuperH
This patch is tested by ms7724se

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-21 11:02:03 +01:00
Kuninori Morimoto
a3a83d9a7c ASoC: Add ak4642/ak4643 codec support
This is very simple driver for ALSA
It supprt headphone output and stereo input only
This patch is tested by ms7724se

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-21 10:54:02 +01:00
Ben Dooks
b2ec22e263 ASoC: S3C24XX: Support for Simtec Hermes boards
Add support for the tlv320aic3x CODEC on the Simtec Hermes board.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-21 10:53:06 +01:00
Ben Dooks
aa6b904e66 ASoC: tlv320aic3x: fixup board device changes
Fixup the device changes by modifying the files that we just removed the
explicit device creation from with i2c_register_board_info() until this
can be moved into the relevant board files.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-21 10:52:57 +01:00
Ben Dooks
cb3826f524 ASoC: tlv320aic3x: Change to use device model
The tlv320aic3x driver managed its own i2c device, instead of an extant
one created by the board support code. Change the code to make it so that
the driver binds to an extant (in this case i2c) device.

Add explict tlv320aic33 as well as tlv320aic3x to the supported device
table and remove the old driver bindings from the users of this code.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-21 10:52:49 +01:00
Ben Dooks
14412acde5 ASoC: S3C24XX: Add audio core and tlv320aic23 for Simtec boards
Add core support for the range of S3C24XX Simtec boards with TLV320AIC23
CODECs on them. Since there are also boards with similar IIS routing the
AMP and the configuration code is placed in a core file for re-use with
other CODEC bindings.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-21 10:52:42 +01:00
Eduardo Valentin
a0a499c579 ASoC: OMAP: Use DMA operating mode of McBSP
Configures DMA sync mode depending on McBSP operating mode value.
The value is configurable by McBSP instance. So, depending
on McBSP operating mode, the DMA sync mode is passed from
omap-mcbsp to omap-pcm. Besides that, it also configures
McBSP threshold value depending on which McBSP mode is activated.

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>
2009-08-20 20:10:29 +01:00
Eduardo Valentin
caebc0cb3b ASoC: OMAP: Use McBSP threshold to playback and capture
This patch changes the way DMA is done in omap-pcm.c
in order to reduce power consumption. There is no need
to have so much SW control in order to have DMA in idle
state during audio streaming. Configuring McBSP threshold value
and DMA to FRAME_SYNC are sufficient.

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>
2009-08-20 20:10:29 +01:00
Eero Nurkkala
ca6e2ce086 ASoC: Always syncronize audio transfers on frames
All these steps are required for ASoC to behave correctly.
rccr and xccr are format dependent, for example TDM audio
has different values than I2S or DSP_A. Also the
omap_mcbsp_xmit_enable and/or omap_mcbsp_recv_enable must
be called right after the DMA has started.
This provides no longer L and R channels switching at random.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:29 +01:00
Eero Nurkkala
c721bbdad7 ASoC: Add runtime check for RFIG and XFIG
This is, no RFIG or XFIG (Not defined in 34xx), correct
initiliazation of rccr and xccr.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:28 +01:00
Eduardo Valentin
a152ff24b9 ASoC: OMAP: Make DMA 64 aligned
Align DMA address to DMA burst transaction sizes.

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>
2009-08-20 20:10:28 +01:00
Eduardo Valentin
9599d485cb ASoC: OMAP: Enable DMA burst mode
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>
2009-08-20 20:10:28 +01:00
Kuninori Morimoto
a4d7d550a9 ASoC: Add SuperH FSI driver support for ALSA
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>
2009-08-20 20:01:42 +01:00
Shine Liu
f61c890ec6 ASoC: S3C24XX : Align the peroid size to the buffer size
> 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>
2009-08-20 19:42:40 +01:00
Linus Torvalds
a1d1251115 Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Fix probe of Toshiba laptops with ALC268 codec
  ALSA: hda: add model for Intel DG45ID/DG45FC boards
  ALSA: hda: enable speaker output for Compaq 6530s/6531s
2009-08-20 10:19:39 -07:00
Takashi Iwai
4cdc115fd3 ALSA: pcm - Fix drain behavior in non-blocking mode
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>
2009-08-20 16:40:16 +02:00
Mark Brown
f8bae4caaa ALSA: Restore support for DMAless DAIs on PXA
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>
2009-08-19 20:30:14 +01:00
Takashi Iwai
454e134d0e Merge branch 'fix/hda' into topic/hda 2009-08-19 20:10:24 +02:00
Takashi Iwai
3abf2f3639 ALSA: hda - Fix probe of Toshiba laptops with ALC268 codec
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>
2009-08-19 20:05:02 +02:00
Mark Brown
474e09ca01 ASoC: Provide default set_bias_level() implementation
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>
2009-08-19 14:18:53 +01:00
Takashi Iwai
1c11ce8118 Merge branch 'fix/hda' into topic/hda 2009-08-19 12:11:06 +02:00
Wu Fengguang
ae709440ed ALSA: hda: add model for Intel DG45ID/DG45FC boards
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>
2009-08-19 12:10:25 +02:00
Wu Fengguang
150fe14c1a ALSA: hda: enable speaker output for Compaq 6530s/6531s
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>
2009-08-19 12:07:27 +02:00
Takashi Iwai
fdbc66266c ALSA: hda - Fix invalid capture mixers with some ALC268 models
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>
2009-08-19 00:22:17 +02:00
Mark Brown
59ae07a580 ASoC: WM8993 digital mixing support
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>
2009-08-18 16:06:13 +01:00
Mark Brown
010ff26226 ASoC: Add input and output AIF widgets
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>
2009-08-18 16:06:08 +01:00
Mark Brown
d1a5e44b89 ASoC: Remove duplicate ADC/DAC widgets from wm_hubs.c
These need to be in the CODEC since the DAIs supported by the CODECs
aren't static.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-18 16:04:24 +01:00
Mark Brown
b2472b1d4c ASoC: Reenable S3C64xx I2S support
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>
2009-08-18 16:02:59 +01:00
Joonyoung Shim
0914b93f4f ASoC: Fix data format configuration for S3C64XX IISv2
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>
2009-08-18 16:02:36 +01:00
Mark Brown
d3c9e9a139 ASoC: Implement TDM configuration for WM8993
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>
2009-08-17 18:53:50 +01:00
Mark Brown
0182dcc52c ASoC: Fix WM8993 MCLK configuration for high frequency MCLKs
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>
2009-08-17 18:53:44 +01:00
Russell King
29c08460d4 Merge branch 'next-s3c' of git://aeryn.fluff.org.uk/bjdooks/linux into devel-stable 2009-08-17 18:16:28 +01:00
Mark Brown
1ca04065c3 ASoC: Power speakers and headphones simultaneously
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>
2009-08-17 16:26:59 +01:00
Mark Brown
b14b76a56e ASoC: Fix handling of bias levels for non-DAPM codecs
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>
2009-08-17 12:57:59 +01:00
Shine Liu
0c093fb542 ASoC: UDA134X: Fix mistaken mute/unmute code
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>
2009-08-17 12:56:57 +01:00
Clemens Ladisch
18dd0aa5af sound: snd_ctl_remove_user_ctl: prevent removal of kernel controls
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>
2009-08-17 12:48:21 +02:00
Clemens Ladisch
f217ac59b6 sound: snd_ctl_remove_unlocked_id: simplify user control counting
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>
2009-08-17 12:48:15 +02:00
Clemens Ladisch
317b80817f sound: snd_ctl_remove_unlocked_id: simplify error paths
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>
2009-08-17 12:48:06 +02:00
Clemens Ladisch
2a031aedf7 sound: snd_ctl_elem_add: fix value count check
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>
2009-08-17 12:48:00 +02:00
Janusz Krzysztofik
471e3dec3a ASoC: OMAP: Enhance OMAP1510 DMA progress software counter
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>
2009-08-17 11:00:34 +01:00
Janusz Krzysztofik
64844a6ac8 ASoC: OMAP: Make use of DMA channel self linking on OMAP1510
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>
2009-08-17 10:59:59 +01:00
Mark Brown
1e97f50b70 ASoC: Factor out cache I/O from WM8974
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-15 12:15:10 +01:00
Mark Brown
37cfa1950e Merge branch 'wm8974-upstream' into for-2.6.32 2009-08-15 11:52:43 +01:00
Mark Brown
29e02cb3ff ASoC: Hook i.MX into build
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-15 11:37:30 +01:00
Mark Brown
d555a552ae ASoC: Staticise unexported variables
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-15 11:36:49 +01:00
Mark Brown
a2d512a978 ASoC: Remove unneeded i.MX dependency on SND
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-15 11:36:20 +01:00
Mark Brown
08229de4b4 Merge branch 'for-2.6.32' into mxc
Conflicts:
	sound/soc/Makefile
2009-08-15 11:20:44 +01:00
Takashi Iwai
7570ef1834 ALSA: hda - Add missing num_adc_nids definition for IDT92HD8xxx
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>
2009-08-15 11:57:53 +02:00
Barry Song
2a708137fd ASoC: delete -spi suffix in ad1938 and free private data while registers fail
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-14 17:53:02 +01:00
Peter Ujfalusi
9028935d75 ASoC: TWL4030: Fix for capture mixer strings
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>
2009-08-14 17:52:59 +01:00
Mark Brown
d91e9a7ab9 ARM: S3C24XX: Add platform device for AC97 controller
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>
2009-08-14 01:13:29 +01:00
Marek Vasut
4ac0478f2a ALSA: Allow passing platform_data for pxa2xx-ac97
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>
2009-08-13 22:19:37 +01:00
Chaithrika U S
30230f4cd7 ASoC: DaVinci: Add audio support fot DA850/OMAP-L138 EVM
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>
2009-08-13 22:19:36 +01:00
Chaithrika U S
517ee6cf69 ASoC: DaVinci: Add a DAI format to McASP driver
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>
2009-08-13 22:19:35 +01:00
Chaithrika U S
6a99fb5fb8 ASoC: DaVinci: McASP driver enhacements
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>
2009-08-13 22:19:35 +01:00
Mark Brown
a2342ae325 ASoC: Factor out shared code from WM8993
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>
2009-08-13 22:19:31 +01:00
Takashi Iwai
667067d898 ALSA: hda - Fix / clean up IDT92HD83xxx codec parser
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>
2009-08-13 18:14:42 +02:00
Takashi Iwai
a6cd7a71fd Merge branch 'topic/hda-dmic-fix' into topic/hda 2009-08-13 18:14:02 +02:00
Mark Brown
e9ade7f933 ASoC: Minor cleanups to AD1938 driver
- Build in SND_SOC_ALL_CODECS.
- Remove null suspend/resume stuff.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-13 15:19:42 +01:00
Barry Song
7eaae41ea5 new ad1836 codec driver based on asoc
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>
2009-08-13 15:18:53 +01:00
Peter Ujfalusi
9008adf9a9 ASoC: TWL4030: Introduce PGAs for outputs
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>
2009-08-13 14:56:13 +01:00
Barry Song
c4ff357ada ASoC: add output/input widgets in ad1938 to make dac/adc dynamic PM work
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>
2009-08-13 10:47:22 +01:00
Takashi Iwai
1c4bdf9be0 ALSA: hda - Enable line-out detection only with speakers
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>
2009-08-13 08:27:38 +02:00
Tim Blechmann
c18bc9b927 ALSA: hdsp - allow proc reporting with disconnected io box
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>
2009-08-12 18:21:30 +02:00
Mark Brown
d2a382143b ASoC: Update AD1938 for new TDM slot API
It's only actually paying attention to the slot count anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-12 14:30:33 +01:00
Takashi Iwai
8884be98bc Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - Don't override ADC definitions for ALC codecs
  ALSA: hda - Add missing vmaster initialization for ALC269
2009-08-12 08:05:20 +02:00
Takashi Iwai
909a2607a5 Merge branch 'fix/asoc' into for-linus
* fix/asoc:
  ASoC: Add missing DRV_NAME definitions for fsl/* drivers
2009-08-12 08:05:19 +02:00
Herton Ronaldo Krzesinski
5908589f31 ALSA: hda - fix noise issue when recording from digital mic with alc268
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>
2009-08-12 07:35:02 +02:00
Takashi Iwai
4f5d170620 ALSA: hda - Clean up init and setup hooks for Realtek codecs
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>
2009-08-11 18:17:46 +02:00
Mark Brown
e0026beac0 ASoC: Update WM9081 for tdm_slot() API change
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>
2009-08-11 16:29:21 +01:00
Takashi Iwai
e9c364c04f ALSA: hda - Add setup hook to ALC preset struct
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>
2009-08-11 17:16:13 +02:00
Takashi Iwai
4d8e22e0f6 ALSA: hda - Add a white-list for MSI option
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>
2009-08-11 14:25:46 +02:00
Mark Brown
1921bab217 Merge commit 'a5479e389e989acfeca9c32eeb0083d086202280' into for-2.6.32 2009-08-11 13:09:27 +01:00
Randy Dunlap
17244c24f9 ASoC: fix I2C build errors
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>
2009-08-11 10:47:25 +01:00
Takashi Iwai
b59bdf3b0c ALSA: hda - Check connectivity for auto-mic of Realtek codecs
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>
2009-08-11 09:47:30 +02:00
Takashi Iwai
52b5deefbb Merge branch 'fix/hda' into topic/hda 2009-08-11 08:47:38 +02:00
Takashi Iwai
dd704698f5 ALSA: hda - Don't override ADC definitions for ALC codecs
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>
2009-08-11 08:45:11 +02:00
Takashi Iwai
f1e6d3c5cf ALSA: usb-audio - Fix types taken in min()
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>
2009-08-11 08:16:15 +02:00
Takashi Iwai
2a22d3f812 ALSA: hda - Use only one capture stream for auto-mic
When the auto-mic feature is enabled, we should support only one
capture stream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-10 18:56:05 +02:00
Takashi Iwai
6c81949227 ALSA: hda - Add auto-mic support for Realtek codecs
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>
2009-08-10 18:47:44 +02:00
Tejun Heo
93fe4483e6 sound: make OSS device number claiming optional and schedule its removal
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>
2009-08-10 13:59:36 +02:00
Mark Brown
e0c48a18f7 ASoC: Drop unneeded declaration of removed wm8731 SPI write function
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-10 12:59:29 +01:00
Tejun Heo
0a848680a8 sound: request char-major-* module aliases for missing OSS devices
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>
2009-08-10 13:59:26 +02:00
Clemens Ladisch
5e8e7c3853 sound: fix OSS MIDI output data loss
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>
2009-08-10 13:15:43 +02:00
Clemens Ladisch
6e2efaacb3 sound: ymfpci: increase timer resolution to 96 kHz
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>
2009-08-10 13:14:46 +02:00
Clemens Ladisch
765e8db078 sound: usb-audio: do not make URBs longer than sync packet interval
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>
2009-08-10 13:13:56 +02:00
Takashi Iwai
d5c9c8912a Merge branch 'fix/hda' into topic/hda 2009-08-10 11:58:09 +02:00
Takashi Iwai
100d5eb36b ALSA: hda - Add missing vmaster initialization for ALC269
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>
2009-08-10 11:57:05 +02:00
Takashi Iwai
da2a2aaa8e ALSA: hda - Fix Oops due to STAC/IDT auto-mic changes
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>
2009-08-10 07:44:09 +02:00
Mark Brown
35b1207b34 ASoC: Convert WM8776 to use factored out register cache code
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-08 10:37:33 +01:00
Chaithrika U S
7ae5945f0c ASoC: DaVinci: Support Audio on DA830 EVM
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>
2009-08-08 09:12:54 +01:00
Uwe Kleine-König
dbe9ea6e79 ASoC: s3c2443-ac97: convert semaphore to mutex
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>
2009-08-08 08:50:13 +01:00
Takashi Iwai
afc5e65245 ASoC: Add missing DRV_NAME definitions for fsl/* drivers
Module builds are broken due to missing DRV_NAME for
efika-audio-fabric and pcm030-audio-fabric.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-07 16:33:53 +02:00
Janusz Krzysztofik
b7b8f9bf0c TTY/ASoC: Rename N_AMSDELTA line discipline to N_V253
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>
2009-08-07 11:48:02 +01:00
Mark Brown
06cddefc1f Merge branch 'reg-cache' into for-2.6.32 2009-08-07 11:43:58 +01:00
Mark Brown
b9b5cc26d0 Merge branch 'for-2.6.31' into for-2.6.32 2009-08-07 11:42:01 +01:00
Troy Kisky
6a90d536fe ASoC: DaVinci: pcm, constrain buffer size to multiple of period
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>
2009-08-07 11:38:29 +01:00
Troy Kisky
9bb7415056 ASoC: DaVinci: i2s: don't bounce through rtd to get dai
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>
2009-08-07 11:38:29 +01:00
Jarkko Nikula
c12abc012e ARM: OMAP: McBSP: Fix ASoC on OMAP1510 by fixing API of omap_mcbsp_start/stop
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>
2009-08-07 10:57:42 +01:00
Daniel Ribeiro
a5479e389e ASoC: change set_tdm_slot api to allow slot_width override.
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>
2009-08-06 15:52:24 +01:00
Janusz Krzysztofik
9029bb316b ASoC: CX20442: simplify codec controller usage
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>
2009-08-06 11:36:46 +01:00
Janusz Krzysztofik
4977b03e3d ASoC: CX20442: add some debugging
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>
2009-08-06 11:36:45 +01:00
Mark Brown
924914ee95 ASoC: Add WM8776 CODEC driver
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>
2009-08-06 11:36:45 +01:00
Takashi Iwai
1972d02504 ALSA: hda - Add quirks for some HP laptops
The new HP laptops have PCI SSID 103c:701x and requires model=hp-dv5.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-06 08:44:43 +02:00
javier Martin
fbb474deda ASoC: Fix review issues in i.MX2x PCM driver
Signed-off-by: javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-05 22:31:55 +01:00
javier Martin
2ccafed43a ASoC: add machine driver for i.mx27_visstrim_m10 board
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>
2009-08-05 22:31:54 +01:00
javier Martin
9d8bc2968c ASoC: add DAI platform ssi driver for MXC
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>
2009-08-05 22:31:54 +01:00
javier Martin
fd6a6394d7 ASoC: add DMA platform driver for MX1x and MX2x
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>
2009-08-05 22:31:54 +01:00
Daniel Mack
15b5bdaeeb ALSA: ASoC: cs4270: move power management hooks to snd_soc_codec_device
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>
2009-08-05 22:13:49 +01:00
John Bonesio
b0a2712ffd ASoC: MPC5200: Support for buffer wrap around
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>
2009-08-05 22:10:14 +01:00
Mark Brown
4bc4c9a5f5 ASoC: Existing S3C24xx AC97 drivers should depend on S3C24xx
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-05 17:15:04 +01:00
Linus Torvalds
6ce90c430b Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* '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
2009-08-04 15:39:55 -07:00
Takashi Iwai
16ffe32c77 ALSA: hda - Fix line-out jack handling with STAC/IDT codec
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>
2009-08-04 13:40:54 +02:00
Mark Brown
27ded041f0 ASoC: Factor out 7 bit register 9 bit data SPI write
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>
2009-08-03 16:59:16 +01:00
Mark Brown
8d50e447d1 ASoC: Factor out I/O for Wolfson 8 bit data 16 bit register CODECs
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-03 16:59:16 +01:00
Mark Brown
afa2f1066e ASoC: Factor out I2C 8 bit address 16 bit data I/O
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>
2009-08-03 16:59:15 +01:00
Mark Brown
7084a42b96 ASoC: Add I/O control bus information to factored out cache setup
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>
2009-08-03 16:59:09 +01:00
Takashi Iwai
15cfa2b3db ALSA: hda - Fix line-out jack detection
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>
2009-08-03 14:23:33 +02:00
Lubomir Rintel
51840409b6 ALSA: pcm - Tell user that stream to be rewound is suspended
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>
2009-08-03 08:57:00 +02:00
Takashi Iwai
e44d4e4cee Merge branch 'fix/hda' into topic/hda 2009-08-03 08:37:17 +02:00
Wu Fengguang
559059b27f ALSA: hda: add IbexPeak/Clarkdale HDMI model with static cvt/pin number
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>
2009-08-03 08:35:05 +02:00
Roel Kluin
4b35d2ca23 ALSA: hda - Read buffer overflow
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>
2009-08-03 08:34:06 +02:00
Chengu Wang
84d3dc200f ALSA: hda: Correct EAPD for Dell Inspiron 1525
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>
2009-08-03 08:30:56 +02:00
Wu Fengguang
e310bb0646 ALSA: hda: warn on spurious response
To help disclose hardware bugs.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:27:53 +02:00
Wu Fengguang
feb273404f ALSA: hda: remember last command for each codec
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:27:39 +02:00
Wu Fengguang
c32649feb4 ALSA: hda: read CORBWP inside reg_lock
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>
2009-08-03 08:26:55 +02:00
Wu Fengguang
cdb1fbf231 ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
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>
2009-08-03 08:26:42 +02:00
Wu Fengguang
a678cdee25 ALSA: hda: take cmd_mutex in probe_codec()
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>
2009-08-03 08:26:23 +02:00
Wu Fengguang
deadff1665 ALSA: hda: track CIRB/CORB command/response states for each codec
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>
2009-08-03 08:26:13 +02:00
Takashi Iwai
ce577e8cf5 ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527
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>
2009-08-03 08:23:52 +02:00
Janusz Krzysztofik
6d7f68a1ea ASoC: add support for Amstrad E3 (Delta) machine
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
7c5cb7862d32cb344be7831d466535d5255e35ac 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 2512fd29db4eb09e82d182596304c7aaf76d2c5c.
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>
2009-07-31 22:38:44 +01:00
Janusz Krzysztofik
ad120dae12 ASoC: CX20442: push down machine independent line discipline bits
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>
2009-07-31 22:38:44 +01:00
Lars-Peter Clausen
b8e22c1fe3 ASoC: jack: Fix race in snd_soc_jack_add_gpios
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>
2009-07-31 22:38:43 +01:00
Mark Brown
77ee09c67e ASoC: Allow CODECs to flag invalid registers
This helps CODECs with sparse register maps work better with the
register cache display interface.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-31 18:54:48 +01:00
Takashi Iwai
ec86fe5209 Merge branch 'fix/oss' into for-linus
* fix/oss:
  sound: mpu401.c: Buffer overflow
  sound: aedsp16: Buffer overflow
2009-07-31 10:17:45 +02:00
Takashi Iwai
d62e345f14 Merge branch 'fix/misc' into for-linus
* fix/misc:
  ALSA: sound/aoa: Add kmalloc NULL tests
2009-07-31 10:17:44 +02:00
Takashi Iwai
6280b61af5 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - Increase PCM stream name buf in patch_realtek.c
  ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
  ALSA: hda - Add quirk for Dell Studio 1555
2009-07-31 10:17:42 +02:00
Julia Lawall
f065fabc86 ALSA: sound/aoa: Add kmalloc NULL tests
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>
2009-07-31 10:14:58 +02:00
Takashi Iwai
aa563af763 ALSA: hda - Increase PCM stream name buf in patch_realtek.c
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>
2009-07-31 10:06:34 +02:00
Takashi Iwai
03cb2dafcb Merge branch 'topic/hda-cirrus' into topic/hda 2009-07-30 18:09:04 +02:00
Takashi Iwai
d195658bd7 Merge branch 'fix/hda' into topic/hda 2009-07-30 18:08:54 +02:00
Takashi Iwai
fefd67f31e ALSA: hda - Add line-out jack detection on IDT/STAC codecs
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>
2009-07-30 18:08:46 +02:00
Stelian Pop
3a38516750 ALSA: hda - Enable HP output with Macbook Pro 5, 5
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>
2009-07-30 14:57:25 +02:00
Mark Brown
a1daf67d72 Merge branch 'gta02-audio' into for-2.6.32 2009-07-30 13:21:38 +01:00
Takashi Iwai
5207e10ed4 ALSA: hda - Integrate Digital Input Source to Input Source
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>
2009-07-30 13:09:08 +02:00
Takashi Iwai
bf677bd8fb ALSA: hda - Fix typos of Capture controls.
The commit 6479c63188
    ALSA: hda - Create Capture controls dynamically
introduced typos of "Capture".  Fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-30 09:24:29 +02:00
Wu Fengguang
6732bd0d15 ALSA: hda: add HP automute support to Intel ALC889/ALC889A models
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>
2009-07-30 09:19:14 +02:00
Wu Fengguang
dd7714c922 ALSA: hda: add 2-channel mode to Intel ALC889/ALC889A models
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>
2009-07-30 08:53:56 +02:00
Barry Song
3a39f832a5 ASoC: Fix checkpatch issues and typos of ad1938 codec and bf5xx-tdm dai
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>
2009-07-29 21:31:53 +01:00
Lars-Peter Clausen
82c4362ee3 ASoC: neo1973_gta02_wm8753: Replace deprecated s3c_gpio calls with gpiolib
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>
2009-07-29 21:29:33 +01:00
Lars-Peter Clausen
69331fbdee ASoC: neo1973_gta02_wm8753: Replace snd_soc_cnew with snd_soc_add_controls.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-29 21:29:33 +01:00
Takashi Iwai
71443b0b74 ALSA: hda - No analog mix input source as default for IDT92HD71bxx
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>
2009-07-29 18:41:29 +02:00
Takashi Iwai
15b4f296fc ALSA: hda - Add missing DMUX initialization for auto-mic with STAC/IDT
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>
2009-07-29 16:32:55 +02:00
Takashi Iwai
26a2798053 ALSA: hda - Remove static connection in IDT 92HD71bxx
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>
2009-07-29 16:30:14 +02:00
Roel Kluin
a987004fbc sound: mpu401.c: Buffer overflow
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>
2009-07-29 14:41:24 +02:00
Roel Kluin
c45ec06c74 sound: aedsp16: Buffer overflow
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>
2009-07-29 14:37:12 +02:00
Roel Kluin
78735cffc2 ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
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>
2009-07-29 14:35:20 +02:00
Takashi Iwai
3d21d3f7e7 ALSA: hda - Support auto-mic switching with IDT/STAC codec
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>
2009-07-29 14:32:56 +02:00
Takashi Iwai
62558ce157 ALSA: hda - Avoid overwrite of jack events with STAC/IDT
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>
2009-07-29 14:28:37 +02:00
Barry Song
c8489c3ed3 ASoC: board driver to connect bf5xx with ad1938
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-28 22:16:02 +01:00
Barry Song
01e2ab207c ASoC: blackfin I2S(TDM mode) CPU DAI driver
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>
2009-07-28 22:15:27 +01:00