openwrt/staging/blogic.git
10 years agoMerge remote-tracking branches 'asoc/topic/max98090' and 'asoc/topic/max98095' into...
Mark Brown [Tue, 3 Jun 2014 09:39:52 +0000 (10:39 +0100)]
Merge remote-tracking branches 'asoc/topic/max98090' and 'asoc/topic/max98095' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/gpio' and 'asoc/topic/intel' into asoc...
Mark Brown [Tue, 3 Jun 2014 09:39:50 +0000 (10:39 +0100)]
Merge remote-tracking branches 'asoc/topic/gpio' and 'asoc/topic/intel' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/fsl-ssi' into asoc-next
Mark Brown [Tue, 3 Jun 2014 09:39:49 +0000 (10:39 +0100)]
Merge remote-tracking branch 'asoc/topic/fsl-ssi' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/davinci' into asoc-next
Mark Brown [Tue, 3 Jun 2014 09:39:48 +0000 (10:39 +0100)]
Merge remote-tracking branch 'asoc/topic/davinci' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/cs42l56' into asoc-next
Mark Brown [Tue, 3 Jun 2014 09:39:47 +0000 (10:39 +0100)]
Merge remote-tracking branch 'asoc/topic/cs42l56' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/alc5623' into asoc-next
Mark Brown [Tue, 3 Jun 2014 09:39:46 +0000 (10:39 +0100)]
Merge remote-tracking branch 'asoc/topic/alc5623' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/adau' and 'asoc/topic/adsp' into asoc...
Mark Brown [Tue, 3 Jun 2014 09:39:44 +0000 (10:39 +0100)]
Merge remote-tracking branches 'asoc/topic/adau' and 'asoc/topic/adsp' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/core' into asoc-next
Mark Brown [Tue, 3 Jun 2014 09:39:43 +0000 (10:39 +0100)]
Merge remote-tracking branch 'asoc/topic/core' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/fix/pxa' and 'asoc/fix/tlv320aic3x' into asoc...
Mark Brown [Tue, 3 Jun 2014 09:39:38 +0000 (10:39 +0100)]
Merge remote-tracking branches 'asoc/fix/pxa' and 'asoc/fix/tlv320aic3x' into asoc-linus

10 years agoASoC: cache: Fix error code when not using ASoC level cache
Mark Brown [Mon, 2 Jun 2014 15:08:21 +0000 (16:08 +0100)]
ASoC: cache: Fix error code when not using ASoC level cache

It is not an error to have no cache so we shouldn't return an error code
and cause our callers to fail, just silently do nothing instead.  Thanks
to Jarkko for identify the problematic commit.

Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: intel: The Baytrail/MAX98090 driver depends on I2C
Mark Brown [Sun, 1 Jun 2014 19:12:05 +0000 (20:12 +0100)]
ASoC: intel: The Baytrail/MAX98090 driver depends on I2C

Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: cache: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
Xiubo Li [Mon, 19 May 2014 08:32:09 +0000 (16:32 +0800)]
ASoC: cache: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

Since we cannot make sure the 'reg_size' will always be none zero here,
and then if 'reg_size' equals to zero, the kzalloc() will return ZERO_SIZE_PTR,
which equals to ((void *)16).

So this patch fix this with just doing the 'reg_size' zero check before calling
kzalloc().

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Add helper functions to cast from DAPM context to CODEC/platform
Lars-Peter Clausen [Sun, 18 May 2014 12:24:12 +0000 (14:24 +0200)]
ASoC: Add helper functions to cast from DAPM context to CODEC/platform

This is useful if we have a pointer to a DAPM context and know that it is a
CODEC or platform DAPM context and want to get a pointer to the CODEC or
platform.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge branch 'topic/fsl' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Sun, 1 Jun 2014 13:02:07 +0000 (14:02 +0100)]
Merge branch 'topic/fsl' of git://git./linux/kernel/git/broonie/sound into asoc-fsl-ssi

Conflicts:
sound/soc/fsl/Kconfig

10 years agoASoC: fsl: Remove dependencies of boards for SND_SOC_EUKREA_TLV320
Alexander Shiyan [Fri, 23 May 2014 11:11:01 +0000 (15:11 +0400)]
ASoC: fsl: Remove dependencies of boards for SND_SOC_EUKREA_TLV320

Eukrea-i.MX51 board was converted to use DT, ie we no longer have a
MACH_EUKREA_MBIMXSD51_BASEBOARD symbol.
Transformation of other boards planned for the near future, so this
patch removes all these dependencies and restricts build of this
driver to ARCH_MXC.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Use regmap
Markus Pargmann [Tue, 27 May 2014 08:24:25 +0000 (10:24 +0200)]
ASoC: fsl-ssi: Use regmap

