aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/fm801.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-10-21ALSA: fm801: Use snd_ctl_enum_info()Takashi Iwai1-8/+2
... and reduce the open codes. Also add missing const to the text array. 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-05-19ALSA: fm801: convert struct description to kernel-docAndy Shevchenko1-10/+16
Just move field descriptions to the struct description in the kernel-doc format. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-29ALSA: fm801: introduce fm801_ac97_is_ready()/fm801_ac97_is_valid() helpersAndy Shevchenko1-37/+42
The introduced functios check AC97 if it's ready for communication and read data is valid. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-29ALSA: fm801: introduce macros to access the hardwareAndy Shevchenko1-63/+68
It will help to maintain HW accessors and, for example, switch from the direct I/O to MMIO which is more convenient for PCI devices. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-26ALSA: fm801: Use standard printk helpersTakashi Iwai1-13/+13
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 Iwai1-3/+2
Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-18[media] tea575x: Move header from sound to mediaOndrej Zary1-1/+1
Move include/sound/tea575x-tuner.h to include/media/tea575x.h and update files that include it. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-05-29ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at removeTakashi Iwai1-1/+0
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>
2012-12-07ALSA: pci: remove __dev* attributesBill Pemberton1-13/+13
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-11-14ALSA: fm801: precedence bug in snd_fm801_tea575x_get_pins()Dan Carpenter1-3/+8
There is a precedence bug because | has higher precedence than ?:. This code was cut and pasted and I fixed a similar bug a few days ago. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06ALSA: Implement channel maps for standard onboard AC97 driversTakashi Iwai1-0/+7
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 Iwai1-3/+3
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 Iwai1-10/+16
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-06-25Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-mediaLinus Torvalds1-2/+2
Pull media fixes from Mauro Carvalho Chehab. Trivial conflict due to new USB HID ID's being added next to each other (Baanto vs Axentia). * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (44 commits) [media] smia: Fix compile failures [media] Fix VIDIOC_DQEVENT docbook entry [media] s5p-fimc: Fix control creation function [media] s5p-mfc: Fix checkpatch error in s5p_mfc_shm.h file [media] s5p-mfc: Fix setting controls [media] v4l/s5p-mfc: added image size align in VIDIOC_TRY_FMT [media] v4l/s5p-mfc: corrected encoder v4l control definitions [media] v4l: mem2mem_testdev: Fix race conditions in driver [media] s5p-mfc: Bug fix of timestamp/timecode copy mechanism [media] cxd2820r: Fix an incorrect modulation type bitmask [media] em28xx: Show a warning if the board does not support remote controls [media] em28xx: Add remote control support for Terratec's Cinergy HTC Stick HD [media] USB: Staging: media: lirc: initialize spinlocks before usage [media] Revert "[media] media: mx2_camera: Fix mbus format handling" [media] bw-qcam: driver and pixfmt documentation fixes [media] cx88: fix firmware load on big-endian systems [media] cx18: support big-endian systems [media] ivtv: fix support for big-endian systems [media] tuner-core: return the frequency range of the correct tuner [media] v4l2-dev.c: fix g_parm regression in determine_valid_ioctls() ...
2012-06-11[media] snd_tea575x: Make the module using snd_tea575x the fops ownerHans de Goede1-2/+2
Before this patch the owner field of the /dev/radio# device fops was set to the snd-tea575x-tuner module itself. Meaning that the module which was using it could be rmmod-ed while the device is open, and then BAD things happen. I know, as I found out the hard way :) Note that there is no need to also somehow increase the refcount of the snd-tea575x-tuner module itself, since any drivers using it will have symbolic references to it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> CC: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-24ALSA: pci: clean up using module_pci_driver()Takashi Iwai1-13/+2
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-19[media] tea575x-tuner: update to latest V4L2 framework requirementsHans Verkuil1-2/+18
The tea575x-tuner module has been updated to use the latest V4L2 framework functionality. This also required changes in the drivers that rely on it. The tea575x changes are: - The drivers must provide a v4l2_device struct to the tea module. - The radio_nr module parameter must be part of the actual radio driver, and not of the tea module. - Changed the frequency range to the normal 76-108 MHz range instead of 50-150. - Add hardware frequency seek support. - Fix broken rxsubchans/audmode handling. - The application can now select between stereo and mono. - Support polling for control events. - Add V4L2 priority handling. And radio-sf16fmr2.c now uses the isa bus kernel framework. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Thanks-to: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-19ALSA: module_param: make bool parameters really boolRusty Russell1-1/+1
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 Gortmaker1-1/+1
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-09-23ALSA: fm801 - Clean up redundant reference to snd_fm801_tea575x_gpios[]Takashi Iwai1-7/+8
Use macro to improve readability. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-22Merge branch 'fix/misc' into topic/miscTakashi Iwai1-5/+10
2011-09-22ALSA: fm801: Gracefully handle failure of tuner auto-detectBen Hutchings1-3/+10
Commit 9676001559fce06e37c7dc230ab275f605556176 ("ALSA: fm801: add error handling if auto-detect fails") seems to break systems that were previously working without a tuner. As a bonus, this should fix init and cleanup for the case where the tuner is explicitly disabled. Reported-and-tested-by: Hor Jiun Shyong <jiunshyong@gmail.com> References: http://bugs.debian.org/641946 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@kernel.org [v3.0+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-22ALSA: fm801: Fix double free in case of error in tuner detectionBen Hutchings1-2/+0
Commit 9676001559fce06e37c7dc230ab275f605556176 ("ALSA: fm801: add error handling if auto-detect fails") added incorrect error handling. Once we have successfully called snd_device_new(), the cleanup function fm801_free() will automatically be called by snd_card_free() and we must *not* also call fm801_free() directly. Reported-by: Hor Jiun Shyong <jiunshyong@gmail.com> References: http://bugs.debian.org/641946 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@kernel.org [v3.0+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-14ALSA: mpu401: clean up interrupt specificationClemens Ladisch1-2/+3
The semantics of snd_mpu401_uart_new()'s interrupt parameters are somewhat counterintuitive: To prevent the function from allocating its own interrupt, either the irq number must be invalid, or the irq_flags parameter must be zero. At the same time, the irq parameter being invalid specifies that the mpu401 code has to work without an interrupt allocated by the caller. This implies that, if there is an interrupt and it is allocated by the caller, the irq parameter must be set to a valid-looking number which then isn't actually used. With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value, which forces us to handle the parameters differently. This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the device interrupt is handled by the caller, and makes the allocation of the interrupt to depend only on the irq parameter. As suggested by Takashi, the irq_flags parameter was dropped because, when used, it had the constant value IRQF_DISABLED. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*Takashi Iwai1-1/+1
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 Iwai1-1/+1
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-06-03ALSA: fm801: add error handling if auto-detect failsDan Carpenter1-2/+11
In the original code if auto detect failed and tea575x_tuner == 4 then we copy bogus information to chip->tea.card. I've changed the autodetect code to cleanup and return -ENODEV on error instead. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-15ALSA: fm801: clean-up radio-related KconfigOndrej Zary1-5/+4
Remove TEA575X_RADIO define from fm801.c. Also update Kconfig help text to include all supported cards. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-13ALSA: tea575x: use better card and bus namesOndrej Zary1-0/+2
Provide real card and bus_info instead of hardcoded values. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-13ALSA: tea575x: remove unused card from structOndrej Zary1-1/+0
struct snd_card *card is present in struct snd_tea575x but never used. Remove it. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-13ALSA: tea575x: remove freq_fixup from structOndrej Zary1-1/+0
freq_fixup is a constant, no need to hold it in struct snd_tea575x and set in each driver. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-11ALSA: fm801: implement TEA575x tuner autodetectionOndrej Zary1-11/+22
Autodetect TEA575x tuner connection type during init. This allows tuner to work out-of-the box. tea575x_tuner module parameter remains functional to force tuner type. Tested with SF256-PCP and SF64-PCR. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-10ALSA: fm801: convert TEA575x support to new interfaceOndrej Zary1-279/+57
Use common functions to access TEA575x tuner - remove original read/write functions and provide new pin manipulation functions instead. Also convert the original triple implementation to a simple GPIO pin map. Tested with SF256-PCP and SF64-PCR (added the GPIO pin for MO/ST signal for them). SF256-PCS untested (pin for MO/ST signal is a guess). Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-21ALSA: tea575x-tuner: remove dev_nrOndrej Zary1-1/+0
Remove unused dev_nr from struct tea575x_tuner. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-09sound: use DEFINE_PCI_DEVICE_TABLEAlexey Dobriyan1-1/+1
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-03snd-fm801: autodetect SF64-PCR (tuner-only) cardOndrej Zary1-13/+27
When primary AC97 is not found, don't fail with tons of AC97 errors. Assume that the card is SF64-PCR (tuner-only). This makes the SF64-PCR radio card work "out of the box". Also fixes a bug that can cause an oops here:         if (tea575x_tuner > 0 && (tea575x_tuner & 0x000f) < 4) { when tea575x_tuner == 16, it passes this check and causes problems a couple lines below:         chip->tea.ops = &snd_fm801_tea_ops[(tea575x_tuner & 0x000f) - 1]; Tested with SF64-PCR, but I don't have any of those sound or sound+radio cards to test if I didn't break anything. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12ALSA: Convert to snd_card_create() in sound/pci/*Takashi Iwai1-3/+3
Convert from snd_card_new() to the new snd_card_create() function in sound/pci/*. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24[ALSA] sound: fm801.c fix shadowed variable warningHarvey Harrison1-4/+4
id was only used as a counter in a for loop, move the declaration to where it is used and change it to i. sound/pci/fm801.c:1288:6: warning: symbol 'id' shadows an earlier one sound/pci/fm801.c:51:13: originally declared here [tiwai - fixed a coding style issue as well] Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-01-31[ALSA] fm801 - Add mute support for FM-only card with FM801 PCI to tuner bridgeAndy Shevchenko1-0/+22
This is improvement of the early support of the FM-only cards where the fm801 chip represents the PCI to tuner bridge. The tuner initialization isn't included the mute on as well as mute support via V4L request. Proposed patch should fix this at least for 64-PCR model. Signed-off-by: Andy Shevchenko <andy@smile.org.ua> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Remove sound/driver.hTakashi Iwai1-1/+0
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-10-16[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela1-2/+2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-07-11PCI: Change all drivers to use pci_device->revisionAuke Kok1-3/+1
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] Add even more 'const' to everything related to TLVTakashi Iwai1-1/+1
Mark TLV data as 'const' Signed-of-by: Philipp Matthias Hahn <pmhahn@pmhahn.de> 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 Iwai1-1/+1
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 Iwai1-3/+8
- 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 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-09-23[ALSA] Add dB scale information to fm801 driverTakashi Iwai1-3/+16
Added the dB scale information to fm801 driver. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23[ALSA] sound/pci/fm801: Use ARRAY_SIZE macroTobias Klauser1-3/+1
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23[ALSA] fm801: fixed broken previous patch for the FM tuner only codeJaroslav Kysela1-13/+19
- do not allocate and enable interrupt - do not do the FM tuner mute (it should be handled more cleanly) Signed-off-by: Jaroslav Kysela <perex@suse.cz>