aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/au88x0/au88x0_core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-12-15ALSA: au88x0: fixed spelling mistakes in au88x0_core.cGhanshyam Agrawal1-5/+5
Multiple spelling mistakes were reported by codespell. They were fixed. Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@gmail.com> Link: https://lore.kernel.org/r/20231215031144.521359-1-ghanshyam1898@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-10-25ALSA: au88x0: use explicitly signed charJason A. Donenfeld1-1/+1
With char becoming unsigned by default, and with `char` alone being ambiguous and based on architecture, signed chars need to be marked explicitly as such. This fixes warnings like: sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)' sound/pci/au88x0/au88x0_core.c:2046 vortex_adb_checkinout() warn: signedness bug returning '(-12)' sound/pci/au88x0/au88x0_core.c:2125 vortex_adb_allocroute() warn: 'vortex_adb_checkinout(vortex, (0), en, 0)' is unsigned sound/pci/au88x0/au88x0_core.c:2170 vortex_adb_allocroute() warn: 'vortex_adb_checkinout(vortex, stream->resources, en, 4)' is unsigned As well, since one function returns errnos, return an `int` rather than a `signed char`. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20221024162929.536004-1-Jason@zx2c4.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-09ALSA: au88x0: Fix assignment in if conditionTakashi Iwai1-23/+24
PCI AU88x0 driver code contains a lot of assignments in if condition, which is a bad coding style that may confuse readers and occasionally lead to bugs. This patch is merely for coding-style fixes. A potential real fix is about the PCI AGP bridge management refcount in addition while spotted out during conversions. Link: https://lore.kernel.org/r/20210608140540.17885-36-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-09ALSA: Replace with fallthrough pseudo keyword in the remaining placesTakashi Iwai1-6/+6
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>
2020-01-05ALSA: au88x0: More constificationsTakashi Iwai1-1/+1
Apply const prefix to each possible place: the static register tables, the coef tables, the string arrays, etc. Just for minor optimization and no functional changes. Link: https://lore.kernel.org/r/20200105144823.29547-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 130Thomas Gleixner1-13/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version 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 library 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-or-later has been chosen to replace the boilerplate/reference in 10 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527063114.579638220@linutronix.de Link: https://lkml.kernel.org/r/20190524100843.303899865@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-12ALSA: au88xx: Add fall-through annotationsTakashi Iwai1-0/+6
As a preparatory patch for the upcoming -Wimplicit-fallthrough compiler checks, add the "fall through" annotation in au88xx driver. Although the usages in both both functions vortex_adbdma_setbuffers() and vortex_wtdma_setbuffers() look a bit suspicious, we keep the behavior as before, just to be safer. If it were broken, we should have already received bug reports. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-27ALSA: au88x0: Fix sparse warning wrt PCM format typeTakashi Iwai1-1/+1
The PCM format type is with __bitwise, and it can't be converted from integer implicitly. Instead of an ugly cast, declare the function argument of vortex_alsafmt_aspfmt() with the proper snd_pcm_format_t type. This fixes the sparse warning like: sound/pci/au88x0/au88x0_core.c:2778:14: warning: restricted snd_pcm_format_t degrades to integer Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-10-17ALSA: au88x0: remove redundant assignment of variable iColin Ian King1-1/+1
The assignment to variable i is redundant as it is never read because it is updated a little later on. Remove this assignment. Cleans up clang warning: Value stored to 'i' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-24ALSA: au88x0: avoid theoretical uninitialized accessArnd Bergmann1-0/+3
The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never initialize some variables: sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute': sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] I assume this can never happen in practice, but adding a check here doesn't hurt either and avoids the warning. The code has been unchanged since the start of git history. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-16ALSA: au88x0: Add missing \n to end of dev_err messageColin Ian King1-1/+1
Trival fix, the dev_err message is missing a \n so add it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-06-29ALSA: au88x0: Fix calculation in vortex_wtdma_bufshift()Takashi Iwai1-3/+2
vortex_wtdma_bufshift() function does calculate the page index wrongly, first masking then shift, which always results in zero. The proper computation is to first shift, then mask. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-05-12ALSA: au88x0: Fix zero clear of stream->resourcesTakashi Iwai1-9/+5
There are a few calls of memset() to stream->resources, but they all are called in a wrong size, sizeof(unsigned char) * VORTEX_RESOURCE_LAST, while this field is a u32 array. This may leave the memories not zero-cleared. Fix it by replacing them with a simpler sizeof(stream->resources) instead. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-15ALSA: au88x0: pr_* replaced with dev_*Sudip Mukherjee1-45/+52
pr_* macros replaced with dev_* as they are more preffered over pr_*. each file which had pr_* was reviewed manually and replaced with dev_*. here we have actually used the reference of the vortex which was added to some functions in the previous patch of this series. The prefix of the CARD_NAME and prefix of "vortex:" was also removed as the dev_* will print the device name. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-15ALSA: au88x0: added reference of vortex_tSudip Mukherjee1-2/+3
added a pointer of the vortex in the following functions : vortex_alsafmt_aspfmt vortex_Vort3D_InitializeSource a3dsrc_ZeroStateA3D so that we can have a reference of the vortex in the function. this reference of the vortex will actually be used in a later patch to convert the pr_* macro to dev_*. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-09sound: pci: au88x0: printk replacementSudip Mukherjee1-38/+38
as pr_* macros are more preffered over printk, so printk replaced with corresponding pr_* macros. this patch will generate warning from checkpatch as it only did printk replacement and didnot fixed other style issues. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07ALSA: pci: remove __dev* attributesBill Pemberton1-1/+1
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-25ALSA: au88x0: Give comment for vortex_wtdma_bufshift() issueTakashi Iwai1-1/+6
The check of the return value from vortex_wtdma_bufshft() in vortex_interrupt() is useless as it executes no code. Actually the return value is intentionally ignored because the delta calculation for wavetable doesn't work always correctly. For avoiding the confusion, a comment is added and the superfluous if () is removed. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-16ALSA: au88x0 - Avoid possible Oops at unbindingTakashi Iwai1-1/+1
The irq handler must check whether the MPU401 instance is still alive. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-24ALSA: Au88x0 - Implement subdevice volume controlsRaymond Yau1-7/+11
- add "PCM Playback Volume" controls for 16 playback subdevices This allow application to change the volume of each subdevice by using hardware mixer of au88x0 and default is zero gain/attenunation. Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-08ALSA: Au88x0 - Fix channels swapping of 4 channels playbackRaymond Yau1-2/+0
Fix channels swapping of 4 channels playback by using vortex_adbdma_stopfifo instead of vortex_adbdma_pausefifo for SNDRV_PCM_TRIGGER_STOP event Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-08ALSA: Au88x0 - Fix IRQ fifo error and channels swap of 4 channels playbackRaymond Yau1-4/+4
Fix IRQ fifo error when playing stereo by set stereo flag of fifo control. This also fix the swap of front and rear channels on au8830. Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-18Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-2/+2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (47 commits) doc: CONFIG_UNEVICTABLE_LRU doesn't exist anymore Update cpuset info & webiste for cgroups dcdbas: force SMI to happen when expected arch/arm/Kconfig: remove one to many l's in the word. asm-generic/user.h: Fix spelling in comment drm: fix printk typo 'sracth' Remove one to many n's in a word Documentation/filesystems/romfs.txt: fixing link to genromfs drivers:scsi Change printk typo initate -> initiate serial, pch uart: Remove duplicate inclusion of linux/pci.h header fs/eventpoll.c: fix spelling mm: Fix out-of-date comments which refers non-existent functions drm: Fix printk typo 'failled' coh901318.c: Change initate to initiate. mbox-db5500.c Change initate to initiate. edac: correct i82975x error-info reported edac: correct i82975x mci initialisation edac: correct commented info fs: update comments to point correct document target: remove duplicate include of target/target_core_device.h from drivers/target/target_core_hba.c ... Trivial conflict in fs/eventpoll.c (spelling vs addition)
2011-02-14ALSA: au88x0 - Modify pointer callback to give accurate playback positionRaymond Yau1-3/+11
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-19Kill off warning: ‘inline’ is not at beginning of declarationJesper Juhl1-2/+2
Fix a bunch of warning: ‘inline’ is not at beginning of declaration messages when building a 'make allyesconfig' kernel with -Wextra. These warnings are trivial to kill, yet rather annoying when building with -Wextra. The more we can cut down on pointless crap like this the better (IMHO). A previous patch to do this for a 'allnoconfig' build has already been merged. This just takes the cleanup a little further. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-05-29ALSA: au88x0: fix wrong period_elapsed() callJaroslav Kysela1-1/+2
The period_elapsed() call should be called when position moves. The idea was taken from ALSA bug#4455. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-29ALSA: au88x0: fix .pointer callbackJaroslav Kysela1-4/+3
Appearently, the used mask in the .pointer callback is invalid. It should be in period_bytes range. The period_bytes is pow(2), so simple bitwise operation is used. Idea was taken from ALSA bug#4455. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-17ALSA: au88x0 - Fix &&|| typoTakashi Iwai1-1/+1
Fixed a typo of || and &&. As it's in a disabled code section, there is no behavior change, though. Reported-by: Jörg-Volker Peetz <jvpeetz@web.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-05ALSA: Fix missing KERN_* prefix to printk in sound/pciTakashi Iwai1-4/+15
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-25ALSA: Clean up SG-buffer helper functions and macrosTakashi Iwai1-21/+17
Clean up SG-buffer helper functions and macros. Helpers take substream as arguments now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13ALSA: au88x0: clipping ceiling loop wrong in commentroel kluin1-1/+1
As is the clipping ceiling loop appears wrong anyways Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] sound/: Spelling fixesJoe Perches1-1/+1
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-2/+2
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-07-12[ALSA] Fix section mismatch errors in ALSA PCI driversTakashi Iwai1-2/+2
Fixed 'section mismatch' errors in ALSA PCI drivers: - removed invalid __devinitdata from pci id tables - fix/remove __devinit of functions called in suspend/resume Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-04-12[ALSA] au88x0 - clean up __devinit/__devexitDale Sedivec1-1/+1
Modules: au88x0 driver Removed all use of __devinit/__devexit and init.h from headers. Any attributes given in the prototype but not in the function definition have been moved to the definition. An exception is vortex_eq_free: I removed the __devexit attribute because vortex_eq_free is called from vortex_core_shutdown, and vortex_core_shutdown may be called from __devinit snd_vortex_create. Compile tested with allyesconfig and allmodconfig. Signed-off-by: Dale Sedivec <dale@codefu.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] au88x0 - 64bit arch fixesTakashi Iwai1-6/+6
Modules: au88x0 driver Fix the driver codes to run on 64bit architectures. The patch taken from ALSA BTS bug#1047. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03[ALSA] Remove xxx_t typedefs: PCI AU88x0Takashi Iwai1-4/+4
Modules: au88x0 driver Remove xxx_t typedefs from the PCI AU88x0 drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] Add missing KERN_* suffix to printkTakashi Iwai1-2/+2
Add missing KERN_* suffix to printk. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] au88x0: codec access procs for multiple AC97 codecsSasha Khapyorsky1-2/+4
Modules: au88x0 driver This patch extends au88x0 AC97 codec access procedures to handle multiple codecs properly. Signed-off-by: Sasha Khapyorsky <sashak@smlink.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds1-0/+2837
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!