History log of /linux-master/sound/soc/codecs/ak4642.c
Revision Date Author Comments
# 340d79a1 06-Oct-2023 Rob Herring <robh@kernel.org>

ASoC: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> # for at91
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# d9e6a80a 31-Aug-2023 Biju Das <biju.das.jz@bp.renesas.com>

ASoC: ak4642: Simplify probe()

Simpilfy probe() by replacing of_device_get_match_data() and id lookup for
retrieving match data by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831204734.104954-3-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a157d07d 31-Aug-2023 Biju Das <biju.das.jz@bp.renesas.com>

ASoC: ak4642: Minor cleanups in probe()

Some minor cleanups:
Replace local variable np with dev_fwnode()
Replace dev_err()->dev_err_probe().
Remove comma in the terminator entry for OF table.
Drop a space in the terminator entry for ID table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831204734.104954-2-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9abcd240 25-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# 410e73a5 23-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: ak*: Remove now redundant non_legacy_dai_naming flag

The ASoC core has now been changed to default to the non-legacy DAI
naming, as such drivers using the new scheme no longer need to specify
the non_legacy_dai_naming flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-48-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e654a133 15-Apr-2022 Stephen Kitt <steve@sk2.org>

ASoC: ak*: use i2c_match_id and simple i2c probe

As part of the ongoing i2c transition to the simple probe
("probe_new"), this patch uses i2c_match_id to retrieve the
driver_data for the probed device. The id parameter is thus no longer
necessary and the simple probe can be used instead.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220415160613.148882-2-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3e8908fb 20-Sep-2021 Mark Brown <broonie@kernel.org>

ASoC: ak4642: Use modern ASoC DAI format terminology

As part of moving to remove the old style defines for the bus clocks update
the ak4642 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164042.16624-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 870b76ea 14-Jan-2021 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak*: sync parameter naming (rate/sample_bits)

This patch syncs naming rule.

- xxx_rates;
+ xxx_rate;

- xxx_samplebits;
+ xxx_sample_bits;

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


# fe209b97 30-Jul-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: convert to SPDX identifiers

As original license mentioned, it is GPL-2.0 in SPDX.
Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL".
See ${LINUX}/include/linux/module.h

"GPL" [GNU Public License v2 or later]
"GPL v2" [GNU Public License v2]

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


# fe439c7c 13-Feb-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: don't have .use_pmdown_time

snd_soc_runtime_ignore_pmdown_time() returns "ignore pmdown time"
decision. Then, it collects each component driver's .use_pmdown_time
settings by using AND operation.
But, ak4613 has no reason to ignore/use pmdown time.
Thus, It should has use_pmdown_time=0, it means it doesn't have
decision right of "ignore pmdown time".

Otherwise, ak4642 paired driver's pmdown_time settings doesn't
have meaning. In other words, "ignore pmdown time" is determined
irrespective of the value of paired driver's settings
(= ignore will be 0 by ak4642).

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


# 43c5d0f0 28-Jan-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 0 -> .idle_bias_on = 1
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1

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


# a180ba45 03-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ASoC: codecs: add const to snd_soc_codec_driver structures

Declare snd_soc_codec_driver structures as const as they are only passed
as an argument to the function snd_soc_register_codec. This argument is
of type const, so declare the structures with this property as const.
In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in
a copy operation along with getting passed to snd_soc_register_codec.
So, it can be made const too.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
position p;
@@
static struct snd_soc_codec_driver s@p={...};

@good1@
identifier match.s;
position p;
@@
snd_soc_register_codec(...,&s@p,...)

@bad@
identifier match.s;
position p!={match.p,good1.p};
@@
s@p

@depends on !bad disable optional_qualifier@
identifier match.s;
@@
static
+const
struct snd_soc_codec_driver s={...};

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 836e4fed 30-Jun-2017 Colin Ian King <colin.king@canonical.com>

ASoC: ak4642: make arrays fs_list and ps_list static const

Don't populate the arrays fs_list and ps_list on the stack but make
them static const. Makes the object code smaller:

Before:
text data bss dec hex filename
12084 4888 64 17036 428c sound/soc/codecs/ak4642.o

After:
text data bss dec hex filename
11883 5032 64 16979 4253 sound/soc/codecs/ak4642.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# fc1e65c3 10-Jan-2017 Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>

ASoC: ak4642: Replace mdelay function to msleep

Replace mdelay to msleep to avoid busy loop on ak4642_lout_event().
Otherwise, sometimes playback doesn't work correctly when pulseaudio
was used.

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


