History log of /linux-master/sound/soc/atmel/sam9g20_wm8731.c
Revision Date Author Comments
# 6547effc 11-Sep-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: atmel: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0n4qniq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8c03fd5f 19-May-2023 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

ASoC: atmel: sam9g20_wm8731: Remove the unneeded include <linux/i2c.h>

This driver does not use i2c, so there is no point in including
<linux/i2c.h>

Remove it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/9b39a59f5829d200d7d1fac4e993dbf8ce05836d.1684578051.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>


# a186762b 15-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: atmel: sam9g20_wm8731: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-32-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>


# c769fb6b 25-Feb-2023 Mark Brown <broonie@kernel.org>

ASoC: sam9g20ek: Disable capture unless building with microphone input

Without modification the AT91SAM9G20-EK has no capture support, none of the
inputs of the CODEC are wired to anything to useful and there are no paths
supporting loopback. Since the audio is clocked from the CODEC and the DAPM
inputs are marked as unusable this means that capture will fail to transfer
any data as the ADC path can't be powered up.

Flag this in the device description so apps don't see unusable capture
support, guarded with the existing optional define for mic input.

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230225-asoc-sam9g20ek-v1-1-9baeb4893142@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7d67657c 05-Aug-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

ASoC: sam9g20_wm8731: Simplify some error message

dev_err_probe() already prints the error code in a human readable way, so
there is no need to duplicate it as a numerical value at the end of the
message.

