aboutsummaryrefslogtreecommitdiffstats
path: root/sound/arm/pxa2xx-ac97-lib.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-10-29ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq()Yang Yingliang1-1/+3
platform_get_irq() returns negative error number on failure, fix the return value check in pxa2xx_ac97_hw_probe() and assign the error code to 'ret'. Fixes: 2548e6c76ebf ("ARM: pxa: pxa2xx-ac97-lib: use IRQ resource") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20221029082001.3207380-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-05-07ASoC: pxa: ac97: use normal MMIO accessorsArnd Bergmann1-52/+72
To avoid dereferencing hardwired constant pointers from a global header file, change the driver to use devm_platform_ioremap_resource for getting an __iomem pointer, and then using readl/writel on that. Each pointer dereference gets changed by a search&replace, which leads to a few overlong lines, but seems less risky than trying to clean up the code at the same time. Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-05-07Input: touchscreen: use wrapper for pxa2xx ac97 registersArnd Bergmann1-0/+12
To avoid a dependency on the pxa platform header files with hardcoded registers, change the driver to call a wrapper in the pxa2xx-ac97-lib that encapsulates all the other ac97 stuff. Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: linux-input@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-04-19ARM: pxa: pxa2xx-ac97-lib: use IRQ resourceArnd Bergmann1-3/+7
The pxa2xx-ac97-lib code is the last driver to use mach/irqs.h for PXA. Almost everything already passes the interrupt as a resource, so use it from there. The one exception is the mxm8x10 machine, which apparently has a resource-less device. Replacing it with the correct one enables the driver here as well. Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-04-19ARM: pxa: move mach/sound.h to linux/platform_data/Arnd Bergmann1-1/+1
This is a basically a platform_data file, so move it out of the mach/* header directory. Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tomas Cech <sleep_walker@suse.com> Cc: Sergey Lapin <slapin@ossfans.org> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-04-19ARM: pxa: split up mach/hardware.hArnd Bergmann1-0/+1
The mach/hardware.h is included in lots of places, and it provides three different things on pxa: - the cpu_is_pxa* macros - an indirect inclusion of mach/addr-map.h - the __REG() and io_pv2() helper macros Split it up into separate <linux/soc/pxa/cpu.h> and mach/pxa-regs.h headers, then change all the files that use mach/hardware.h to include the exact set of those three headers that they actually need, allowing for further more targeted cleanup. linux/soc/pxa/cpu.h can remain permanently exported and is now in a global location along with similar headers. pxa-regs.h and addr-map.h are only used in a very small number of drivers now and can be moved to arch/arm/mach-pxa/ directly when those drivers are to pass the necessary data as resources. Cc: Michael Turquette <mturquette@baylibre.com> Cc: Stephen Boyd <sboyd@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com> Cc: Pavel Machek <pavel@ucw.cz> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@kernel.org> Cc: linux-clk@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: linux-leds@vger.kernel.org Cc: linux-mmc@vger.kernel.org Cc: linux-mtd@lists.infradead.org Cc: linux-rtc@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Cc: linux-watchdog@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 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 version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-18ASoC: pxa: add devicetree supportRobert Jarzmik1-0/+12
Add the devicetree support, so that the driver can be used in a devictree platform. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-04ASoC: arm: make pxa2xx-ac97-lib ac97 codec agnosticRobert Jarzmik1-16/+21
All pxa library functions don't use the input parameters for nothing but slot number. This simplifies their prototypes, and makes them usable by both the legacy ac97 bus and the new ac97 bus. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-06-09ASoC: pxa2xx-ac97: prepare and unprepare the clocksRobert Jarzmik1-6/+6
Add the clock prepare and unprepare call to the driver initialization phase. This will remove a warning once the PXA architecture is migrated to the clock infrastructure. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-06ALSA: pxa2xx: Replace BUG() with snd_BUG()Takashi Iwai1-2/+2
BUG() used in the driver is just to spit the stack trace on buggy points, not really needed to stop the whole operation. For that purpose, it'd be more convenient to use snd_BUG() instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-18ALSA: pxa: slightly refactor reset handlingDmitry Eremin-Solenikov1-17/+10
PXA25x also shows some problems when using interrupts during reset handling. Thus do not use interrupts on all pxa kinds (to detect codec ready state). Instead use a common mdelay-loop on all platforms to detect codecs becoming ready. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-01-08ALSA: pxa27x: rename pxa27x_assert_ac97reset()Mike Dunn1-4/+4
This patch does nothing functionally, it just gives the function a new name and modifies the prototype slightly in order to clarify what the function is doing (which is not necessarily asserting the reset). Some commentary also added. Tested on a palm treo 680 machine. Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-08ALSA: pxa27x: fix ac97 warm resetMike Dunn1-1/+17
This patch fixes some code that implements a work-around to a hardware bug in the ac97 controller on the pxa27x. A bug in the controller's warm reset functionality requires that the mfp used by the controller as the AC97_nRESET line be temporarily reconfigured as a generic output gpio (AF0) and manually held high for the duration of the warm reset cycle. This is what was done in the original code, but it was broken long ago by commit fb1bf8cd ([ARM] pxa: introduce processor specific pxa27x_assert_ac97reset()) which changed the mfp to a GPIO input instead of a high output. The fix requires the ac97 controller to obtain the gpio via gpio_request_one(), with arguments that configure the gpio as an output initially driven high. Tested on a palm treo 680 machine. Reportedly, this broken code only prevents a warm reset on hardware that lacks a pull-up on the line, which appears to be the case for me. Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-01-08ALSA: pxa27x: fix ac97 cold resetMike Dunn1-2/+6
Cold reset on the pxa27x currently fails and pxa2xx_ac97_try_cold_reset: cold reset timeout (GSR=0x44) appears in the kernel log. Through trial-and-error (the pxa270 developer's manual is mostly incoherent on the topic of ac97 reset), I got cold reset to complete by setting the WARM_RST bit in the GCR register (and later noticed that pxa3xx does this for cold reset as well). Also, a timeout loop is needed to wait for the reset to complete. Tested on a palm treo 680 machine. Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-12-07ALSA: pxa2xx: 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> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-29Merge tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-0/+1
Pull "ARM: cleanups of io includes" from Olof Johansson: "Rob Herring has done a sweeping change cleaning up all of the mach/io.h includes, moving some of the oft-repeated macros to a common location and removing a bunch of boiler plate. This is another step closer to a common zImage for multiple platforms." Fix up various fairly trivial conflicts (<mach/io.h> removal vs changes around it, tegra localtimer.o is *still* gone, yadda-yadda). * tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (29 commits) ARM: tegra: Include assembler.h in sleep.S to fix build break ARM: pxa: use common IOMEM definition ARM: dma-mapping: convert ARCH_HAS_DMA_SET_COHERENT_MASK to kconfig symbol ARM: __io abuse cleanup ARM: create a common IOMEM definition ARM: iop13xx: fix missing declaration of iop13xx_init_early ARM: fix ioremap/iounmap for !CONFIG_MMU ARM: kill off __mem_pci ARM: remove bunch of now unused mach/io.h files ARM: make mach/io.h include optional ARM: clps711x: remove unneeded include of mach/io.h ARM: dove: add explicit include of dove.h to addr-map.c ARM: at91: add explicit include of hardware.h to uncompressor ARM: ep93xx: clean-up mach/io.h ARM: tegra: clean-up mach/io.h ARM: orion5x: clean-up mach/io.h ARM: davinci: remove unneeded mach/io.h include [media] davinci: remove includes of mach/io.h ARM: OMAP: Remove remaining includes for mach/io.h ARM: msm: clean-up mach/io.h ...
2012-03-25ARM: pxa: use common IOMEM definitionRob Herring1-0/+1
pxa was missed in the moving of IOMEM to a common definition, so lots of IOMEM redefined warnings were introduced. So remove pxa IOMEM definition and fix all the fallout. Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: rtc-linux@googlegroups.com Cc: alsa-devel@alsa-project.org
2012-01-25sound: pxa2xx-ac97: include mach/irqs.h directlyRob Herring1-1/+1
In preparation of removing mach/irqs.h include from asm/irq.h, include mach/irqs.h directly. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2011-10-31sound: Add module.h to the previously silent sound usersPaul Gortmaker1-0/+1
Lots of sound drivers were getting module.h via the implicit presence of it in <linux/device.h> but we are going to clean that up. So fix up those users now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-09-22sound: irq: Remove IRQF_DISABLEDYong Zhang1-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>
2010-03-02[ARM] pxa: remove now unnecessary pxa_gpio_mode() calls in ac97Eric Miao1-8/+0
Now most (if not all) PXA platforms have been switched to the new MFP API, it's rather safe to remove these unnecessary pxa_gpio_mode() calls in pxa2xx-ac97-lib.c now. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2010-03-02[ARM] pxa: introduce processor specific pxa27x_assert_ac97reset()Eric Miao1-44/+6
This is really pxa27x specific and should be kept in pxa27x.c. With this newly introduced function, the original set_resetgpio_mode() is deprecated. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2010-03-02[ARM] pxa: remove the unnecessary restoring of MFP registersEric Miao1-10/+0
MFP registers are saved and restored by the mfp sys_device before all other platform devices, and it is unnecessary here. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2009-05-11pxa2xx-ac97: fix reset gpio mode settingMike Rapoport1-1/+1
Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-15[ARM] pxa: merge AC97 platform data structuresMark Brown1-1/+1
Currently there are two possible platform datas for the PXA AC97 driver: one supported by the generic AC97 driver only which provides callbacks to allow board-specific configuration at stream startup and teardown, and another for pxa2xx-ac97-lib which allows configuration of the reset GPIO for PXA2xx CPUs. Obviously this won't actually work when using the generic AC97 driver since the drivers will attempt to parse the platform data in both formats. Fix this by merging the two structures. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
2009-04-06Merge branch 'topic/asoc' into for-linusTakashi Iwai1-5/+10
2009-04-02pxa2xx-ac97: fix displaying GSR after reset timeoutLuotao Fu1-5/+10
the variable gsr_bit is set in isr. It is however set to 0 and interrupts are disabled prior to reset. Hence it doesn't make a lot of sense to show the content of gsr_bit in case of a reset timeout. Signed-off-by: Luotao Fu <l.fu@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-03-28Merge branch 'origin' into develRussell King1-5/+66
Conflicts: sound/soc/pxa/pxa2xx-i2s.c
2009-03-19ALSA: Fix wrong pointer to dev_err() in arm/pxa2xx-ac97-lib.cTakashi Iwai1-1/+1
Fix the wrong device pointer passed to dev_err(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-15ASoC: Allow choice of ac97 gpio reset lineRobert Jarzmik1-5/+66
As the PXA27x series allow 2 gpios to reset the ac97 bus, allow through platform data configuration the definition of the correct gpio which will reset the AC97 bus. This comes from a silicon defect on the PXA27x series, where the gpio must be manually controlled in warm reset cases. Signed-off-by: Robert Jarzmik <rjarzmik@free.fr> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-03-09[ARM] pxa: remove unnecessary #include of pxa-regs.h and hardware.hEric Miao1-1/+0
pxa-regs.h and hardware.h are not intended for use directly in driver code, remove those unnecessary references. Signed-off-by: Eric Miao <eric.miao@marvell.com>
2009-01-05pxa2xx-ac97: switch AC unit to correct state before probingDmitry Baryshkov1-9/+16
If AC97 unit is in partially enabled state, early request_irq can trigger IRQ storm or even full hang up. Workaround this by forcibly switching ACLINK off at the start of the probe. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-02[ARM] pxa: move AC97 register definitions into dedicated regs-ac97.hEric Miao1-1/+1
The optimal change would be to move the AC97 register definitions into the AC97 driver, unfortunately, the registers are shared between several files. Move them into a dedicated regs-ac97.h first. Signed-off-by: Eric Miao <eric.miao@marvell.com>
2008-10-14ALSA: Fix pxa2xx-ac97-lib.c compilationMarc Zyngier1-6/+6
The last ALSA merge broke pxa2xx-ac97-lib.c, as it brought back references to cpu_is_pxa21x that Eric Miao removed in commit 0ffcbfd54ea81ca24c0749f55ca4fcf3e2bdc23e: [ARM] pxa: make cpu_is_pxa2* macros more consistent This patch gets rid of those references, and only keeps cpu_is_pxa25x(). Signed-off-by: Marc Zyngier <maz@misterjones.org> Acked-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-23ALSA: pxa2xx-ac97-lib: support building for several CPUsDmitry Baryshkov1-78/+137
Support building of pxa2xx-ac97-lib for several CPUs by making code run-time selected, not only compile-time. [Fixed 3XX->3xx typos in ifdef checks -- broonie.] Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-23ALSA: Separate common pxa2xx-ac97 codeDmitry Baryshkov1-0/+325
ASoC and non-ASoC drivers for ACLINK on PXA share lot's of common code. Move all common code into separate module snd-pxa2xx-lib. [Fixed handing of SND_AC97_CODEC in Kconfig and some checkpatch warnings -- broonie] Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>