# 3a6ce00e 08-Aug-2016 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codec duplicated callback function goes to component on ak4642

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

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


# a2ebd586 31-May-2016 Peter Ujfalusi <peter.ujfalusi@ti.com>

ASoC: ak4642: Implement suspend callback

Add the suspend callback to accompany the existing resume operation.
With the suspend/resume callbacks the regmap (regcache) state handling can
follow the recommended sequence.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# d3030d11 18-May-2016 Mark Brown <broonie@kernel.org>

ASoC: ak4642: Enable cache usage to fix crashes on resume

The ak4642 driver is using a regmap cache sync to restore the
configuration of the chip on resume but (as Peter observed) does not
actually define a register cache which means that the resume is never
going to work and we trigger asserts in regmap. Fix this by enabling
caching.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org


# b6bf3289 19-Apr-2016 Stephen Boyd <sboyd@codeaurora.org>

ASoC: ak4642: Remove CLK_IS_ROOT

This flag is a no-op now (see commit 47b0eeb3dc8a "clk: Deprecate
CLK_IS_ROOT", 2016-02-02) so remove it.

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


# 544637bf 14-Sep-2015 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: exchange macro name to avoid redefinition

71a0138ab("ASoC: ak4642: enable to use MCKO as fixed rate output
pin on DT") added new FS() macro, but x86 already has it in
arch/x86/include/uapi/asm/ptrace-abi.h
This patch exchange FS() to FSs() to avoid redefinition warning

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 171a0138 10-Sep-2015 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: enable to use MCKO as fixed rate output pin on DT

ak4642 chip can output clock via MCKO pin as audio reference clock.
This patch supports it on DT

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


# 2719a752 10-Sep-2015 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: use *dev on ak4642_i2c_probe()

Let's replace &i2c->dev to dev

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


# 1c07a4de 14-Jul-2015 Krzysztof Kozlowski <krzk@kernel.org>

ASoC: drivers: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f8ea6ceb 30-Jun-2015 Axel Lin <axel.lin@ingics.com>

ASoC: ak4642: Fix up max_register setting

The max_register setting for ak4642, ak4643 and ak4648 are wrong, fix it.

According to the datasheet:
the maximum valid register for ak4642 is 0x1f
the maximum valid register for ak4643 is 0x24
the maximum valid register for ak4648 is 0x27

The default settings for ak4642 and ak4643 are the same for 0x0 ~ 0x1f
registers, so it's fine to use the same reg_default table with differnt
num_reg_defaults setting.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f4bf8d77 27-Apr-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Move bias level update to the core

All drivers have the same line at the end of the set_bias_level callback to
update the bias_level state. Move this update into
snd_soc_dapm_force_bias_level() and remove them from the drivers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c01673e0 10-Apr-2015 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: fixup channels_min

ak4642 doesn't have Mono record, ak4643 have it, but not supported.
This patch fixes channel mismatch

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


# 39c26180 23-Mar-2015 Takeshi Kihara <takeshi.kihara.df@renesas.com>

ASoC: ak4642: enable stereo line output power-save mode

ak4642 has power-save mode for stereo line to reduce pop noise.
This patch enables it.

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


# 379c4b05 15-Mar-2015 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: tidyup DAPM route for playback

It needs DAC -> Playback route instead of direct settings via
SND_SOC_DAPM_DAC. otherwise, it can't find correct path if
sound card used prefix name

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


# 61ce9ee3 20-Oct-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: ak4642: Cleanup manual bias level transitions

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 27204ca8 28-Jul-2014 Kiran Padwal <kiran.padwal21@gmail.com>

ASoC: ak4642: Make of_device_id array const

Make of_device_id array const, because all OF functions handle it as const

Signed-off-by: Kiran Padwal <kiran.padwal21@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 5cd15e29 14-May-2014 Sascha Hauer <s.hauer@pengutronix.de>

ASoC: ak4642: Add support for extended sysclk frequencies of the ak4648

Additionally to the ak4642 pll frequencies the ak4648 also supports 13MHz,
19.2MHz and 26MHz. This adds support for these frequencies.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# d815c703 14-May-2014 Sascha Hauer <s.hauer@pengutronix.de>

ASoC: ak4642: Add driver data and driver private struct

Currently unused, this is done to let the driver distinguish between
the different supported codec types in later patches.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 370f83a1 14-May-2014 Sascha Hauer <s.hauer@pengutronix.de>

ASoC: ak4642: Add ALC controls

ALC and ALC Zero crossing detection has been enabled unconditionally.
Add controls for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# da731845 14-May-2014 Sascha Hauer <s.hauer@pengutronix.de>

ASoC: ak4642: Fix typo zoro -> zero

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 5d6be5aa 10-Mar-2014 Xiubo Li <Li.Xiubo@freescale.com>

ASoC: codec: Simplify ASoC probe code.

For some CODEC drivers like who act as the MFDs children are ignored
by this patch.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 2f54d2a1 28-Nov-2013 Mark Brown <broonie@linaro.org>

ASoC: ak4642: Convert to module_i2c_driver()

The device does not support anything other than I2C (at least with the
current driver) so save code.

Signed-off-by: Mark Brown <broonie@linaro.org>


# 4574cd94 28-Nov-2013 Mark Brown <broonie@linaro.org>

ASoC: ak4642: Convert to direct regmap API usage

This moves us towards being able to remove the ASoC level I/O code which
duplicates regmap functionality. Currently the only difference between
the supported devices in the driver is the regmap so we can replace the
CODEC driver selections with regmap selection instead.

Signed-off-by: Mark Brown <broonie@linaro.org>


# a8ca52b7 28-Nov-2013 Mark Brown <broonie@linaro.org>

ASoC: ak4642: Convert to table based control init

Improves error handling and saves code.

Signed-off-by: Mark Brown <broonie@linaro.org>


# b34d7cf3 20-Nov-2013 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: ak4642: Use IS_ENABLED() macro

Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 7b5bfb82 01-Nov-2013 Phil Edworthy <phil.edworthy@renesas.com>

ASoC: ak4642: prevent un-necessary changes to SG_SL1

If you record the sound during playback,
the playback sound becomes silent.
Modify so that the codec driver does not clear
SG_SL1::DACL bit which is controlled under widget

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org


# 0feb23d1 13-Sep-2013 Sachin Kamat <sachin.kamat@linaro.org>

ASoC: ak4642: Remove redundant break

'break' after return statement is redundant. Remove it.

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


# c890caee 13-Jan-2013 Stephen Rothwell <sfr@canb.auug.org.au>

ASoC: ak4642: remove __devinitconst annotation

CONFIG_HOTPLUG is always true now and the __dev* macros have been removed.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# bbf1453e 10-Jan-2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add Device Tree support

Support for loading the ak4642 codec module via devicetree.

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


# 7a79e94e 07-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ASoC: codecs: 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>


# 2f391251 20-Nov-2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: cleanup struct ak4642_priv

This patch removed struct ak4642_priv which had
meaningless variable.
It is no longer needed

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


# 1f99e44c 05-Apr-2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: fixup: mute needs +1 step

ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute.
But current settings didn't care +1 step for mute.
This patch adds it

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


# e555cf36 20-Feb-2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: fixup HeadPhone L/R dapm settings

Current ak4642 driver had wrong dapm settings for headphone L/R.
If you select headphone L, and select R after that,
headphone L setting was removed by R settings.

This patch fixes it up.
It provides just "Headphone Enable" to user side

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


# 022658be 03-Feb-2012 Liam Girdwood <lrg@ti.com>

ASoC: core: Add support for DAI and machine kcontrols.

Currently ASoC can only add kcontrols using codec and platform component device
handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for
SoC card machine drivers too. This allows the kcontrol to have a direct handle to
the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily
get it's private data.

This change makes snd_soc_add_controls() static and wraps it in the folowing
calls (card and dai are new) :-

snd_soc_add_card_controls()
snd_soc_add_codec_controls()
snd_soc_add_dai_controls()
snd_soc_add_platform_controls()

This patch also does a lot of small mechanical changes in individual codec drivers
to replace snd_soc_add_controls() with snd_soc_add_codec_controls().

It also updates the McBSP DAI driver to use snd_soc_add_dai_controls().

Finally, it updates the existing machine drivers that register controls to either :-

1) Use snd_soc_add_card_controls() where no direct codec control is required.
2) Use snd_soc_add_codec_controls() where there is direct codec control.