This patch replaces the ssi specific functions write_ssi, read_ssi and
write_ssi_mask by standard regmap function calls.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: reorder and document fsl_ssi_private
Markus Pargmann [Tue, 27 May 2014 08:24:24 +0000 (10:24 +0200)]
ASoC: fsl-ssi: reorder and document fsl_ssi_private

Reorder all variables in struct fsl_ssi_private to have groups that make
sense together. The patch also updates the struct documentation.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Fix baudclock handling
Markus Pargmann [Tue, 27 May 2014 08:24:23 +0000 (10:24 +0200)]
ASoC: fsl-ssi: Fix baudclock handling

The baudclock may be used and set by different streams.

Allow only the first stream to set the bitclock rate. Other streams have
to try to get to the correct rate without modifying the bitclock rate
using the SSI internal clock modifiers.

The variable baudclk_streams is introduced to keep track of the active
streams that are using the baudclock. This way we know if the baudclock
may be set and whether we may enable/disable the clock.

baudclock enable/disable is moved to hw_params()/hw_free(). This way we can
keep track of the baudclock in those two functions and avoid a running
clock while it is not used. As hw_params()/hw_free() may be called
multiple times for the same stream, we have to use baudclk_streams
variable to know whether we may enable/disable the clock.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Set framerate divider correctly for i2s master mode
Sascha Hauer [Tue, 27 May 2014 08:24:22 +0000 (10:24 +0200)]
ASoC: fsl-ssi: Set framerate divider correctly for i2s master mode

In i2s master mode the fsl_ssi driver depends on someone calling
.set_tdm_slot correctly. In this mode though only a DC value of
2 is allowed, so set it in this case and no longer depend on
.set_tdm_slot.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: remove unnecessary spinlock
Sascha Hauer [Tue, 27 May 2014 08:24:21 +0000 (10:24 +0200)]
ASoC: fsl-ssi: remove unnecessary spinlock

The baudclock_locked variable is only used in functions which
are serialized anyway from the core. No need to have a lock
around the variable, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: set bitclock in master mode from hw_params
Sascha Hauer [Tue, 27 May 2014 08:24:20 +0000 (10:24 +0200)]
ASoC: fsl-ssi: set bitclock in master mode from hw_params

The fsl_ssi driver uses the .set_sysclk callback to configure the
bitclock for master mode. This is unnecessary since the bitclock
is known in hw_params. This patch configures the bitclock from .hw_params.
.set_dai_sysclk now sets a bitclock frequency which is preferred over
the default calculated bitclock frequency.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: make fsl,mode property optional
Markus Pargmann [Tue, 27 May 2014 08:24:19 +0000 (10:24 +0200)]
ASoC: fsl-ssi: make fsl,mode property optional

The simple soundcard binding has its own way for specifying the dai
format. To be able to use this binding we have to make the fsl,mode
property optional. As the property is used in existing devicetrees
keep the option around for compatibility reasons.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: introduce SoC specific data
Sascha Hauer [Tue, 27 May 2014 08:24:18 +0000 (10:24 +0200)]
ASoC: fsl-ssi: introduce SoC specific data

Introduce a SoC data struct which contains the differences between
the different SoCs this driver supports. This makes it easy to support
more differences without having to introduce a new switch/case each
time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: byt-rt5640: Use card PM ops from core
Jarkko Nikula [Mon, 26 May 2014 13:56:33 +0000 (16:56 +0300)]
ASoC: Intel: byt-rt5640: Use card PM ops from core

Use card PM ops from ASoC core instead of defining custom PM ops here since
we are calling anyway common suspend/resume callbacks.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: Use devm_snd_soc_register_card
Jarkko Nikula [Wed, 28 May 2014 09:35:39 +0000 (12:35 +0300)]
ASoC: Intel: Use devm_snd_soc_register_card

Simplify byt-rt5640.c and haswell.c machine drivers by using
devm_snd_soc_register_card(). Remove also needless dev_set_drvdata()
from byt_rt5640_probe() since snd_soc_register_card() does it too.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: remove duplicate headers
Andy Shevchenko [Mon, 26 May 2014 13:56:31 +0000 (16:56 +0300)]
ASoC: Intel: remove duplicate headers

A few files contain duplicate headers. This patch removes the second entry of
duplicate in each file under question.

There is no functional changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: Clear stored Baytrail DSP DMA pointer before stream start
Jarkko Nikula [Mon, 26 May 2014 13:56:30 +0000 (16:56 +0300)]
ASoC: Intel: Clear stored Baytrail DSP DMA pointer before stream start

Stored DSP DMA pointer must be cleared before starting the stream since
PCM pointer callback sst_byt_pcm_pointer() can be called before pointer is
updated. In that case last position of previous stream was wronly returned.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls
Axel Lin [Fri, 23 May 2014 05:05:31 +0000 (13:05 +0800)]
ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls

