platform/adaptation/renesas_rcar/renesas_kernel.git
10 years agoMerge remote-tracking branch 'asoc/topic/arizona' into for-tiwai
Mark Brown [Thu, 16 Jan 2014 12:43:55 +0000 (12:43 +0000)]
Merge remote-tracking branch 'asoc/topic/arizona' into for-tiwai

10 years agoMerge remote-tracking branch 'asoc/topic/pcm' into for-tiwai
Mark Brown [Thu, 16 Jan 2014 12:42:57 +0000 (12:42 +0000)]
Merge remote-tracking branch 'asoc/topic/pcm' into for-tiwai

10 years agoMerge remote-tracking branch 'asoc/topic/dma' into for-tiwai
Mark Brown [Thu, 16 Jan 2014 12:42:54 +0000 (12:42 +0000)]
Merge remote-tracking branch 'asoc/topic/dma' into for-tiwai

10 years agoMerge remote-tracking branch 'asoc/topic/dapm' into for-tiwai
Mark Brown [Thu, 16 Jan 2014 12:42:53 +0000 (12:42 +0000)]
Merge remote-tracking branch 'asoc/topic/dapm' into for-tiwai

10 years agoMerge remote-tracking branch 'asoc/topic/core' into for-tiwai
Mark Brown [Thu, 16 Jan 2014 12:42:53 +0000 (12:42 +0000)]
Merge remote-tracking branch 'asoc/topic/core' into for-tiwai

10 years agoMerge remote-tracking branches 'asoc/fix/adau1701' and 'asoc/fix/tlv320aic32x4' into...
Mark Brown [Thu, 16 Jan 2014 12:42:51 +0000 (12:42 +0000)]
Merge remote-tracking branches 'asoc/fix/adau1701' and 'asoc/fix/tlv320aic32x4' into for-tiwai

10 years agoASoC: tlv320aic32x4: Fix regmap range_min
Markus Pargmann [Wed, 15 Jan 2014 17:12:40 +0000 (18:12 +0100)]
ASoC: tlv320aic32x4: Fix regmap range_min

range_min is the lowest address in the virtual register range. This is
the first register with address 0, not the first register of page 1.

Currently all writes to page 1 are mapped to page 0, so the codec fails
to operate.

Fixes: 4d208ca429ad (ASoC: tlv320aic32x4: Convert to direct regmap API usage)
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org (v3.13 if the fix misses -final)
10 years agoASoC: core: Return -ENOTSUPP from set_sysclk() if no operation provided
Mark Brown [Wed, 15 Jan 2014 19:04:19 +0000 (19:04 +0000)]
ASoC: core: Return -ENOTSUPP from set_sysclk() if no operation provided

Make it easier for generic code to work with set_sysclk() by distinguishing
between the operation not being supported and an error as is done for
other operations like set_dai_fmt()

Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: dapm: Change prototype of soc_widget_read
Arun Shamanna Lakshmi [Tue, 14 Jan 2014 23:31:54 +0000 (15:31 -0800)]
ASoC: dapm: Change prototype of soc_widget_read

soc_widget_read API returns the register data and it is possible
that a register can contain 0xffffffff. Thus, change the prototype
of soc_widget_read to return only the error code and pass the reg
data through pointer argument.

Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag
Lars-Peter Clausen [Sat, 11 Jan 2014 13:02:21 +0000 (14:02 +0100)]
ASoC: samsung: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag

The Samsung dmaengine ASoC driver is used with two different dmaengine drivers.
The pl80x, which properly supports residue reporting and the pl330, which
reports that it does not support residue reporting. So there is no need to
manually set the NO_RESIDUE flag. This has the advantage that a proper (race
condition free) PCM pointer() implementation is used when the pl80x driver is
used. Also once the pl330 driver supports residue reporting the ASoC PCM driver
will automatically start using it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: axi-{spdif,i2s}: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag
Lars-Peter Clausen [Sat, 11 Jan 2014 13:02:20 +0000 (14:02 +0100)]
ASoC: axi-{spdif,i2s}: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag

The pl330 driver properly reports that it does not have residue reporting
support, which means the PCM dmanegine driver is able to figure this out on its
own. So there is no need to set the flag manually. Removing the flag has the
advantage that once the pl330 driver gains support for residue reporting it will
automatically be used by the generic dmaengine PCM driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: generic-dmaengine-pcm: Check DMA residue granularity
Lars-Peter Clausen [Sat, 11 Jan 2014 13:02:19 +0000 (14:02 +0100)]
ASoC: generic-dmaengine-pcm: Check DMA residue granularity

The dmaengine framework now exposes the granularity with which it is able to
report the transfer residue for a certain DMA channel. Check the granularity in
the generic dmaengine PCM driver and
a) Set the SNDRV_PCM_INFO_BATCH if the granularity is per period or worse.
b) Fallback to the (race condition prone) period counting if the driver does
not support any residue reporting.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: generic-dmaengine-pcm: Check NO_RESIDUE flag at runtime
Lars-Peter Clausen [Sat, 11 Jan 2014 13:02:18 +0000 (14:02 +0100)]
ASoC: generic-dmaengine-pcm: Check NO_RESIDUE flag at runtime

Currently we have two different snd_soc_platform_driver structs in the generic
dmaengine PCM driver. One for dmaengine drivers that support residue reporting
and one for those which do not. When registering the PCM component we check
whether the NO_RESIDUE flag is set or not and use the corresponding
snd_soc_platform_driver. This patch modifies the driver to only have one
snd_soc_platform_driver struct where the pointer() callback checks the
NO_RESIDUE flag at runtime. This allows us to set the NO_RESIDUE flag after the
PCM component has been registered. This becomes necessary when querying whether
the dmaengine driver supports residue reporting from the dmaengine driver itself
since the DMA channel might only be requested after the PCM component has been
registered.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agodma: pl330: Set residue_granularity
Lars-Peter Clausen [Sat, 11 Jan 2014 13:02:17 +0000 (14:02 +0100)]
dma: pl330: Set residue_granularity