In the case of 1) above we also update the machine drivers to get the correct
component data pointers from the kcontrol (rather than getting the machine pointer
via the codec pointer).

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


# 2ff49eea 19-Dec-2011 Axel Lin <axel.lin@gmail.com>

ASoC: Convert ak4642 to devm_kzalloc()

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 997c2ea9 26-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded platform_device.h inclusions from CODECs

They've not been needed for a long time if they were ever required.

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


# 679acec1 26-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove driver versioning from ak4642

It's never been updated so it can't be that useful and it makes the
driver needlessly chatty.

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


# 85e7652d 23-Nov-2011 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Constify snd_soc_dai_ops structs

Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure")
introduced the possibility to have constant DAI ops structures, yet this is
barley used in both existing drivers and also new drivers being submitted,
although none of them modifies its DAI ops structure. The later is not
surprising since existing drivers are often used as templates for new drivers.
So this patch just constifies all existing snd_soc_dai_ops structs to eliminate
the issue altogether.

The patch was generated with the following coccinelle semantic patch:
// <smpl>
@@
identifier ops;
@@
-struct snd_soc_dai_ops ops =
+const struct snd_soc_dai_ops ops =
{ ... };
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a9317e8b 10-Nov-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add ak4648 support

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


# e8c83dbf 10-Nov-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add Line out support

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