The new value argument needs proper shift to match the mask bit fields.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: byt/hsw: Add missing kthread_stop to error/cleanup path
Imre Deak [Fri, 30 May 2014 07:52:29 +0000 (10:52 +0300)]
ASoC: Intel: byt/hsw: Add missing kthread_stop to error/cleanup path

Baytrail and Haswell SST IPC don't stop the kernel thread in error and
cleanup path thus leaving orphan kernel thread behind in such a case.

Also while at it, fix one error path in sst-haswell-ipc.c that doesn't free
hsw->msg.

[Jarkko: I edited the commit log a little]
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: Add Baytrail byt-max98090 machine driver
Jarkko Nikula [Fri, 30 May 2014 12:16:43 +0000 (15:16 +0300)]
ASoC: Intel: Add Baytrail byt-max98090 machine driver

Add machine driver and ACPI probing for Baytrail SST with MAX98090 codec.

Jack detect code from Kevin Strasser <kevin.strasser@intel.com>, GPIO
resolving from Mika Westerberg <mika.westerberg@linux.intel.com> and fixes
and cleanups from Liam Girdwood <liam.r.girdwood@linux.intel.com>.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: tlv320aci3x: Fix custom snd_soc_dapm_put_volsw_aic3x() function
Peter Ujfalusi [Fri, 30 May 2014 13:47:41 +0000 (16:47 +0300)]
ASoC: tlv320aci3x: Fix custom snd_soc_dapm_put_volsw_aic3x() function

For some unknown reason the parameters for snd_soc_test_bits() were in wrong
order:
It was:
snd_soc_test_bits(codec, val, mask, reg); /* WRONG!!! */
while it should be:
snd_soc_test_bits(codec, reg, mask, val);

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
10 years agoASoC: Blackfin: ADAU1X81 eval board support
Lars-Peter Clausen [Tue, 27 May 2014 08:53:21 +0000 (10:53 +0200)]
ASoC: Blackfin: ADAU1X81 eval board support

This patch adds a ASoC machine driver to support the EVAL-ADAU1X81 board
connected to a Analog Devices BF5XX evaluation board.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Blackfin: ADAU1X61 eval board support
Lars-Peter Clausen [Tue, 27 May 2014 08:53:20 +0000 (10:53 +0200)]
ASoC: Blackfin: ADAU1X61 eval board support

This patch adds a ASoC machine driver to support the EVAL-ADAU1X61 board
connected to a Analog Devices BF5XX evaluation board.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Add ADAU1381/ADAU1781 audio CODEC support
Lars-Peter Clausen [Tue, 27 May 2014 08:53:19 +0000 (10:53 +0200)]
ASoC: Add ADAU1381/ADAU1781 audio CODEC support

This patch adds support for the Analog Devices ADAU1381 and ADAU1781 audio
CODECs. The device is a low-power, 24-bit stereo audio CODEC with multiple
analog inputs and outputs, two digital microphone inputs and an I2S interface.
The device can be controlled either using I2C or SPI. The main difference
between the two variants is that the ADAU1781 has a freely programmable SigmaDSP
processor, while the ADAU1381 has a fixed function wind noise reduction filter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Add ADAU1361/ADAU1761 audio CODEC support
Lars-Peter Clausen [Tue, 27 May 2014 08:53:18 +0000 (10:53 +0200)]
ASoC: Add ADAU1361/ADAU1761 audio CODEC support

This patch adds support for the Analog Devices ADAU1361 and ADAU1761 CODECs.
The device is a a low-power, 24-bit stereo audio CODEC with multiple analog
input and outputs, one digital microphone input and an I2S interface. The device
can be controlled either via I2C or SPI. The main difference between the two
variants is that the ADAU1761 has a built-in SigmaDSP, while the ADAU1361 has
not.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Add ADAU1X61 and ADAU1X81 CODECs common code
Lars-Peter Clausen [Tue, 27 May 2014 08:53:17 +0000 (10:53 +0200)]
ASoC: Add ADAU1X61 and ADAU1X81 CODECs common code

The ADAU1X61 and ADAU1X81 are very similar in the digital domain, but are quite
different in the analog domain. This patch adds support for the common parts of
the ADAU1X61 and ADAU1X81 CODECs.

The patch also restores some of the alphabetical order in the Makfile and
Kconfig.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: wm_adsp: Use adsp_err/warn instead of dev_err/warn
Charles Keepax [Tue, 27 May 2014 12:08:43 +0000 (13:08 +0100)]
ASoC: wm_adsp: Use adsp_err/warn instead of dev_err/warn

We have defines for adsp messages best to consistently use them.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: jack: Fix multiple definition of `snd_soc_jack_add_gpiods'
Jarkko Nikula [Tue, 27 May 2014 07:39:57 +0000 (10:39 +0300)]
ASoC: jack: Fix multiple definition of `snd_soc_jack_add_gpiods'