The pl330 driver currently does not support residue reporting, so set the
residue granularity to DMA_RESIDUE_GRANULARITY_DESCRIPTOR.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agodma: Indicate residue granularity in dma_slave_caps
Lars-Peter Clausen [Sat, 11 Jan 2014 13:02:16 +0000 (14:02 +0100)]
dma: Indicate residue granularity in dma_slave_caps

This patch adds a new field to the dma_slave_caps struct which indicates the
granularity with which the driver is able to update the residue field of the
dma_tx_state struct. Making this information available to dmaengine users allows
them to make better decisions on how to operate. E.g. for audio certain features
like wakeup less operation or timer based scheduling only make sense and work
correctly if the reported residue is fine-grained enough.

Right now four different levels of granularity are supported:
* DESCRIPTOR: The DMA channel is only able to tell whether a descriptor has
  been completed or not, which means residue reporting is not supported by
  this channel. The residue field of the dma_tx_state field will always be
  0.
* SEGMENT: The DMA channel updates the residue field after each successfully
  completed segment of the transfer (For cyclic transfers this is after each
  period). This is typically implemented by having the hardware generate an
  interrupt after each transferred segment and then the drivers updates the
  outstanding residue by the size of the segment. Another possibility is if
  the hardware supports SG and the segment descriptor has a field which gets
  set after the segment has been completed. The driver then counts the
  number of segments without the flag set to compute the residue.
* BURST: The DMA channel updates the residue field after each transferred
  burst. This is typically only supported if the hardware has a progress
  register of some sort (E.g. a register with the current read/write address
  or a register with the amount of bursts/beats/bytes that have been
  transferred or still need to be transferred).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge branch 'topic/samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Tue, 14 Jan 2014 21:28:35 +0000 (21:28 +0000)]
Merge branch 'topic/samsung' of git://git./linux/kernel/git/broonie/sound into asoc-dma

10 years agoMerge branch 'topic/axi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Tue, 14 Jan 2014 21:28:22 +0000 (21:28 +0000)]
Merge branch 'topic/axi' of git://git./linux/kernel/git/broonie/sound into asoc-dma

10 years agoASoC: pcm: Use snd_pcm_rate_mask_intersect() helper
Lars-Peter Clausen [Sat, 11 Jan 2014 09:24:44 +0000 (10:24 +0100)]
ASoC: pcm: Use snd_pcm_rate_mask_intersect() helper

Instead of open-coding the intersecting of two rate masks (and getting slightly
wrong for some of the corner cases) use the new snd_pcm_rate_mask_intersect()
helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoALSA: Add helper function for intersecting two rate masks
Lars-Peter Clausen [Sat, 11 Jan 2014 09:24:43 +0000 (10:24 +0100)]
ALSA: Add helper function for intersecting two rate masks

A bit of special care is necessary when creating the intersection of two rate
masks. This comes from the special meaning of the SNDRV_PCM_RATE_CONTINUOUS and
SNDRV_PCM_RATE_KNOT bits, which needs special handling when intersecting two
rate masks. SNDRV_PCM_RATE_CONTINUOUS means the hardware supports all rates in a
specific interval. SNDRV_PCM_RATE_KNOT means the hardware supports a set of
discrete rates specified by a list constraint. For all other cases the supported
rates are specified directly in the rate mask.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: s6000: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates
Lars-Peter Clausen [Sat, 11 Jan 2014 09:24:42 +0000 (10:24 +0100)]
ASoC: s6000: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates

SNDRV_PCM_RATE_CONTINUOUS means that all rates (possibly limited to a certain
interval) are supported. There is no need to manually set other rate bits.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates
Lars-Peter Clausen [Sat, 11 Jan 2014 09:24:41 +0000 (10:24 +0100)]
ASoC: fsl: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates

SNDRV_PCM_RATE_CONTINUOUS means that all rates (possibly limited to a certain
interval) are supported. There is no need to manually set other rate bits.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: pcm: Properly initialize hw->rate_max
Lars-Peter Clausen [Sat, 11 Jan 2014 09:24:40 +0000 (10:24 +0100)]
ASoC: pcm: Properly initialize hw->rate_max

If none of the components (CODEC or CPU DAI) sets a maximum sample rate we'll
end up with the rate_max field of the runtime hardware set to 0.  (Note that it
is still possible for the components to constrain the supported sample rates
using other methods, e.g. setting a list constraint) If rate_max is 0 this means
that the sound card doesn't support any rates at all, which is not the desired
result. So initialize rate_max to UINT_MAX. For symmetry reasons also set
rate_min to 0.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge tag 'v3.13-rc3' into asoc-pcm
Mark Brown [Tue, 14 Jan 2014 20:41:53 +0000 (20:41 +0000)]
Merge tag 'v3.13-rc3' into asoc-pcm

Linux 3.13-rc3

10 years agosound: oss: remove last sleep_on users
Arnd Bergmann [Thu, 2 Jan 2014 12:07:51 +0000 (13:07 +0100)]
sound: oss: remove last sleep_on users

There are three files in oss for which I could not find an easy way to
replace interruptible_sleep_on_timeout with a non-racy version. This
patch instead just adds a private implementation of the function, now
named oss_broken_sleep_on, and changes over the remaining users in
sound/oss/ so we can remove the global interface.

