History log of /linux-master/sound/soc/codecs/tlv320dac33.c
Revision Date Author Comments
# 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


# ed5c2f5f 15-Aug-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

i2c: Make remove callback return void

The value returned by an i2c driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)

So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.

Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/*
Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5
Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio
Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860
Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b
Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes
Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>


# 04f3d715 23-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: tlv320*: 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-63-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 894bf75b 02-Jun-2022 Mark Brown <broonie@kernel.org>

ASoC: tlv320dac3x: Use modern ASoC DAI format terminology

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

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


# 9ba0daa6 05-Apr-2022 Stephen Kitt <steve@sk2.org>

ASoC: tlv320*: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

This avoids scanning the identifier tables during probes.

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


# 39e69cef 11-Mar-2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: tlv320dac33: clarify expression

cppcheck warning:

sound/soc/codecs/tlv320dac33.c:1074:43: style: Clarify calculation
precedence for '%' and '?'. [clarifyCalculation]
(dac33->alarm_threshold % period_size ?
^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5e518edd 14-May-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs: use snd_soc_xxx_active()

We have snd_soc_dai/dai_stream/component_active() macro
This patch uses it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87wo5e58j4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2b27bdcc 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

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 version 2 as
published by the free software foundation 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 51 franklin st fifth floor boston ma 02110
1301 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6857b9d0 16-Nov-2018 Colin Ian King <colin.king@canonical.com>

ASoC: tlv320dac33: clean up indentation, remove extraneous tab

The goto statement is indented too much by one level, fix this by
removing the extraneous tab.

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


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

ASoC: tlv320dac33: 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 = 1 -> .idle_bias_on = 0
.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>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3d3dd0d3 15-Jan-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: tlv320dac33: fix regression by adding back .read/.write

commit c4305af43a8 ("ASoC: use internal reg_cache on tlv320dac33")
removed .read/.write from driver, but it might breaks non-regmap
driver, because ALSA SoC framework might call it.

To fix this regression, this patch back .read/.write

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


# c4305af4 13-Nov-2017 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: use internal reg_cache on tlv320dac33

Codec reg_cache is legacy feature and very few driver only are using
it. But, ALSA SoC framework needs to support it.
Codec will be merged into Component in the future, so, let's remove
legacy and unused feature from framework.
This patch implements ALSA SoC reg_cache feature into driver,
and don't use ALSA SoC framework's feature.

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


# ce9544dc 08-Nov-2017 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: don't use codec hw_write on tlv320dac33

uda1380 driver is using codec hw_write/control_data,
but it is redundant code. This patch cleanup these

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>


# 88910982 04-Sep-2016 Bhaktipriya Shridhar <bhaktipriya96@gmail.com>

ASoC: tlv320dac33: Remove deprecated create_singlethread_workqueue

The workqueue "dac33_wq" queues a single work item &dac33->work and
hence doesn't require ordering. Also, it is not being used on a memory
reclaim path. Hence, it has been converted to use system_wq.

System workqueues have been able to handle high level of concurrency
for a long time now and hence it's not required to have a singlethreaded
workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
created with create_singlethread_workqueue(), system_wq allows multiple
work items to overlap executions even on the same CPU; however, a
per-cpu workqueue doesn't have any CPU locality or global ordering
guarantee unless the target CPU is explicitly specified and thus the
increase of local concurrency shouldn't make any difference.

The work item has been flushed in dac33_soc_remove to ensure that
there are no pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


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

ASoC: codec duplicated callback function goes to component on tlv320dac33

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>


# 8733f99c 29-Feb-2016 Takashi Iwai <tiwai@suse.de>

ASoC: tlv320dac33: Fix enum ctl accesses in a wrong type

"FIFO Mode" ctl in tlv320dac33 codec driver is enum, while the current
driver accesses wrongly via value.integer.value[]. They have to be
via value.enumerated.item[] instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
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>


# 37e931c1 14-May-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: tlv320dac33: Replace direct snd_soc_codec dapm field access

The dapm field of the snd_soc_codec struct is eventually going to be
removed, in preparation for this replace all manual access to
codec->dapm.bias_level with snd_soc_codec_get_bias_level().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
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>


# c61ac6b7 14-Jan-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: tlv320dac33: Replace w->codec snd_soc_dapm_to_codec(w->dapm)

The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

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


# 90db15e1 26-Nov-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: tlv320dac33: 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.

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


# c60f23cb 30-Jul-2014 Mark Brown <broonie@linaro.org>

ASoC: tlv320dac33: Convert to params_width()

The CODEC doesn't care how data is laid out in memory.

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


# f4333203 16-Jun-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Move name and id from CODEC/platform to component

The component struct already has a name and id field which are initialized to
the same values as the same fields in the CODEC and platform structs. So remove
them from the CODEC and platform structs and used the ones from the component
struct instead.

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


# e9382e3b 24-Apr-2014 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: tlv320dac33: Use devm_regulator_bulk_get()

Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

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


# ea53bf77 18-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Add snd_soc_kcontrol_codec() helper function

For CODEC controls snd_kcontrol_chip() currently returns a pointer to the
CODEC that registered the control. With the upcoming consolidation of
platform and CODEC controls this will change. Prepare for this by introducing
the snd_soc_kcontrol_codec() helper function that will hide the implementation
details of how the CODEC for a control can be obtained. This will allow us to
change this easily in the future.

The patch also updates all CODEC drivers to use the new helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 092eba93 10-Mar-2014 Xiubo Li <Li.Xiubo@freescale.com>

ASoC: io: New signature for snd_soc_codec_set_cache_io()

Now that all users have been converted to regmap and the config.reg_bits
and config.val_bits can be setted by each user through regmap core API.
So these two params are redundant here.

Since the only control type that left is SND_SOC_REGMAP, so remove it. Drop
the control params and add struct regmap *regmap to simplify the code.

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


# 5c898e74 05-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Add helper function to check whether a CODEC is active

Instead of directly checking the 'active' field of the CODEC struct add a new
helper function that will return either true or false depending on whether the
CODEC is active. This will make the migration to the component level easier.

The patch also updates all CODEC drivers that check the active attribute to use
the new helper function.

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


# d77c290a 18-Feb-2014 Takashi Iwai <tiwai@suse.de>

ASoC: tlv320dac33: Use SOC_ENUM_SINGLE_*_DECL()

Just replace with the helper macros. No functional change at all.

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# f4d8ada2 11-Jan-2013 Peter Ujfalusi <peter.ujfalusi@ti.com>

ASoC: tlv320dac33: Remove suspend/resume soc driver operations

With idle_bias_off these are no longer needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.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>


# 63a47a75 06-Aug-2012 Sachin Kamat <sachin.kamat@linaro.org>

ASoC: tlv320dac33: Use module_i2c_driver

module_i2c_driver makes the code simpler by eliminating module_init
and module_exit calls.

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


# e6968a17 04-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: codecs: Remove rtd->codec usage from CODEC drivers

In order to support CODEC<->CODEC links remove the assumption that there
is only a single CODEC on a DAI link by removing the use of the CODEC
pointer in the rtd from the CODEC drivers. They are already being passed
their DAI whenever they are passed an rtd and can get the CODEC from
there.

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>


# eb3032f8 27-Jan-2012 Axel Lin <axel.lin@gmail.com>

ASoC: Set idle_bias_off flag in snd_soc_codec_driver

Since commit 33c5f969 "ASoC: Allow idle_bias_off to be specified in CODEC
drivers", now we can set idle_bias_off flag in struct snd_soc_codec_driver
for devices can unconditionally support idle_bias_off.

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


# 3a4cbf88 20-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix build of tlv320dac33

The problem was introduced due to the obscure formatting some of the
older drivers use.

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


# 8d725b2b 17-Jan-2012 Peter Ujfalusi <peter.ujfalusi@ti.com>

ASoC: tlv320dac33: Use core to set the msbits constraint

Core can set the msbits constraint in behalf of the dai.

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


# a54877d7 28-Dec-2011 Axel Lin <axel.lin@gmail.com>

ASoC: Convert tlv320dac33 to devm_kzalloc()

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


# 84b315ee 02-Dec-2011 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Drop unused state parameter from CODEC suspend callback

The existence of this parameter is purely historical. None of the CODEC drivers
uses it and we always pass in the same value anyway, so it should be safe to
remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.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>


# 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>


# 8066eb55 11-Oct-2011 Peter Ujfalusi <peter.ujfalusi@ti.com>

ASoC: tlv320dac33: Convert to table based init

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


# c29429f3 28-Sep-2011 Axel Lin <axel.lin@gmail.com>

ASoC: tlv320dac33: Add guarding parentheses to macros

Put parentheses around macro argument uses. This avoids pitfalls
for the programmer, where the argument expansion does not give the
expected result, for example:

SAMPLES_TO_US(substream->runtime->rate, dac33->uthr - DAC33_MODE7_MARGIN + 1);

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.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>


# 93864cf0 03-May-2011 Peter Ujfalusi <peter.ujfalusi@ti.com>

ASoC: tlv320dac33: Update e-mail address

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


# 82a58a8b 12-Apr-2011 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Lower the OSC calibration time

To get correct calibration, we can decrease the time
needed for the OSC to calibrate itself.
With this change we can save ~15ms in the OSC
calibration phase.

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


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# 4b8ffdb9 24-Mar-2011 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Move codec power up to DAPM

Move the codec power on (in reg 0x01, bit 4) from
set_bias_level:SND_SOC_BIAS_ON to a DAPM supply.
In this way we can be sure, that all the things within
the codec is powered before the external amp is
going to be enabled.

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


# 56a3536c 24-Mar-2011 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Restore L/R DAC power control register

Register 0x40, 0x41 need to be restored after power up, since
it contains gain related fields, which affects playback volume.

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


# a3b55791 18-Mar-2011 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Fix inconsistent spinlock usage

The lock is used within the interrupt handler.
Correct the spinlock usage, and use irqsave/irqrestore
flavour of spin_lock/unlock.

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


# 573f26e3 04-Mar-2011 Axel Lin <axel.lin@gmail.com>

ASoC: tlv320dac33: add MODULE_DEVICE_TABLE

The device table is required to load modules based on modaliases.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 399b82e4 10-Jan-2011 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Add DAPM selection for LOM invert

The L/R LOM line can be invertined side of the
corresponding DAC, or inverted from the corresponding
LOP.
Add control for user space to select the source of the
LOM inversion.
When only the analog bypass is enabled, and the LOM
is inverted from DAC output, we need to power the
corresponding DAC.

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


# 0d99d2b0 22-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Add 32/24 bit audio support

Add support for 24 bit audio (with S32_LE msbits 24).
The reason to limit the msbits to 24, is that the FIFO
can be configured for 16 or 24 bit layout.
It is unknown how the codec would downsample from 32 to
24 bit, if the interface is configured to receive 32
bit data.

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


# 549675ed 22-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Some cleanup for 32/24 bit support

Change the structure of FIFO handling in order to
pave the way for adding 32/24 bit audio support.

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


# 3591f4cd 22-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Remove manual FIFO configuration

The manual FIFO configuration was the first version to enable
the use of the FIFO in the codec.
It had served it's purpose as debugging aid, but the automatic
FIFO configuration is much safer to use.
The removal of the manual controls, and configuration makes
it easier to add new features for the codec later, since
the manual mode neded different ways to calculate, and
protect against misconfiguration.

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


# a6cea965 10-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Power down digital parts, when not needed

If the following scenario has been followed:
1. Enable analog bypass
amixer sset 'Analog Left Bypass' on
amixer sset 'Analog Right Bypass' on

2. Start playback
aplay -fdat -d3 /dev/zero

After the playback stopped (3 sec), and the soc timeout (5 sec),
the digital parts of the codec will remain powered up.
This means that the DAI clocks are continue to run, the
oscillator remain operational, etc.

Use the SND_SOC_DAPM_POST_PMD widget to get notification
about the stopped stream, and power down the digital
part of the codec.
If the analog bypass is enabled, than the codec will remain in
BIAS_ON level, and things will work correctly.
In case, if the bypass is disabled, than the codec will
fall to BIAS_STANDBY than to BIAS_OFF level, as it used
to.

The digital part of DAC33 is initialized at every stream start
(DAPM_PRE:PRE_PMU event), so subsequent streams (within 5 sec)
will have working DAI.
When the codec is coming out from BIAS_OFF, the full power-up
sequence followed by the same DAPM_PRE widget event will power up
the digital part.

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


# 3ee4fe15 08-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Fix compillation error

Fix the compilation error introduced by patch:
ASoC: tlv320dac33: Avoid multiple soft power up

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


# 76eac39c 08-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Move DAC LR power on to a supply widget

The power for the DACs need to be enabled, even when only
the analog bypass is in use with the codec, otherwise
the audio is going to be distorted.
Make sure that the DACs are powered all the time, when
there is audio activity.

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


# 9e87186f 08-Dec-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Rename outpup amplifier widget

Use better name for the widget, and remove the 'Power'
from it's name.

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


# 3e202345 30-Nov-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Avoid multiple soft power up

During playback start the codec has been already powered at
BIAS_ON event time, so there's no need to enable the codec again.

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


# 18f45404 30-Nov-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Do not enable the codec in init_chip

No need to enable the codec at this time.
The codec will be enabled later by other events

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


# 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>


# 1bc13b2e 29-Oct-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Mode1 FIFO auto configuration fix

Do not allow invalid (too big) nSample value, when FIFO Mode1
and automatic fifo configuration has been selected.

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


# d54e1f4f 29-Oct-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Limit the US_TO_SAMPLES macro

Limit the time window to maximum 1s in the macro.
The driver deals with much shorter times (<200ms).
This will fix a rare division by zero bug in Mode1.
This could happen, when the work is not executed in
time (within mode1_latency) after the interrupt.
In this case the DAC33 will not receive the needed
nSample command in time, and enters to an unknown
state, and won't recover.
In such event the time window will increase, and
eventually going to be bigger than 1s, resulting
devision by zero.

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


# 911a0f0b 26-Oct-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Error handling for broken chip

Correct/Implement handling of broken chip.
Fail the soc_prope if the communication with the chip
fails (can not read chip ID).

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


# 84eae18c 22-Oct-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Use usleep_range for delays

Switch to use the more precise usleep_range instead of
msleep().
Replace the udelay with usleep_range to remove the busy loop
waiting.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Borwn <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# cf4bb698 13-Oct-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Control for line output gain

New control to select the line output gain.
This gain control affects the linein-to-lineout and
dac-to-loneout gain differently.
Use enum type to select the desired gain combination.

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


# c6d5cca0 14-Sep-2010 Jarkko Nikula <jhnikula@gmail.com>

ASoC: Remove needless codec->bias_level assignment to SND_SOC_BIAS_OFF

This assignment is done by the snd_soc_register_codec so there is no need
to redo it in probe function of a codec driver.

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>


# 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>


# a577b318 28-Jul-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Add support for automatic FIFO configuration

Platform parameter to enable automatic FIFO configuration when
the codec is in Mode1 or Mode7 FIFO mode.
When this mode is selected, the controls for changing
nSample (in Mode1), and UTHR (in Mode7) are not added.
The driver configures the FIFO configuration based on
the stream's period size in a way, that every burst will
read period size of data from the host.
In Mode7 we need to use a formula, which gives close enough
aproximation for the burst length from the host point
of view.

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


# f430a27f 28-Jul-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Revisit the FIFO Mode1 handling

Replace the hardwired latency definition with platform data
parameter, and simplify the nSample parameter calculation.

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


# 9d7db2b2 07-Jun-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Add support for changing upper threshold

Upper threshold is used in mode7 of DAC33.
Instead of hard wired UTHR, add control to change the upper threshold
value.
Changing upper threshold is not allowed when the playback is already
running, since wrongly timed change in the UTHR can cause problems
with the codec.
With this control the length of the burst in mode7 can be changed.

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


# 2d4cdd6f 17-May-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF

Avoid calling the dac33_hard_power when the codec was
already in BIAS_OFF state.
This could happen in device suspend and module removal
time.

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


# 7fd1d74b 17-May-2010 Felipe Balbi <felipe.balbi@nokia.com>

ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function

Since the cases when the same power state would be set again
handled gracefully, we do not need to use dev_warn.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 29e189c2 07-May-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded suspend bias managment from CODEC drivers

The core will ensure that the device is in either STANDBY or OFF bias
before suspending, restoring the bias in the driver is unneeded. Some
drivers doing slightly more roundabout things have been left alone
for now.

Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 2f005471 05-May-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Use codec defaults for LOM/LOP and DAC power

Do not change the codec defaults for the following registers:
0x40, 0x41: Line output gains, do not use amplification
0x42: LOM/LOP Voltage hold, and selection
0x44: LOM inversion control

It has been found, that the values configured to these registers
can cause amplification, which can make the output of DAC33
distorted.

The codec reset values are considered safe in all environmnts.

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


# ad05c03b 30-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Support for turning off the codec

Let the codec to hit OFF instead of STANDBY, when there is no activity.
When the codec is off, than the associated regulator can be also turned
off (if the number of users on the regulator is 0).

After initialization, the codec remains in power off, it is only turned
on for reading the ID registers (also testing the regulators).

The codec power is enabled, when the codec is moving from BIAS_OFF
to BIAS_STANDBY.
The codec is turned off, when it hits BIAS_OFF.

There are few scenarios, which has to be taken care::
1. Analog bypass caused BIAS_OFF -> BIAS_ON
We need to power on the codec, and do the chip init, but we does not
need to execute the playback related configuration
2. Playback caused BIAS_OFF -> BIAS_ON
We need to power on the codec, and do the chip init, and also we need
to execute the playback related configuration.
3. Playback start, while Analog bypass is on (BIAS_ON -> BIAS_ON)
We need to execute the playback related configuration. The codec is
already on.
4. Analog bypass enable, while playback (BIAS_ON -> BIAS_ON)
Nothing need to be done.
5. Playback start withing soc power down timeout (BIAS_ON -> BIAS_ON)
We need to execute the playback related configuration. The codec is
still on.

Since the power up, and the codec init is optimized, the added overhead
in stream start is minimal.

Withing this patch, the hard_power function is now only doing what it
supposed to: only handle the powers, and GPIO reset line.
The codec initialization and state restore has been moved out.

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


# 0b61d2b9 30-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Manage a pointer for snd_pcm_substream in private structure

As a preparation for supporting codec to be turned off,
when we are in BIAS_STANDBY.

The substream must be easily available in other places than
pcm_* callbacks.

Manage a pointer in _startup, and _shutdown for this.

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


# 239fe55c 30-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Revised module loading, and DAC33 ID read

Optimize the way how tlv320dac33 is powered uppon module and
soc initialization.
Also read the DAC33 ID registers, and update the reg_cache
to reflect it.

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


# ef909d67 30-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Optimize power up, and restore

On power up we only need to initialize the codec, and
restore only registers, which are not in either in DAPM
nor in the playback start sequence.
These are mostly gain related registers.

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


# cf134d5b 26-Mar-2010 Liam Girdwood <lrg@slimlogic.co.uk>

ASoC: tlv320dac33 - disable regulators at i2c remove()

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


# f57d2cfa 23-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: FIFO caused delay reporting

Delay reporting for the three implemented DAC33 FIFO modes.
DAC33 has FIFO depth status register(s), but it can not be used, since
inside of pcm_pointer we can not send I2C commands.
Timestamp based estimation need to be used. The method of calculating
the delay depends on the active FIFO mode.

Bypass mode: FIFO is bypassed, report 0 as delay

Mode1: nSample fill mode. In this mode I need to use two timestamp
ts1: taken when the interrupt has been received
ts2: taken before writing to nSample register.

Interrupts are coming when DAC33 FIFO depth goes under alarm threshold.

Phase1: when we received the alarm threshold, but our workqueue has
not been executed (safeguard phase). Just count the played out
samples since ts1 and subtract it from the alarm threshold
value.
Phase2: During nSample burst (after writing to nSample register), count
the played out samples since ts1, count the samples received
since ts2 (in a burst). Estimate the FIFO depth using these and
alarm threshold value.
Phase3: Draining phase (after the burst read), count the played out
samples since ts1. Estimate the FIFO depth using the nSample
configuration and the alarm threshold value.

Mode7: Threshold based fill mode. In this mode one timestamp is enough.
ts1: taken when the interrupt has been received

Interrupts are coming when DAC33 FIFO depth reaches upper threshold.

Phase1: Draining phase (after the burst), counting the played out
samples since ts1, and subtract it from the upper threshold
value.
Phase2: During burst operation. Using the pre calculated time needed to
play out samples from the buffer during the drain period (from
upper to lower threshold), move the time window to cover the
estimated time from the burst start to the current time.
Calculate the samples played out since lower threshold and also
the samples received during the same time.

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


# 76f47127 23-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Calculate the interface speed during bursts

When the DAC33 FIFO is in use the dai interface is running in
much higher speed than the sampling frequency.
Calculate the rate based on the internal base frequency and
the bclk divider.

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


# 4260393e 23-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Change magic numbers used in Mode7

Upper and Lower threshold values are used as magic
numbers. Replace them with defines for later use.

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


# 55abb59c 23-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Skip calculations in FIFO Bypass mode

There is no need for calculations for FIFO bypass mode.
Just in case set the nsample maximum limit, which
has been done in the calculation phase.

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


# f4d59328 23-Apr-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Fix for early interrupt in FIFO Mode1

Alarm threshold interrupt is triggered right after the
playback start.
This interrupt is recieved during the first burst period,
and caused the state machine to write additional nSample
command, which has to be avoided.
To fix this issue move the DAC33 interrupt unmasking
after we configured the PREFILL register with a small
delay.

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


# 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>


# fdb6b1e1 19-Mar-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Internal clocking changes

During validation of the internal clocking setup it has
been found that the following settings were not configured
in an optimal way:

ASRC_CTRL_A: SRCLKDIV was incorrect, instad of divide ratio 3,
ratio of 2 has to be used (as the comment stated)
DAC_CTRL_A: Fs = Fsref is the desired configuration instead of
Fs = Fsref / 1.5

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


# 44f497b4 19-Mar-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Fix DSP modes

To make DSP_A mode working correctly the data delay should be
configured to 0. DSP_B mode thus can not be used with DAC33,
so remove it.

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


# eeb309a8 11-Mar-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Add option for keeping the BCLK running

Platform data option for the codec to keep the BCLK clock
continuously running in FIFO modes (codec master).

OMAP3 McBSP when in slave mode needs continuous BCLK running
on the serial bus in order to operate correctly.

Since in FIFO mode the DAC33 can also shut down the BCLK clock
and enable it only when it is needed, let the platforms decide
if the CPU side needs the BCLK running or not.

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


# c3746a07 11-Mar-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Start/stop sequence change

To avoid race condition especially in FIFO modes the
sequence for enabling and disabling the codec need to
be changed.

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


# 7833ae0e 16-Feb-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Correct the OSCSET calculation

OSCSET calculation was not correct in case of 44.1KHz
sampling rate.
With small adjustment both 48 and 44.1 KHz calculation
now gives the correct value.

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


# e5e878c1 16-Feb-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Clearing FIFOFLUSH flag before playback

In repeated playback the FIFOFLUSH bit remained set, and
never has been cleared.
Clear it during the setup phase.

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


# 6aceabb4 20-Jan-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Burst mode BCLK divider configuration

Add possibility to configure the burst mode BCLK divider through platform
data structure.
The BCLK divider changes the actual speed of the serial bus in burst mode,
which is faster than the sampling frequency of the running stream.
In this way platforms can experiment with the optimal burst speed without
the need to modify the codec driver itself.

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


# 6cd6cede 20-Jan-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: BCLK divider fix

The BCLK divider was not configured in case of mode7.
This leads to unpredictable behavior when switching between FIFO modes.
Configure the BCLK divider depending on the fifo_mode (FIFO is in use,
or FIFO bypass).

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


# a5b5a064 19-Jan-2010 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Correct the prefill number of samples

Set the prefill number of samples as the same as the lower
threshold in mode7.
In this way the codec will read the same amount of data on
startup and during the running playback.

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


# 735fe4cf 12-Jan-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add missing __devexit and __devinit annotations

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


# adcb8bc0 31-Dec-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Safety check for codec slave mode

The currently available FIFO modes (mode1 and mode7) require master
mode from the codec.
Do not allow the slave configuration when the FIFO is in use.

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


# 28e05d98 31-Dec-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Add new FIFO mode: mode 7

Mode 7 of tlv320dac33 operates in the following way:
The codec is in master mode.
Host configures upper and lower thresholds in tlv320dac33
During playback the codec will clock in the data until the
upper threshold is reached in FIFO. At this point the codec
stops the colocks on the serial bus.
When the FIFO fill is reaching the lower threshold limit the
codec will enable the clocks on the serial bus, and clocks
in data till the upper threshold is reached.

In this mode, we can also request interrupts for threshold
events (upper, lower and alarm), which could be used for
power management.

At this point the interrupts are not enabled for this mode,
but it can be taken into use in the future, when the surrounding
code makes it possible to use it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.oc.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# aec242dc 31-Dec-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Clean up the hardware configuration code

Use switch instead of if statements to configure FIFO bypass
and mode1.
With this change adding new FIFO mode is going to be easier,
and cleaner.

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


# d4f102d4 31-Dec-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Introduce prefill and playback state handlers

Ensure that the code is going to be readable, when new FIFO modes
are introduced later.
Move the prefill and playback state handling to inlined
functions.

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


# 7427b4b9 31-Dec-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Change nsample switch to FIFO mode enum

In order to have support for more FIFO modes supported by
tlv320dac33, the switch for enabling/disabling the FIFO
use has to be replaced with an enum.

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


# 3a7aaed7 04-Dec-2009 Ilkka Koskinen <ilkka.koskinen@nokia.com>

ASoC: tlv320dac33: Add support for regulator framework

Take the regulator framework in use for managing the power sources.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 74ea23aa 26-Nov-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: tlv320dac33: Change RT wq to singlethread wq

RT workqueue is going away in the near future, replace it with
singlethread wq for now, which is still supported.

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


# 0a3f5e35 12-Nov-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove redundant snd_soc_dapm_new_widgets() calls

The DAPM widgets are now insntantiated by the core when creating the card
so there is no need for the individual CODEC drivers to do so.

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>


# c8bf93f0 15-Oct-2009 Peter Ujfalusi <peter.ujfalusi@nokia.com>

ASoC: Codec driver for Texas Instruments tlv320dac33 codec

Driver for Texas Instruments TLV320DAC33 (SLAS546) low power stereo
audio DAC.

TLV320DAC33 is a stereo audio codec with integrated 24KB FIFO for low
power audio playback.

The digital interface can use I2S, DSP (A or B), Right and Left
justified formats.
DAC33 has stereo analog input, which can be bypassed to the analog
outputs.

Regarding to the internal 24KB FIFO the driver implements 'FIFO bypass'
mode (default) and nSample mode (FIFO is in use).
a) In 'FIFO bypass' mode the internal FIFO is not in use, the codec is
working synchronously as a normal codec (it needs constant stream of
data on the digital interface).

b) The nSample mode implementation uses one interrupt line from DAC33 to
the host:
Alarm threshold is set to 10ms of audio data (limit by the driver
implementation).
DAC33 will signal an interrupt, when the FIFO level goes under the
Alarm threshold.
The host will write to nSample register a value (number of stereo
samples), to tell DAC33 how many samples it should read in a burst from
the host. When the DAC33 received the number of samples, it disables the
clocks on the I2S bus. When the FIFO use again goes under the Alarm
threshold, DAC33 signals the host with an interrupt, and the process is
repeated.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>