summaryrefslogtreecommitdiff
path: root/sound/pci/oxygen/oxygen_pcm.c
AgeCommit message (Collapse)Author
2020-07-09ALSA: Replace with fallthrough pseudo keyword in the remaining placesTakashi Iwai
A few places (except for ASoC) are left unconverted for the new fallthrough pseudo keyword. Now replace them all. Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200709111750.8337-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: pci: Drop superfluous ioctl PCM opsTakashi Iwai
PCM core deals the empty ioctl field now as default(*). Let's kill the redundant lines. (*) commit fc033cbf6fb7 ("ALSA: pcm: Allow NULL ioctl ops") Link: https://lore.kernel.org/r/20191210061145.24641-16-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: oxygen: Use managed buffer allocationTakashi Iwai
Clean up the drivers with the new managed buffer allocation API. The superfluous snd_pcm_lib_malloc_pages() and snd_pcm_lib_free_pages() calls are dropped. Link: https://lore.kernel.org/r/20191209094943.14984-49-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-11-06ALSA: pci: Avoid non-standard macro usageTakashi Iwai
Pass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability. Link: https://lore.kernel.org/r/20191105151856.10785-24-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 404Thomas Gleixner
Based on 1 normalized pattern(s): this driver is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 this driver is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this driver if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 6 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190531190112.130218438@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02ALSA: oxygen: constify snd_pcm_ops structuresJulia Lawall
Check for snd_pcm_ops structures that are only stored in the ops field of a snd_soc_platform_driver structure or passed as the third argument to snd_pcm_set_ops. The corresponding field or parameter is declared const, so snd_pcm_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct snd_pcm_ops i@p = { ... }; @ok1@ identifier r.i; struct snd_soc_platform_driver e; position p; @@ e.ops = &i@p; @ok2@ identifier r.i; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-16ALSA: oxygen: add support for third analog inputClemens Ladisch
Make it possible for cards to have three stereo analog input pairs. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-02ALSA: oxygen: Remove unnecessary snd_pcm_lib_preallocate_free_for_all()Lars-Peter Clausen
The ALSA core takes care that all preallocated memory is freed when the PCM itself is freed. There is no need to do this manually in the driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-22ALSA: oxygen: set fifo_sizeClemens Ladisch
Allow the driver to report the hardware FIFO size. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17ALSA: firewire-speakers, oxygen, ua101: allow > 10 s periodsClemens Ladisch
Since commit f2b3614cefb6 (Don't check DMA time-out too shortly), drivers need no longer restrict their PCM period length to be shorter than 10 seconds. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10ALSA: oxygen: simplify model-specific MCLK handlingClemens Ladisch
Replace the get_i2s_mclk callback with tables of MCLK values. This simplifies the MCLK-handling code in both the framework and the model- specific drivers. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10ALSA: oxygen: allow different number of PCM and mixer channelsClemens Ladisch
For cards like the Xonar HDAV1.3, differentiate between the number of PCM channels that can be played and the number of channels whose volume can be adjusted. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-22ALSA: oxygen: support for period wakeup disablingClemens Ladisch
Allow disabling period wakeup interrupts for all PCM streams. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-06ALSA: oxygen: reduce minimum period countClemens Ladisch
The interrupt counter is independent of the buffer counter, so there are no restrictions on the period size. Having fewer periods also makes PulseAudio happy. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-28sound: oxygen: allow custom MCLK ratesClemens Ladisch
Add a callback that allows model drivers to modify the default I2S MCLK rate. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-28sound: oxygen: add stereo upmixing to center/LFE channelsClemens Ladisch
Add the possibility to route a mix of the two channels of stereo data to the center and LFE outputs. This is implemented only for models where the DACs support this, i.e., for the Xonar D1 and DX. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-01sound: oxygen: fix MCLK rate for 192 kHz playbackClemens Ladisch
Do not forget to program the MCLK ratio for the I2S output. Otherwise, the master clock frequency can be too high for the DACs at sample frequencies above 96 kHz. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-25sound: oxygen: reset DMA when stream is closedClemens Ladisch
When a PCM stream is closed, flush the corresponding DMA channel. Otherwise, the DMA controller would continue to output the last sample which would result in a DC offset on the output. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-22ALSA: oxygen: rename first PCM deviceClemens Ladisch
Rename the first PCM device from "Analog" to "Multichannel" because it can be used for HDMI output on the Xonar HDAV. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2008-09-22ALSA: oxygen: rename pcm_dev_cfgClemens Ladisch
Rename the pcm_dev_cfg field to device_config because there will be additional flags that do not describe PCM devices. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2008-09-22ALSA: oxygen: use a copy of the model structClemens Ladisch
Put a copy of the model structure into the chip structure so that model- specific drivers can modify it depending on a particular device instance. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2008-05-19[ALSA] virtuoso: restrict period time to less than 10 sClemens Ladisch
Add a constraint for the period time so that there are less than ten seconds between interrupts so that ALSA does not assume that the device is dead. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-05-19[ALSA] oxygen: add symbols for buffer/period size constraintsClemens Ladisch
Introduce symbols for the buffer/period size constraints so that their limits and relationships become clearer. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-05-19[ALSA] oxygen: add PM supportClemens Ladisch
Add suspend/resume support. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-04-24[ALSA] oxygen: change model-specific PCM device configurationClemens Ladisch
When specifying which PCM devices to use, model drivers now use flags that also specify the routing between PCM devices and DMA channels instead of just DMA channel bits. This simplifies some code that checks for these flags. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-02-22[ALSA] oxygen - Fix section mismatchTakashi Iwai
Removed invalid __devinit and __devexit that are remaining after split to a helper module. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-31[ALSA] oxygen: add front panel captureClemens Ladisch
When a second AC97 codec is present, add a PCM device for capturing from the front panel. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: more initializationClemens Ladisch
Initialize more registers of the controller and the second AC97 codec. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: make the number of analog output configurableClemens Ladisch
Add a field to struct oxygen_model to allow model drivers for cards with less than eight output channels. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: fix SPDIF input ratesClemens Ladisch
Fix up SPDIF input sample rates again: 32 kHz and 64 kHz are not supported. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: optimize snd_pcm_hardware structuresClemens Ladisch
Add one more indirection to the lookup of the snd_pcm_hardware structures so that we can save the space of the duplicate ones. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: add 192 kHz SPDIF input supportClemens Ladisch
Change the oxygen_spdif_input_bits_changed() function so that clock changes on the SPDIF input are correctly detected. This means that sample rates greater than 96 kHz are now supported. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: fix pause handlingClemens Ladisch
Use the DMA_PAUSE register for pausing instead of stopping DMA. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: remove magic numbersClemens Ladisch
Replace some magic numbers with register symbols. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: add register definitionsClemens Ladisch
Add more symbols for registers and register fields. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: make the I2S format configurableClemens Ladisch
Add proper register bit symbols for the I2S format field, and allow card models to configure the I2S format to be used for the DACs and ADCs. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: make PCM limits configurableClemens Ladisch
Add a callback to the model structure to allow modification of the hardware PCM limits. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: make all DMA channels configurableClemens Ladisch
Allow the card models to specify whether each of the hardware DMA channels is used. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: make AC97 codec optionalClemens Ladisch
Only initialize and create mixer controls for the first AC97 codec when one has actually been detected. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: use an array of snd_kcontrol pointersClemens Ladisch
Use an array for the pointers to known controls so that it is easier to add more. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Remove sound/driver.hTakashi Iwai
This header file exists only for some hacks to adapt alsa-driver tree. It's useless for building in the kernel. Let's move a few lines in it to sound/core.h and remove it. With this patch, sound/driver.h isn't removed but has just a single compile warning to include it. This should be really killed in future. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] oxygen: use uintptr_t in pointer castsClemens Ladisch
When we store the DMA channel number in the substream's private_data pointer, use uintptr_t as an intermediate step when casting from/to unsigned int to prevent the compiler from whining when the pointer size is different. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] add CMI8788 driverClemens Ladisch
Add the snd-oxygen driver for the C-Media CMI8788 (Oxygen) chip, used on the Asound A-8788, AuzenTech X-Meridian, Bgears b-Enspirer, Club3D Theatron DTS, HT-Omega Claro, Razer Barracuda AC-1, Sondigo Inferno, and TempoTec HIFIER sound cards. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>