[fixed coding style warnings by tiwai]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agosound: oss: dmasound: kill SLEEP() macro to avoid race
Arnd Bergmann [Thu, 2 Jan 2014 12:07:50 +0000 (13:07 +0100)]
sound: oss: dmasound: kill SLEEP() macro to avoid race

The use of interruptible_sleep_on_timeout in the dmasound driver
is questionable and we want to kill off all sleep_on variants.
This replaces the calls with wait_event_interruptible_timeout
where possible, to wait for a particular event instead of blocking
in a racy way. In the sq_write function, the easiest solution is
an open-coded prepare_to_wait loop.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agosound: oss: midibuf: fix sleep_on races
Arnd Bergmann [Thu, 2 Jan 2014 12:07:48 +0000 (13:07 +0100)]
sound: oss: midibuf: fix sleep_on races

sleep_on is known to be racy and going away because of this. All instances
of interruptible_sleep_on and interruptible_sleep_on_timeout in the midibuf
driver can trivially be replaced with wait_event_interruptible and
wait_event_interruptible_timeout.

[fixed coding style warnings by tiwai]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agosound: oss: vwsnd: avoid interruptible_sleep_on
Arnd Bergmann [Thu, 2 Jan 2014 12:07:49 +0000 (13:07 +0100)]
sound: oss: vwsnd: avoid interruptible_sleep_on

Interruptible_sleep_on is racy and we want to remove it. This replaces
the use in the vwsnd driver with an open-coded prepare_to_wait
loop that fixes the race between concurrent open() and close() calls,
and also drops the global mutex while waiting here, which restores
the original behavior that was changed during the BKL removal.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agosound: oss: msnd_pinnacle: avoid interruptible_sleep_on_timeout
Arnd Bergmann [Thu, 2 Jan 2014 12:07:47 +0000 (13:07 +0100)]
sound: oss: msnd_pinnacle: avoid interruptible_sleep_on_timeout

We want to remove all sleep_on variants from the kernel because they are
racy. In case of the pinnacle driver, we can replace
interruptible_sleep_on_timeout with wait_event_interruptible_timeout
by changing the meaning of a few flags used in the driver so they
are cleared at wakeup time, which is a somewhat more appropriate
way to do the same, although probably still racy.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Fix endless vmaster hook call in thinkpad_helper.c
Takashi Iwai [Tue, 14 Jan 2014 13:56:55 +0000 (14:56 +0100)]
ALSA: hda - Fix endless vmaster hook call in thinkpad_helper.c

The new vmaster hook, update_tpacpi_mute_led(), calls the original
vmaster hook, but I forgot to save the original hook function but keep
calling the updated one, which of course results in a stupid endless
loop.  Fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: snd-usb: re-order some quirk entries
Daniel Mack [Tue, 14 Jan 2014 13:37:56 +0000 (14:37 +0100)]
ALSA: snd-usb: re-order some quirk entries

No code change, just a cosmetic cleanup to keep entries ordered by the
device ID within a block of unique vendor IDs.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: usb-audio: Fix Creative VF0420 rate
Pavel Hofman [Tue, 14 Jan 2014 12:42:57 +0000 (13:42 +0100)]
ALSA: usb-audio: Fix Creative VF0420 rate

Creative Live! Cam Vista IM (VF0420) reports rate of 16kHz while working
at 8kHz. The patch adds its USB ID to the existing quirk.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: usb-audio: Add support for Focusrite Saffire 6 USB
Eduard Gilmutdinov [Fri, 20 Dec 2013 08:06:58 +0000 (14:06 +0600)]
ALSA: usb-audio: Add support for Focusrite Saffire 6 USB

Signed-off-by: Eduard Gilmutdinov <edgilmutdinov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - automute via amp instead of pinctl on some AIO models
Hui Wang [Tue, 14 Jan 2014 06:07:36 +0000 (14:07 +0800)]
ALSA: hda - automute via amp instead of pinctl on some AIO models

On some AIO (All In One) models with the codec alc668
(Vendor ID: 0x10ec0668) on it, when we plug a headphone into the jack,
the system will switch the output to headphone and set the speaker to
automute as well as change the speaker Pin-ctls from 0x40 to 0x00,
this will bring loud noise to the headphone.

I tried to disable the corresponding EAPD, but it did not help to
eliminate the noise.

According to Takashi's suggestion, we use amp operation to replace the
pinctl modification for the automute, this really eliminate the noise.

BugLink: https://bugs.launchpad.net/bugs/1268468
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Apply codec power_filter to FG nodes
Takashi Iwai [Mon, 13 Jan 2014 15:09:57 +0000 (16:09 +0100)]
ALSA: hda - Apply codec power_filter to FG nodes

Apply the codec->power_filter to the FG nodes in general for reducing
hackish set_power_state ops override in patch_sigmatel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoASoC: codec: tlv320aic32x4: Fix regmap range config
Markus Pargmann [Sat, 11 Jan 2014 13:48:30 +0000 (14:48 +0100)]
ASoC: codec: tlv320aic32x4: Fix regmap range config

This codec driver fails to probe because it has a higher regmap
range_max value than max_register. This patch sets the range_max to the
max_register value as described in the for struct regmap_range_cfg:
"@range_max: Address of the highest register in virtual range."

Fixes: 4d208ca429ad (ASoC: tlv320aic32x4: Convert to direct regmap API usage)
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org (v3.13 if the fix misses -final)
10 years agoALSA: hda - Don't set indep_hp flag for old AD codecs
Takashi Iwai [Mon, 13 Jan 2014 11:40:07 +0000 (12:40 +0100)]
ALSA: hda - Don't set indep_hp flag for old AD codecs