# 3c703526 10-Nov-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add headphone mute switch control

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


# 24747dae 10-Nov-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add DAPM support for HeadPhone Output

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


# ed2dd7da 10-Nov-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add ak4642_set_bias_level()

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


# 20211391 06-Nov-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: ak4642 was tested

ak4642 was tested by ms7724se board

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.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>


# 19b115e5 13-Oct-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: fixup cache register table

ak4642 register was 8bit, but cache table was defined as 16bit.
ak4642 doesn't work correctry without this patch.

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


# b91470bb 11-Oct-2011 Axel Lin <axel.lin@gmail.com>

ASoC: ak4642: convert to soc-cache

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# bd7fdbca 06-Jul-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2

mask didn't cover update-data

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# cb9c130a 19-Jan-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: add SND_SOC_DAIFMT_FORMAT support

This patch support LEFT_J / I2S only for now

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.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>


# a3471239 14-Oct-2010 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: make sure name of register/value

This patch replace magic code with defined name,
and remove unnecessary settings which set default value

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 1422408b 11-Oct-2010 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: simultaneous playback/recorde support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 0ce75aa4 15-Sep-2010 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: code clean up

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 73bb379f 03-Sep-2010 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: Revive ak4642_snd_controls

This patch revive ak4642_snd_controls which was removed on
f0fba2ad1b6b53d5360125c41953b7afcd6deff0

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
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>


# 7bcaad91 22-Jul-2010 Axel Lin <axel.lin@gmail.com>

ASoC: ak4642: fix a memory leak if failed to initialise AK4642

ak4642 should be kfreed if ak4642_init() return error.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a300de3c 30-Jun-2010 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: ak4642: Add Digital Playback Volume control

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


# 3367e452 14-Jun-2010 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: header cleanup for ak4642

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# b2c812e2 14-Apr-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add indirection for CODEC private data

One of the features of the multi CODEC work is that it embeds a struct
device in the CODEC to provide diagnostics via a sysfs class rather than
via the device tree, at which point it's much better to use the struct
device private data rather than having two places to store it. Provide
an accessor function to allow this change to be made more easily, and
update all the CODEC drivers are updated.

To ensure use of the accessor the private data structure member is
renamed, meaning that if code developed with older an older core that
still uses private_data is merged it will fail to build.

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


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 1ad747ca 23-Mar-2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>

ASoC: ak4642: Add enhanced sampling rate

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


# 0643ce8f 15-Mar-2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>

ASoC: ak4642: Add set_fmt function for snd_soc_dai_ops

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


# 4b6316b4 23-Mar-2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>

ASoC: ak4642: Add pll select support

Current ak4642 was not able to select pll.
This patch add support it.
It still expect PLL base input pin is MCKI.
see Table 5 "setting of PLL Mode" of datasheet

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


# 1cf86f6f 14-Dec-2009 Kuninori Morimoto <morimoto.kuninori@renesas.com>

ASoC: ak4642: Add default return value in ak4642_modinit

If ak4642 driver was compiled without I2C configs,
ak4642_modinit return value will become un-stable.
This patch modify this bug

Reported-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# fe3e78e0 03-Nov-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Factor out snd_soc_init_card()

snd_soc_init_card() is always called as the last part of the CODEC probe
function so we can factor it out into the core card setup rather than
have each CODEC replicate the code to do the initialiastation. This will
be required to support multiple CODECs per card.

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


# a3a83d9a 20-Aug-2009 Kuninori Morimoto <morimoto.kuninori@renesas.com>

ASoC: Add ak4642/ak4643 codec support

This is very simple driver for ALSA
It supprt headphone output and stereo input only
This patch is tested by ms7724se

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>