summaryrefslogtreecommitdiffstats
path: root/sound/firewire/dice.c
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: dice: Move file to its own directoryTakashi Sakamoto2014-11-291-1512/+0
| | | | | | | | | In followed commits, dice driver is split into several files. For easily managing these files, this commit adds subdirectory and move file into the directory. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: dice: Rename structure and its membersTakashi Sakamoto2014-11-291-81/+81
| | | | | | | | | | | | Currently, dice driver supports AMDTP out-stream. In followed commits, AMDTP in-stream will be supported but current name of members in dice structure are not propper. This commit renames these members to proper name. Additionally, for easily distinguishing local symbols from structure tag, rename dice tag into snd_dice. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: dice: suppress checkpatch.pl warningsTakashi Sakamoto2014-11-291-4/+5
| | | | | | | | | | The checkpatch.pl generates some warnings due to: - C99 comment - a line over 80 characters - min() for parameters with different types Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire-lib/dice: add arrangements of PCM pointer and interrupts for ↵Takashi Sakamoto2014-08-291-4/+11
| | | | | | | | | | | | | | | | | | | | | | | Dice quirk In IEC 61883-6, one data block transfers one event. In ALSA, the event equals one PCM frame, hence one data block transfers one PCM frame. But Dice has a quirk at higher sampling rate (176.4/192.0 kHz) that one data block transfers two PCM frames. Commit 10550bea44a8 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRE") moved some codes related to this quirk into Dice driver. But the commit forgot to add arrangements for PCM period interrupts and DMA pointer updates. As a result, Dice driver cannot work correctly at higher sampling rate. This commit adds 'double_pcm_frames' parameter to amdtp structure for this quirk. When this parameter is set, PCM period interrupts and DMA pointer updates occur at double speed than in IEC 61883-6. Reported-by: Daniel Robbins <drobbins@funtoo.org> Fixes: 10550bea44a8 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRE") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Cc: <stable@vger.kernel.org> # 3.16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: dice: fix wrong channel mappping at higher sampling rateTakashi Sakamoto2014-08-291-5/+9
| | | | | | | | | | | | | | The channel mapping is initialized by amdtp_stream_set_parameters(), however Dice driver set it before calling this function. Furthermore, the setting is wrong because the index is the value of array, and vice versa. This commit moves codes for channel mapping after the function and set it correctly. Reported-by: Daniel Robbins <drobbins@funtoo.org> Fixes: 10550bea44a8 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRE") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Cc: <stable@vger.kernel.org> # 3.16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire-lib/dice/speakers: Add common PCM constraints for AMDTP streamsTakashi Sakamoto2014-05-261-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds common PCM constraints according to current firewire-lib implementation. 1.Maximum width for each sample is limited by 24. AM824 in IEC 61883-6 can deliver 24bit data. 2. Minimum time for period is 5msec. Apply the old value. For shorter latency, further works are needed. 3. In blocking mode, frames per period/buffer is aligned to 32. Each packet can include some frames depending on its sampling rate. In blocking mode, the number equals to SYT_INTERVAL. Currently firewire-lib can schedule snd_pcm_period_elapsed() for each packet. So, for accurate PCM interrupt, the number of frames per period/buffer should be aligned to SYT_INTERVAL. Currently firewire-lib is lack of better rules to achieve this. So LCM of each value of SYT_INTERVALs (=32) is applied. This can be improved for further work. [Fixed the compile error due to the missing "&" by tiwai] Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRETakashi Sakamoto2014-05-261-6/+27
| | | | | | | | | In previous commit, AMDTP functionality in firewire-lib supports mapping for PCM data channels. With this mapping, firewire-lib can obsolete a flag, CIP_HI_DUALWIRE, but Dice driver still keeps dual wire mode. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire-lib: Add 'direction' member to 'amdtp_stream' structureTakashi Sakamoto2014-05-261-1/+1
| | | | | | | | | | | | | | | This patch adds 'direction' member to amdtp_stream structure to indicate its direction. This patch also adds 'direction' argument to amdtp_stream_init() function to determine its direction. The amdtp_stream_init() function is exported and used by firewire-speakers and dice so this patch also affects them. This patch just add them. Actual implementation will be done by followed patches. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire-lib: Rename functions, structure, member for AMDTPTakashi Sakamoto2014-05-261-23/+23
| | | | | | | | This patch renames some functions, a structure and its member to reuse them in both AMDTP in/out stream. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire: Convert to snd_card_new() with a device pointerTakashi Iwai2014-02-141-2/+2
| | | | | | | Also remove superfluous snd_card_set_dev() calls. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: dice: fix array limits in dice_proc_read()Dan Carpenter2013-11-291-2/+2
| | | | | | | | | | The array limits are supposed to be in units of u32 instead of in bytes. The current code has a potential array overflow. Fixes: c614475b0ea9 ('ALSA: dice: add a proc file to show device information') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang2013-11-151-1/+1
| | | | | | | | | | | | Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ALSA: dice: restrict the driver to playback-only devicesClemens Ladisch2013-10-201-0/+9
| | | | | | | | At the moment, this driver supports only playback, while FFADO supports (only) full-duplex devices. So, prevent conflicts by not claiming devices that would be better handled by FFADO. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: fix detection of Weiss devicesClemens Ladisch2013-10-201-5/+12
| | | | | | | | While most DICE devices keep TCAT's default category ID of 0x04, Weiss devices identify themselves with 0x00. Reported-by: Rolf Anderegg <rolf.anderegg@weiss.ch> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: dice_proc_read: remove wrong typecastClemens Ladisch2013-10-201-2/+1
| | | | | | Remove a wrong typecast that resulted from a copy-and-paste error. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: add a proc file to show device informationClemens Ladisch2013-10-201-0/+246
| | | | | | | For easier debugging, add a proc file to show the device's capabilities and current status. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: check clock change timeoutClemens Ladisch2013-10-201-2/+3
| | | | | | | Output a warning if the wait for the clock change notification times out. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: dynamic sample rate selectionClemens Ladisch2013-10-201-35/+102
| | | | | | | Instead of relying of some control panel application to configure some fixed sample rate, allow applications to set it automatically. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: get rate-dependent parametersClemens Ladisch2013-10-201-2/+90
| | | | | | | In preparation for sample rate selection support, read the stream parameters that might change when running at different sample rates. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: allow notifications during initializationClemens Ladisch2013-10-201-11/+11
| | | | | | | Reorganize the initialization order so that the driver can receive notifications earlier. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: get clock capabilitiesClemens Ladisch2013-10-201-2/+21
| | | | | | | In preparation for sample rate selection support, ensure that the driver knows about the device's clock capabilities. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: fix lockingStefan Richter2013-10-201-4/+4
| | | | | | | Avoid a lock inversion between dice->mutex and pcm->open_mutex. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: remove superfluous fieldClemens Ladisch2013-10-201-3/+1
| | | | | | The pcm field was not actually used. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: remove 10s period length limitClemens Ladisch2013-10-201-1/+1
| | | | | | | Since commit f2b3614cefb6 (Don't check DMA time-out too shortly), we need no longer to restrict the period length to less than 10 s. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: avoid superflous write at bus resetClemens Ladisch2013-10-201-0/+5
| | | | | | | When a bus reset happens, the enable register is automatically cleared, so we do not need to clear it manually when stopping the stream. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: firewire: extend snd_fw_transaction()Clemens Ladisch2013-10-201-143/+64
| | | | | | | | | | | Add a flag to snd_fw_transaction() to allow it to abort when a bus reset happens. This removes most of the duplicated error handling loops that were required around calls to the low-level fw_run_transaction(). Also add a flag to suppress error messages; errors are expected when we attempt to clean up after the device was unplugged. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: optimize reading of consecutive registersClemens Ladisch2013-10-201-16/+11
| | | | | | | Instead of reading two consecutive register with two quadlet requests, use one block read request. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: support dual-wire stream format at 192 kHzClemens Ladisch2013-10-201-8/+21
| | | | | | | Change the AMDTP streaming code to handle the non-standard stream format that DICE devices use at sample rates greater than 96 kHz. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: fix device detection for other vendorsClemens Ladisch2013-10-201-18/+84
| | | | | | | | | DICE devices do not have a unique specifier ID in their unit directory (it's always the same as the device vendor's ID), so rely on just the version ID for driver loading, and use a heuristic in the probe callback to detect actual DICE devices. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: reorganize interface definitionsClemens Ladisch2013-10-201-207/+2
| | | | | | | Move the DICE interface symbols into a separate header file, and add more documentation. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: firewire: introduce amdtp_out_stream_running()Clemens Ladisch2013-10-201-12/+5
| | | | | | | | Introduce the helper function amdtp_out_stream_running(). This makes many checks in amdtp.c clearer and frees the device drivers from having to track this with a separate variable. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: clear device lock when closing hwdep deviceClemens Ladisch2013-10-201-0/+13
| | | | | | | Ensure that misbehaving or aborted userspace programs do not accidentally keep the lock. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: implement hwdep deviceClemens Ladisch2013-10-201-22/+203
| | | | | | Implement the hwdep locking and notification mechanisms. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: fix hang when unplugging a running deviceClemens Ladisch2013-10-201-2/+5
| | | | | | | | | | | When aborting a PCM stream, the xrun is signaled only if the stream is running. When disconnecting a PCM stream, calling snd_card_disconnect() too early would change the stream into a non-running state and thus prevent the xrun from being noticed by user space. To prevent this, move the snd_card_disconnect() call after the xrun. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice, firewire-lib: add blocking modeClemens Ladisch2013-10-201-1/+1
| | | | | | | | | Allow AMDTP output streams to use blocking mode. Use it for DICE devices, because the old DICE-II chip will in some cases not be able to lock to non-blocking streams (erratum E7). Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: reduce noisy loggingClemens Ladisch2013-10-201-2/+2
| | | | | | | The notification bits are not of general interest; log them only when debugging. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: allow all sample ratesClemens Ladisch2013-10-201-13/+42
| | | | | | | | | | Instead of forcing a constant 44.1 kHz, read the current sample rate from the device when opening the PCM device. Actually changing the sample rate requires some separate controller application. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: dice: optimize bus reset handlingClemens Ladisch2013-10-201-55/+93
| | | | | | | After a bus reset, do not stop the stream completely to avoid having to reconfigure the device when restarting the stream. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* ALSA: add DICE driverClemens Ladisch2013-10-171-0/+1008
As a start point for further development, this is an incomplete driver for DICE devices: - only playback (so no clock source except the bus clock) - only 44.1 kHz - no MIDI - recovery after bus reset is slow - hwdep device is created, but not actually implemented Contains compilation fixes by Stefan Richter. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
OpenPOWER on IntegriCloud