Some old AD codecs don't like the independent HP handling, either it
contains a single DAC (AD1981) or it mandates the mixer routing
(AD1986A).  This patch removes the indep_hp flag for such codecs.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=68081
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks
Takashi Iwai [Fri, 10 Jan 2014 13:20:42 +0000 (14:20 +0100)]
ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks

The PCI devices with DMA masks smaller than 32bit should enable
CONFIG_ZONE_DMA.  Since the recent change of page allocator, page
allocations via dma_alloc_coherent() with the limited DMA mask bits
may fail more frequently, ended up with no available buffers, when
CONFIG_ZONE_DMA isn't enabled.  With CONFIG_ZONE_DMA, the system has
much more chance to obtain such pages.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=68221
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: PCM: Warn when buffer preallocation fails
Takashi Iwai [Fri, 10 Jan 2014 12:01:41 +0000 (13:01 +0100)]
ALSA: PCM: Warn when buffer preallocation fails

The failures of buffer preallocations at driver initializations aren't
critical but it's still helpful to inform, so that user can know that
something doesn't work as expected.

For example, the recent page allocator change triggered regressions,
but developers didn't notice until recently because the driver didn't
complain.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoASoC: wm5110: Add controls for headphone short circuit protection
Charles Keepax [Thu, 9 Jan 2014 14:29:25 +0000 (14:29 +0000)]
ASoC: wm5110: Add controls for headphone short circuit protection

Add controls to enable/disable the headphone short circuit protection of
the headphone outputs.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agomfd: wm5110: Add registers for headphone short circuit control
Charles Keepax [Thu, 9 Jan 2014 14:29:24 +0000 (14:29 +0000)]
mfd: wm5110: Add registers for headphone short circuit control

Add the registers necessary to enable/disable the headphone short
circuit protection.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge tag 'v3.13-rc3' into asoc-arizona
Mark Brown [Fri, 10 Jan 2014 11:52:05 +0000 (11:52 +0000)]
Merge tag 'v3.13-rc3' into asoc-arizona

Linux 3.13-rc3

10 years agoALSA: ctxfi - Work around emu20k1 glitch to prevent buffered sound data loss
Sarah Bessmer [Thu, 9 Jan 2014 19:36:31 +0000 (11:36 -0800)]
ALSA: ctxfi - Work around emu20k1 glitch to prevent buffered sound data loss

Occasionally, on playback stream ringbuffer wraparound, the EMU20K1
hardware will momentarily return 0 instead of the proper current(loop)
address. This patch handles that case, fixing the problem of playback
position corruption and subsequent loss of buffered sound data, that
occurs with some common buffering layout patterns(e.g. multiple
simultaneous output streams with differently-sized or
non-power-of-2-sized buffers).

An alternate means of fixing the problem would be to read the ca
register continuously, until two sequential reads return the same
value; however, that would be a more invasive change, has performance
implications, and isn't necessary unless there are also issues with the
value not being updated atomically in regards to individual bits or
something similar(which I have not encountered through light testing).

I have no EMU20K2 hardware to confirm if the issue is present there,
but even if it's not, this change shouldn't break anything that's not
already broken.

Signed-off-by: Sarah Bessmer <aotos@fastmail.fm>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoASoC: Allow PCMs to restrict the supported formats
Lars-Peter Clausen [Mon, 6 Jan 2014 13:19:16 +0000 (14:19 +0100)]
ASoC: Allow PCMs to restrict the supported formats

Some DMA cores might add additional restrictions on which in memory audio
formats can be supported by the compound sound card. If the PCM component
specifies a set of formats it supports (by setting the formats field to non 0)
take these into account when calculating the format set for the compound sound
card.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoALSA: Merge memalloc code into snd-pcm module
Takashi Iwai [Thu, 9 Jan 2014 06:48:12 +0000 (07:48 +0100)]
ALSA: Merge memalloc code into snd-pcm module

Instead of keeping a separate snd-page-alloc module, merge into the
core snd-pcm module, as we don't need to keep it as an individual
module due to the drop of page reservation.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: Remove superfluous header inclusions in memalloc.c
Takashi Iwai [Thu, 9 Jan 2014 06:44:11 +0000 (07:44 +0100)]
ALSA: Remove superfluous header inclusions in memalloc.c

After cutting off the proc and page reservation codes, we don't need
many headers any longer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: Remove memory reservation code from memalloc helper
Takashi Iwai [Wed, 8 Jan 2014 15:12:25 +0000 (16:12 +0100)]
ALSA: Remove memory reservation code from memalloc helper

Nowadays we have CMA for obtaining the contiguous memory pages
efficiently.  Let's kill the old kludge for reserving the memory pages
for large buffers.  It was rarely useful (only for preserving pages
among module reloading or a little help by an early boot scripting),
used only by a couple of drivers, and yet it gives too much ugliness
than its benefit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: Remove memory accounting in memalloc helper
Takashi Iwai [Wed, 8 Jan 2014 15:09:31 +0000 (16:09 +0100)]
ALSA: Remove memory accounting in memalloc helper

It's almost superfluous, and doesn't help much for real uses.
Let's reduce the layer size.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda/hdmi - apply all Haswell fix-ups to Broadwell display codec
Mengdong Lin [Wed, 8 Jan 2014 20:55:32 +0000 (15:55 -0500)]
ALSA: hda/hdmi - apply all Haswell fix-ups to Broadwell display codec

