Commit Graph

13370 Commits

Author SHA1 Message Date
Axel Lin 410fe39c6d ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional
devm_gpiod_get_optional() returns NULL when the gpio is not assigned.
So the if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) test is always false.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-01 11:53:56 +02:00
kbuild test robot dcf7d1992b ASoC: sunxi: fix semicolon.cocci warnings
sound/soc/sunxi/sun4i-i2s.c:624:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-01 11:38:29 +02:00
Maxime Ripard fa7c0d13cb ASoC: sunxi: Add Allwinner A10 Digital Audio driver
The Allwinner A10 and later come with a hardware block that used for the
PCM and I2S interfaces.

Add a driver for it in ASoC.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Tested-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 22:42:53 +01:00
Sylwester Nawrocki 4c5d146929 ASoC: max98504: Add max98504 speaker amplifier driver
This patch adds driver for the MAX98504 speaker amplifier.  The MAX98504
is a high efficiency mono class D amplifier that features an integrated
boost converter with voltage and current sensing ADCs for Dynamic Speaker
Management.
This driver does not include support for the I2S DAI, as we wouldn't be
able  to test such code in a hardware configuration where the amplifier
has only wired the analogue input.

Signed-off-by: Inha Song <ideal.song@samsung.com>
[k.kozlowski: rebased on 4.1]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[s.nawrocki: removed unused macro definitions, rewrote regulator supply
 related parts, rewrote regmap configuration code, added support for speaker
 enable and global chip enable through DAPM, rewritten as component driver,
 added PDM DAI definition and TDM callbacks for PDM channels configuration]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
--
Changes since v2:
 - added parsing of the VBAT brownout DT properties,
 - removed MAX98504_REG_SPEAKER_SOURCE_SELECT register initialization,
 - removed unused macro definitions.

Changes since v1:
 - none.

Changes since initial version:
 - added regulator supply handling,
 - added DAPM widges for speaker source selection,
 - added PDM DAI definition and TDM callbacks for setting up active
   PDM Tx channels and I/V sense ADC data mapping,
 - removed all optional DT properties, added regulator supply properties
   in the DT binding.
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 20:21:50 +01:00
Garlic Tseng d6f3710a56 ASoC: mediatek: add structure define and clock control for 2701
add structure define and clock control function for 2701.

Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 20:11:09 +01:00
Garlic Tseng 6b1e19d91d ASoC: mediatek: let mt8173 use mediatek common structure
Modify mt8173 driver implementation to use common structure.

Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 20:11:09 +01:00
Garlic Tseng 283b612429 ASoC: mediatek: implement mediatek common structure
implement mediatek basic structure, include common private data,
afe fe dai operator and afe platform driver.

Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 20:11:09 +01:00
Garlic Tseng 0d1d7a6642 ASoC: mediatek: Refine mt8173 driver and change config option
move mt8173 driver to another folder and add prefix.
add config option SND_SOC_MT8173

Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 20:11:09 +01:00
Alexander Shiyan 4f14f5c11d ASoC: fsl_ssi: Fix number of words per frame for I2S-slave mode
The i.MX51 datasheet says:
Chapter 56.1.2.4 I2S Mode
...
When I2S modes are entered (I2S master (01) or I2S slave (10)),
the following settings are recommended:
...
- TX Frame Rate should be 2 i.e. (STCCR[12:8] = 1)
- RX Frame Rate should be 2 i.e. (SRCCR[12:8] = 1)

Chapter 56.3.3.12 SSI Transmit and Receive Clock Control Registers (STCCR & SRCCR)
...
Bits 12-8 DC4-DC0
Frame Rate Divider Control. These bits are used to control the divide ratio
for the programmable frame rate dividers. The divide ratio works on the word
clock. In Normal mode, this ratio determines the word transfer rate.
In Network mode, this ratio sets the number of words per frame. The divide
ratio ranges from 1 to 32 in Normal mode and from 2 to 32 in Network mode.
In Normal mode, a divide ratio of 1 (DC=00000) provides continuous periodic
data word transfer. A bit-length frame sync must be used in this case.

Function fsl_ssi_hw_params() setup Normal mode for MONO output,
so with DC=0, SSI enters to continuous periodic data word transfer.
To fix this, setup DC for any I2S mode.
Patch has tested on custom board based on Digi CCMX-51 module (i.MX51).

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 19:20:11 +01:00
Kuninori Morimoto abd3147e69 ASoC: add new simple-card-utils.c
Current ALSA SoC has simple-card driver which is supporting both
platform and DT probe.
Now, some sound cards driver are created based on simple-card.
They have similar feature or function, but implemented separately
on each drivers. This is a waste of code.
OTOH, merging these driver into same driver is highly risk,
because it will be very difficult to keep compatibility.
More over, ALSA SoC want to have graph base of DT feature in the
future. Maybe it want to use simple-card like feature / function.
Because of these background, this patch creates simple-card
helper utils, and provides common function to each drivers.
1st is asoc_simple_card_parse_daifmt()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 19:12:30 +01:00
Kuninori Morimoto 9eac361877 ASoC: simple-card: add new asoc_simple_jack and use it
Current simple-card supports snd_soc_jack/pin/gpio.
These code are very similar, but driver has verbosity code.
So, this patch adds new snd_soc_jack and cleanups code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 19:12:30 +01:00
Arnd Bergmann 20f12f2c48 ASoC: cs35l33: mark PM functions as __maybe_unused
The newly added cs35l33 driver produces a harmless warning when
CONFIG_PM is disabled:

sound/soc/codecs/cs35l33.c:908:12: error: 'cs35l33_runtime_suspend' defined but not used [-Werror=unused-function]
sound/soc/codecs/cs35l33.c:868:12: error: 'cs35l33_runtime_resume' defined but not used [-Werror=unused-function]

This adds __maybe_unused annotations to shut up the warning
regardless of the configuration.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-29 17:23:12 +01:00
Axel Lin 262329fcca ASoC: cs35l33: Remove setting dapm->bias_level in cs35l33_set_bias_level
This is done by ASoC core now.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-28 20:56:03 +01:00
Axel Lin beefe4a9f4 ASoC: cs35l33: Remove unnecessary free_irq call
Current code uses devm_request_threaded_irq() so it does not need to
explicitly call free_irq() in .probe error path and .remove.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-28 20:55:59 +01:00
Colin Ian King d93c5066e8 ASoC: fsl_spdif: fix spelling mistake: "receivce" -> "receive"
trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-28 15:57:48 +01:00
Kuninori Morimoto efc9194bcf ASoC: hdmi-codec: callback function will be called with private data
Current hdmi-codec driver is assuming that it will be registered
from HDMI driver. Because of this assumption, each callback function
has struct device pointer which is parent device (= HDMI).
Then, it can use dev_get_drvdata() to get private data.

OTOH, on some SoC/HDMI case, SoC has VIDEO/SOUND and HDMI IPs.
This case, it needs SoC VIDEO, SoC SOUND and HDMI video, HDMI codec
driver. In DesignWare HDMI IP case, SoC VIDEO (= DRM/KMS) driver tries
to bind DesignWare HDMI video driver, and HDMI codec driver
(= hdmi-codec). This case, above "parent device" of HDMI codec driver
is DRM/KMS driver and its "device" already has private data.

And, from DT and ASoC CPU/Codec/Card binding point of view, HDMI codec
(= hdmi-codec) needs to have "parent device" (= DRM/KMS), otherwise,
it never detect sound card.

