summaryrefslogtreecommitdiffstats
path: root/sound/pci/asihpi/asihpi.c
AgeCommit message (Collapse)Author
2013-07-15ALSA: asihpi: Fix unlocked snd_pcm_stop() callTakashi Iwai
snd_pcm_stop() must be called in the PCM substream lock context. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-28ALSA: Replace the magic number 44 with constTakashi Iwai
The char arrays with size 44 are for the name string of snd_ctl_elem_id. Define the constant and replace the raw numbers with it for clarifying better. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-29ALSA: asihpi: add format support check in snd_card_asihpi_capture_formatsEldad Zack
Some Asihpi formats are not supported or invalid, and their mapping to ALSA format is set to -1. Before performing the format conversion into ALSA bitwise formats, add a consistency check for the requested format, as done in snd_card_asihpi_playback_formats(). Compile tested only. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-29ALSA: pcm_format_to_bits strong-typed conversionEldad Zack
Add a function to handle conversion from snd_pcm_format_t to bitwise with proper typing. Change such conversions to use this function and silence sparse warnings. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12ALSA: asihpi - fix potential NULL pointer dereferenceWei Yongjun
The dereference should be moved below the NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07ALSA: pci: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06sound: Remove unnecessary semicolonPeter Senna Tschudin
A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r1@ statement S; position p,p1; @@ S@p1;@p @script:python r2@ p << r1.p; p1 << r1.p1; @@ if p[0].line != p1[0].line_end: cocci.include_match(False) @@ position r1.p; @@ -;@p // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14ALSA: PCI: Replace CONFIG_PM with CONFIG_PM_SLEEPTakashi Iwai
Otherwise we may get compile warnings due to unused functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-09ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info()Takashi Iwai
Dan Carpenter reported that setting 0 to uinfo->value.enumerated.items in snd_asihpi_cmode_info() may lead to Oops. This function should return an error immediately in such a case instead. Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Fix format validity check.Eliot Blennerhassett
Sharing and not reinitialising static pcm_hardware struct resulted in stream format validity flags being incorrectly shared between cards. Fix and clarify by declaring locally and initialising in the open functions. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Use valid channel count in format enumeration.Eliot Blennerhassett
Since introduction of mono and low latency modes, fixed channel count of 2 is not always valid. Use reported max_channels instead. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Add HPI version to module description.Eliot Blennerhassett
It is useful to know the HPI version without having to load the module, in order to determine the matching firmware version. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Remove redundant struct members.Eliot Blennerhassett
Structs hpi_adapter and snd_card_asihpi had members that duplicate those in underlying hpi_adapter_obj or whose info can be retrieved using hpi_adapter_get_info(). Print less info in probe function, it can be retrieved from /proc. Avoid name redundancy: hpi_adapter_obj.adapter_type renamed to .type Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Update node types.Eliot Blennerhassett
Add "Internal" node type. Remove GPI and GPO node types. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Only set sync if card supports hardware stream grouping.Eliot Blennerhassett
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Relax drained check for more reliable playback startup.Eliot Blennerhassett
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Use snd_pcm_debug_name to get substream name.Eliot Blennerhassett
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Volumes and meters may have 1 or 2 channels.Eliot Blennerhassett
The channel count can be queried to determine which. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - Low latency mode stream has fixed channel count.Eliot Blennerhassett
Unlike other streams which support 1..max channels, Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-22ALSA: asihpi - fix pcm dma pointer trackingEliot Blennerhassett
Elapsed counter should only count data committed to snd_pcm_period_elapsed, rather than all data available Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-19ALSA: module_param: make bool parameters really boolRusty Russell
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-10-31sound: Add module.h to the previously silent sound usersPaul Gortmaker
Lots of sound drivers were getting module.h via the implicit presence of it in <linux/device.h> but we are going to clean that up. So fix up those users now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-07-24ALSA: Make snd_pcm_debug_name usable outside pcm_libEliot Blennerhassett
Formatting a PCM name is useful for module debug too. Add snd_prefix when making function public. [minor coding-style fixes by tiwai] Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-22Merge branch 'topic/misc' into for-linusTakashi Iwai
2011-07-22ALSA: asihpi - Replace with snd_ctl_boolean_mono_info()Takashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-22ALSA: asihpi - Add volume mute controlsEliot Blennerhassett
Mute functionality was recently added to the DSP firmware Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-22ALSA: asihpi - Control name updatesEliot Blennerhassett
Add names corresponding to new HPI node types. Shorten some names so that constructed names don't overflow the maximum name length. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-22ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macroEliot Blennerhassett
Work towards moving the function into alsa common header. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-24ALSA: Remove unneeded version.h includes from sound/Jesper Juhl
In the sound/ directory there are two files (flagged by 'make versioncheck'); sound/pci/asihpi/asihpi.c and sound/soc/codecs/wm8991.c that include linux/version.h although they don't need it. This patch removes the unneeded includes. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10ALSA: Use KBUILD_MODNAME for pci_driver.name entriesTakashi Iwai
The convention for pci_driver.name entry in kernel drivers seem to be the module name or equivalent ones. But, so far, almost all PCI sound drivers use more verbose name like "ABC Xyz (12)", and these are fairly confusing when appearing as a file name. This patch converts the all pci_driver.name entries in sound/pci/* to use KBUILD_MODNAME for more unified appearance. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-22Merge branch 'topic/misc' into for-linusTakashi Iwai
2011-04-05ALSA: asihpi: Standardise substream name generationEliot Blennerhassett
Define and use pcm_debug_name if CONFIG_SND_DEBUG Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-05ALSA: asihpi: MMAP for non-busmaster cardsEliot Blennerhassett
Allow older non DMA capable cards to use MMAP by emulating the DMA using read and write functions, and getting rid of copy & silence callbacks that were used only by older cards. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-05ALSA: asihpi: Handle playback drained status betterEliot Blennerhassett
Use the card drained status reporting for playback, but allow it to persist for a few timer cycles before signalling XRUN, to allow card to recover by itself. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-05ALSA: asihpi: Update debug printingEliot Blennerhassett
Debug print full substream ID. Other minor debug print updates. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-05ALSA: snd-asihpi: Control namingEliot Blennerhassett
Clock source is neither capture nor playback, so change 'Capture Clock' to 'Clock'. Add spaces to control name string for consistency, always 'PCM 0' , never 'PCM0' Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-25ALSA: asihpi - Update verbose debug print macrosEliot Blennerhassett
Replace local VPRINTK1 with snd_printdd. Create local snd_printddd instead of VPRINTK2 for most verbose debug. In most cases let snd_printk supply default level for messages. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-25ALSA: asihpi - Improve non-busmaster adapter operationEliot Blennerhassett
Make playback silence callback a no-op, card automatically outputs silence when written data runs out. Increasing update interval and thus minimum period avoids xrun on startup or because of timer jitter. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-25ALSA: asihpi - Support single-rate no-SRC cardsEliot Blennerhassett
Cards without settable local samplerate and without SRC still must have a valid samplerate. This fixed rate is determined by reading the current rate for the card. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-10ALSA: asihpi - Fix outstream start trigger for non-mmap adapters.Eliot Blennerhassett
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-10ALSA: asihpi - Add snd_card_set_dev to init.Eliot Blennerhassett
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-10ALSA: asihpi - Remove unused subsys pointer from all HPI functions.Eliot Blennerhassett
asihpi.c don't link playback and capture streams, there is too much offset between them. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-10ALSA: asihpi - Rewrite PCM timer function. Update control names.Eliot Blennerhassett
Reported samples_played from card may be inaccurate, so don't use it. Update control names to be closer to alsa standard practice. Also fixed some accidentally lowercased strings. [Removed adriver.h inclusion for external module builds by tiwai] Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-16ALSA: asihpi: fix sign bugKulikov Vasiliy
bytes_per_sec is unsigned, so if snd_pcm_format_width() return error we would not see it. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-06ALSA: asihpi - HPI API updatesEliot Blennerhassett
Remove some deprecated items. Change compander api to one function per parameter. Add a version string define. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-02ALSA: asihpi - Fix uninitialized variableTakashi Iwai
Initialize prev_ctl properly before reference: sound/pci/asihpi/asihpi.c: In function ‘snd_card_asihpi_mixer_new’: sound/pci/asihpi/asihpi.c:2568:30: warning: ‘prev_ctl.dst_node_index’ may be used uninitialized in this function Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-22ALSA: Add support of AudioScience ASI boardsEliot Blennerhassett
Added the support of AudioScience ASI boards. The driver has been tested for years on alsa-driver external tree, now finally got merged to the kernel. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>