aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/pci/asihpi/asihpi.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-01-05ALSA: asihpi: More constificationsTakashi Iwai1-2/+2
Apply const prefix to each possible place: the static tables for formats, parameters, etc. Just for minor optimization and no functional changes. Link: https://lore.kernel.org/r/20200105144823.29547-33-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: asihpi: Drop superfluous ioctl PCM opsTakashi Iwai1-17/+0
snd_card_asihpi_playback_ioctl() and snd_card_asihpi_capture_ioctl() do nothing but calling the default handler. Now PCM core accepts NULL as the default ioctl ops(*), so let's drop altogether. (*) commit fc033cbf6fb7 ("ALSA: pcm: Allow NULL ioctl ops") Link: https://lore.kernel.org/r/20191210061145.24641-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: asihpi: Use managed buffer allocationTakashi Iwai1-7/+3
Clean up the driver 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-24-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-11-06ALSA: pci: Avoid non-standard macro usageTakashi Iwai1-2/+2
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-07-08Merge tag 'asoc-v5.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai1-14/+1
ASoC: Updates for v5.3 This is a very big update, mainly thanks to Morimoto-san's refactoring work and some fairly large new drivers. - Lots more work on moving towards a component based framework from Morimoto-san. - Support for force disconnecting muxes from Jerome Brunet. - New drivers for Cirrus Logic CS47L35, CS47L85 and CS47L90, Conexant CX2072X, Realtek RT1011 and RT1308. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-05ALSA: asihpi: Remove unneeded variable changeHariprasad Kelam1-5/+2
this patch fixes below issue reported by coccicheck sound/pci/asihpi/asihpi.c:1558:5-11: Unneeded variable: "change". Return "1" on line 1564 Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 273Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of version 2 of the gnu general public license as published by the free software foundation this program 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 program 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 24 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141334.606756275@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-06ALSA: pci: Clean up with new procfs helpersTakashi Iwai1-4/+2
Simplify the proc fs creation code with new helper functions, snd_card_ro_proc_new() and snd_card_rw_proc_new(). Just a code refactoring and no functional changes. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-19ALSA: asihpi: clean up indentation, replace spaces with tabColin Ian King1-1/+1
The struct declaration is not indented correctly. Fix this by replacing spaces with a tab. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27ALSA: asihpi: Fix PCM format notationsTakashi Iwai1-11/+13
asihpi driver treats -1 as an own invalid PCM format, but this needs a proper cast with __force prefix since PCM format type is __bitwise. Define a constant with the proper type and use it allover. This fixes sparse warnings like: sound/pci/asihpi/asihpi.c:315:9: warning: incorrect type in initializer (different base types) Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28sound: Use octal not symbolic permissionsJoe Perches1-6/+6
Convert the S_<FOO> symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...> Miscellanea: o Wrapped one multi-line call to a single line Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-10-16ALSA: asihpi: clean up a couple of build warningsColin Ian King1-3/+0
Variable dpcm is never used and hence can be removed. Variable runtime is being assigned but is never read, so the assignment is redundant and can be removed. Cleans up two clang warnings: Value stored to 'dpcm' is never read Value stored to 'runtime' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-10-05ALSA: asihpi: Convert timers to use timer_setup()Kees Cook1-7/+5
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-09-07ALSA: asihpi: Kill BUG_ON() usagesTakashi Iwai1-5/+1
BUG_ON() is the worst choice for a trivial sanity check. Either it should be removed or replaced with a softer one like WARN_ON() if still really needed. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02ALSA: constify snd_pcm_ops structuresJulia Lawall1-2/+2
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> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-24ALSA: asihpi: Fix duplicate const for clock sourcesKrzysztof Kozlowski1-1/+1
Replace duplicated const keyword for 'sampleclock_sources' with proper array of const pointers to const strings. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-19ALSA: asihpi: Use setup_timer() and mod_timer()Takashi Iwai1-8/+5
No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-02ALSA: asihpi: Remove always NULL parameterLars-Peter Clausen1-7/+2
snd_asihpi_hpi_new() takes a pointer to a pointer of a hwdep where if this parameter is provided the newly allocated hwdep is stored. All callers pass NULL though, so remove the parameter. This makes the code a bit cleaner and shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-22ALSA: asihpi: Use standard printk helpersEliot Blennerhassett1-19/+13
Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-22ALSA: asihpi: Add support for stream interrupt.Eliot Blennerhassett1-29/+148
Some cards have a so-called low-latency mode, in which they present a single multichannel stream with no mixing or samplerate conversion. In this mode the card can generate an interrupt per internal processing block (typically 32 or 64 frames) Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-22ALSA: asihpi: Logging format improvementsEliot Blennerhassett1-46/+39
Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-22ALSA: asihpi: New I/O types - AVB & BLUlink, DAB Rf receiverEliot Blennerhassett1-7/+18
Audio cards wth have AVB or BLU Link IO. Tuner card with DAB receiver Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-22ALSA: asihpi: Minor string and dead code cleanupEliot Blennerhassett1-9/+4
Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-09ALSA: pcm: Add snd_pcm_stop_xrun() helperTakashi Iwai1-4/+1
Add a new helper function snd_pcm_stop_xrun() to the standard sequnce lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the existing open codes with this helper. The function checks the PCM running state to prevent setting the wrong state, too, for more safety. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21ALSA: asihpi: Use snd_ctl_enum_info()Takashi Iwai1-41/+5
... and reduce the open codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-12PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine1-1/+1
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ - DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id i[] = z; // </smpl> [bhelgaas: add semantic patch] Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-03-31ALSA: asihpi: fix some indenting in snd_card_asihpi_pcm_new()Dan Carpenter1-4/+5
This used to be a part of a condition until f3d145aac913 ('ALSA: asihpi: MMAP for non-busmaster cards') but now it's not and we can remove an indent level. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12ALSA: pci: Convert to snd_card_new() with a device pointerTakashi Iwai1-11/+5
Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-13ALSA: asihpi: a couple array out of bounds issuesDan Carpenter1-2/+7
These ->put() functions are called from snd_ctl_elem_write() with user supplied data. snd_asihpi_tuner_band_put() is missing a limit check and the check in snd_asihpi_clksrc_put() can underflow. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-15ALSA: asihpi: Fix unlocked snd_pcm_stop() callTakashi Iwai1-0/+3
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 Iwai1-1/+1
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 Zack1-1/+1
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 Zack1-2/+2
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 Yongjun1-1/+2
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 Pemberton1-28/+27
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 Tschudin1-1/+1
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 Iwai1-1/+1
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 Iwai1-0/+3
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 Blennerhassett1-36/+33
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 Blennerhassett1-12/+8
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 Blennerhassett1-1/+3
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 Blennerhassett1-77/+66
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 Blennerhassett1-2/+1
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 Blennerhassett1-3/+3
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 Blennerhassett1-3/+2
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 Blennerhassett1-2/+6
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 Blennerhassett1-2/+14
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 Blennerhassett1-4/+13
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 Blennerhassett1-2/+2
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 Russell1-2/+2
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>