Broadwell and Haswell have the same behavior on display audio. So this patch
defines is_haswell_plus() to include codecs for both Haswell and its successor
Broadwell, and apply all Haswell fix-ups to Broadwell.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - add codec ID for Broadwell display audio codec
Mengdong Lin [Wed, 8 Jan 2014 20:55:24 +0000 (15:55 -0500)]
ALSA: hda - add codec ID for Broadwell display audio codec

This patch adds codec ID (0x80862808) and module alias for Broadwell
display codec.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - add device ID for Broadwell display audio controller
Mengdong Lin [Wed, 8 Jan 2014 20:55:14 +0000 (15:55 -0500)]
ALSA: hda - add device ID for Broadwell display audio controller

This patch adds the device ID for Intel Broadwell display HD-Audio controller,
and applies Haswell properties to this device.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Split Thinkpad ACPI-related code
Takashi Iwai [Wed, 8 Jan 2014 10:44:21 +0000 (11:44 +0100)]
ALSA: hda - Split Thinkpad ACPI-related code

Both patch_realtek.c and patch_conexant.c contain the fairy same code
snippet for supporting Thinkpad ACPI LED controls.  Split them into
thinkpad_helper.c and include it from both places.  Although this
isn't the best approach from the code size POV, the probability for
coexistence of both Realtek and Conexant codecs on a single machine is
pretty low, thus it'll end up with less memory footprint than
splitting to yet another module.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant
Lars-Peter Clausen [Wed, 8 Jan 2014 10:22:25 +0000 (11:22 +0100)]
ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant

The driver defines ADAU1701_SEROCTL_WORD_LEN_16 as 0x10 while it should be b10,
so 0x2. This patch fixes it.

Reported-by: Magnus Reftel <magnus.reftel@lockless.no>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
10 years agoASoC: sapm: Automatically connect DAI link widgets in DAPM graph.
Liam Girdwood [Wed, 8 Jan 2014 10:40:19 +0000 (10:40 +0000)]
ASoC: sapm: Automatically connect DAI link widgets in DAPM graph.

Connect the DAPM graph through each BE DAI link to the componnent(s) on the
other side of the BE DAI link. This allows the graph to be walked on
both sides of the link when graph changes are made.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: utils: Add internal call to determine if DAI is dummy.
Liam Girdwood [Wed, 8 Jan 2014 10:40:18 +0000 (10:40 +0000)]
ASoC: utils: Add internal call to determine if DAI is dummy.

Provide a quick way to tell if a DAI is a dummy DAI or a regular DAI.
This is for internal DAPM usage only and is used to determine whether to
insert a DAI link connection into the DAPM graph.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoALSA: hda - Don't create duplicated ctls for loopback paths
Takashi Iwai [Tue, 7 Jan 2014 17:11:44 +0000 (18:11 +0100)]
ALSA: hda - Don't create duplicated ctls for loopback paths

AD1986A mic pins (0x1d and 0x1f) share the same widget for controlling
the loopback volume/mute, but the generic parser didn't check it.
This ended up with the duplicated controls for the same effect.

This patch adds the check of the duplication for avoiding it.

After this fix, there will be only one control although it affects
both paths; this remaining issue should be fixed later in a different
patch.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Correct AD1986A 3stack pin configs
Takashi Iwai [Tue, 7 Jan 2014 16:48:11 +0000 (17:48 +0100)]
ALSA: hda - Correct AD1986A 3stack pin configs

The 3stack pin configs for AD1986A codec had incorrect values that
resulted in broken mic and line-in.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Add consistent tag names for firmware patch
Takashi Iwai [Tue, 7 Jan 2014 14:28:51 +0000 (15:28 +0100)]
ALSA: hda - Add consistent tag names for firmware patch

Some tags used in the firmware patch file are inconsistent with hwdep
sysfs file names, such as, the firmware patch takes [hint] tag while
sysfs file is */hints.  This makes even me referring back to the
document often.  Let's provide the same tag names as sysfs for
reducing confusions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - firmware patch code cleanup
Takashi Iwai [Tue, 7 Jan 2014 14:23:44 +0000 (15:23 +0100)]
ALSA: hda - firmware patch code cleanup

Just a code refactoring: the need_codec flag in hda_patch_item struct
can be removed by checking the current mode instead.  No functional
change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Increment default stream numbers for AMD HDMI controllers
Takashi Iwai [Mon, 9 Dec 2013 09:18:09 +0000 (10:18 +0100)]
ALSA: hda - Increment default stream numbers for AMD HDMI controllers

It turned out that some AMD HDMI controllers still don't provide
proper values in GCAP register (all zero), and the driver assigns only
one stream in that case, although the connected codec chip supports
more than one stream.

In this patch, the default max number of streams for AMD HDMI
controllers is increased to 8, which  should suffice for most use
cases.  The overhead by this increase is more azx_dev struct and BDL
allocations, so it's negligible.  Of course, if the controller
provides a proper GCAP register, the register value would be used.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Minor code optimization for patch_realtek.c
Takashi Iwai [Tue, 7 Jan 2014 17:22:49 +0000 (18:22 +0100)]
ALSA: hda - Minor code optimization for patch_realtek.c

No functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoASoC: dpcm: Explicitly set BE DAI link supported stream directions
Liam Girdwood [Tue, 7 Jan 2014 17:51:42 +0000 (17:51 +0000)]
ASoC: dpcm: Explicitly set BE DAI link supported stream directions

Some BE DAIs can be "dummy" (when the DSP is controlling the DAI) and as such
wont have set a minimum number of playback or capture channels required for BE
DAI registration (to establish supported stream directions).