Because of these reasons, some driver can't use dev_get_drvdata() to
get private data on hdmi-codec driver. This patch add new void pointer
on hdmi_codec_pdata for private data, and callback function will be
called with it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 18:53:15 +01:00
kbuild test robot bac829430a ASoC: cs35l33: fix platform_no_drv_owner.cocci warnings
sound/soc/codecs/cs35l33.c:1301:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 17:53:51 +01:00
Paul Handrigan 3333cb7187 ASoC: cs35l33: Initial commit of the cs35l33 CODEC driver.
Initial commit of the Cirrus Logic cs35l33 8V boosted class D
amplifier.

Signed-off-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 17:39:06 +01:00
Vedang Patel 91c1832579 ASoC: Intel: Skylake: Increase loglevel of debug messages.
There is log spam while doing playback, record or reloading the
audio firmware.

print_hex_dump uses printk(KERN_DEBUG,... which is different from
dev_dbg used elsewhere in the driver: it's always enabled at
compile-time. Change it to print_hex_dump_debug for logging consistency.

For consistency with other log statements, change dev_info to dev_dbg
for a kernel print which is frequently printed by the driver.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 15:51:29 +01:00
Vedang Patel ef06b6f391 ASoC: Intel: common: increase the loglevel of "FW Poll Status".
For consistency with other log statements, change dev_info to dev_dbg
for a kernel print which is frequently printed by the driver.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 15:51:29 +01:00
Vedang Patel 3cb7cec144 ASoC: hdac_hdmi: Increase loglevel of hex dump printed
The hdac_hdmi codec driver prints the ELD information everytime an
external monitor is connected. Make it so that the information is only
printed when someone trying to debug the driver explicitly enables it.

print_hex_dump_bytes (which just calls print_hex_dump) uses
printk(KERN_DEBUG,... which is different from dev_dbg used elsewhere in
the driver: it's always enabled at compile-time. Change it to
print_hex_dump_debug for logging consistency.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 15:51:29 +01:00
Adam Thomson a01b89336f ASoC: da7219: Convert driver to use generic device/fwnode functions
This change converts the driver from using the of_* functions to using
the device_* and fwnode_* functions for accssing FW related data.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 12:39:42 +01:00
Colin Ian King 48b418d7fd ASoC: samsung: fix spelling mistake: "unknwon" -> "unknown"
trivial fix to spelling mistake in pr_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 12:29:26 +01:00
Alan Cox 18f5839932 ASoC: Intel: atom: fix missing breaks that would cause the wrong operation to execute
Now we correctly error an attempt to execute an unsupported operation.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 12:28:37 +01:00
Helen Koike 39088c251c ASoC: tpa6130a2: Remove goto err_gpio
Replace goto err_gpio by return ret

Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
Tested-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 12:28:13 +01:00
Helen Koike 6d2de5ab43 ASoC: tpa6130a2: Add DAPM support
Add DAPM support and updated rx51 accordingly.
As a consequence:
- the exported function tpa6130a2_stereo_enable is not needed anymore
- the mutex is dealt in the DAPM
- the power state is tracked by the DAPM

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
[koike: port for upstream]
Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
Tested-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 12:28:13 +01:00
Colin Ian King 57072ae122 SoC: dwc: trivial fix of spelling mistake "unsuppted" -> "unsupported"
trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 02:18:52 +01:00
Alexander Shiyan eb87f9e2b3 ASoC: wm8753: Replace magic number
Use SND_SOC_NOPM constant, instead of -1.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-26 02:18:02 +01:00
Alan Cox 9c4639ec95 ASoC: Intel: atom: fix missing breaks that would cause the wrong operation to execute
Now we correctly error an attempt to execute an unsupported operation.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-24 12:33:17 +01:00
Amitoj Kaur Chawla 34c5cdbcbd ASoC: wm8753: Remove unneeded header file
Drop redundant include of moduleparam.h

The Coccinelle semantic patch used to make this change is as follows:
@ includesmodule @
@@

@ depends on includesmodule @
@@

- #include <linux/moduleparam.h>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-24 12:14:05 +01:00
Helen Koike e01d700c39 ASoC: tpa6130a2: Use snd soc volsw functions
Use snd_soc_{info,get,put}_volsw instead of custom volume functions

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
[koike: port for upstream]
Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
[On N900]
Tested-By: Sebastian Reichel <sre@kernel.org>
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-23 15:36:05 +01:00
Helen Koike a0d5ff4496 ASoC: tap6130a2: Use regmap
Use regmap instead of open-coding IO access and caching

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
[koike: port for upstream]
Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
[On N900]
Tested-By: Sebastian Reichel <sre@kernel.org>
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-23 15:35:51 +01:00
Helen Koike cb7e62256e ASoC: tpa6130a2: Register component
Add tpa6130a2 controls by the component API and update rx51 accordingly

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
[koike: port for upstream]
Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
Tested-By: Sebastian Reichel <sre@kernel.org>
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-23 15:35:39 +01:00
Nicolin Chen 05f33bc5d6 ASoC: cs53l30: Add MUTE pin control support via GPIO
The codec chip has a physical MUTE pin to let users control it via
GPIO. So this patch add a mute control support to the driver.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-23 11:35:52 +01:00
Charles Keepax 7c9190f7e7 ASoC: compress: Pass error out of soc_compr_pointer
Both soc_compr_pointer and the platform driver pointer callback return
ints but current soc_compr_pointer always returns 0. Update this so we
return the actual value from the platform driver callback. This doesn't
fix any issues simply makes the code more consistent.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:16:02 +01:00
Jayachandran B e68aca08d7 ASoC: Intel: Skylake: Support multi-core in Broxton
Add multicore DSP support in Broxton DSP operations.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:13:12 +01:00
Jayachandran B 40a166039a ASoC: Intel: Skylake: Support multi-core in Skylake
Add multicore DSP support in Skylake DSP operations.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:13:12 +01:00
Jayachandran B 052f103c89 ASoC: Intel: Skylake: Add DSP muti-core infrastructure
The DSP can have more than one cores. In that case the secondary
core has to be managed by the driver. This patch adds the changes
to driver infrastructure to support multiple core.

A new object skl_dsp_cores is introduced to support multiple
core. Helpers skl_dsp_get_core() skl_dsp_put_core() help to
managed the cores.

Many of the power_up/down and DSP APIs take additional argument
of core_id. The primary core, 0 is always powered up first and
then on demand second core.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:13:12 +01:00
Helen Koike 49220e9b45 ASoC: max9877: Remove unused function declaration
Remove unused function declaration from header

Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:12:26 +01:00
Oder Chiou b63d4d13ac ASoC: rt5514: Fix the issue that the variable dereferenced before checking
The patch fixes the issue that variable dereferenced before checking
'rt5514_dsp->substream'. Move the assignment to after the variable
checking of 'rt5514_dsp->substream'.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:02:04 +01:00
Vinod Koul 957427d94a ASoC: Intel: Skylake: Update comment style
Noticed a style inconsistency in a comment, so update that

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:01:05 +01:00
Vinod Koul f749a78a54 ASoC: Intel: Skylake: Add pm ops for broxton-rt298 machine
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:01:05 +01:00
Vinod Koul 2e9dc2b645 ASoC: Intel: Skylake: Disable async suspend
We do not support async suspend due to dependency with rest of
card and require suspend/resume be executed synchronously, mark
the device accordingly.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:01:05 +01:00
Vinod Koul 45a9e07531 ASoC: Intel: Revert "ASoC: Intel: Add support for PM ops in bxt-rt298"
This reverts commit 3513798ca4 ("ASoC: Intel: Add support for
PM ops in bxt-rt298") as the right way to fix this is to disable
async suspend

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 16:01:05 +01:00
Oder Chiou c9506bb84b ASoC: rt5514: Add the MCLK handling
The patch adds the control of MCLK that depends on the status of DAPM.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 15:55:05 +01:00
Enric Balletbo i Serra 0ac4aeb518 ASoC: max9867: Fix unix permissions for source files.
Change file permissions of source files max9867.c/h from 0755 to 0644.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 15:52:03 +01:00
Vinod Koul c3f2fe621a ASoC: Intel: Kconfig: formatting update
Kconfig help texts were missing periods as suggested by Randy.

Also fix the alignment on a block of help text to be consistent
with rest.

Suggested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 15:47:22 +01:00
Vinod Koul 3493d4a864 ASoC: Intel: Kconfig: fix build when ACPI is not enabled
Randy reported following error when ACPI is not enabled:

warning: (SND_SOC_INTEL_BYTCR_RT5640_MACH && SND_SOC_INTEL_BYTCR_RT5651_MACH
&& SND_SOC_INTEL_CHT_BSW_RT5672_MACH && SND_SOC_INTEL_CHT_BSW_RT5645_MACH &&
SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH) selects SND_SST_IPC_ACPI
+which has unmet direct dependencies (SOUND && !M68K && !UML && SND &&
SND_SOC && ACPI)

causing these build errors:

In file included from ../sound/soc/intel/atom/sst/sst_acpi.c:40:0:
../include/acpi/acpi_bus.h:65:20: error: conflicting types for
'acpi_evaluate_dsm'
 union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid,
In file included from ../sound/soc/intel/atom/sst/sst_acpi.c:31:0:
../include/linux/acpi.h:676:34: note: previous definition of
'acpi_evaluate_dsm' was here
 static inline union acpi_object *acpi_evaluate_dsm(acpi_handle handle,

CONFIG_SND_SST_IPC_ACPI was already dependent upon ACPI, but that was not
solving it. So move the depends up to machine drivers and remove from
CONFIG_SND_SST_IPC_ACPI.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 15:47:22 +01:00
Simon Trimmer 6facd2d10f ASoC: wm_adsp: Disable DMAs before clearing the transfer length
This patch reorders the clearing of the DMA masks to avoid potential
artefacts being introduced.

Signed-off-by: Simon Trimmer <simont@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-22 15:45:06 +01:00
Bard Liao 874352a763 ASoC: rt5670: patch reg-0x8a
reg-8a assign the tracking source for each ASRC tracker. The default
value is 0x0000 which means all ASRC trackers will track LRCK1. But
in most case, we wish each ASRC tracker track the corresponding LRCK.
i.e. ASRC1 tracks LRCK1, ASRC2 tracks LRCK2 and so on. So, we rewrite
reg-8a as 0x0123.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-21 19:43:45 +01:00
Arnd Bergmann 3276d0aa0b ASoC: dwc: make pcm support built-in when necessary
The new PIO mode for the dwc audio driver causes a link failure
when it is built as a loadable module but the audio driver is built-in:

sound/built-in.o: In function `i2s_irq_handler':
:(.text+0x58c64): undefined reference to `dw_pcm_push_tx'
sound/built-in.o: In function `dw_i2s_probe':
:(.text+0x593dc): undefined reference to `dw_pcm_register'

We could link both into a single module, but apparently the
author intended them to be separate, so this instead changes
the Makefile to force the pcm module to be built-in if the
base module is. This is a bit hacky but not as bad as trying
to work around it in Kconfig language.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 79361b2b98 ("ASoC: dwc: Add PIO PCM extension")
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-21 19:07:21 +01:00
Nicolin Chen b0e71c0ddd ASoC: cs53l30: Set idle_bias_off true
The driver is using the set_bias_level to control the power on and
off so it should get SND_SOC_BIAS_OFF in order to proceed normal
powering sequences. This patch enables the idle_bias_off option so
the DAPM core will set the bias level to SND_SOC_BIAS_OFF instead
of stopping at SND_SOC_BIAS_STANDBY.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-18 14:10:33 +01:00
Wei Yongjun ee85be8c9b ASoC: cs53l30: Fix non static symbol warnings
Fixes the following sparse warnings:

sound/soc/codecs/cs53l30.c:182:20: warning:
 symbol 'input1_sel_values' was not declared. Should it be static?
sound/soc/codecs/cs53l30.c:202:20: warning:
 symbol 'input2_sel_values' was not declared. Should it be static?
sound/soc/codecs/cs53l30.c:734:20: warning:
 symbol 'cs53l30_src_rates' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-18 14:09:18 +01:00
Wei Yongjun 716540fdd3 ASoC: max9860: fix non static symbol warnings
Fixes the following sparse warnings:

sound/soc/codecs/max9860.c:120:28: warning:
 symbol 'max9860_regmap' was not declared. Should it be static?
sound/soc/codecs/max9860.c:596:25: warning:
 symbol 'max9860_pm_ops' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-18 14:09:00 +01:00
Janusz Krzysztofik 86c0ae7cde ASoC: cx20442: set tty->receiver_room in v253_open
Commit 79901317ce ("n_tty: Don't flush buffer when closing ldisc"),
introduced in v3.10, revealed a bug in the cx20442 codec driver
which has never been setting tty->receive_room on line discipline
open as it should from the beginning. Fix it.

Created and tested on Amstrad Delta against Linux-4.7-rc3

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-17 12:39:52 +01:00
Geert Uytterhoeven f9ae17ba97 ASoC: ak4613: Implement suspend callback
Add the suspend callback to accompany the existing resume operation.
With the suspend/resume callbacks the regmap (regcache) state handling
can follow the recommended sequence.

Based on commit a2ebd58627 ("ASoC: ak4642: Implement suspend
callback") by Peter Ujfalusi <peter.ujfalusi@ti.com>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-17 12:36:09 +01:00
Geert Uytterhoeven dcd2d1f786 ASoC: ak4613: Enable cache usage to fix crashes on resume
During system resume:

    kernel BUG at drivers/base/regmap/regcache.c:347!
    ...
    PC is at regcache_sync+0x1c/0x128
    LR is at ak4613_resume+0x28/0x34

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

Based on commit d3030d1196 ("ASoC: ak4642: Enable cache usage to
fix crashes on resume") by Mark Brown <broonie@kernel.org>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-17 12:36:09 +01:00
Geert Uytterhoeven 50c7a0ef2d ASoC: wm8940: Enable cache usage to fix crashes on resume
The wm8940 driver is using a regmap cache sync to restore the
configuration of the chip when switching from OFF to STANDBY, but does
not actually define a register cache which means that the restore is
never going to work and we trigger asserts in regmap.  Fix this by
enabling caching.

Based on commit d3030d1196 ("ASoC: ak4642: Enable cache usage to
fix crashes on resume") by Mark Brown <broonie@kernel.org>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-17 12:35:33 +01:00
Matt Flax cf5ef3a299 ASoc: wm8731: add 32bit mode.
This patch adds 32 bit word capability to the wm8731 driver. The wm8731
codec is capable of handling 32 bit word sizes, however that has not
previously been activated in the codec driver.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-17 12:14:32 +01:00
Arnd Bergmann b82d67f4cf ASoC fix up SND_SOC_WM8985 dependency
I just added an I2C dependency to the wm8985 driver to work around
a build failure, but it turns out that was premature: we actually
need to depend on SND_SOC_I2C_AND_SPI, as the driver can work with either
of the two, and we only need to prevent a configuration that has
I2C=m and SND_SOC_WM8985=y.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 05252513fb ("ASoC: wm8985: add i2c dependency")
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-17 11:41:10 +01:00
Lars-Peter Clausen 5d76de61dd ASoC: adau17x1: Add support for specifying the MCLK using the CCF
The devices from the ADAU17X1 family all have a MCLK clock input which
supplies the master clock for the device. The master clock is used as the
input clock for the PLL. Currently the MCLK rate as well as the desired PLL
output frequency need to be supplied by calling snd_soc_dai_set_pll() form
a machine driver.

Add support for specifying the MCLK using the common clock framework. In
addition to that also automatically configure the PLL to a suitable rate
if the master clock was provided using the CCW. This allows to use the
CODEC driver without any special configuration requirements from the
machine driver.

While the PLL output frequency can be configured over a (more or less)
continuous range the narrowness of the range and the other constraints of
the clocking tree usually only result in two output frequencies that will
actually be chosen. One for 44.1kHz based rates and one for 48kHz based
rates, these are the rates that the automatic PLL configuration will use.
For the rare case where a non-standard setup is required a machine driver
can disable the auto-configuration and configure a custom frequency using
the existing mechanisms.

If the common clock framework is not enabled clk_get() will return NULL and
the driver will function as before and the clock rate needs to be
configured manually.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:42:40 +01:00
Eric Nelson 8419caa727 ASoC: sgtl5000: Do not disable regulators in SND_SOC_BIAS_OFF
Disabling the SGTL5000 through regulators would certainly save more
power than simply disabling the reference voltages as described in the
data sheet, but won't properly restore things on resume.

This driver does not support active regulators. So we simply disable the
reference bias currents.

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:09:30 +01:00
Eric Nelson 08dea16e09 ASoC: sgtl5000: Disable internal PLL early
To handle the soft reboot case, the internal PLL must be
disabled in SGTL5000_CHIP_CLK_CTRL before clearing bits
SGTL5000_VCOAMP_POWERUP and SGTL5000_PLL_POWERUP in
register SGTL5000_CHIP_ANA_POWER.

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:09:26 +01:00
Eric Nelson 3d632cc872 ASoC: sgtl5000: Initialize CHIP_ANA_POWER to power-on defaults
Initialize CHIP_ANA_POWER to match power on defaults, which disables
ADC, DAC, and charge pumps.

In the process, remove references to the following register/bitfields
from the sgtl5000_set_power_regs routine:
	CHIP_ANA_POWER/LINREG_SIMPLE_POWERUP and
	CHIP_LINREG_CTRL/LINREG_VDD_MASK

And remove CHIP_ANA_POWER and CHIP_LINREG_CTRL from the set of default
registers so they don't get clobbered by sgtl5000_fill_defaults().

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:09:21 +01:00
Eric Nelson f219b16959 ASoC: sgtl5000: Write all default registers
If an error occurs writing defaults, produce an error message but
continue writing other registers. The failure of a single write should
not cause catastrophic device failure.

In at least one occurrence, I2C writes of CHIP_ANA_POWER were nacked,
though continuing allowed the device to operate properly.

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:09:17 +01:00
Eric Nelson 940adb280d ASoC: sgtl5000: Fix regulator support
Regulator support on SGTL5000 is broken because the VDDIO and
VDDA and VDDD should be powered on before enabling MCLK as
shown in Figure 4 of [1]. This requires moving control of the
regulators from the codec block to the I2C block of the driver.

The bulk of this patch consists of swapping the codec device with
the i2c client. The new field num_supplies in struct sgtl5000_priv
is used instead of ARRAY_SIZE(supplies) to handle the special case
when the internal LDO is used instead of external VDDD.

Note that ER1 in the SGTL5000 Errata document [2] suggests that
all designs should use external VDDD.

Since the internal LDO can only be enabled after I2C is available,
there's no benefit in treating it as a regulator, so this patch
removes the regulator structure surrounding it.

Instead, a single block of code in sgtl5000_i2c_probe() performs
the initialization sequence in section 2.2.1.1 of [3] and page
26 of [1].

References:
[1] SGTL5000 data sheet
    http://cache.nxp.com/files/analog/doc/data_sheet/SGTL5000.pdf
[2] SGTL5000 errata
    http://cache.nxp.com/files/analog/doc/errata/SGTL5000ER.pdf
[3] SGTL5000 Initialization and programming app note
    http://cache.nxp.com/files/analog/doc/app_note/AN3663.pdf

Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:09:09 +01:00
Clemens Gruber 7e74436410 ASoC: sgtl5000: Remove misleading comment
All new designs should use external VDDD according to official
documentation. See ER1 in errata sheet:
http://cache.nxp.com/files/analog/doc/errata/SGTL5000ER.pdf

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 14:09:05 +01:00
Jeeja KP 09464974ea ASoC: dapm: Fix to return correct path list in is_connected_ep.
In is_connected_ep, when custom_stop_condition is true, need to
return the correct paths instead of con which is 0.

Fixes: 6742064aef7f('ASoC: dapm: support user-defined stop condition in dai_get_connected_widgets')
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-15 10:19:27 +01:00
Vinod Koul a35aeaee94 ASoC: Intel: Skylake: Check for module list being NULL
While clearing loaded module count, we should check first to see
if module list is NULL or not. Some distributions can ship with
no modules and thus list can be empty.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 18:00:45 +01:00
Vinod Koul b914bb55f2 ASoC: Intel: Skylake: Initialize module list for Broxton
The module list was not initialized for Broxton DSP code, so
initialize it.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 18:00:34 +01:00
Jeeja KP 3513798ca4 ASoC: Intel: Add support for PM ops in bxt-rt298
We need card to be early suspended and late resumed, so use prepare and
complete for card suspend and resume.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Jayachandran B 2f74053bea ASoC: Intel: Skylake: Update DSP stall bits
The stall bits needs to comprehend the number of DSP cores
running, so update the stall and unstall register writes to
comprehend SKL_DSP_CORES_MASK values as well.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Senthilnathan Veppur 2023576dd7 ASoC: Intel: Skylake: Update FW purge for Broxton
Broxton needs to send Purge firmware IPC to DSP before downloading the
firmware. The DMA id needs to be updated for that.

While at it also update Broxton boot sequence to send purge request after
power up and before yanking off reset.

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Jayachandran B 1665c177ab ASoC: Intel: Skylake: Enable firmware reload in suspend
Broxton DSP needs retains code loaded during runtime_pm cycles.
But it looses that on suspend cycle, so on resume we need to
download the firmware again.

This is done by adding a new flag and based on flag status, we
download the firmware.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Senthilnathan Veppur 316f135a4e ASoC: Intel: Update ignore suspend for bxt-rt298
Capture from DMIC requires that we ignore the suspend, so mark
these as ignore_suspend in bxt-rt298 machine.

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Senthilnathan Veppur 4cdf33feb2 ASoC: Intel: Add FE rate & channel constraints for bxt-rt298
We support stereo 48Khz audio, so add these as constraints
for this card

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Senthilnathan Veppur bfcdc6d190 ASoC: Intel: Add DMIC 4 channel support for bxt machine
Like Skylake, we can support  4 channel for DMIC, so add
hw_params and constraints in the bxt-rt298 machine

While at it, also add codec1 pipe for speaker playback.

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:59:33 +01:00
Arnd Bergmann 4983d32526 ASoC: nau8825: mark pm functions __maybe_unused
The newly added nau8825_dai_is_active() function is only called from
the PM logic that is build-time conditional in this driver, so we get
a warning when CONFIG_PM is disabled:

sound/soc/codecs/nau8825.c:229:13: error: 'nau8825_dai_is_active' defined but not used [-Werror=unused-function]
 static bool nau8825_dai_is_active(struct nau8825 *nau8825)

By replacing the #ifdef around the functions with a __maybe_unused
annotation, the code becomes more robust to this kind of problem
and we no longer get the warning while also slightly improving
readability.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b50455fab4 ("ASoC: nau8825: cross talk suppression measurement function")
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:46:58 +01:00
Arnd Bergmann 8f273aacc0 ASoC: remove one extraneous 'const'
A recent commit made a few arrays 'const', but also added the
same attribute to a function return type, where it makes no
sense, and we get a warning when building with W=1:

sound/soc/codecs/arizona.c:1725:27: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
 static const char * const arizona_dai_clk_str(int clk_id)

This removes it again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-14 14:46:36 +01:00
Nicolin Chen 88b1c01fb4 ASoC: cs53l30: Correct clock inversion check
SND_SOC_DAIFMT_IB_NF = 0x3 (11b) | SND_SOC_DAIFMT_IB_IF = 0x4 (100b)
creates a mask 0x7 (111b) which also includes SND_SOC_DAIFMT_NB_IF
= 0x2 (10b).

So this patch uses the traditional way to check the clock inversion.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:53:22 +01:00
Jose Abreu 79361b2b98 ASoC: dwc: Add PIO PCM extension
A PCM extension was added to I2S driver so that audio
samples are transferred using PIO mode.

The PCM supports two channels @ 16 or 32 bits with rates
32k, 44.1k and 48k.

Although the mainline I2S driver uses ALSA DMA engine the
I2S controller can be built without DMA support, therefore
this is the reason why this extension was added.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:52:00 +01:00
Arnd Bergmann cc9bdcf2a4 ASoC: rcar: fix 'const static' variables
When building with 'make W=1', we get a harmless warning about
slightly incorrect prototypes in the rcar audio driver:

sound/soc/sh/rcar/gen.c: In function 'rsnd_gen2_probe':
sound/soc/sh/rcar/gen.c:209:2: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]

This changes the 'const static' to 'static const' as it should be.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:45:35 +01:00
Arnd Bergmann a074ae0ed6 ASoC: pcm1681/pcm1791: fix typo in declaration
gcc -Wextra warns about an obvious but harmless typo in the
pcm1681_writeable_reg function, which has an extra 'register
keyword', and in pcm179x, which has a second copy of that
declaration:

sound/soc/codecs/pcm1681.c:76:42: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]
sound/soc/codecs/pcm179x.c:62:42: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]

For consistency with the rest of the file, I'm changing this from
'unsigned register' to 'unsigned int', which has the same meaning
but causes no warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:45:18 +01:00
Arnd Bergmann 53d4b031e3 ASoC: cs53l30: include gpio/consumer.h
When GPIOLIB is disabled, we don't see the declarations from
gpio/consumer.h, so we have to include the header explicitly
to avoid this build error:

sound/soc/codecs/cs53l30.c: In function 'cs53l30_i2c_probe':
sound/soc/codecs/cs53l30.c:931:24: error: implicit declaration of function 'devm_gpiod_get_optional' [-Werror=implicit-function-declaration]
  cs53l30->reset_gpio = devm_gpiod_get_optional(dev, reset,
                        ^~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/cs53l30.c:932:13: error: 'GPIOD_OUT_LOW' undeclared (first use in this function)
             GPIOD_OUT_LOW);
             ^~~~~~~~~~~~~
sound/soc/codecs/cs53l30.c:932:13: note: each undeclared identifier is reported only once for each function it appears in
sound/soc/codecs/cs53l30.c:939:3: error: implicit declaration of function 'gpiod_set_value_cansleep' [-Werror=implicit-function-declaration]
   gpiod_set_value_cansleep(cs53l30->reset_gpio, 1);

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:44:52 +01:00
Arnd Bergmann d13e4362de ASoC: fix ABE_TWL6040 dependency
The TWL6040 ASoC support has recently started turning on CLK_TWL6040,
but that fails to build when CONFIG_COMMON_CLK is disabled:

warning: (SND_OMAP_SOC_OMAP_ABE_TWL6040) selects CLK_TWL6040 which has unmet direct dependencies (COMMON_CLK && TWL6040_CORE)
0xF18E38F6 Thu Jun 9 18:57:32 CEST 2016 failed
In file included from ../include/linux/clocksource.h:18:0,
                 from ../drivers/clocksource/timer-nps.c:34:
../include/linux/of.h:1005:20: error: comparison of distinct pointer types lacks a cast [-Werror]
        .data = (fn == (fn_type)NULL) ? fn : fn  }
                    ^

This adds a dependency to avoid the invalid configuration.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 443500a392 ("ASoC: omap: Kconfig: SND_OMAP_SOC_OMAP_ABE_TWL6040 to select CLK_TWL6040")
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:44:37 +01:00
Arnd Bergmann 05252513fb ASoC: wm8985: add i2c dependency
The wm8985 driver is now user-selectable, but building it with
I2C disabled results in a link failure:

sound/built-in.o: In function `wm8985_i2c_probe':
:(.text+0x44914): undefined reference to `__devm_regmap_init_i2c'
sound/built-in.o: In function `wm8985_exit':
:(.exit.text+0x3d8): undefined reference to `i2c_del_driver'
sound/built-in.o: In function `wm8985_modinit':
:(.init.text+0x1454): undefined reference to `i2c_register_driver'

This adds a Kconfig dependency the way that the other codec
drivers have it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 811e66de22 ("ASoC: wm8985: add support for WM8758")
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 17:44:16 +01:00
Charles Keepax 28ee3d7377 ASoC: wm_adsp: Treat missing compressed buffer as a fatal error
If the DSP is powered down whilst a compressed stream is being processed
we should treat this as a fatal error, clearly the stream is no longer
valid.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 16:49:51 +01:00
Charles Keepax 8d280664d2 ASoC: wm_adsp: Use new snd_compr_stop_error to signal stream failure
If we encounter a fatal error on the compressed stream call the new
snd_compr_stop_error to shutdown the stream and allow the core to
inform user-space that the stream is no longer valid.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 16:49:51 +01:00
Wei Yongjun 7d267ddfd5 ASoC: sti: fix return value check in uni_player_parse_dt_audio_glue()
In case of error, the function syscon_regmap_lookup_by_phandle() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 16:37:19 +01:00
Charles Keepax 10867b32a1 ASoC: wm5102: Revert manual speaker enable
The OUT4L and OUT4R widgets are not registered PRE_PMU or POST_PMD
events, as such the manual speaker enable on wm5102 does not actually
ever run. Furthermore since the issue actually only affected rev B of
the silicon which never shipped in volume, simply remove the work around
from the code.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 15:11:48 +01:00
Charles Keepax a3178a3ed7 ASoC: arizona: Add a couple of missing consts
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 15:11:48 +01:00
Charles Keepax 19edeb30c5 ASoC: wm5102: Correct supported channels on trace compressed DAI
The audio trace firmware on wm5102 only supports 4 channels correct
the DAI driver structure to reflect this.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 15:11:15 +01:00
Ajit Pandey d72fea6214 ASoC: wm5110: Add missing route from OUT3R to SYSCLK
Output 3 is stereo on wm5110 and all inputs/outputs should have a
connection to SYSCLK. This patch adds the missing DAPM route.

Signed-off-by: Ajit Pandey <ajit.pandey@soctronics.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 15:10:05 +01:00
Kuninori Morimoto 548563fa3e ASoC: simple-card: use common PREFIX for each DT property
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 13:24:54 +01:00
John Hsu b50455fab4 ASoC: nau8825: cross talk suppression measurement function
The cross talk measurement function can reduce cross talk across the JKTIP
HPL) and JKR1(HPR) outputs which measures the cross talk signal level to
determine what is the cross talk reduction gain. This system works by
sending a 23Hz -24dBV sine wave into the headset output DAC and through
the PGA. The output of the PGA is then connected to an internal current
sense which measures the attenuated 23Hz signal and passing the output to
an ADC which converts the measurement to a binary code. With two separated
measurement, one for JKR1(HPR) and the other JKTIP(HPL), measurement data
can be separated read in IMM_RMS_L for HSR and HSL after each measurement.

Thus, the measurement function has four states to complete whole sequence.
(1)Prepare state : Prepare the resource for detection and transfer to HPR
IMM stat to make JKR1(HPR) impedance measure.
(2)HPR IMM state : Read out orignal signal level of JKR1(HPR) and transfer
to HPL IMM state to make JKTIP(HPL) impedance measure.
(3)HPL IMM state : Read out cross talk signal level of JKTIP(HPL) and
transfer to IMM state to determine suppression sidetone gain.
(4)IMM state : Computes cross talk suppression sidetone gain with orignal
and cross talk signal level. Apply this gain and then restore codec con-
figuration. Then transfer to Done state for ending.

In order to get the cross talk suppression sidetone gain, we need the
function to compute log10 value and the result is round off to 3 decimal.
This function takes reference to dvb-math. The source code locates as the
following. "Linux/drivers/media/dvb-core/dvb_math.c"
Then, the orignal and cross talk signal vlues need to be characterized.
The sidetone value can be converted to decibel with the equation below.
sidetone = 20 * log (original signal level / crosstalk signal level)

Besides, the state machine for cross talk process needs interruptions to
trigger worked. We have the RMS intrruption enabled with the internal VCO
clock when headset connected. In the interrupt handler, the driver will
judge the headset is high impedance or not. If yes, the cross talk supp-
ression shouldn't apply and do nothing but relieve the protection raised
before. Otherwise, apply the cross talk suppression in the headset and
start the process.

Because the process spends a lot of time, there is an resource race issue
easily between the application and interruption. They will control codec
power and clock concurrently. In one situaiton, the jack is inserted when
playback, and then the application changes to headset device. The applica-
tion prepares the playback and interrupt handler raises work for cross
talk process together. For this case, the solution is that driver delays
soc jack report until cross talk process completes. The mechanism can
avoid application to do playback preparation before cross talk detection
is still working.
In another situaiton, the system suspends when playback. After resume, the
system restarts playback, and meanwhile jack detection restarts. The play-
back preparation and cross talk process triggered by interruptions happens
concurrently. For the case, the driver provides the semaphone to syn-
chronize the playback and interrupt handler. In order to avoid the play-
back interfered by cross talk process, the driver make the playback prepa-
ration halted until cross talk process finish. After codec resume, the
driver finds the codec dai is active, and then the driver raises the pro-
tection for cross talk function to avoid the playback recovers before
cross talk process finish.

The driver also provides cancel method to forcely cancel the cross talk
task and restores the configuration to original status. Before the codec
remove, ejection, or suspend, the driver is obliged to cancel the cross
talk detection process. It can reduce the risk of failure when quickly and
continually doing jack insertion and ejection.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13 11:39:02 +01:00
Lars-Peter Clausen 0eadaa9ce2 ASoC: adau: Factor out shared PLL configuration code
Multiple devices from the ADAU family share the same PLL structure and
configuration register layout. Introduce a new helper module that can be
used to calculated the PLL configuration registers based on a specified
input frequency and the desired output frequency of the PLL.

The ADAU1761/ADAU1781 and ADAU1373 drivers are updated to make use of this
new helper module. But future drivers for additional devices from the ADAU
family are also expected to make use of it.

In anticipation of sharing more infrastructure code between different
devices from the ADAU family the new module is called adau-utils.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-09 18:41:41 +01:00
Kuninori Morimoto 7dc2031966 ASoC: rsnd: adg :: AUDIO-CLKOUTn asynchronizes support
AUDIO-CLKOUTn can asynchronizes with L/R clock.
AUDIO-CLKOUTn synchronizes with L/R clock is now default behavior.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-09 11:40:43 +01:00
Oder Chiou 6eebf35b0e ASoC: rt5514: add rt5514 SPI driver
The device has multiple control interfaces, I2C and SPI. The I2C interface
mainly controls the register settings of codec. The SPI interface is in
order to provide the high speed transmission of data. For example, high
bandwidth memory read/write of DSP. The patch adds the rt5514 SPI driver
for loading the firmware of DSP and retrieving the voice data from DSP
after the system is waked up by specific voice.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 16:22:31 +01:00
Jeeja KP 7b96144df1 ASoC: Intel: Skylake: Report position in pointer query
Don't update the runtime_delay in pointer query, delay need to
reported as part of soc driver ops delay function. The delay
value overwritten by ASoC core so this is dummy code and hence
removing it.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Jeeja KP 8871dcb9f0 ASoC: Intel: Skylake: Copy the pipe parameter by pipe type
For pass through pipe, Host and Link DMA id's are valid,
instead of overwriting the params set the host and link
based on pipe type.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Jeeja KP f0aa94faa0 ASoC: Intel: Skylake: Set the DSP pipe type
DSP pipe type can be a pass through or it can be processing pipe.
In case of pass through pipe, it is a single pipeline with both
host and link copier in the same pipeline.

Identify the DSP pipe type if it pass through or not. Pass through
pipe is identified by checking if it has both host and link copier
in the same pipeline.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Jeeja KP 287af4f9f2 ASoC: Intel: Skylake: Create Pipe to widget list in soc probe
We need to Identify the DSP pipe type and based on it being a pass
thru pipeline or not, we need to copy the pipeline params.

Pipe to widget mapping was earlier done in pre PMD widget handler,
but since the pipe type would now be required in hw_params for
bypass pipelines we need to move this to be done during the ASoC
probe of the platform component.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Dharageswari R fe3f4442e2 ASoC: Intel: Skylake: Clean up of driver resources in suspend
On suspend firmware is re-initialized so resources are reset inside
firmware. Driver should also clear the firmware counters at this time.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Dharageswari R 260eb73aa2 ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps
When DSP pipe/module is not initialized successfully, memory/mcps
is not allocated. So check the pipe/module state to avoid freeing
up of unallocated memory/mcps. And allocate resources when pipe/
module is initialized successfully.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Dharageswari R 51a01b8c2e ASoC: Intel: Skylake: Disable SRAM Retention before D3
SW needs to set the PGCTL.LSRMD = 1 to disable LPSRAM retention
feature,otherwise it may lead to SRAM ECC Errors.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Dharageswari R 1ae7ca041a ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting
If pipeline is not STARTED, we do not need to pause pipeline while
deleting.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Jeeja KP 353f72aa77 ASoC: Intel: Skylake: Set the pipe state to paused when paused
When pipe is stopped/Paused, set the pipe state to paused instead
of created.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Jeeja KP 2004432f94 ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset
In case of XRUN recovery PCM prepare will be called. In this case
Host/Link DMAs are reset and reconfigured, hence the corresponding
FE/BE pipe needs to be reset in order to get to a clean state.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 14:19:11 +01:00
Bard Liao e1f42a2f25 ASoC: rt5670: fix HP Playback Volume control
The register setting for HP Playback Volume is inverted. So, set
the invert flag in SOC_DOUBLE_TLV.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 11:43:57 +01:00
Bard Liao 572f1f613a ASoC: rt5670: fix HP Playback Volume control
The register setting for HP Playback Volume is inverted. So, set
the invert flag in SOC_DOUBLE_TLV.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-07 11:43:20 +01:00
Sudip Mukherjee 8d7d11005e ASoC: atmel: fix build failure
m32r allmodconfig build is failing with the error:
ERROR: "bad_dma_ops" [sound/soc/atmel/snd-soc-atmel-pcm-pdc.ko] undefined!

The code is using DMA but the related dependency is not mentioned in the
Kconfig.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-06 17:00:47 +01:00
John Hsu 0cbeccdfb1 ASoC: nau8825: correct typo in biquad filter coefficients
There is typo in the name of biquad filter coefficients control.
The patch is to fix the typo.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-03 11:41:35 +01:00
Sudip Mukherjee 121a01521b ASoC: fsl: fix build failure
m32r allmodconfig build is failing with the error:
ERROR: "bad_dma_ops" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!

The code is using DMA but the related dependency is not mentioned in the
Kconfig.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-03 00:28:15 +01:00
PC Liao 0c198ed2ba ASoC: mediatek: add MCLK source selection
The new machine's MCLK source is from mt8173 which is dynamic from
sampling rate*256. This patch provides the selection for device tree.

Signed-off-by: PC Liao <pc.liao@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 18:18:25 +01:00
Lars-Peter Clausen a0d3546cf9 ASoC: Add ADAU7002 Stereo PDM-to-I2S/TDM Converter driver
This patch adds support for the ADAU7002 PDM-to-I2S/TDM converter. The
ADAU7002 takes a stereo PDM signal (e.g. from two digital microphones) and
converts it into a I2S/TDM PCM stream. The chip does not have a
programmable control interface and the driver simply describes the static
capabilities of the chip.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 15:45:42 +01:00
Arnd Bergmann 6de7df8d1b ASoC: hdmi-codec: select CONFIG_HDMI
SND_SOC_HDMI_CODEC can be enabled without HDMI support, leading
to a link error:

In function `hdmi_codec_hw_params':
sound/soc/codecs/hdmi-codec.c:188: undefined reference to `hdmi_audio_infoframe_init'
sound/built-in.o:(.debug_addr+0x1a5c0): undefined reference to `hdmi_audio_infoframe_init'

This changes the Kconfig file to select HDMI, as the other codec using
hdmi_audio_infoframe_init already does.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 12:08:55 +01:00
Nicolin Chen 87a4bb1135 ASoC: cs53l30: Check return value of regcache_sync()
Regcache_sync() might fail. So this patch adds a return value Check for it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 11:16:09 +01:00
Nicolin Chen b97c444681 ASoC: cs53l30: Rename the volume controls for preamplifier
Volume controls should end with 'Volume', so this patch renames them for
ADC preamplifier.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 11:16:04 +01:00
Peter Ujfalusi 272ee030eb ASoC: davinci-mcasp: Use a copy of pdata per instance during DT boot
Instead of modifying the static pdata struct per McASP instance we need to
allocate pdata for each McASP.
This way we can avoid configuration leakage from prior McASP to McASP
drivers probed at later time.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 10:58:19 +01:00
Peter Ujfalusi 8e1cc0e4ba ASoC: davinci-mcasp: Fix dra7 DMA offset when using CFG port
The TX and RX offset is different for each serializers when using the CFG
port for DMA access.
When using the CFG port only one serializer can be used per direction so
print error message and only configure the first serializer's offset.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Suggested-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 10:57:48 +01:00
Peter Ujfalusi 9ac0013ce6 ASoC: davinci-mcasp: Fix dra7 DMA offset when using CFG port
The TX and RX offset is different for each serializers when using the CFG
port for DMA access.
When using the CFG port only one serializer can be used per direction so
print error message and only configure the first serializer's offset.

Reported-by: Misael Lopez Cruz <misael.lopez@ti.com>
Suggested-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02 10:57:37 +01:00
Sathyanarayana Nujella de15996eab ASoC: Intel: Add Broxton-P Dialog+Maxim machine driver entry
This patch adds bxt_da7219_max98357a_i2s machine driver
entry into machine table

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-01 17:10:34 +01:00
Sathyanarayana Nujella 723bad3fef ASoC: Intel: Add Broxton-P Dialog Maxim machine driver
This patch adds Broxton-P I2S machine driver which uses
DA7219 and MAX98357A codecs.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-01 17:10:34 +01:00
Petr Kulhavy f7d3d2d8e8 ASoC: tas571x: add input channel mixer for TAS5717/19
Add channel 1 and 2 input mixer registers and the related ALSA mixer
controls for TAS5717/19 chips.

The mixer control coefficients on the chip are linear in the range
-3.99999 to +3.99999, encoded in 3.23 number format.
In this patch the mixer controls are limited to 128 values
from 0.0 to 1.0 in 1/64 steps.

Signed-off-by: Petr Kulhavy <brain@jikos.cz>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-01 16:22:10 +01:00
Bastien Nocera 11f9192cc1 ASoC: tlv320aix31xx: Add ACPI match for Lenovo 100S
The Lenovo 100S netbook has a codec controller for which there is a
driver, but doesn't know how to access the device. This adds the
necessary ACPI table for the driver to find the device.

Device (TTLV)
{
    Name (_ADR, Zero)  // _ADR: Address
    Name (_HID, "10TI3100")  // _HID: Hardware ID
    Name (_CID, "10TI3100")  // _CID: Compatible ID
    Name (_DDN, "TI TLV320AIC3100 Codec Controller ")  // _DDN: DOS Device Name
    Name (_UID, One)  // _UID: Unique ID

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Tested-by: Jan Schmidt <jan@centricular.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-01 16:18:47 +01:00
John Hsu 2ec30f60ff ASoC: nau8825: non-clock jack detection for power saving at standby
The driver changes jack type detection interruption to non-clock archi-
tecture for less 1mW power saving. The architecture is called manual mode
jack detection. It has no hardware debounce, no jack type detection, but
only detecting jack insertion. After jack insertion, the driver will
switch to auto mode jack detection with internal clock which can detect
microphone, jack type and do hardware debounce.

The manual architecture has these main changes including codec initiation,
interruption, clock control, and power management. When codec initiation
or system resume, the clock is closed as jack insertion detection at man-
ual mode, and bypass debounce circuit. These configurations move to resume
setup function when setup bias level after resume.

When jack insertion detection happens, the manual mode turns off and make
configuration about jack type detection interruption at auto mode in auto
irq setup function which can detect microphone and jack type. The inter-
ruption will switch to manual mode again with clock free until jack ejec-
tion happens.

The system clock configuration adds clock disable option which can disable
internal VCO clock. Before the system clock change, there is an restric-
tion added to make sure clock disabled and not config any clock when no
headset connected.

In power management, we involve the solution about races and jack detec-
tion in resume from Ben Zhang in the following patch and list his comment.
[PATCH] ASoC: nau8825: Fix jack detection across suspend
"Jack plug status is rechecked at resume to handle plug/unplug
in S3 when the chip has no power."
"Suspend/resume callbacks are moved from the i2c dev_pm_ops to
snd_soc_codec_driver. soc_resume_deferred is a delayed work
which may trigger nau8825_set_bias_level. The bias change races
against dev_pm_ops, causing jack detection issues.
soc_resume_deferred ensures bias change and snd_soc_codec_driver
suspend/resume are sequenced correctly."

Change SAR widget to supply type which can prevent the codec keeping at
SND_SOC_BIAS_ON during suspend. The codec suspend function can just invoke
normally.

Before the system suspends, the driver turns off all interruptions. Keep
the interruption quiet before resume setup completes. The ADC channel will
be disabled which is needed for interruptions at audo mode.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 18:49:03 +01:00
John Hsu 18d8306d7e ASoC: nau8825: add programmable biquad filter control
Add programmable biquad filter configuration control for user space.
The filter is configurable for low pass filters, high pass filters,
Notch filter, etc in the ADC and DAC path.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 18:38:59 +01:00
Yong Zhi 05282c7751 ASoC: Intel: boards: configure DMIC for machine sklnau8825max
This machine driver can support 2 or 4 DMIC configuration, so
apply the ch constraint according to driver pdata.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 18:37:44 +01:00
Yong Zhi cfa12367f8 ASoC: Intel: boards: configure DMIC for machine sklnau8825adi
This machine driver can support 2 or 4 DMIC configuration, so
apply the ch constraint according to driver pdata.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 18:37:44 +01:00
Simran Rai 1200a7d9b2 ASoC: cygnus: Add Cygnus audio DMA driver
This patch adds Cygnus audio DMA driver. It supports playback
and capture modes and uses ringbuffers for data transfer.

Signed-off-by: Lori Hikichi <lhikichi@broadcom.com>
Signed-off-by: Simran Rai <ssimran@broadcom.com>
Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Arun Parameswaran <arunp@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 17:50:42 +01:00
Simran Rai a6ee05d94e ASoC: cygnus: Add Cygnus audio DAI driver
This patch adds Cygnus audio DAI driver. It supports I2S, TDM
and SPDIF modes and uses three clocks derived from PLL.

This patchset has been tested on Cygnus wireless audio
bcm958305K board.

Signed-off-by: Lori Hikichi <lhikichi@broadcom.com>
Signed-off-by: Simran Rai <ssimran@broadcom.com>
Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Arun Parameswaran <arunp@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 17:50:42 +01:00
Peter Ujfalusi a2ebd58627 ASoC: ak4642: Implement suspend callback
Add the suspend callback to accompany the existing resume operation.
With the suspend/resume callbacks the regmap (regcache) state handling can
follow the recommended sequence.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 14:37:08 +01:00
Vinod Koul 500e06b9a3 ASoC: hdac_hdmi: Fix potential NULL dereference
Static checker warns:
Pointer 'hlink' returned from call to function 'snd_hdac_ext_bus_get_link'
at line may be NULL and will be dereferenced"

So we should always check the return of snd_hdac_ext_bus_get_link() before
referencing the link pointer

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 14:36:30 +01:00
Charles Keepax 546ad3d024 ASoC: arizona: Add data structure for voice trigger notifier
64-bit builds would generate a warning when we passed the core number as
a pointer through the notifier data:

sound/soc/codecs/cs47l24.c:1091:13: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
             (void *)i);

Rather than just fix this up with more casting add a data structure that
holds information for the notifier chain. This will make it easier to
add additional information in the future as well.

Fixes: 7baa7e2490 ("ASoC: arizona: Add event notification on voice trigger events")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 14:35:49 +01:00
Vinod Koul 3467a64dde ASoC: Intel: Skylake: Find uuids for Broxton
Broxton uses different offset in manifest for parsing module
table. So invoke common parsing utility from broxton using
broxton offset.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Vinod Koul 06711051d2 ASoC: Intel: Skylake: Find uuids for Skylake
SKylake uses different offset in manifest for parsing module
table. So invoke common parsing utility from skylake using
skylake offset.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Shreyas NC ea6b3e9437 ASoC: Intel: Skylake: Add DSP firmware manifest parsing
Module params like module_id and loadable flag can be changed
in the DSP Firmware. These are kept in the firmware manifest
and driver should read these values from this manifest.

So, add support to parse the DSP firmware manifest and
read these module params.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Vinod Koul bf242d19d5 ASoC: Intel: Skylake: Strip manifest for Broxton platform
Broxton firmrware comes with extended manifest so invoke
skl_dsp_strip_extended_manifest() to check and strip

Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Vinod Koul cd63655e80 ASoC: Intel: Skylake: Strip manifest for Skylake platform
Future firmware updates may comes with extended manifest so invoke
skl_dsp_strip_extended_manifest() to check and strip

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Vinod Koul fdfa82ee14 ASoC: Intel: Skylake: Don't use local pointer for firmware
We have firmware pointer is driver context, so use that instead
of local pointer.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Ramesh Babu 6eee87261f ASoC: Intel: Skylake: Add strip extended manifest utility
Some upcoming platforms like broxton etc have extended manifest
in firmware binary. This is not required to be downloaded to DSP.
So driver needs to strip this before downloading.

Add a utility function to check if a header exists, and remove it
in that case

Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:24:41 +01:00
Yong Zhi f65cf7d666 ASoC: Intel: Skylake: Add api to retrieve dmic array info from nhlt
Skylake can be configured with either both 2 and 4 channel DMIC
array, or 2 channel DMIC array only, this patch provides an API to
retrieve the DMIC info from nhlt.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 18:16:44 +01:00
Kuninori Morimoto 5fb9cb1651 ASoC: simple-card: platform also uses asoc_simple_card_sub_parse_of()
In current simple-card, platform is handled as special case,
but, the code is not readable.
This patch makes platform to use asoc_simple_card_sub_parse_of()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 17:16:19 +01:00
Kuninori Morimoto 52fd98bcaf ASoC: rsrc-card: remove unused dai_num
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 17:00:38 +01:00
Petr Kulhavy 811e66de22 ASoC: wm8985: add support for WM8758
The WM8758 chip is almost identical to WM8985 with the difference that it
doesn't feature the AUX input. This patch adds the WM8758 support into the
WM8985 driver.

The chip selection is done by the I2C name. The SPI probe supports only
the WM8985.

Signed-off-by: Petr Kulhavy <petr@barix.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:25:36 +01:00
Petr Kulhavy 68f9eac356 ASoC: wm8985: add register definitions for WM8758
The WM8758 chip is almost identical to WM8985 with the difference that it
doesn't feature the AUX input. This patch adds the register definitions
for WM8758 specific bit fields to the header file.

Signed-off-by: Petr Kulhavy <petr@barix.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:25:36 +01:00
Peter Ujfalusi bafcbfe429 ASoC: tlv320aic31xx: Make the register values human readable
The datasheet uses decimal numbers for the register addresses, convert the
register values from hexadecimal to decimal and introduce macro for the
register definitions. This way it is easier to look up registers in the
documentation.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:24:36 +01:00
Petr Kulhavy 4b9e385b9d ASoC: tas571x: add biquads for TAS5717/19
TAS571x features multiple biquad filters. Their coefficients
are stored in 20-byte registers, which cannot be supported by
regmap.

This patch adds read and write functions for multi-word (32-bit) register
access and mixer controls for the biquads. The multi-word read/write
functions can be used in the future to implement other features like DRC or
output mixer.

Signed-off-by: Petr Kulhavy <brain@jikos.cz>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:21:01 +01:00
Petr Kulhavy dca3fed85e ASoC: tas571x: add biquad registers for TAS5717/19
Add biquad register definitions for TAS5717/19.

Signed-off-by: Petr Kulhavy <brain@jikos.cz>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:21:01 +01:00
Sylwester Nawrocki ee12a817bb ASoC: samsung: Remove unused Odroid x2/u3 machine driver
We have been using "simple-audio-card" for Odroid X2/U3 boards,
as can be seen from sound node in arch/arm/boot/dts/
exynos4412-odroid-common.dtsi. A dedicated machine driver is not
needed and it is removed in this patch.
There is no dts files using "samsung,odroidx2-audio" or
"samsung,odroidu3-audio" compatible strings.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:20:03 +01:00