History log of /linux-master/sound/arm/pxa2xx-ac97-lib.c
Revision Date Author Comments
# a9ae9c52 16-May-2023 Arnd Bergmann <arnd@arndb.de>

ARM: pxa: fix missing-prototypes warnings

The PXA platform has a number of configurations that end up with
a warning like these when building with W=1:

drivers/hwmon/max1111.c:83:5: error: no previous prototype for 'max1111_read_channel' [-Werror=missing-prototypes]
arch/arm/mach-pxa/reset.c:86:6: error: no previous prototype for 'pxa_restart' [-Werror=missing-prototypes]
arch/arm/mach-pxa/mfp-pxa2xx.c:254:5: error: no previous prototype for 'keypad_set_wake' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa25x.c:70:14: error: no previous prototype for 'pxa25x_get_clk_frequency_khz' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa25x.c:325:12: error: no previous prototype for 'pxa25x_clocks_init' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa27x.c:74:14: error: no previous prototype for 'pxa27x_get_clk_frequency_khz' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa27x.c:102:6: error: no previous prototype for 'pxa27x_is_ppll_disabled' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa27x.c:470:12: error: no previous prototype for 'pxa27x_clocks_init' [-Werror=missing-prototypes]
arch/arm/mach-pxa/pxa27x.c:44:6: error: no previous prototype for 'pxa27x_clear_otgph' [-Werror=missing-prototypes]
arch/arm/mach-pxa/pxa27x.c:58:6: error: no previous prototype for 'pxa27x_configure_ac97reset' [-Werror=missing-prototypes]
arch/arm/mach-pxa/spitz_pm.c:170:15: error: no previous prototype for 'spitzpm_read_devdata' [-Werror=missing-prototypes]

The problem is that there is a declaration for each of these, but
it's only seen by the caller and not the callee. Moving these
into appropriate header files ensures that both use the same
calling conventions and it avoids the warnings.

Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20230516153109.514251-11-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# 46cf1954 29-Oct-2022 Yang Yingliang <yangyingliang@huawei.com>

ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq()

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>


# 8ff06452 18-Sep-2019 Arnd Bergmann <arnd@arndb.de>

ASoC: pxa: ac97: use normal MMIO accessors

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>


# e217b085 18-Sep-2019 Arnd Bergmann <arnd@arndb.de>

Input: touchscreen: use wrapper for pxa2xx ac97 registers

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>


# 2548e6c7 10-Sep-2019 Arnd Bergmann <arnd@arndb.de>

ARM: pxa: pxa2xx-ac97-lib: use IRQ resource

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>


# 22f08665 01-Sep-2019 Arnd Bergmann <arnd@arndb.de>

ARM: pxa: move mach/sound.h to linux/platform_data/

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>


# 08d3df8c 01-Sep-2019 Arnd Bergmann <arnd@arndb.de>

ARM: pxa: split up mach/hardware.h

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>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

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>


# a4519526 16-Jun-2018 Robert Jarzmik <robert.jarzmik@free.fr>

ASoC: pxa: add devicetree support

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>


# 6f8acad6 02-Sep-2017 Robert Jarzmik <robert.jarzmik@free.fr>

ASoC: arm: make pxa2xx-ac97-lib ac97 codec agnostic

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>


# 4091d342 09-Jun-2014 Robert Jarzmik <robert.jarzmik@free.fr>

ASoC: pxa2xx-ac97: prepare and unprepare the clocks

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>


# 88ec7ae8 05-Nov-2013 Takashi Iwai <tiwai@suse.de>

ALSA: pxa2xx: Replace BUG() with snd_BUG()

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>


# beb02cdd 17-Oct-2013 Dmitry Baryshkov <dbaryshkov@gmail.com>

ALSA: pxa: slightly refactor reset handling

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>


# 053fe0f1 07-Jan-2013 Mike Dunn <mikedunn@newsguy.com>

ALSA: pxa27x: rename pxa27x_assert_ac97reset()

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>


# 3b4bc7bc 07-Jan-2013 Mike Dunn <mikedunn@newsguy.com>

ALSA: pxa27x: fix ac97 warm reset

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


# 41b645c8 07-Jan-2013 Mike Dunn <mikedunn@newsguy.com>

ALSA: pxa27x: fix ac97 cold reset

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


# e21596bb 05-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ALSA: pxa2xx: remove __dev* attributes

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>


# 23019a73 20-Mar-2012 Rob Herring <rob.herring@calxeda.com>

ARM: pxa: use common IOMEM definition

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


# 9482ee71 03-Jan-2012 Rob Herring <rob.herring@calxeda.com>

sound: pxa2xx-ac97: include mach/irqs.h directly

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>


# da155d5b 14-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

sound: Add module.h to the previously silent sound users

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>


# 88e24c3a 22-Sep-2011 Yong Zhang <yong.zhang0@gmail.com>

sound: irq: Remove IRQF_DISABLED

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>


# 846c864c 04-Jan-2010 Eric Miao <eric.y.miao@gmail.com>

[ARM] pxa: remove now unnecessary pxa_gpio_mode() calls in ac97

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>


# fb1bf8cd 04-Jan-2010 Eric Miao <eric.y.miao@gmail.com>

[ARM] pxa: introduce processor specific pxa27x_assert_ac97reset()

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>


# e1aed7ca 04-Jan-2010 Eric Miao <eric.y.miao@gmail.com>

[ARM] pxa: remove the unnecessary restoring of MFP registers

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>


# 1ffafeb5 11-May-2009 Mike Rapoport <rppt@kernel.org>

pxa2xx-ac97: fix reset gpio mode setting

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>


# eae17754 13-Apr-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

[ARM] pxa: merge AC97 platform data structures

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>


# 057de50c 26-Mar-2009 Luotao Fu <l.fu@pengutronix.de>

pxa2xx-ac97: fix displaying GSR after reset timeout

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>


# 1f218695 19-Mar-2009 Takashi Iwai <tiwai@suse.de>

ALSA: Fix wrong pointer to dev_err() in arm/pxa2xx-ac97-lib.c

Fix the wrong device pointer passed to dev_err().

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 26ade896 15-Mar-2009 Robert Jarzmik <robert.jarzmik@free.fr>

ASoC: Allow choice of ac97 gpio reset line

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>


# 5742964e 19-Jan-2009 Eric Miao <eric.miao@marvell.com>

[ARM] pxa: remove unnecessary #include of pxa-regs.h and hardware.h

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>


# 79612336 04-Jan-2009 Dmitry Baryshkov <dbaryshkov@gmail.com>

pxa2xx-ac97: switch AC unit to correct state before probing

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>


# 1f017a99 27-Nov-2008 Eric Miao <eric.miao@marvell.com>

[ARM] pxa: move AC97 register definitions into dedicated regs-ac97.h

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>


# 8825e8e8 14-Oct-2008 Marc Zyngier <maz@misterjones.org>

ALSA: Fix pxa2xx-ac97-lib.c compilation

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>


# 9d1cf39b 09-Sep-2008 Dmitry Baryshkov <dbaryshkov@gmail.com>

ALSA: pxa2xx-ac97-lib: support building for several CPUs

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>


# 9c636342 09-Sep-2008 Dmitry Baryshkov <dbaryshkov@gmail.com>

ALSA: Separate common pxa2xx-ac97 code

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>