Fixes: 29f4078f777f ("ASoC: sam9g20_wm8731: Use dev_err_probe() for snd_soc_register_card()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/fb959b3bda689aa47e1fbe9948de957b77530b24.1659764734.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>


# 29f4078f 06-May-2022 Mark Brown <broonie@kernel.org>

ASoC: sam9g20_wm8731: Use dev_err_probe() for snd_soc_register_card()

Log the error code when snd_soc_regster_card() fails, but fold in the
silencing of deferred probe errors.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220506130349.451452-1-broonie@kernel.org


# 01251dd0 25-Mar-2022 Mark Brown <broonie@kernel.org>

ASoC: atmel: Don't squash error codes from atmel_ssc_set_audio()

The AT91SAM9G20-EK audio driver is replacing any error code returned by
atmel_ssc_set_audio() with -EINVAL which could be unhelpful for debugging.
Pass through the error code, and include it in the log message we print for
good measure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220325154241.1600757-4-broonie@kernel.org


# 28103509 25-Mar-2022 Mark Brown <broonie@kernel.org>

ASoC: atmel: Fix error handling in at91samg20ek probe()

The error handling in the AT91SAM9G20-EK machine driver probe did not
consistently free the SSC in error paths, sometimes immediately returning
an error rather than doing cleanup. Fix this.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220325154241.1600757-3-broonie@kernel.org


# c775cbf6 25-Mar-2022 Mark Brown <broonie@kernel.org>

ASoC: atmel: Remove system clock tree configuration for at91sam9g20ek

The MCLK of the WM8731 on the AT91SAM9G20-EK board is connected to the
PCK0 output of the SoC, intended in the reference software to be supplied
using PLLB and programmed to 12MHz. As originally written for use with a
board file the audio driver was responsible for configuring the entire tree
but in the conversion to the common clock framework the registration of
the named pck0 and pllb clocks was removed so the driver has failed to
instantiate ever since.

Since the WM8731 driver has had support for managing a MCLK provided via
the common clock framework for some time we can simply drop all the clock
management code from the machine driver other than configuration of the
sysclk rate, the CODEC driver still respects that configuration from the
machine driver.

Fixes: ff78a189b0ae55f ("ARM: at91: remove old at91-specific clock driver")
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220325154241.1600757-2-broonie@kernel.org


# f590797f 06-Mar-2022 Miaoqian Lin <linmq006@gmail.com>

ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe

This node pointer is returned by of_parse_phandle() with refcount
incremented in this function.
Calling of_node_put() to avoid the refcount leak.

Fixes: 531f67e41dcd ("ASoC: at91sam9g20ek-wm8731: convert to dt support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220307124539.1743-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4a8cf938 15-Sep-2021 Mark Brown <broonie@kernel.org>

ASoC: atmel: Convert to new style DAI format definitions

Convert the Atmel drivers to use the new style defines for clocking in DAI
formats.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Acked-by: Peter Rosin <peda@axentia.se>


# b434d707 22-Mar-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: atmel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87369zk5ul.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0efd1d7c 27-Jun-2019 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: atmel: sam9g20_wm8731: consider CPU-Platform possibility

commit bfc7938e58142a5 ("ASoC: atmel: sam9g20_wm8731: don't select
unnecessary Platform")

Current ALSA SoC avoid to add duplicate component to rtd,
and this driver was selecting CPU component as Platform component.
Thus, above patch removed Platform settings from this driver,
because it assumed these are same component.

But, some CPU driver is using generic DMAEngine, in such case, both
CPU component and Platform component will have same of_node/name.
In other words, there are some components which are different but
have same of_node/name.

In such case, Card driver definitely need to select Platform even
though it is same as CPU.
It is depends on CPU driver, but is difficult to know it from Card driver.
This patch reverts above patch.

Fixes: commit bfc7938e58142a5 ("ASoC: atmel: sam9g20_wm8731: don't select unnecessary Platform")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# bfc7938e 18-Jun-2019 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: atmel: sam9g20_wm8731: don't select unnecessary Platform

ALSA SoC is now supporting "no Platform". Sound card doesn't need to
select "CPU component" as "Platform" anymore if it doesn't need
special Platform.
This patch removes such settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# d83923c5 05-Jun-2019 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: atmel: sam9g20_wm8731: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 1 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 as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# edefc8f3 15-Jan-2018 Ladislav Michl <ladis@linux-mips.org>

ASoC: sam9g20_wm8731: use dev_*() logging functions

Use dev_*() logging functions instead of plain printk and as
messages are now properly prefixed drop 'ASoC' prefix as well.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# a1677e39 11-Apr-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: at91sam9g20ek: Automatically disconnect non-connected pins

According to the schematics the both LHPOUT and RHPOUT are connected to the
external connector. RHPOUT is missing from the DAPM routes, but otherwise
they seem to be complete.

This patch adds the missing route and then sets the fully_routed flag for
the card. This allows to remove all the manual calls to
snd_soc_dapm_nc_pin().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# d7a6fe01 05-Jan-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

ASoC: sam9g20_wm8731: drop machine_is_xxx

Atmel based boards can now only be used with device tree. Drop non DT
initialization.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7491831f 06-Jan-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

ASoC: atmel: sam9g20_wm8731: remove useless include

A mach/ header is included but never used. Simply remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 059d3dc6 01-Jan-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: sam9g20_wm8731: Use static DAI format setup

Set the dai_fmt field in the dai_link struct instead of manually calling
snd_soc_dai_fmt(). This makes the code cleaner and shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c9845a84 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

ASoC: atmel: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 15fb63a0 14-Apr-2014 Nicolas Ferre <nicolas.ferre@microchip.com>

ASoC: sam9g20_wm8731: remove useless mach/gpio.h

This include file is about to disapear. In addition it is
useless for this code. So it is time to remove it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Mark Brown <broonie@linaro.org>


# b0ffe9b1 08-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: sam9g20_wm8731: Convert to table based DAPM setup

Use table based setup to register the DAPM widgets and routes. This on one hand
makes the code a bit shorter and cleaner and on the other hand the board level
DAPM elements get registered in the card's DAPM context rather than in the
CODEC's DAPM context.

While we are at it also remove the snd_soc_dapm_enable_pin() in the init
callback. Pins are enabled by default.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 8aa99652 11-Oct-2013 Sachin Kamat <sachin.kamat@linaro.org>

ASoC: atmel: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 9b74fad5 06-May-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: sam9g20ek: Let device core handle pinctrl

Since commit ab78029 (drivers/pinctrl: grab default handles from device
core) we can rely on device core for handling pinctrl so remove
devm_pinctrl_get_select_default() from the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>


# 151edfc7 30-Jan-2013 Bo Shen <voice.shen@atmel.com>

ASoC: sam9g20_wm8731: disable clock and correct sequence when unload

disable clock and correct sequence when unload

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 71d14ea6 07-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ASoC: atmel: 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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 531f67e4 14-Nov-2012 Bo Shen <voice.shen@atmel.com>

ASoC: at91sam9g20ek-wm8731: convert to dt support

convert at91sam9g20ek with wm8731 to device tree support

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3310b57d 14-Nov-2012 Bo Shen <voice.shen@atmel.com>

ASoC: atmel-ssc-dai: match new method of dai and pcm register

Remove unneeded code with the new method of dai and pcm register

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 242b9bb8 10-Oct-2012 Bo Shen <voice.shen@atmel.com>

ASoC: sam9g20-wm8731: convert to use snd_soc_register_card()

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 338d68db 22-Dec-2011 Axel Lin <axel.lin@gmail.com>

ASoC: atmel: Add .owner to struct snd_soc_card

Missed .owner of struct snd_soc_card will prevent the module from being
removed from underneath its users.

Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 87bea31c 08-Oct-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove redundant snd_soc_dapm_sync() calls from machine drivers

The core will sync DAPM as part of the card initialization, there is no
need for machine drivers to do so during their setup.

OMAP drivers are omitted as I know Peter already has patches for them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d4c6005f 06-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add context parameter to card DAPM callbacks

The card callback will get called for each DAPM context in the card so it
can be useful for it to know which device is currently undergoing a
transition.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>


# 6bb74a72 24-May-2011 Nicolas Ferre <nicolas.ferre@microchip.com>

ASoC: sam9g20_wm8731: use the proper SYSCKL value

at91sam9g20 is providing master clock to wm8731: not using a crystal but an
external MCLK. We can avoid conflict and save power using WM8731_SYSCLK_MCLK as
we do not need oscillator to be powered.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 99b59f3c 27-Mar-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove -codec from WM8731 driver name

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>


# c7a734e5 25-Nov-2010 Axel Lin <axel.lin@gmail.com>

ASoC: sam9g20_wm8731: fix resource leak in at91sam9g20ek_init error path

Fix the error path to properly free allocated resources.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# b3915d1f 22-Nov-2010 Vasiliy Kulikov <segoon@openwall.com>

ASoC: atmel: test wrong variable

After clk_get() mclk is checked second time instead of pllb check.
In patch v1 Jarkko Nikula noticed that PTR_ERR() is also has wrong argument.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 505fb824 21-Nov-2010 Jarkko Nikula <jhnikula@gmail.com>

ASoC: Do not include soc-dapm.h

There is no need to include soc-dapm.h since soc.h includes it.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ce6120cc 05-Nov-2010 Liam Girdwood <lrg@slimlogic.co.uk>

ASoC: Decouple DAPM from CODECs

Decoupling Dynamic Audio Power Management (DAPM) from codec devices is
required when developing ASoC further. Such as for other ASoC components to
have DAPM widgets or when extending DAPM to handle cross-device paths.

This patch decouples DAPM related variables from struct snd_soc_codec and
moves them to new struct snd_soc_dapm_context that is used to encapsulate
DAPM context of a device. ASoC core and API of DAPM functions are modified
to use DAPM context instead of codec.

This patch does not change current functionality and a large part of changes
come because of structure and internal API changes.

Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some
minor core changes, codecs and machine driver conversions from
Jarkko Nikula <jhnikula@gmail.com>.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Cliff Cai <cliff.cai@analog.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Timur Tabi <timur@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Jassi Brar <jassi.brar@samsung.com>
Cc: Daniel Gloeckner <dg@emlix.com>
Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# abfa4eae 18-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add simplfied device registration for Atmel SSC devices

Since the SSC is already being registered as a device under arch and
the DMA and SSC hardware are pretty much the same provide a simplified
device registration function for the Atmel SSC which will add the
ASoC-specific devices within the ASoC code, parenting the SSC device
off the actual SSC device. Also use it in the sam9g20-ek driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>


# dad965f0 18-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix device name for AT91SAM9G20-EK devices

A couple of typos in the multi-component conversion.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>


# e7712510 17-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Support non-crystal master clocks for WM8731

Instead of unconditionally enabling the crystal oscillator on the WM8731
only enable it when explicitly selected via set_sysclk(), allowing machine
drivers to specify that they drive a clock into MCLK alone. This avoids
any conflicts between the oscillator and the external MCLK source and saves
power for systems which do not need the oscillator.

This should also deliver a small power saving on systems using the crystal
since the oscillator will only be enabled when the ADC or DAC is active.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 9745e824 17-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Support non-crystal master clocks for WM8731

Instead of unconditionally enabling the crystal oscillator on the WM8731
only enable it when explicitly selected via set_sysclk(), allowing machine
drivers to specify that they drive a clock into MCLK alone. This avoids
any conflicts between the oscillator and the external MCLK source and saves
power for systems which do not need the oscillator.

This should also deliver a small power saving on systems using the crystal
since the oscillator will only be enabled when the ADC or DAC is active.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f0fba2ad 17-Mar-2010 Liam Girdwood <lrg@slimlogic.co.uk>

ASoC: multi-component - ASoC Multi-Component Support

This patch extends the ASoC API to allow sound cards to have more than one
CODEC and more than one platform DMA controller. This is achieved by dividing
some current ASoC structures that contain both driver data and device data into
structures that only either contain device data or driver data. i.e.

struct snd_soc_codec ---> struct snd_soc_codec (device data)
+-> struct snd_soc_codec_driver (driver data)

struct snd_soc_platform ---> struct snd_soc_platform (device data)
+-> struct snd_soc_platform_driver (driver data)

struct snd_soc_dai ---> struct snd_soc_dai (device data)
+-> struct snd_soc_dai_driver (driver data)

struct snd_soc_device ---> deleted

This now allows ASoC to be more tightly aligned with the Linux driver model and
also means that every ASoC codec, platform and (platform) DAI is a kernel
device. ASoC component private data is now stored as device private data.

The ASoC sound card struct snd_soc_card has also been updated to store lists
of it's components rather than a pointer to a codec and platform. The PCM
runtime struct soc_pcm_runtime now has pointers to all its components.

This patch adds DAPM support for ASoC multi-component and removes struct
snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec
or runtime PCM level basis rather than using snd_soc_socdev.

Other notable multi-component changes:-

* Stream operations now de-reference less structures.
* close_delayed work() now runs on a DAI basis rather than looping all DAIs
in a card.
* PM suspend()/resume() operations can now handle N CODECs and Platforms
per sound card.
* Added soc_bind_dai_link() to bind the component devices to the sound card.
* Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove
DAI link components.
* sysfs entries can now be registered per component per card.
* snd_soc_new_pcms() functionailty rolled into dai_link_probe().
* snd_soc_register_codec() now does all the codec list and mutex init.

This patch changes the probe() and remove() of the CODEC drivers as follows:-

o Make CODEC driver a platform driver
o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core.
o Removed all static codec pointers (drivers now support > 1 codec dev)
o snd_soc_register_pcms() now done by core.
o snd_soc_register_dai() folded into snd_soc_register_codec().

CS4270 portions:
Acked-by: Timur Tabi <timur@freescale.com>

Some TLV320aic23 and Cirrus platform fixes.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>

TI CODEC and OMAP fixes
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>

Samsung platform and misc fixes :-
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>

MPC8610 and PPC fixes.
Signed-off-by: Timur Tabi <timur@freescale.com>

i.MX fixes and some core fixes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

J4740 platform fixes:-
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

CC: Tony Lindgren <tony@atomide.com>
CC: Nicolas Ferre <nicolas.ferre@atmel.com>
CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC: Kuninori Morimoto <morimoto.kuninori@renesas.com>
CC: Daniel Gloeckner <dg@emlix.com>
CC: Manuel Lauss <mano@roarinelk.homelinux.net>
CC: Mike Frysinger <vapier.adi@gmail.com>
CC: Arnaud Patard <apatard@mandriva.com>
CC: Wan ZongShun <mcuos.com@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 69d2c2ae 08-Oct-2009 Nicolas Ferre <nicolas.ferre@microchip.com>

ASoC: at91sam9g20ek_2mmc board uses same audio connexion as at91sam9g20ek

The modified revision of at91sam9g20 Evaluation Kit rev. C and onwards share
with previous ones its audio connexion to Wolfson wm8731. Modify the SoC file
to extend the machine ID checking.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d7dbf6ea 08-Jul-2009 Mark Brown <broonie@sirena.org.uk>

[ARM] 5596/1: at91sam9g20-ek: Register WM8731 in board file

The WM8731 driver has been updated to allow registration via normal
device model methods rather than from within the ASoC driver probe
so update the AT91SAM9G20-EK to make use of this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# 96fd6d47 08-Jul-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Configure WM8731 SYSCLK at startup on AT91SAM9G20-EK

The system clock is currently fixed by the driver and this avoids
the need for us to handle errors with enabling and disabling MCLK
(which was incorrect previously so this fixes bugs in error
handling).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 22df8eb4 08-Jul-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Disable microphone input for AT91SAM9G20-EK by default

As shipped the board does not have inputs but it is relatively
straightforward to modify the board to hook them up so support
is provided in the driver. When these modifications have not
been made enabling the microphone stage can cause problems.

Add an ifdef to disable this by default. Don't put it into
Kconfig since users will have to get their soldering irons
out to change things.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 2a01e5f3 08-Jul-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Use CODEC as clock master on AT91SAM9G20-EK

This simplifies the driver by removing the need to manually
configure dividers within the CPU and improve audio performance
by ensuring that the optimal phase relationships between the
clocks in the system are maintained.

Note that currently this means that for playback to work the
Output Mixer HiFi switch must be enabled since otherwise CODEC
will not generate the DAC clock.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5998102b 16-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Refactor WM8731 device registration

Move the WM8731 driver to use a more standard device registration
scheme where the device can be registered independantly of the ASoC
probe.

As a transition measure push the current manual code for registering
the WM8731 into the individual machine driver probes. This allows
separate patches to update the relevant architecture files with less
risk of merge issues.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 7ee75380 16-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Rename AT91SAMG20-EK for applications

This is a bit more idiomatic and makes identifying a configuration
based on the board type work better.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5de7f9b2 16-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Actively manage MCLK for AT91SAM9G20-EK

We have software control of the MCLK for the WM8731 so save a bit of
power by actively managing it within the machine driver, enabling it
only while the codec is active.

Once ASoC supports multiple boards and doesn't require the soc-audio
device the initial clock setup should be pushed down into the arch/arm
code but for now this reduces merge issues.

Tested-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 40135ea0 16-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Check machine type before loading on AT91SAM9G20-EK

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d6943541 16-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Improve diagnostics for AT91SAM9G20-EK probe

We should display an error by default if we fail to register.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 8c0bad7f 06-Jan-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Use snd_soc_dapm_nc_pin() in at91sam9g20ek

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 87689d56 02-Dec-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Push platform registration down into the card

As part of the deprecation of snd_soc_device push the registration of
the platform down into the card structure.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 87506549 18-Nov-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Rename snd_soc_card to snd_soc_machine

One of the issues with the ASoC v1 API which has been addressed in the
ASoC v2 work that Liam Girdwood has done is that the ALSA card provided
by ASoC is distributed around the ASoC structures. For example, machine
wide data such as the struct snd_card are maintained as part of the
CODEC data structure, preventing the use of multiple codecs. This has
been addressed by refactoring the data structures so that all the data
for the ALSA card is contained in a single structure snd_soc_card which
replaces the existing snd_soc_machine and snd_soc_device.

Begin the process of backporting this by renaming struct snd_soc_machine
to struct snd_soc_card, better reflecting its function and bringing it
closer to standard ALSA terminology.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 0ee46636 04-Nov-2008 Takashi Iwai <tiwai@suse.de>

ALSA: ASoC - Remove unnecessary inclusion of linux/version.h

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


# 5b99e6cc 03-Oct-2008 Sedji Gaouaou <sedji.gaouaou@atmel.com>

ASoC: Add audio support for the Atmel AT91SAM9G20ek board(uing wolfson 8731).

Add audio support for the Atmel AT91SAM9G20ek board(uing wolfson 8731).
It is based on the former eti_b1_wm8731.c file, using the atmel scc API.

Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>