Commit f025d3b9c64e ("ASoC: jack: Add support for GPIO descriptor defined
jack pins") caused build error when CONFIG_GPIOLIB is not set:

sound/include/sound/soc.h:470: multiple definition of `snd_soc_jack_add_gpiods'
sound/soc/soc-core.o:sound/include/sound/soc.h:470: first defined here
make[2]: *** [sound/soc/snd-soc-core.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

Fix this by marking snd_soc_jack_add_gpiods() as static inline in soc.h.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: jack: Clarify GPIO descriptor lookup in struct snd_soc_jack_gpio doc
Jarkko Nikula [Tue, 27 May 2014 10:54:18 +0000 (13:54 +0300)]
ASoC: jack: Clarify GPIO descriptor lookup in struct snd_soc_jack_gpio doc

Clarify struct snd_soc_jack_gpio documentation for the idx and name fields.
Because name is passed as connection ID to gpiod_get_index() when using GPIO
descriptor defined jack pins it is not only used as a label in debugfs but
also as function name lookup in systems that support functions names for
GPIOs.

Clarify also idx since the index is within the function of the GPIO consumer
device and not within the device itself only.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: davinci-evm: Replace instances of rtd->codec->card with rtd->card
Lars-Peter Clausen [Mon, 19 May 2014 09:41:47 +0000 (11:41 +0200)]
ASoC: davinci-evm: Replace instances of rtd->codec->card with rtd->card

No need to go via the CODEC to get a pointer to the card. This will help to
eventually remove the card field from the snd_soc_codec struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98095: Add master clock handling
Tushar Behera [Mon, 26 May 2014 08:28:22 +0000 (13:58 +0530)]
ASoC: max98095: Add master clock handling

If master clock is provided through device tree, then update
the master clock frequency during set_sysclk.

Documentation has been updated to reflect the change.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Add master clock handling
Tushar Behera [Mon, 26 May 2014 08:28:21 +0000 (13:58 +0530)]
ASoC: max98090: Add master clock handling

If master clock is provided through device tree, then update
the master clock frequency during set_sysclk.

Documentation has been updated to reflect the change.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: alc5623: Fix Kconfig dependency
Takashi Iwai [Mon, 26 May 2014 14:08:37 +0000 (16:08 +0200)]
ASoC: alc5623: Fix Kconfig dependency

Add "depends on I2C" to shut up the build errors from randconfig.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: jack: Add support for GPIO descriptor defined jack pins
Jarkko Nikula [Mon, 26 May 2014 11:34:37 +0000 (14:34 +0300)]
ASoC: jack: Add support for GPIO descriptor defined jack pins

Allow jack GPIO pins be defined also using GPIO descriptor-based interface
in addition to legacy GPIO numbers. This is done by adding two new fields to
struct snd_soc_jack_gpio: idx and gpiod_dev.

Legacy GPIO numbers are used only when GPIO consumer device gpiod_dev is
NULL and otherwise idx is the descriptor index within the GPIO consumer
device.

New function snd_soc_jack_add_gpiods() is added for typical cases where all
GPIO descriptor jack pins belong to same GPIO consumer device. For other
cases the caller must set the gpiod_dev in struct snd_soc_jack_gpio before
calling snd_soc_jack_add_gpios().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: jack: Basic GPIO descriptor conversion
Jarkko Nikula [Mon, 26 May 2014 11:34:36 +0000 (14:34 +0300)]
ASoC: jack: Basic GPIO descriptor conversion

This patch does basic GPIO descriptor conversion to soc-jack. Even the GPIOs
are still passed and requested using legacy GPIO numbers the driver
internals are converted to use GPIO descriptor API.

Motivation for this is to prepare soc-jack so that it will allow registering
jack GPIO pins using both GPIO descriptors and legacy GPIO numbers.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: pxa: pxa-ssp: Terminate of match table
Stephen Boyd [Sat, 24 May 2014 00:16:49 +0000 (17:16 -0700)]
ASoC: pxa: pxa-ssp: Terminate of match table

Failure to terminate this match table can lead to boot failures
depending on where the compiler places the match table.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: avoid format string leak to thread name
Kees Cook [Thu, 22 May 2014 18:43:55 +0000 (11:43 -0700)]
ASoC: Intel: avoid format string leak to thread name

This makes sure a format string can never get processed into the worker
thread name from the device name.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Add NI/MI values for user pclk 19.2 MHz
Chen Zhen [Thu, 22 May 2014 11:21:43 +0000 (13:21 +0200)]
ASoC: max98090: Add NI/MI values for user pclk 19.2 MHz

This patch adds the clock divisor and multiplier NI, MI values for audio
sampling frequencies 44100 and 48000 Hz and PCLK 19.2 MHz. This is useful
for the Odroid X2/U2 boards when the codec works in master mode and its
MCLK clock is fed from the I2S CDCLK output.

Signed-off-by: Chen Zhen <zhen1.chen@samsung.com>
[s.nawrocki@samsung.com: edited the commit description]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl_ssi: Add suspend/resume support
Fabio Estevam [Fri, 23 May 2014 05:38:56 +0000 (02:38 -0300)]
ASoC: fsl_ssi: Add suspend/resume support

Doing a suspend/resume sequence while playing an audio track in the backgroung
causes broken audio right after resume:

root@freescale /$ aplay clarinet.wav &

root@freescale /home$ Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian,
 Rate 44100 Hz, Mono

root@freescale /home$ echo mem > /sys/power/state
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.002 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
Suspending console(s) (use no_console_suspend to debug)
PM: suspend of devices complete after 37.082 msecs
PM: suspend devices took 0.040 seconds
PM: late suspend of devices complete after 4.234 msecs
PM: noirq suspend of devices complete after 4.618 msecs
Disabling non-boot CPUs ...
PM: noirq resume of devices complete after 4.013 msecs
PM: early resume of devices complete after 4.000 msecs
PM: resume of devices complete after 68.907 msecs
PM: resume devices took 0.070 seconds
Restarting tasks ... Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
....

Add SNDRV_PCM_TRIGGER_RESUME/SUSPEND cases so that we can gracefully handle
system suspend/resume.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoMerge remote-tracking branches 'asoc/topic/ux500', 'asoc/topic/wm8731', 'asoc/topic...
Mark Brown [Wed, 21 May 2014 23:24:04 +0000 (00:24 +0100)]
Merge remote-tracking branches 'asoc/topic/ux500', 'asoc/topic/wm8731', 'asoc/topic/wm8804', 'asoc/topic/wm8955' and 'asoc/topic/wm8985' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/rt5651', 'asoc/topic/samsung', 'asoc/topic...
Mark Brown [Wed, 21 May 2014 23:24:00 +0000 (00:24 +0100)]
Merge remote-tracking branches 'asoc/topic/rt5651', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/sirf', 'asoc/topic/sta350' and 'asoc/topic/tlv320dac33' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/nuc900', 'asoc/topic/omap', 'asoc/topic...
Mark Brown [Wed, 21 May 2014 23:23:57 +0000 (00:23 +0100)]
Merge remote-tracking branches 'asoc/topic/nuc900', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/rt5640' and 'asoc/topic/rt5645' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', 'asoc/topic...
Mark Brown [Wed, 21 May 2014 23:23:54 +0000 (00:23 +0100)]
Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/devm', 'asoc/topic/fsl', 'asoc/topic/fsl...
Mark Brown [Wed, 21 May 2014 23:23:51 +0000 (00:23 +0100)]
Merge remote-tracking branches 'asoc/topic/devm', 'asoc/topic/fsl', 'asoc/topic/fsl-esai', 'asoc/topic/fsl-sai', 'asoc/topic/fsl-spdif' and 'asoc/topic/fsl-ssi' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/cs42l56', 'asoc/topic/cs42xx8' and 'asoc...
Mark Brown [Wed, 21 May 2014 23:23:49 +0000 (00:23 +0100)]
Merge remote-tracking branches 'asoc/topic/cs42l56', 'asoc/topic/cs42xx8' and 'asoc/topic/davinci' into asoc-next

10 years agoMerge remote-tracking branches 'asoc/topic/ad1980', 'asoc/topic/adsp', 'asoc/topic...
Mark Brown [Wed, 21 May 2014 23:23:45 +0000 (00:23 +0100)]
Merge remote-tracking branches 'asoc/topic/ad1980', 'asoc/topic/adsp', 'asoc/topic/ak4104', 'asoc/topic/ak4642', 'asoc/topic/alc5623', 'asoc/topic/arizona', 'asoc/topic/atmel' and 'asoc/topic/cache' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/pcm512x' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:45 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/pcm' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:44 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/pcm' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/enum' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:44 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/enum' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/dt' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:43 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/dt' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/dapm-init' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:42 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/dapm-init' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/dapm' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:42 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/core' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:41 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/core' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/topic/component' into asoc-next
Mark Brown [Wed, 21 May 2014 23:23:41 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/topic/component' into asoc-next

10 years agoMerge remote-tracking branch 'asoc/fix/max98090' into asoc-linus
Mark Brown [Wed, 21 May 2014 23:23:37 +0000 (00:23 +0100)]
Merge remote-tracking branch 'asoc/fix/max98090' into asoc-linus

10 years agoMerge tag 'asoc-v3.15-rc5-intel' into asoc-linus
Mark Brown [Wed, 21 May 2014 23:23:36 +0000 (00:23 +0100)]
Merge tag 'asoc-v3.15-rc5-intel' into asoc-linus

ASoC: Intel fixes for v3.15

This is a relatively large batch of fixes for the newly added
Haswell/Baytrail drivers from Intel.  It's a bit larger than is good for
this point in the cycle but it's all for a newly added driver so not so
worrying as it might otherwise be.  Some of it's integration problems,
some of it's the sort of problem usually turned up in stress tests.

# gpg: Signature made Wed 14 May 2014 12:40:27 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"

10 years agoMerge tag 'asoc-v3.15-rc5-drivers' into asoc-linus
Mark Brown [Wed, 21 May 2014 23:23:31 +0000 (00:23 +0100)]
Merge tag 'asoc-v3.15-rc5-drivers' into asoc-linus

ASoC: Driver fixes for v3.15

A small set of driver fixes, nothing remarkable in itself or of any
relevance outside of the driver.

# gpg: Signature made Wed 14 May 2014 12:49:57 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"

10 years agoMerge tag 'asoc-v3.15-rc5-core' into asoc-linus
Mark Brown [Wed, 21 May 2014 23:23:30 +0000 (00:23 +0100)]
Merge tag 'asoc-v3.15-rc5-core' into asoc-linus

ASoC: Core fixes for v3.15

A few things here:

 - Fix the creation of spurious CODEC<->CODEC links which caused DAPM to
   have audio paths which shouldn't be present causing spurious powerups
   and potential audible issues for users.
 - Ensure the suspend->off transition doesn't have spurious transitions
   to prepare added to the sequence.
 - Fix incorrect skipping of PCM suspension for active audio streams.
 - Remove Timur Tabi from the CS4270 maintainers, Cirrus are now doing
   this and Timur no longer has the boards that he was using.

# gpg: Signature made Wed 14 May 2014 12:59:19 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"

10 years agoASoC: samsung: Add devm_clk_get to pcm.c
Tushar Behera [Wed, 21 May 2014 03:22:20 +0000 (08:52 +0530)]
ASoC: samsung: Add devm_clk_get to pcm.c

clk_get in probe function can be safely replaced with devm_clk_get.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: samsung: Use devm_snd_soc_register_component
Tushar Behera [Wed, 21 May 2014 03:22:19 +0000 (08:52 +0530)]
ASoC: samsung: Use devm_snd_soc_register_component

Replaced snd_soc_register_component with its devres equivalent,
devm_snd_soc_register_component.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: samsung: Use devm_snd_soc_register_platform
Tushar Behera [Wed, 21 May 2014 03:22:18 +0000 (08:52 +0530)]
ASoC: samsung: Use devm_snd_soc_register_platform

Replaced snd_soc_register_platform with devm_snd_soc_register_platform
in samsung_asoc_dma_platform_register(). This makes the function
samsung_asoc_dma_platform_unregister() redundant. This is removed and
all its users are updated.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: samsung: Use devm_snd_soc_register_card
Tushar Behera [Wed, 21 May 2014 03:22:17 +0000 (08:52 +0530)]
ASoC: samsung: Use devm_snd_soc_register_card

Replace snd_soc_register_card with devm_snd_soc_register_card.
With this change, we can delete the empty remove functions.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: neo1973_wm8753: Automatically disconnected non-connected pins
Lars-Peter Clausen [Tue, 20 May 2014 09:13:28 +0000 (11:13 +0200)]
ASoC: neo1973_wm8753: Automatically disconnected non-connected pins

The DAPM routes for this board are complete, hence we can let the core take care
of disconnecting non-connected pins rather than doing it manually.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: samsung: Allow setting OP_CLK of the IIS Multi Audio Interface
Sylwester Nawrocki [Mon, 19 May 2014 17:30:38 +0000 (19:30 +0200)]
ASoC: samsung: Allow setting OP_CLK of the IIS Multi Audio Interface

This patch adds support for setting source clock of the "Core CLK"
of the IIS Multi Audio Interface.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: pxa: remove mach header dependency
Arnd Bergmann [Sun, 4 May 2014 03:25:21 +0000 (11:25 +0800)]
ASoC: pxa: remove mach header dependency

As we are moving the mmp platform towards multiplatform support,
we have to stop including platform header files.

This changes the pxa-ssp sound driver file to no longer depend
on mach/hardware.h and mach/dma.h. The code using the definitions
from those headers is actually gone already, the only thing
that was still being used was the pxa_dma_desc typedef, which
we can easily work around by using the normal 'struct pxa_dma_desc'
name.

The pxa2xx-dma driver still uses this header, so we include it
explicitly there, which is ok because that is only used on pxa,
not on mmp.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: alc5623: Add device tree binding
Andrew Lunn [Sat, 3 May 2014 18:30:11 +0000 (20:30 +0200)]
ASoC: alc5623: Add device tree binding

Let the ALC5623 codec be instantiated from DT. Add a simple binding
for the additional control register and the jack detect register.

Also, add a prompt to the Kconfig entry for this CODEC, so that it can
be selected. Since kirkwood-t5325.c will no longer be used, we need to
be able to enable the CODEC in the mvebu_v5_defconfig etc.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Move fsl_ssi_set_dai_sysclk above fsl_ssi_hw_params
Sascha Hauer [Mon, 28 Apr 2014 10:54:52 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Move fsl_ssi_set_dai_sysclk above fsl_ssi_hw_params

fsl_ssi_set_dai_sysclk will be called from fsl_ssi_hw_params in the
next patch. Move up to avoid forward declaration and to keep the next patch
more readable. No functional change.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Transmit enable synchronization
Markus Pargmann [Mon, 28 Apr 2014 10:54:51 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Transmit enable synchronization

When the fsl-ssi unit is used in i2s slave mode, it is possible that the
SSI unit starts transmitting data on the wrong channel. This happens
because the SSI does not synchronize with the left-right-clock by
default.

This patch enables transmit enable synchronization.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Remove unnecessary variables from ssi_private
Markus Pargmann [Mon, 28 Apr 2014 10:54:48 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Remove unnecessary variables from ssi_private

There are some variables defined in struct fsl_ssi_private that describe
states that are also described by other variables.

This patch adds some helper functions that return exactly the same
information based on available variables. This helps to clean up struct
fsl_ssi_private and remove them from the probe function.

It also removes some not really used variables (new_binding, name).

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Cleanup probe function
Markus Pargmann [Mon, 28 Apr 2014 10:54:47 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Cleanup probe function

Reorder the probe function to be able to move the second imx-specific
block to the seperate imx probe function. The patch also removes some
comments/variables/code that are not used anymore or could be simply
replaced by other variables.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Remove useless DMA code
Markus Pargmann [Mon, 28 Apr 2014 10:54:46 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Remove useless DMA code

Simplify dma DT property handling. fsl,ssi-dma-events is not used
anymore. It passes invalid data to imx_pcm_dma_params_init_data() which
copies some data into an imx dma struct. This struct is never used in
imx-dma or imx-sdma because of generic OF DMA handling. The
"fsl,ssi-dma-events" is not used anywhere in dts files.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Move imx-specific probe to seperate function
Markus Pargmann [Mon, 28 Apr 2014 10:54:45 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Move imx-specific probe to seperate function

Move imx specific probe code to a seperate function. It reduces the
size of the probe() function and makes the code and error handling
easier to understand.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Use dev_name for DAI driver struct
Markus Pargmann [Mon, 28 Apr 2014 10:54:44 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Use dev_name for DAI driver struct

Instead of creating a name using string manipulation functions, we can
simply use the device name for the DAI driver struct.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Move debugging to seperate file
Markus Pargmann [Mon, 28 Apr 2014 10:54:43 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Move debugging to seperate file

Move all code that is only used for debugging to a seperate file. This
makes it easier to see what functions are used for debugging only.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: fsl-ssi: Fix register values when disabling
Markus Pargmann [Mon, 28 Apr 2014 10:54:42 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Fix register values when disabling

The bits we have to clear when disabling are different when the other
stream is still active.

This patch fixes the calculation of new register values after disabling
one stream. It also adds a more detailed description of the new register
value calculation.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: mop500_ab8500: Replace instances of rtd->codec->card with rtd->card
Lars-Peter Clausen [Mon, 19 May 2014 09:41:48 +0000 (11:41 +0200)]
ASoC: mop500_ab8500: Replace instances of rtd->codec->card with rtd->card

No need to go via the CODEC to get a pointer to the card. This will help to
eventually remove the card field from the snd_soc_codec struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: omap: Replace instances of rtd->codec->card with rtd->card
Lars-Peter Clausen [Mon, 19 May 2014 09:41:46 +0000 (11:41 +0200)]
ASoC: omap: Replace instances of rtd->codec->card with rtd->card

No need to go via the CODEC to get a pointer to the card. This will help to
eventually remove the card field from the snd_soc_codec struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: ad1980: Replace goto loop with do-while loop
Lars-Peter Clausen [Tue, 20 May 2014 12:23:10 +0000 (14:23 +0200)]
ASoC: ad1980: Replace goto loop with do-while loop

Using a proper do-while loop here instead of a open-coded goto loop is both
cleaner and shorter.

Also fixes the following warnings from smatch:
sound/soc/codecs/ad1980.c:213 ad1980_reset() info: loop could be replaced with if statement.
sound/soc/codecs/ad1980.c:212 ad1980_reset() info: ignoring unreachable code.
sound/soc/codecs/ad1980.c:215 ad1980_reset() info: ignoring unreachable code.

While we are at it also change retry_cnt to unsigned int, using u16 for a
on-stack loop counter doesn't make that much sense.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Intel: Fix pcm stream context restore crash
Kevin Strasser [Mon, 19 May 2014 08:14:23 +0000 (11:14 +0300)]
ASoC: Intel: Fix pcm stream context restore crash

In some cases the pcm stream is closed while context has been
scheduled to be restored, causing a null pointer deref panic.
Cancel work to ensure stream does not get freed while work is
still active/pending.

Also, restoring the pcm context can be safely skipped after the
stream has been stopped. Check if pcm stream is still running
before restoring stream context to help pending work finish
more quickly in stream close path.

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rt5645: Fix updating wrong register for T5645_AIF2 case
Axel Lin [Sat, 17 May 2014 11:17:32 +0000 (19:17 +0800)]
ASoC: rt5645: Fix updating wrong register for T5645_AIF2 case

This looks like a copy-paste bug, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Remove needless snd_soc_dapm_enable_pin() from machine driver inits
Jarkko Nikula [Mon, 19 May 2014 13:17:27 +0000 (16:17 +0300)]
ASoC: Remove needless snd_soc_dapm_enable_pin() from machine driver inits

ALSA SoC core marks widgets as connected by default when they are
initialized in snd_soc_dapm_new_control() so there is no need to call
snd_soc_dapm_enable_pin() from machine driver init functions.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: Remove needless snd_soc_dapm_sync() from machine driver inits
Jarkko Nikula [Mon, 19 May 2014 13:17:26 +0000 (16:17 +0300)]
ASoC: Remove needless snd_soc_dapm_sync() from machine driver inits

ALSA SoC core takes care of calling snd_soc_dapm_sync() at the end
snd_soc_instantiate_card() so there is no need to call it from machine
driver init functions.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: rt5651: Do not use rtd->codec
Lars-Peter Clausen [Mon, 19 May 2014 06:03:04 +0000 (08:03 +0200)]
ASoC: rt5651: Do not use rtd->codec

rtd->codec does not necessarily point to the CODEC instance for which the
callback was called (e.g. for CODEC<->CODEC or multi-CODEC links). Use
dai->codec instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: cs42xx8: Do not use rtd->codec
Lars-Peter Clausen [Mon, 19 May 2014 06:03:03 +0000 (08:03 +0200)]
ASoC: cs42xx8: Do not use rtd->codec

rtd->codec does not necessarily point to the CODEC instance for which the
callback was called (e.g. for CODEC<->CODEC or multi-CODEC links). Use
dai->codec instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Move microphone bias voltage setting to probe function
Jarkko Nikula [Fri, 16 May 2014 13:55:24 +0000 (16:55 +0300)]
ASoC: max98090: Move microphone bias voltage setting to probe function

Microphone bias level configuration register can configure voltage between
2.2 V and 2.8 V but doesn't manage is voltage on or off. Microphone bias
on/off state is controlled by "MICBIAS" DAPM widget.

Therefore there is no need to update bias voltage conditionally depending on
jack state each time when codec goes to SND_SOC_BIAS_ON state and setting
can be moved to max98090_probe() as driver currently doesn't support other
levels than 2.8 V.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Make sure we configure BCLK in one place
Liam Girdwood [Fri, 16 May 2014 13:55:23 +0000 (16:55 +0300)]
ASoC: max98090: Make sure we configure BCLK in one place

BCL is being configured in two places producing a warning message.
Make sure we only configure BCLK once and when we are master.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Add ACPI probing support
Jarkko Nikula [Fri, 16 May 2014 13:55:25 +0000 (16:55 +0300)]
ASoC: max98090: Add ACPI probing support

Add ACPI ID for MAX98090 and ACPI 5 I2C device probing support.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Mark cache as dirty prior to restoring
Liam Girdwood [Fri, 16 May 2014 13:55:22 +0000 (16:55 +0300)]
ASoC: max98090: Mark cache as dirty prior to restoring

Make sure the cache is fully flushed at resume time.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Reset codec on resume
Liam Girdwood [Fri, 16 May 2014 13:55:21 +0000 (16:55 +0300)]
ASoC: max98090: Reset codec on resume

Make sure we reset codec and clear any IRQs on resume. This matches
the init sequence in probe.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoASoC: max98090: Fix reset at resume time
Liam Girdwood [Fri, 16 May 2014 13:55:20 +0000 (16:55 +0300)]
ASoC: max98090: Fix reset at resume time

Reset needs to wait 20ms before other codec IO is performed. This wait
was not being performed. Fix this by making sure the reset register is not
restored with the cache, but use the manual reset method in resume with
the wait.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org