summaryrefslogtreecommitdiffstats
path: root/sound/arm/aaci.c
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: aaci: constify ac97_pcm structuresArvind Yadav2017-08-231-1/+1
| | | | | | | | | 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>
* ALSA: arm: constify snd_pcm_ops structuresArvind Yadav2017-08-191-2/+2
| | | | | | | | | snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. 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>
* ALSA: arm: make snd_pcm_hardware constBhumika Goyal2017-08-171-1/+1
| | | | | | | | Make this const as it is only used in a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Deletion of checks before the function call "iounmap"Markus Elfring2015-01-041-2/+2
| | | | | | | | | | 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>
* ALSA: arm: Convert to snd_card_new() with a device pointerTakashi Iwai2014-02-141-4/+2
| | | | | | Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: Convert to modern PM opsUlf Hansson2013-12-031-12/+11
| | | | | | | | Even if the CONFIG_PM explicity is undefined, let's convert to the modern PM ops. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Remove the rest of *_set_drvdata(NULL) callsTakashi Iwai2013-05-291-2/+0
| | | | | | | A few calls are still left in parport drivers after this commit, which I'm not quite sure yet. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: remove __dev* attributesBill Pemberton2012-12-071-9/+9
| | | | | | | | | | | | 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> Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ARM: 7362/1: AMBA: Add module_amba_driver() helper macro for amba_driverviresh kumar2012-03-161-12/+1
| | | | | | | | | | | For simple modules that contain a single amba_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_amba_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* sound: aaci: Enable module alias autogeneration for AMBA driversDave Martin2011-11-221-0/+2
| | | | Signed-off-by: Dave Martin <dave.martin@linaro.org>
* sound: irq: Remove IRQF_DISABLEDYong Zhang2011-09-221-1/+1
| | | | | | | | | | | | | | | Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
*---. Merge branches 'aaci', 'mmci-dma', 'pl' and 'pl011' into driversRussell King2011-03-171-2/+9
|\ \ \
| | * | ARM: amba: make probe() functions take const id tablesRussell King2011-02-231-1/+2
| | |/ | | | | | | | | | | | | | | | | | | | | | Make Primecell driver probe functions take a const pointer to their ID tables. Drivers should never modify their ID tables in their probe handler. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| | * ALSA: AACI: allow writes to MAINCR to take effectRussell King2011-02-071-1/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | The AACI TRM requires the MAINCR enable bit to be held zero for two bitclk cycles plus three apb_pclk cycles. Use a delay of 1us to ensure this. Ensure that writes to MAINCR to change the addressed codec only happen when required, and that they take effect in a similar manner to the above, otherwise we seem to occasionally have stuck slot busy bits. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: make fifo variables more explanitoryRussell King2011-01-261-18/+24
| | | | | | | | | | | | | | Improve commenting and change fifo variable names to reflect their meanings. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: no need to call snd_pcm_period_elapsed() for each periodRussell King2011-01-261-8/+10
| | | | | | | | | | | | | | | | | | There is no need to call snd_pcm_period_elapsed() each time a period elapses - we can call it after we're done once loading/unloading the FIFO with data. ALSA works out how many periods have elapsed by reading the current pointers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: use snd_pcm_lib_period_bytes()Russell King2011-01-261-2/+2
| | | | | | | | | | | | Use the helper rather than open-coding this. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: clean up AACI announcement printkRussell King2011-01-261-3/+3
| | | | | | | | | | | | | | | | | | Make the AACI announcement printk say which primecell part number has been found. Display the revision as an unsigned decimal, and display only the first 8 hex digits of the base address unless it's larger. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: fix channel mask selectionRussell King2011-01-261-50/+20
| | | | | | | | | | | | | | | | When double-rate mode was selected, we weren't setting the additional two channel mask bits to allow double-rate to work. Rearrange the hw_params code to allow the correct channel mask to be selected. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: fix number of channels for recordRussell King2011-01-251-62/+52
| | | | | | | | | | | | | | | | | | | | | | | | AC'97 codecs only support two channels for recording, so we shouldn't advertize that there are up to six channels available. Limit the selection of 4 and 6 channel audio to playback only. As this adds additional SNDRV_PCM_STREAM_PLAYBACK conditionals, we can combine some resulting in the elimination of __aaci_pcm_open() entirely, and making the code easier to read. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | ALSA: AACI: fix multiple IRQ claimingRussell King2011-01-251-9/+15
|/ | | | | | | | | Claiming the IRQ each time a playback or capture interface is opened is wasteful; the second copy of the registered handler is identical to the first and just wastes resources. Track the number of opens and only register the handler when necessary. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ALSA: AACI: fix timeout durationRussell King2011-01-251-19/+23
| | | | | | | | | | | Relying on the access time of peripherals is unreliable - it depends on the speed of the CPU and the bus. On Versatile Express, these timeouts were expiring, causing the driver to fail. Add udelay(1) to ensure that they don't expire early, and adjust timeouts to give a reasonable margin over the response times. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ALSA: AACI: fix timeout condition checkingRussell King2011-01-251-3/+3
| | | | | | | | Ensure that a timeout coincident with the condition being waited for results in success rather than failure. This helps avoid timeout conditions being inappropriately flagged. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ALSA: aaci - Fix alignment faults on ARM Cortex introduced by commit 29a4f2d3Philby John2010-04-131-2/+5
| | | | | | | | | | | | The commit 29a4f2d3 used writel() at offset 0x26 which is half-word aligned causing unaligned exceptions on a Cortex-A8. The original patch solved the "aaci-pl041 fpga:04: ac97 read back fail" issue on a soft reset. Reading from any arbitrary aaci register seems to solve this issue. Signed-off-by: Philby John <pjohn@mvista.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: sound/arm: Fix build failure caused by missing struct aaci definitionPeter Huewe2009-12-261-2/+1
| | | | | | | | | | | | | | | | | | | This patch fixes a build failure introduced by the patch ALSA: AACI: factor common hw_params logic into aaci_pcm_hw_params [1] by adding/moving the aaci struct to the right position. The patch mentioned above merged common source parts into one function, but unfortunately left out the aaci struct and consequently caused a build failure e.g. for arm versatile_config [2] References: [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=d3aee7996c30f928bbbbfd0994148e35d2e83084 [2] http://kisskb.ellerman.id.au/kisskb/buildresult/1893605/ Patch against Linus' tree. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: switch to per-pcm lockingRussell King2009-12-181-20/+29
| | | | | | | | We can use finer-grained locking, which makes things easier when we gain DMA support. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: add double-rate supportRussell King2009-12-181-2/+15
| | | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: factor common hw_params logic into aaci_pcm_hw_paramsRussell King2009-12-181-15/+7
| | | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: cleanup aaci_pcm_hw_paramsRussell King2009-12-181-11/+7
| | | | | | | | Since the recording and playback paths are now the same, eliminate the needless conditionals. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: AACI: simplify codec rate informationRussell King2009-12-181-72/+3
| | | | | | | | | There's no need for a specific rule; ALSA's generic AC'97 support calculates the necessary rate constraint information itself, and we can use this directly. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: aaci - Fix a typoTakashi Iwai2009-12-181-1/+1
| | | | | | | Fixed a typo of the max buffer size specified for buffer allocation changed in the commit d6797322231af98b9bb4afb175dd614cf511e5f7. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/misc' into for-linusTakashi Iwai2009-12-041-14/+5
|\
| * ALSA: aaci - Clean up duplicate codeTakashi Iwai2009-12-011-9/+3
| | | | | | | | | | | | | | Now snd_ac97_pcm_open() is called with the exactly same arguments for both playback and capture directions. Remove the unneeded check. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * Merge branch 'fix/misc' into topic/miscTakashi Iwai2009-12-011-1/+5
| |\
| * | ALSA: AACI cleanupRussell King2009-11-231-5/+2
| | | | | | | | | | | | | | | | | | | | | Fix the buffer size calculation to use the size which ALSA is expecting. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | Merge branch 'topic/core-change' into for-linusTakashi Iwai2009-12-041-11/+5
|\ \ \ | |_|/ |/| |
| * | ALSA: Remove old DMA-mmap code from arm/devdma.cTakashi Iwai2009-11-271-11/+5
| |/ | | | | | | | | | | The call of dma_mmap_coherent() is done in the PCM core now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: AACI: fix recording bugRussell King2009-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | pcm->r[1].slots is the double rate slot information, not the capture information. For capture, 'pcm' will already be the capture ac97 pcm structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: AACI: fix AC97 multiple-open bugRussell King2009-11-301-0/+4
|/ | | | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: aaci: ARM1176 aaci-pl041 AC97 register read timeoutPhilby John2009-10-131-0/+1
| | | | | | | | | | | | | | After a reboot on an ARM1176 which amounts to a softreset, it has been noted that the ALSA driver does not get registered and the probe fails with the error "aaci-pl041 fpga:04: ac97 read back fail". In the process of reading from a register the SL1TxBusy bit is set indicating that the transceiver is busy and remains so until the default timeout occurs. Set the Power down register 0x26 to an arbitrary value as specified in the PL041 manual (page: 3-18) so that AACISL1TX/AACISL2TX registers take their default state. Signed-off-by: Philby John <pjohn@in.mvista.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ARM] 5544/1: Trust PrimeCell resource sizesLinus Walleij2009-06-111-1/+1
| | | | | | | | | | | | | | | | | | I found the PrimeCell/AMBA Bus drivers distrusting the resource passed in as part of the struct amba_device abstraction. This patch removes all hard coded resource sizes found in the PrimeCell drivers and move the responsibility of this definition back to the platform/board device definition, which already exist and appear to be correct for all in-tree users of these drivers. We do this using the resource_size() inline function which was also replicated in the only driver using the resource size, so that has been changed too. The KMI_SIZE was left in kmi.h in case someone likes it. Test-compiled against Versatile and Integrator defconfigs, seems to work but I don't posess these boards and cannot test them. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 5519/1: amba probe: pass "struct amba_id *" instead of void *Alessandro Rubini2009-05-201-1/+1
| | | | | | | | | | | | The second argument of the probe method points to the amba_id structure, so it's better passed with the correct type. None of the current in-tree drivers uses the pointer, so they have only been checked for a clean compile. Change suggested by Russell King. Signed-off-by: Alessandro Rubini <rubini@unipv.it> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* Merge branch 'topic/snd_card_new-err' into for-linusTakashi Iwai2009-03-241-3/+4
|\
| * ALSA: Convert to snd_card_create() in other sound/*Takashi Iwai2009-01-121-3/+4
| | | | | | | | | | | | | | Convert from snd_card_new() to the new snd_card_create() function in other sound subdirectories. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | [ARM] AACI: timeout will reach -1Roel Kluin2009-02-101-3/+3
|/ | | | | | | | With a postfix decrement the timeout will reach -1 rather than 0, so the warning will not be issued. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* ALSA: aaci - Fix NULL test at error pathTakashi Iwai2008-09-041-3/+3
| | | | | | | | | | The original fix by Julien Brunel <brunel@diku.dk>. aaci_init_card() returns a pointer with ERR_PTR(), but in aaci_init() NULL is supposed at this error path. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] Remove sound/driver.hTakashi Iwai2008-01-311-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>
* Add missing newlines to some uses of dev_<level> messagesJoe Perches2007-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found these while looking at printk uses. Add missing newlines to dev_<level> uses Add missing KERN_<level> prefixes to multiline dev_<level>s Fixed a wierd->weird spelling typo Added a newline to a printk Signed-off-by: Joe Perches <joe@perches.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Roland Dreier <rolandd@cisco.com> Cc: Tilman Schmidt <tilman@imap.cc> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Smart <James.Smart@Emulex.Com> Cc: Andrew Vasquez <andrew.vasquez@qlogic.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [ARM] Fix ARM AACI ALSA driverRussell King2007-02-201-6/+6
| | | | | | | | | | | | | | | | | CC [M] sound/arm/aaci.o sound/arm/aaci.c:729: error: parse error before '*' token sound/arm/aaci.c:731: warning: function declaration isn't a prototype ... sound/arm/aaci.c:786: error: parse error before '*' token sound/arm/aaci.c:786: warning: function declaration isn't a prototype ... sound/arm/aaci.c:827: error: parse error before '*' token sound/arm/aaci.c:828: warning: function declaration isn't a prototype ... sound/arm/aaci.c:845: error: parse error before "aaci_capture_ops" sound/arm/aaci.c:845: warning: type defaults to `int' in declaration of `aaci_capture_ops' Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 4140/1: AACI stability add ac97 timeout and retriesKevin Hilman2007-02-181-11/+39
| | | | | | | | Add timeouts to hardware read/write/probe functions in order to avoid lockups on buggy/broken hardware. Signed-off-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>