Force machine drivers to explicitly set whether they support playback and capture
stream directions for every BE DAIs.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoALSA: compress: add num_sample_rates in snd_codec_desc
Vinod Koul [Tue, 7 Jan 2014 16:25:42 +0000 (21:55 +0530)]
ALSA: compress: add num_sample_rates in snd_codec_desc

this gives ability to convey the valid values of supported rates in
sample_rates array

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoASoC: pcm: Fix lack of platform bespoke_trigger() call
Jean-Francois Moine [Fri, 3 Jan 2014 08:19:18 +0000 (09:19 +0100)]
ASoC: pcm: Fix lack of platform bespoke_trigger() call

When the platform driver has no ops, the platform function
bespoke_trigger() is no more called.

The problem was introduced by the commit c5914b0aaea6494aaa9e415cbd32f8b7eb604af0
"ASoC: pcm: Check for ops before deferencing them"

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: dpcm: Allow PCMs to omit the set of supported formats
Lars-Peter Clausen [Mon, 6 Jan 2014 13:19:07 +0000 (14:19 +0100)]
ASoC: dpcm: Allow PCMs to omit the set of supported formats

Allow PCMs that do not impose any restrictions on the supported formats to set
the formats field to 0, Instead of assuming that this means that the PCM does
not support any formats (which doesn't make much sense), assume that it supports
all formats. This brings the behavior of DPCM closer to that of non-DPCM.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: dpcm: Add helper function for initializing runtime pcm
Lars-Peter Clausen [Mon, 6 Jan 2014 13:19:06 +0000 (14:19 +0100)]
ASoC: dpcm: Add helper function for initializing runtime pcm

We have the same code for initializing the runtime pcm on both the playback and
the capture path. Factor this out into a common helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoALSA: compress: update struct snd_codec_desc for sample rate
Vinod Koul [Sat, 4 Jan 2014 11:29:13 +0000 (16:59 +0530)]
ALSA: compress: update struct snd_codec_desc for sample rate

Now that we don't use SNDRV_PCM_RATE_xxx bit fields for sample rate, we need to
change the description to an array for describing the sample rates supported by
the sink/source

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: compress: update comment for sample rate in snd_codec
Vinod Koul [Sat, 4 Jan 2014 11:29:12 +0000 (16:59 +0530)]
ALSA: compress: update comment for sample rate in snd_codec

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: compress: remove the sample rate check
Vinod Koul [Sat, 4 Jan 2014 11:29:11 +0000 (16:59 +0530)]
ALSA: compress: remove the sample rate check

commit f0e9c080 - "ALSA: compress: change the way sample rates are sent to
kernel" changed the way sample rates are sent. So now we don't need to check for
PCM_RATE_xxx in kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: rme9652: fix a missing comma in channel_map_9636_ds[]
Takashi Iwai [Thu, 26 Dec 2013 22:13:08 +0000 (00:13 +0200)]
ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]

The lack of comma leads to the wrong channel for an SPDIF channel.
Unfortunately this wasn't caught by compiler because it's still a
valid expression.

Reported-by: Alexander Aristov <aristov.alexander@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: cs5535audio: use named constants for pci_power_t values
Julia Lawall [Thu, 2 Jan 2014 23:40:30 +0000 (00:40 +0100)]
ALSA: cs5535audio: use named constants for pci_power_t values

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev;
@@

pci_set_power_state(pdev,
- 3
+ PCI_D3hot
 )
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoALSA: hda - Disable Front HP jack detection on Gigabyte Z87X-UD3H
David Henningsson [Wed, 1 Jan 2014 13:01:34 +0000 (14:01 +0100)]
ALSA: hda - Disable Front HP jack detection on Gigabyte Z87X-UD3H

This motherboard seems to have a flaky jack detection - when the
front HP is not present, the jack state quickly switches on and off.

This has been reported by three people in the bug, so I doubt it's
a user error this time.

BugLink: https://bugs.launchpad.net/bugs/1248116
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agoMerge tag 'asoc-v3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
Takashi Iwai [Sun, 5 Jan 2014 10:19:46 +0000 (11:19 +0100)]
Merge tag 'asoc-v3.14' of git://git./linux/kernel/git/broonie/sound into for-next

ASoC: Updates  for v3.14

Not a lot going on framework wise, partly due to Christmas at least in
the case of the work I've been doing, but there's been quite a lot of
cleanup activity going on and the usual trickle of new drivers:

 - Update to the generic DMA code to support deferred probe and managed
   resources.
 - New drivers for BCM2835 (used in Raspberry Pi), Tegra with MAX98090
   and Analog Devices AXI I2S and S/PDIF controller IPs.
 - Device tree support for the simple card, max98090 and cs42l52.
 - Conversion of the Samsung drivers to native dmaengine, making them
   multiplatform compatible and hopefully helping keep them more modern
   and up to date.
 - More regmap conversions, including a very welcome one for twl6040
   from Peter Ujfalusi.
 - A big overhaul of the DaVinci drivers also from Peter Ujfalusi.

10 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Sun, 5 Jan 2014 10:19:34 +0000 (11:19 +0100)]
Merge branch 'for-linus' into for-next

