summaryrefslogtreecommitdiffstats
path: root/sound/core
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'topic/pcm-internal' into for-nextTakashi Iwai2015-02-231-51/+41
|\
| * ALSA: pcm: Don't ignore internal PCMs in snd_pcm_dev_disconnect()Takashi Iwai2015-02-201-5/+2
| | | | | | | | | | | | | | | | | | | | | | Some codes in snd_pcm_dev_disconnect() are still valid even for internal PCMs, but they are skipped because of the check of list_empty(&pcm->list) at the beginning. Remove this check and put pcm->internal checks appropriately for internal PCM object to process through this function. Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: pcm: Don't notify internal PCMsTakashi Iwai2015-02-201-5/+8
| | | | | | | | | | | | | | Notifier shouldn't listen to the changes of internal PCMs. Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: pcm: Don't add internal PCMs to PCM device listTakashi Iwai2015-02-201-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An internal PCM object shouldn't be added to the PCM device list, as it's never accessed directly from the user-space, and it has no proc or any similar accesses. Currently, it's excluded in snd_pcm_get() and snd_pcm_next(), but it's easier not to add such an object to the list. Actually, the whole snd_pcm_dev_register() can be skipped for an internal PCM. So this patch changes the code there, but also addresses the uninitialized list_head access. Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: pcm: Minor refactoring in snd_pcm_attach_substream()Takashi Iwai2015-02-201-26/+15
| | | | | | | | | | | | | | No functional changes at all. Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/seq-cleanup' into for-nextTakashi Iwai2015-02-236-475/+168
|\ \ | |/ |/|
| * ALSA: seq: Drop snd_seq_autoload_lock() and _unlock()Takashi Iwai2015-02-124-36/+9
| | | | | | | | | | | | | | | | The autoload lock became already superfluous due to the recent rework of autoload code. Let's drop them now. This allows us to simplify a few codes nicely. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: seq: Define driver object in each driverTakashi Iwai2015-02-125-104/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the driver object initialization and allocation to each driver's module init/exit code like other normal drivers. The snd_seq_driver struct is now published in seq_device.h, and each driver is responsible to define it with proper driver attributes (name, probe and remove) with snd_seq_driver specific attributes as id and argsize fields. The helper functions snd_seq_driver_register(), snd_seq_driver_unregister() and module_snd_seq_driver() are used for simplifying codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: seq: Clean up device and driver structsTakashi Iwai2015-02-121-21/+10
| | | | | | | | | | | | | | | | Use const string pointer instead of copying the id string to each object. Also drop the status and list fields of snd_seq_device struct that are no longer used. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: seq: Rewrite sequencer device binding with standard busTakashi Iwai2015-02-121-374/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've used the old house-made code for binding the sequencer device and driver. This can be far better implemented with the standard bus nowadays. This patch refactors the whole sequencer binding code with the bus /sys/bus/snd_seq. The devices appear as id-card-device on this bus and are bound with the drivers corresponding to the given id like the former implementation. The module autoload is also kept like before. There is no change in API functions by this patch, and almost all transitions are kept inside seq_device.c. The proc file output will change slightly but kept compatible as much as possible. Further integration works will follow in later patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: seq: Don't compile snd_seq_device_load_drivers() for built-inTakashi Iwai2015-02-121-6/+3
| | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: seq: Move EXPORT_SYMBOL() after each functionTakashi Iwai2015-02-121-10/+8
| | | | | | | | | | | | ... to follow the standard coding style. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: Consolidate snd_find_free_minor()Takashi Iwai2015-02-171-9/+5
|/ | | | | | | A really small cleanup to consolidate snd_find_free_minor() and snd_kernel_minor() so that we can get rid of one more ifdef. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: seq: potential out of bounds in do_control()Dan Carpenter2015-02-121-0/+3
| | | | | | | | | | | | | | | | | Smatch complains that "control" is user specifigy and needs to be capped. The call tree to understand this warning is quite long. snd_seq_write() <-- get the event from the user snd_seq_client_enqueue_event() snd_seq_deliver_event() deliver_to_subscribers() snd_seq_deliver_single_event() snd_opl3_oss_event_input() snd_midi_process_event() do_control() Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: control: fix failure to return new numerical ID in 'replace' event dataTakashi Sakamoto2015-02-091-0/+1
| | | | | | | | | In 'replace' event data, numerical ID of control is always invalid. This commit fix this bug so as the event data has renewed numerical ID for control. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm: allow for trigger_tstamp snapshot in .triggerPierre-Louis Bossart2015-02-091-1/+3
| | | | | | | | | Don't use generic snapshot of trigger_tstamp if low-level driver or hardware can get a more precise value for better audio/system time synchronization. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: pcm: don't override timestamp unconditionallyPierre-Louis Bossart2015-02-091-1/+4
| | | | | | | | | | | | timestamp in RUNNING mode is already taken in update_hw_ptr routine, getting a new timestamp introduces offset between hw_ptr, audio_tstamp and system time Add else condition to read timestamp as fallback and only when enabled Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: control: fix failure to return numerical ID in 'add' eventTakashi Sakamoto2015-02-081-0/+1
| | | | | | | | | Currently when adding a new control, the assigned numerical ID is not set for event data, thus userspace applications cannot realize it just by event data. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Add a helper to add a new attribute group to cardTakashi Iwai2015-02-061-6/+25
| | | | | | | | | | | | | | | For assigning sysfs entries for a card device from the driver, introduce a new helper function, snd_card_add_dev_attr(). In this way, we can avoid the possible race between the device registration and the sysfs addition / removal. The driver can pass a new attribute group to add freely. This has to be called before snd_card_register(). Currently, up to two extra groups can be added. More than that, it'll return an error. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge tag 'asoc-v3.20-2' of ↵Takashi Iwai2015-02-051-0/+85
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.20 More updates for v3.20: - Lots of refactoring from Lars-Peter Clausen, moving drivers to more data driven initialization and rationalizing a lot of DAPM usage. - Much improved handling of CDCLK clocks on Samsung I2S controllers. - Lots of driver specific cleanups and feature improvements. - CODEC support for TI PCM514x and TLV320AIC3104 devices. - Board support for Tegra systems with Realtek RT5677. Conflicts: sound/soc/intel/sst-mfld-platform-pcm.c
| * Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-nextMark Brown2015-02-041-0/+85
| |\
| | * ALSA: pcm: Add snd_interval_ranges() and snd_pcm_hw_constraint_ranges()Peter Rosin2015-01-281-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add helper functions to allow drivers to specify several disjoint ranges for a variable. In particular, there is a codec (PCM512x) that has a hole in its supported range of rates, due to PLL and divider restrictions. This is like snd_pcm_hw_constraint_list(), but for ranges instead of points. Signed-off-by: Peter Rosin <peda@axentia.se> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge branch 'topic/snd-device' into for-nextTakashi Iwai2015-02-039-255/+237
|\ \ \
| * | | ALSA: Drop snd_get_device() helperTakashi Iwai2015-02-021-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the device is no longer hidden but embedded into each component, we no longer need snd_get_device(). Let's drop it and relevant codes. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: Simplify snd_device_register() variantsTakashi Iwai2015-02-028-86/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all callers have been replaced with snd_device_register_for_dev(), let's drop the obsolete device registration code and concentrate only on the code handling struct device directly. That said, - remove the old snd_device_register(), - rename snd_device_register_for_dev() with snd_device_register(), - drop superfluous arguments from snd_device_register(), - change snd_unregister_device() to pass the device pointer directly Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: compress: Embed struct deviceTakashi Iwai2015-02-021-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like previous patches, this one embeds the struct device into struct snd_compr. As the dev field wasn't used beforehand, it's reused as the new device struct. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: seq: Handle the device directlyTakashi Iwai2015-02-021-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the previous change for the timer device, this patch changes the device management for the ALSA sequencer device using the struct device directly. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: timer: Handle the device directlyTakashi Iwai2015-02-021-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a relatively straightforward change, using the struct device directly for managing the ALSA timer device. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: timer: Propagate the error at initializationTakashi Iwai2015-02-021-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of just printing errors. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: rawmidi: Use rawmidi device file for kernel messagesTakashi Iwai2015-02-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of card's device. This will be helpful to distinguish errors from multiple rawmidi devices on a single card. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: rawmidi: Embed struct deviceTakashi Iwai2015-02-021-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like previous patches, this changes the device management for rawmidi, embedding the struct device into struct snd_rawmidi. The required change is more or less same as hwdep device. The currently unused dev field is reused as the new embedded struct field now. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: pcm: Embed struct deviceTakashi Iwai2015-02-021-23/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like previous patches, at this time we embed the struct device into PCM object. However, this needs a bit more caution: struct snd_pcm doesn't own one device but two, for both playback and capture! Thus not struct snd_pcm but struct snd_pcm_str object contains the device. Along with this change, pcm->dev field is dropped for avoiding confusion. It was meant to point to a non-standard parent. But, since now we can touch each struct device directly, we can manipulate the parent field easily there, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: hwdep: Embed struct deviceTakashi Iwai2015-02-021-50/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the previous patch, this one embeds the device object into hwdep object. For a proper object lifecycle, it's freed in the release callback. This also allows us to create sysfs entries via passing to the groups field of the device without explicit function calls. Since each driver can see the device and touch its groups field directly, we don't need to delegate in hwdep core any longer. So, remove the groups field from snd_hwdep, and let the user (in this case only hda_hwdep.c) modify the device groups. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: control: Embed struct deviceTakashi Iwai2015-02-021-24/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch embeds a struct device for the control device into the card object and avoid the device creation at registration time. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: Add a helper to initialize deviceTakashi Iwai2015-02-021-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new helper function snd_device_initialize() to initialize the device object for sound devices. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: control: Provide a helper to look for the preferred subdeviceTakashi Iwai2015-02-023-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of open-coding the search over the control file loop, provide a helper function for the preferred subdevice assigned to the current process. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: Allow to pass the device object to snd_register_device*()Takashi Iwai2015-02-023-22/+37
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preliminary patch for the further work on embedding struct device into each sound device instance. It changes snd_register_device*() helpers to receive the device object directly for skipping creating a device there. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: Include linux/uaccess.h and linux/bitopts.h instead of asm/*Takashi Iwai2015-01-281-1/+1
| | | | | | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: Include linux/io.h instead of asm/io.hTakashi Iwai2015-01-283-3/+3
| | | | | | | | | | | | | | | | | | Nowadays it's recommended. Replace all in a shot. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: seq: remove unused callback_all fieldClemens Ladisch2015-01-263-7/+2
| | | | | | | | | | | | | | | Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: seq: fix off-by-one error in port limit checkClemens Ladisch2015-01-261-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: seq: correctly report maximum number of portsClemens Ladisch2015-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Due to SNDRV_SEQ_ADDRESS_BROADCAST, not all 256 port number values can be used. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | Merge branch 'for-linus' into for-nextTakashi Iwai2015-01-261-31/+0
|\| | | | | | | | | | | | | | Sync with the latest 3.19-rc state for applying other ALSA sequencer core fixes.
| * | ALSA: seq-dummy: remove deadlock-causing events on closeClemens Ladisch2015-01-261-31/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the last subscriber to a "Through" port has been removed, the subscribed destination ports might still be active, so it would be wrong to send "all sounds off" and "reset controller" events to them. The proper place for such a shutdown would be the closing of the actual MIDI port (and close_substream() in rawmidi.c already can do this). This also fixes a deadlock when dummy_unuse() tries to send events to its own port that is already locked because it is being freed. Reported-by: Peter Billam <peter@www.pjb.com.au> Cc: <stable@vger.kernel.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: timer: Use setup_timer() and mod_timer()Takashi Iwai2015-01-191-3/+1
| | | | | | | | | | | | No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: seq: Deletion of unnecessary checks before the function call ↵Markus Elfring2015-01-042-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | "snd_midi_event_free" The snd_midi_event_free() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: pcm: add SNDRV_PCM_TRIGGER_DRAIN triggerLibin Yang2014-12-311-1/+9
| | | | | | | | | | | | | | | | | | | | Add SNDRV_PCM_TRIGGER_DRAIN trigger for pcm drain. Some audio devices require notification of drain events in order to properly drain and shutdown an audio stream. Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/pcm-params' into for-nextTakashi Iwai2014-12-301-3/+3
|\ \
| * | ALSA: snd_pcm_oss_period_size: Use round{up,down}_pow_of_two()Lars-Peter Clausen2014-12-301-3/+3
| |/ | | | | | | | | | | | | | | | | | | Instead of opencoding them use the standard roundup_pow_of_two() and rounddown_pow_of_two() helper functions. This gets rids one of the few users of the custom ld2() function and also makes it a bit more obvious what the code does. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: Add support for wildcard msbits constraintsLars-Peter Clausen2014-12-301-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the msbits constraints requires to specify a specific sample format width for which the constraint should be applied. But often the number of most significant bits is not sample format specific, but rather a absolute limit. E.g. the PCM interface might accept 32-bit and 24-bit samples, but the DAC has a 16-bit resolution and throws away the LSBs. In this case for both 32-bit and 24-bit format msbits should be set to 16. This patch extends snd_pcm_hw_constraint_msbits() so that a wildcard constraint can be setup that is applied for all formats with a sample width larger than the specified msbits. Choosing the wildcard constraint is done by setting the sample width parameter of the function to 0. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>