summaryrefslogtreecommitdiff
path: root/sound/pci/atiixp.c
AgeCommit message (Collapse)Author
2017-08-23ALSA: atiixp: constify ac97_pcm structuresArvind Yadav
ac97_pcm are not supposed to change at runtime. All functions working with ac97_pcm provided by <sound/ac97_codec.h> work with const ac97_pcm. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-12ALSA: pci: make snd_pcm_hardware constBhumika Goyal
Make these const as they are only used during a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02ALSA: 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> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-30ALSA: atiixp: constify atiixp_dma_ops structuresJulia Lawall
The atiixp_dma_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-29ALSA: pci: Drop superfluous ifdef CONFIG_PROC_FSTakashi Iwai
The compiler can optimize the unused code away, so we can drop ifdefs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-05ALSA: Use const struct ac97_quirkJoe Perches
Use const to reduce data by ~3Kb. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: Include linux/io.h instead of asm/io.hTakashi Iwai
Nowadays it's recommended. Replace all in a shot. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-11Merge branch 'topic/pci-cleanup' into for-nextTakashi Iwai
2015-01-09ALSA: atiixp: Simplify PM callbacksTakashi Iwai
This is a similar cleanup like the commit [3db084fd0af5: ALSA: fm801: PCI core handles power state for us]. Since pci_set_power_state(), pci_save_state() and pci_restore_state() are already done in the PCI core side, so we don't need to it doubly. Also, pci_enable_device(), pci_disable_device() and pci_set_master() calls in PM callbacks are superfluous nowadays, too, so get rid of them as well. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-04ALSA: Deletion of checks before the function call "iounmap"Markus Elfring
The iounmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-09ALSA: pcm: Add snd_pcm_stop_xrun() helperTakashi Iwai
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-08-12PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine
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-02-26ALSA: atiixp: Use standard printk helpersTakashi Iwai
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12ALSA: pci: Convert to snd_card_new() with a device pointerTakashi Iwai
Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-15ALSA: atiixp: 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-05-29ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at removeTakashi Iwai
As drvdata is cleared to NULL at probe failure or at removal by the driver core, we don't have to call pci_set_drvdata(pci, NULL) any longer in each driver. The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in hda_intel.c. Since this function itself releases the card instance, we need to clear drvdata here as well, so that it won't be released doubly in the remove callback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-25ALSA: Make snd_printd() and snd_printdd() inlineTakashi Iwai
Because currently snd_printd() and snd_printdd() macros are expanded to empty when CONFIG_SND_DEBUG=n, a compile warning like below appears sometimes, and we had to covert it by ugly ifdefs: sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’: sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable] For "fixing" these issues better, this patch replaces snd_printd() and snd_printdd() definitions with empty inline functions instead of macros. This should have the same effect but shut up warnings like above. But since we had already put ifdefs, changing to inline functions would trigger compile errors. So, such ifdefs is removed in this patch. In addition, snd_pci_quirk name field is defined only when CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in snd_printdd() argument triggers the build errors, too. For avoiding these errors, introduce a new macro snd_pci_quirk_name() that is defined no matter how the debug option is set. Reported-by: Stratos Karafotis <stratosk@semaphore.gr> 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-09-06ALSA: Implement channel maps for standard onboard AC97 driversTakashi Iwai
Just set the channel maps depending on the hardware availability. 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-07-03ALSA: Convert to new pm_ops for PCI driversTakashi Iwai
Straightforward conversion to the new pm_ops from the legacy suspend/resume ops. Since we change vx222, vx_core and vxpocket have to be converted, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: pci: clean up using module_pci_driver()Takashi Iwai
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: fix drivers needing module.h not moduleparam.hPaul Gortmaker
The implicit presence of module.h lured several users into incorrectly thinking that they only needed/used modparam.h but once we clean up the module.h presence, these will show up as build failures, so fix 'em now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-06-10ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*Takashi Iwai
The name argument of request_irq() appears in /proc/interrupts, and it's quite ugly when the name entry contains a space or special letters. In general, it's simpler and more readable when the module name appears there, so let's replace all entries with KBUILD_MODNAME. 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-03-11ALSA: atiixp - Fix wrong time-out checks during ac-link resetTakashi Iwai
The time-out in snd_atiixp_aclink_reset() is wrongly checked, and it resulted in exiting from the loop at the first iteration. Reported-by: Amir Shamsuddin <AmirS2+alsa@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-17Merge branch 'fix/misc' into topic/miscTakashi Iwai
Conflicts: sound/pci/hda/patch_realtek.c
2010-02-09sound: use DEFINE_PCI_DEVICE_TABLEAlexey Dobriyan
Use DEFINE_PCI_DEVICE_TABLE() to make PCI device ids go to .devinit.rodata section, so they can be discarded in some cases, and make them const. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-28ALSA: atiixp: Specify codec for Foxconn RC4107MA-RS2Daniel T Chen
BugLink: https://bugs.launchpad.net/ubuntu/+bug/498863 This mainboard needs ac97_codec=0. Cc: stable@kernel.org Tested-by: Apoorv Parle <apparle@yahoo.co.in> Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-25sound: Use PCI_VDEVICEJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-20ALSA: Atiixp: Add SSID for mute_led quirk (unknown HP model)Daniel T Chen
Reference: Ubuntu #84973 (https://launchpad.net/bugs/84973) Reference: Linux #8001 (http://bugzilla.kernel.org/show_bug.cgi?id=8001) Make the mute LED function properly on this unknown HP model. Signed-off-by: Daniel T Chen <seven.steps@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12ALSA: Convert to snd_card_create() in sound/pci/*Takashi Iwai
Convert from snd_card_new() to the new snd_card_create() function in sound/pci/*. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-21pci: use pci_ioremap_bar() in sound/Arjan van de Ven
Use the newly introduced pci_ioremap_bar() function in sound/. pci_ioremap_bar() just takes a pci device and a bar number, with the goal of making it really hard to get wrong, while also having a central place to stick sanity checks. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-04ALSA: atiixp - Add PCI ID for SB600 (1002:4382)Takashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13ALSA: Kill snd_assert() in sound/pci/*Takashi Iwai
Kill snd_assert() in sound/pci/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-04-24[ALSA] Fix synchronize_irq() bugs, redundanciesJeff Garzik
free_irq() calls synchronize_irq() for you, so there is no need for drivers to manually do the same thing (again). Thus, calls where sync-irq immediately precedes free-irq can be simplified. However, during this audit several bugs were noticed, where free-irq is preceded by a "irq >= 0" check... but the sync-irq call is not covered by the same check. So, where sync-irq could not be eliminated completely, the missing check was added. Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-01-31[ALSA] sound: fix atiixp section mismatchRandy Dunlap
Fix section mismatch in atiixp by making some functions __devinit. WARNING: vmlinux.o(.text+0xfd9304): Section mismatch: reference to .init.data:atiixp_quirks (between 'ac97_probing_bugs' and 'snd_atiixp_codec_detect') Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.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>
2007-07-11PCI: Change all drivers to use pci_device->revisionAuke Kok
Instead of all drivers reading pci config space to get the revision ID, they can now use the pci_device->revision member. This exposes some issues where drivers where reading a word or a dword for the revision number, and adding useless error-handling around the read. Some drivers even just read it for no purpose of all. In devices where the revision ID is being copied over and used in what appears to be the equivalent of hotpath, I have left the copy code and the cached copy as not to influence the driver's performance. Compile tested with make all{yes,mod}config on x86_64 and i386. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Acked-by: Dave Jones <davej@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-02-09[ALSA] atiixp - Use quirk list helper functionTakashi Iwai
Clean up ac97_codec quirk using snd_pci_quirk_lookup(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] atiixp - Add a parameter ac97_quirkDan Carpenter
Add an option to specify the AC'97 codec instead of probing. This is a fix for bugzilla #7467. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] ac97 - Suppress power-saving mode on non-supporting driversTakashi Iwai
Don't enable power-saving mode on drivers that don't support it. The supporting drivers set AC97_SCAP_POWER_SAVE to scaps at creation of ac97 instance. Currently enable on the following drivers: intel8x0, intel8x0m, atiixp, atiixp-modem, via82xx and via82xx-modem. Also, a bit clean up of power-saving stuff: - Don't create an own workq - Remove superfluous ifdefs Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-12-20[ALSA] Remove IRQF_DISABLED for shared PCI irqsTakashi Iwai
Fix IRQ flags for PCI devices. The shared IRQs for PCI devices shouldn't be allocated with IRQF_DISABLED. Also, when MSI is enabled, IRQF_SHARED shouldn't be used. The patch removes unnecessary cast in request_irq and free_irq, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-22[ALSA] Various fixes for suspend/resume of ALSA PCI driversTakashi Iwai
- Check the return value of pci_enable_device() and request_irq() in the suspend. If any error occurs there, disable the device using snd_card_disconnect(). - Call pci_set_power_state() properly with pci_choose_state(). - Fix the order to call pci_set_power_state(). - Removed obsolete house-made PM codes in some drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells
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 Iwai
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-07-02[PATCH] irq-flags: sound: Use the new IRQF_ constantsThomas Gleixner
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-22[ALSA] Remove unneeded read/write_size fields in proc text opsTakashi Iwai
Remove unneeded read/write_size fields in proc text ops. snd_info_set_text_ops() is fixed, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-04-27[ALSA] add __devinitdata to all pci_device_idHenrik Kretzschmar
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>