aboutsummaryrefslogtreecommitdiff
path: root/sound/core
AgeCommit message (Collapse)Author
2014-06-03Merge branch 'for-linus' into for-nextTakashi Iwai
Just to catch up a few small fixes for HD-audio and DMA engine.
2014-05-19ALSA: pcm_dmaengine: Add check during device suspendTushar Behera
Currently snd_dmaengine_pcm_trigger() calls dmaengine_pause() unconditinally during device suspend. In case where DMA controller doesn't support PAUSE/RESUME functionality, this call is not able to stop the DMA controller. In this scenario, audio playback doesn't resume after device resume. Calling dmaengine_pause/dmaengine_terminate_all conditionally fixes the issue. It has been tested with audio playback on Samsung platform having PL330 DMA controller which doesn't support PAUSE/RESUME. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28ALSA: core: Fix format string mismatch in seq_midi.cMasanari Iida
Fix format string mismatch in snd_seq_midisynth_register_port(). Argument type of p is unsigned int. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-16ALSA: pcm: 'BUG:' message unnecessarily triggers kerneloopsTim Gardner
BugLink: http://bugs.launchpad.net/bugs/1305480 The kerneloops-daemon scans dmesg for common crash signatures, among which is 'BUG:'. The message emitted by the PCM library is really a warning, so the most expedient thing to do seems to be to change the string. Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-31Merge branch 'for-next' into for-linusTakashi Iwai
2014-03-19ALSA: compress: Pass through return value of open ops callbackCharles Keepax
The snd_compr_open function would always return 0 even if the compressed ops open function failed, obviously this is incorrect. Looks like this was introduced by a small typo in: commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85 ALSA: Add a reference counter to card instance This patch returns the value from the compressed op as it should. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-13Merge tag 'asoc-v3.15' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.15 Quite a busy release for ASoC this time, more on janitorial work than exciting new features but welcome nontheless: - Lots of cleanups from Takashi for enumerations; the original API for these was error prone so he's refactored lots of code to use more modern APIs which avoid issues. - Elimination of the ASoC level wrappers for I2C and SPI moving us closer to converting to regmap completely and avoiding some randconfig hassle. - Provide both manually and transparently locked DAPM APIs rather than a mix of the two fixing some concurrency issues. - Start converting CODEC drivers to use separate bus interface drivers rather than having them all in one file helping avoid dependency issues. - DPCM support for Intel Haswell and Bay Trail platforms. - Lots of work on improvements for simple-card, DaVinci and the Renesas rcar drivers. - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the CSR SiRF SoC.
2014-02-27ALSA: Move EXPORT_SYMBOL() in appropriate placesTakashi Iwai
Just a cleanup to follow the standard coding style. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25ALSA: Clean up snd_device_*() codesTakashi Iwai
A few code cleanups and optimizations. In addition, drop snd_device_disconnect() that isn't used at all, and drop the return values from snd_device_free*(). Another slight difference by this change is that now the device state will become always SNDRV_DEV_REGISTERED no matter whether dev_register ops is present or not. It's for better consistency. There should be no impact for the current tree, as the state isn't checked. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25ALSA: Use priority list for managing device listTakashi Iwai
Basically, the device type specifies the priority of the device to be registered / freed, too. However, the priority value isn't well utilized but only it's checked as a group. This results in inconsistent register and free order (where each of them should be in reversed direction). This patch simplifies the device list management code by simply inserting a list entry at creation time in an incremental order for the priority value. Since we can just follow the link for register, disconnect and free calls, we don't have to specify the group; so the whole enum definitions are also simplified as well. The visible change to outside is that the priorities of some object types are revisited. For example, now the SNDRV_DEV_LOWLEVEL object is registered before others (control, PCM, etc) and, in return, released after others. Similarly, SNDRV_DEV_CODEC is in a lower priority than SNDRV_DEV_BUS for ensuring the dependency. Also, the unused SNDRV_DEV_TOPLEVEL, SNDRV_DEV_LOWLEVEL_PRE and SNDRV_DEV_LOWLEVEL_NORMAL are removed as a cleanup. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25ALSA: hwdep: Allow to assign the given parentTakashi Iwai
Just like PCM, allow hwdep to be assigned to a different parent device than the card. It'll be used for the HD-audio codec device in the later patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25ALSA: hwdep: Take private_data as drvdata for sysfsTakashi Iwai
For referring to a different object from sysfs ops, take hwdep private_data as stored via dev_set_drvdata() at creating the device object. In that way, the same sysfs ops can be used by different device types. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25ALSA: Create sysfs attribute files via groupsTakashi Iwai
Instead of calling each time device_create_file(), create the groups of sysfs attribute files at once in a normal way. Add a new helper function, snd_get_device(), to return the associated device object, so that we can handle the sysfs addition locally. Since the sysfs file addition is done differently now, snd_add_device_sysfs_file() helper function is removed. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-20ALSA: Export snd_pcm_constraint_mask64()Mark Brown
Allow modules to use it, fixing a build failure when the newly added ADAU1977 driver is built as a module. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Takashi Iwai <tiwai@suse.de>
2014-02-19ALSA: core: Fix missing card sysfs contentsTakashi Iwai
While moving the card device into struct snd_card, the reference to the assigned card in sysfs show/store callbacks were forgotten to be refreshed, still accessing to the no longer used drvdata. Fix these places to refer correctly via container_of(). Also, remove the superfluous NULL checks since it's guaranteed to be non-NULL now. Fixes: 8bfb181c17d2 ('ALSA: Embed card device into struct snd_card') Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: Drop __bitwise and typedefs for snd_device attributesTakashi Iwai
Using __bitwise and typedefs for the attributes of snd_device struct isn't so useful, and rather it worsens the readability. Let's drop them and use the straightforward enum. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: seq_oss: Use standard printk helpersTakashi Iwai
Use the standard pr_xxx() helpers instead of home-baked snd_print*(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: seq: Use standard printk helpersTakashi Iwai
Use the standard pr_xxx() helpers instead of home-baked snd_print*(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: timer: Use standard printk helpersTakashi Iwai
Use the standard pr_xxx() helpers instead of home-baked snd_print*(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: oss: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: hwdep: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: rawmidi: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: core: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: pcm: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. For simplicity, introduce new helpers for pcm stream, pcm_err(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: control: Use standard printk helpersTakashi Iwai
Use dev_err() & co as much as possible. If not available (no device assigned at the calling point), use pr_xxx() helpers instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: seq_oss: Drop debug printsTakashi Iwai
The debug prints in snd-seq-oss module are rather useless. Let's clean up before further modifications. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: Use standard device refcount for card accountingTakashi Iwai
Drop the own refcount but use the standard device refcounting via get_device() and put_device(). Introduce a new completion to snd_card instead of the wait queue for syncing the last release, which is used in snd_card_free(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: Use static groups for id and number card sysfs attr filesTakashi Iwai
... instead of calling device_create_file() manually. No functional change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-14ALSA: Embed card device into struct snd_cardTakashi Iwai
As prepared in the previous patch, we are ready to create a device struct for the card object in snd_card_create() now. This patch changes the scheme from the old style to: - embed a device struct for the card object into snd_card struct, - initialize the card device in snd_card_create() (but not register), - registration is done in snd_card_register() via device_add() The actual card device is stored in card->card_dev. The card->dev pointer is kept unchanged and pointing to the parent device as before for compatibility reason. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12ALSA: Mandate to pass a device pointer at card creation timeTakashi Iwai
This is a part of preliminary works for modernizing the ALSA device structure. So far, we set card->dev at later point after the object creation. Because of this, the core layer doesn't always know which device is being handled before it's actually registered, and it makes impossible to show the device in error messages, for example. The first goal is to achieve a proper struct device initialization at the very beginning of probing. As a first step, this patch introduces snd_card_new() function (yes there was the same named function in the very past), in order to receive the parent device pointer from the very beginning. snd_card_create() is marked as deprecated. At this point, there is no functional change other than that. The actual change of the device creation scheme will follow later. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12ALSA: Drop unused name argument in snd_register_oss_device()Takashi Iwai
The last argument, name, of snd_oss_register_device() is nowhere referred in the function in the current code. Let's drop it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10ALSA: Replace with IS_ENABLED()Takashi Iwai
Replace the lengthy #if defined(XXX) || defined(XXX_MODULE) with the new IS_ENABLED() macro. The patch still doesn't cover all ifdefs. For example, the dependency on CONFIG_GAMEPORT is still open-coded because this also has an extra dependency on MODULE. Similarly, an open-coded ifdef in pcm_oss.c and some sequencer-related stuff are left untouched. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10ALSA: Fix typos in alsa-driver-api.xmlMasanari Iida
This patch fixed 2 typos in DocBook/alsa-driver-api.xml. It is because this file is generated by make xmldocs, I have to fix typos within source files. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-23ALSA: Refactor slot assignment codeTakashi Iwai
There are two loops that are almost identical but only with different checks. Refactor them with a simple helper, and give a bit more comments what's doing there. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-23ALSA: bits vs bytes bug in snd_card_create()Dan Carpenter
The test here is intended intended to prevent shift wrapping bugs when we do "1U << idx2". We should consider the number of bits in a u32 instead of the number of bytes. [fix another chunk similarly by tiwai] Fixes: 7bb2491b35a2 ('ALSA: Add kconfig to specify the max card numbers') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-16Merge remote-tracking branch 'asoc/topic/pcm' into for-tiwaiMark Brown
2014-01-14ALSA: Add helper function for intersecting two rate masksLars-Peter Clausen
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>
2014-01-11ALSA: PCM: Warn when buffer preallocation failsTakashi Iwai
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>
2014-01-09ALSA: Merge memalloc code into snd-pcm moduleTakashi Iwai
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>
2014-01-09ALSA: Remove superfluous header inclusions in memalloc.cTakashi Iwai
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>
2014-01-09ALSA: Remove memory reservation code from memalloc helperTakashi Iwai
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>
2014-01-09ALSA: Remove memory accounting in memalloc helperTakashi Iwai
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>
2014-01-05ALSA: compress: remove the sample rate checkVinod Koul
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>
2013-12-17ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail functionJongHo Kim
When the process is sleeping at the SNDRV_PCM_STATE_PAUSED state from the wait_for_avail function, the sleep process will be woken by timeout(10 seconds). Even if the sleep process wake up by timeout, by this patch, the process will continue with sleep and wait for the other state. Signed-off-by: JongHo Kim <furmuwon@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-16Merge tag 'sound-fix-3.13-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Two peaks in diffstat are for the audio EQ init of IDT codecs and the EMU2004 usb mixer addition, both of which are pretty device-specific, so safe to apply. The rest are a bunch of small fixes, most of them are regression fixes" * tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits) ALSA: hda - load EQ params into IDT codec on HP bNB13 systems ASoC: cs42l52: Correct MIC CTL mask ASoC: wm8962: Turn on regcache_cache_only before disabling regulator ALSA: jack: Unregister input device at disconnection ALSA: pcsp: Fix the order of input device unregistration ASoC: fsl: imx-pcm-fiq: omit fiq counter to avoid harm in unbalanced situations ASoC: blackfin: Fix missing break ALSA: usb-audio: add front jack channel selector for EMU0204 ALSA: hda - Don't clear the power state at snd_hda_codec_reset() ASoC: arizona: Fix typo in name of EQ coefficient controls ALSA: hda - Control EAPD for Master volume on Lenovo N100 ALSA: hda - Don't turn off EAPD for headphone on Lenovo N100 ALSA: isa: not allocating enough space ALSA: snd-aoa: two copy and paste bugs ASoC: wm8997: Correct typo in ISRC mux routes ALSA: hda - Check keep_eapd_on before inv_eapd ALSA: hda - Fix Line Out automute on Realtek multifunction jacks ALSA: msnd: Avoid duplicated driver name ALSA: compress_core: don't return -EBADFD from poll if paused ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD ...
2013-11-15sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram bufferNicolin Chen
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-14ALSA: jack: Unregister input device at disconnectionTakashi Iwai
The recent change in sysfs triggered a kernel WARNING at unloading a sound driver like WARNING: CPU: 3 PID: 2247 at fs/sysfs/group.c:214 sysfs_remove_group+0xe8/0xf0() sysfs group ffffffff81ab7b20 not found for kobject 'event14' for each jack instance. It's because the unregistration of jack input device is done in dev_free callback, which is called after snd_card_disconnect(). Since device_unregister(card->card_dev) is called in snd_card_disconnect(), the whole sysfs entries belonging to card->card_dev have been already removed recursively. Thus this results in a warning as input_unregister_device() yet tries to unregister the already removed sysfs entry. For fixing this mess, we need to unregister the jack input device at dev_disconnect callback so that it's called before unregistering the card->card_dev. Reviwed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-13Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs updates from Al Viro: "All kinds of stuff this time around; some more notable parts: - RCU'd vfsmounts handling - new primitives for coredump handling - files_lock is gone - Bruce's delegations handling series - exportfs fixes plus misc stuff all over the place" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (101 commits) ecryptfs: ->f_op is never NULL locks: break delegations on any attribute modification locks: break delegations on link locks: break delegations on rename locks: helper functions for delegation breaking locks: break delegations on unlink namei: minor vfs_unlink cleanup locks: implement delegations locks: introduce new FL_DELEG lock flag vfs: take i_mutex on renamed file vfs: rename I_MUTEX_QUOTA now that it's not used for quotas vfs: don't use PARENT/CHILD lock classes for non-directories vfs: pull ext4's double-i_mutex-locking into common code exportfs: fix quadratic behavior in filehandle lookup exportfs: better variable name exportfs: move most of reconnect_path to helper function exportfs: eliminate unused "noprogress" counter exportfs: stop retrying once we race with rename/remove exportfs: clear DISCONNECTED on all parents sooner exportfs: more detailed comment for path_reconnect ...
2013-11-12ALSA: compress_core: don't return -EBADFD from poll if pausedRichard Fitzgerald
Pausing audio playback is not an illegal state so it doesn't seem sensible for poll() to return -EBADFD on a paused stream. There's also no reason to assume that we can't write more data to the DSP while playback is paused. Remove the -EBADFD so that a stream in paused state will still report the buffer availability from poll(). It is up to the user process to manage its state so that it knows whether it is paused or not. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by VInod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07ALSA: compress: fix drain calls blocking other compress functions (v6)Vinod Koul
The drain and drain_notify callback were blocked by low level driver until the draining was complete. Due to this being invoked with big fat mutex held, others ops like reading timestamp, calling pause, drop were blocked. So to fix this we add a new snd_compr_drain_notify() API. This would be required to be invoked by low level driver when drain or partial drain has been completed by the DSP. Thus we make the drain and partial_drain callback as non blocking and driver returns immediately after notifying DSP. The waiting is done while releasing the lock so that other ops can go ahead. [ The commit 917f4b5cba78 was wrongly applied from the preliminary patch. This commit corrects to the final version. Sorry for inconvenience! -- tiwai ] Signed-off-by: Vinod Koul <vinod.koul@intel.com> CC: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>