10 years agoMerge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', 'asoc/topic...
Mark Brown [Thu, 2 Jan 2014 13:01:55 +0000 (13:01 +0000)]
Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', 'asoc/topic/adav80x', 'asoc/topic/adsp', 'asoc/topic/ak4641', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x', 'asoc/topic/axi', 'asoc/topic/bcm2835', 'asoc/topic/blackfin', 'asoc/topic/cs4271', 'asoc/topic/cs42l52', 'asoc/topic/da7210', 'asoc/topic/davinci', 'asoc/topic/ep93xx', 'asoc/topic/fsl', 'asoc/topic/fsl-mxs', 'asoc/topic/generic', 'asoc/topic/hdmi', 'asoc/topic/jack', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/mxs', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/s6000', 'asoc/topic/sai', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/spear', 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', 'asoc/topic/tegra', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/uda1380', 'asoc/topic/width', 'asoc/topic/wm8510', 'asoc/topic/wm8523', 'asoc/topic/wm8580', 'asoc/topic/wm8711', 'asoc/topic/wm8728', 'asoc/topic/wm8731', 'asoc/topic/wm8741', 'asoc/topic/wm8750', 'asoc/topic/wm8753', 'asoc/topic/wm8776', 'asoc/topic/wm8804', 'asoc/topic/wm8900', 'asoc/topic/wm8901', 'asoc/topic/wm8940', 'asoc/topic/wm8962', 'asoc/topic/wm8974', 'asoc/topic/wm8985', 'asoc/topic/wm8988', 'asoc/topic/wm8990', 'asoc/topic/wm8991', 'asoc/topic/wm8994', 'asoc/topic/wm8995', 'asoc/topic/wm9081' and 'asoc/topic/x86' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/dt' into asoc-next
Mark Brown [Thu, 2 Jan 2014 13:01:52 +0000 (13:01 +0000)]
Merge remote-tracking branch 'asoc/topic/dt' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/dma' into asoc-next
Mark Brown [Thu, 2 Jan 2014 13:01:52 +0000 (13:01 +0000)]
Merge remote-tracking branch 'asoc/topic/dma' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/dapm' into asoc-next
Mark Brown [Thu, 2 Jan 2014 13:01:51 +0000 (13:01 +0000)]
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/core' into asoc-next
Mark Brown [Thu, 2 Jan 2014 13:01:50 +0000 (13:01 +0000)]
Merge remote-tracking branch 'asoc/topic/core' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/fix/fsl' into asoc-linus
Mark Brown [Thu, 2 Jan 2014 13:01:49 +0000 (13:01 +0000)]
Merge remote-tracking branch 'asoc/fix/fsl' into asoc-linus

10 years agoASoC: ad1836: Reject unsupported bit sizes
Mark Brown [Mon, 23 Dec 2013 12:41:39 +0000 (12:41 +0000)]
ASoC: ad1836: Reject unsupported bit sizes

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
10 years agoASoC: ssm2518: Fix off-by-one error by ffs()
Takashi Iwai [Mon, 23 Dec 2013 10:42:55 +0000 (11:42 +0100)]
ASoC: ssm2518: Fix off-by-one error by ffs()

ffs() returns the bit position from 1, while the ssm2158 driver code
assumes it being 0-based.  Also, the bit mask computation of the two
channel slots are incorrect; it must have worked just casually.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: simple-card: Add device's module clock selection.
Xiubo Li [Mon, 23 Dec 2013 07:25:38 +0000 (15:25 +0800)]
ASoC: simple-card: Add device's module clock selection.

Try to get the device's module clock if the dt has no clocks and
system-clock-frequency properties.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: imx-spdif: Use snd-soc-dummy CODEC driver to link card
Nicolin Chen [Mon, 23 Dec 2013 09:28:53 +0000 (17:28 +0800)]
ASoC: imx-spdif: Use snd-soc-dummy CODEC driver to link card

This is a quick fix for the below two issues when building spdif as modules.

1) If modprobing modules in order: (Step 1) snd-soc-fsl-spdif -> (Step 2)
snd-soc-imx-spdif -> (Step 3) snd-soc-spdif-tx/rx, we will fail to create
imx-spdif card and dai link unless we rmmod snd-soc-imx-spdif and modprobe
it again due to the execution platform_driver_unregister() in probe() when
meeting -EPROBE_DEFER at Step 2.

2) After "imx-spdif sound-spdif.17: dit-hifi <-> 2004000.spdif mapping ok",
'rmmod snd-soc-imx-spdif' would cause kernel dump with warning:
WARNING: CPU: 0 PID: 1301 at /home/rmk/git/linux-rmk/fs/sysfs/dir.c:915 sysfs_hash_and_remove+0x84/0x90()
sysfs: can not remove 'dapm_widget', no directory
This should be caused by disordered resourse releasing of the whole link.
And trying to unregister the card and then CODEC dev can't fix this issue.

Thus this patch just provides a simple fix to these two bugs by using the
snd-soc-dummy in the core instead of seperate snd-soc-spdif-tx/rx so that
there's no need to handle the registering and unregistering of CODEC or
CODEC dai any more.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: core: Fix the DAI name getting.
Xiubo Li [Fri, 20 Dec 2013 06:39:51 +0000 (14:39 +0800)]
ASoC: core: Fix the DAI name getting.

From "ASoC: make snd_soc_dai_link more symmetrical", can we see that
the name of CPU DAI maybe omitted. If the DAI name is omitted, try to
use the component name instead.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: add SRC (Sampling Rate Converter) support
Kuninori Morimoto [Fri, 20 Dec 2013 03:28:51 +0000 (19:28 -0800)]
ASoC: rsnd: add SRC (Sampling Rate Converter) support

This patch adds SRC support to Renesas sound driver.
SRC converts sampling rate between codec <-> cpu.
It needs special codec chip,
or very simple DA/AD converter to use it.
This patch was tested via ak4554 codec,
and supports Gen1 only at this point.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: tidyup rsnd_ssi_master_clk_start() parameter
Kuninori Morimoto [Fri, 20 Dec 2013 03:28:39 +0000 (19:28 -0800)]
ASoC: rsnd: tidyup rsnd_ssi_master_clk_start() parameter

Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.

This patch cleanup it with focusing about SRC and Gen2 part.

ssi clock which is calculated from rsnd_ssi_master_clk_start()
should have flexibility since Renesas sound has
SRC (= Sampling Rate Converter).
But current implementation is using runtime->rate directly.
This patch tidyup rsnd_ssi_master_clk_start() parameter
as preparation of future SRC support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: scu cleanup: add rsnd_scu_rate_ctrl()
Kuninori Morimoto [Fri, 20 Dec 2013 03:28:31 +0000 (19:28 -0800)]
ASoC: rsnd: scu cleanup: add rsnd_scu_rate_ctrl()

Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.

This patch cleanup it with focusing about SRC and Gen2 part.

rsnd_scu_set_hpbif() is renamed to rsnd_scu_rate_ctrl(),
since its naming doesn't indicate the function meaning.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: INT_ENABLE is needed only Gen2
Kuninori Morimoto [Fri, 20 Dec 2013 03:28:19 +0000 (19:28 -0800)]
ASoC: rsnd: INT_ENABLE is needed only Gen2

INT_ENABLE is needed only Gen2.
rsnd_mod_write() do nothing on Gen1, but it is confusable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: add rsnd_scu_transfer_start()
Kuninori Morimoto [Fri, 20 Dec 2013 03:28:04 +0000 (19:28 -0800)]
ASoC: rsnd: add rsnd_scu_transfer_start()

Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.

This patch cleanup it with focusing about SRC and Gen2 part.

SRC_CTRL/BUSIF_MODE are used for transfer start.
This patch adds rsnd_scu_transfer_start() and merge these

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: route setting is needed only Gen1
Kuninori Morimoto [Fri, 20 Dec 2013 03:27:37 +0000 (19:27 -0800)]
ASoC: rsnd: route setting is needed only Gen1

Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.

This patch cleanup it with focusing about SRC and Gen2 part.

rsnd_scu_set_route() is needed only Gen1.

This patch renames it to rsnd_scu_set_route_if_gen1()
and it adds comment to rsnd_reg member
in order to clarify it is used for Gen1.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: make sure variable name for 44.1kHz/48kHz
Kuninori Morimoto [Fri, 20 Dec 2013 03:27:19 +0000 (19:27 -0800)]
ASoC: rsnd: make sure variable name for 44.1kHz/48kHz

This driver is assuming that
RBGA is used as source clock of 44.1kHz category, and
RBGB is used as source clock of 48kHz category.
This patch clarifies the variable name.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: tidyup register naming
Kuninori Morimoto [Fri, 20 Dec 2013 03:27:03 +0000 (19:27 -0800)]
ASoC: rsnd: tidyup register naming

Use correct register name which appears in the datasheet

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: tidyup ssi comment
Kuninori Morimoto [Fri, 20 Dec 2013 03:26:44 +0000 (19:26 -0800)]
ASoC: rsnd: tidyup ssi comment

we can check rsnd_ssi_init(), not, rsnd_ssi_start()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rsnd: add rsnd_adg_set_ssi_clk() and cleanup adg
Kuninori Morimoto [Fri, 20 Dec 2013 03:26:31 +0000 (19:26 -0800)]
ASoC: rsnd: add rsnd_adg_set_ssi_clk() and cleanup adg

This patch adds rsnd_adg_set_ssi_clk() to access to
AUDIO_CLK_SEL0/1/2, and removes last user of
rsnd_write/read/bset which is very low level function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: hdmi-codec: Add devicetree binding with documentation
Jyri Sarha [Fri, 20 Dec 2013 10:40:16 +0000 (12:40 +0200)]
ASoC: hdmi-codec: Add devicetree binding with documentation

Signed-off-by: Jyri Sarha <jsarha@ti.com>
cc: bcousson@baylibre.com
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: simple-card: Cleanup __asoc_simple_card_dai_init() ret check
Xiubo Li [Mon, 23 Dec 2013 05:24:59 +0000 (13:24 +0800)]
ASoC: simple-card: Cleanup __asoc_simple_card_dai_init() ret check

The ret parameter is always equal to zero till here.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: simple-card: Add DAPM routes parse from device tree
Xiubo Li [Mon, 23 Dec 2013 04:57:01 +0000 (12:57 +0800)]
ASoC: simple-card: Add DAPM routes parse from device tree

Parses a simple DAPM route table from device tree.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: atmel: sam9x5_wm8731: remove platform_set_drvdata
Bo Shen [Wed, 27 Nov 2013 10:05:10 +0000 (18:05 +0800)]
ASoC: atmel: sam9x5_wm8731: remove platform_set_drvdata

When call snd_soc_register_card, it will set driver data to this
device through dev_set_drvdata, then in driver, no need to call
platform_set_drvdata again, so remove it.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl_sai: fix the endianess for SAI fifo data.
Xiubo Li [Tue, 31 Dec 2013 07:33:22 +0000 (15:33 +0800)]
ASoC: fsl_sai: fix the endianess for SAI fifo data.

Revert the SAI's endianess for fifo data to/from DMA engine.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl_sai: Fix one bug for hardware limitation.
Xiubo Li [Tue, 31 Dec 2013 07:33:21 +0000 (15:33 +0800)]
ASoC: fsl_sai: Fix one bug for hardware limitation.

This is maybe one bug or a limitation of the hardware that the {T,R}CR2's
Synchronous Mode bits must be set as late as possible, or the SAI device
maybe hanged up, and there has not any explaination about this limitation
in the SAI Data Sheet.

And the {T,R}CR2's Synchronous Mode bits must be set at the same time whether
for Tx or Rx stream.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>