Commit graph

13818 commits

Author SHA1 Message Date
John Hsu
a8961cae29 ASoC: nau8825: fix bug in FLL parameter
In the FLL parameter calculation, the FVCO should choose the maximum one.
The patch is to fix the bug about the wrong FVCO chosen.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2016-09-14 16:14:37 +01:00
Hsin-Yu Chao
96fc294cf6 ASoC: da7219: software reset codec at probe
Da7219 does not trigger interrupt to report jack status
when system boots from warm reset because its power
remains on during warm reset.
Doing software reset at probe to handle this.

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-14 16:11:31 +01:00
Julia Lawall
c59b24f87b ASoC: constify gpio_chip structures
These structures are only used to copy into other structures, so declare
them as const.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct gpio_chip i@p = { ... };

@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct gpio_chip e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct gpio_chip i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-12 20:04:54 +01:00
Julia Lawall
52abe54138 ASoC: ac97: constify gpio_chip structures
These structures are only used to copy into other structures, so declare
them as const.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct gpio_chip i@p = { ... };

@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct gpio_chip e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct gpio_chip i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-12 20:04:28 +01:00
Julia Lawall
115c725488 ASoC: constify snd_pcm_ops structures
Check for snd_pcm_ops structures that are only stored in the ops field of a
snd_soc_platform_driver structure or passed as the third argument to
snd_pcm_set_ops.  The corresponding field or parameter is declared const,
so snd_pcm_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_platform_driver e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
snd_pcm_set_ops(e1, e2, &i@p)

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_pcm_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_pcm_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-12 20:04:09 +01:00
Sugar Zhang
3628c6987f ASoC: rockchip: spdif: restore register during runtime_suspend/resume cycle
when step into runtime_suspend, spdif pd will be disabled and loss state.
so need to restore register when runtime_resume.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-12 20:00:46 +01:00
Sugar Zhang
f0447f6cbb ASoC: rockchip: i2s: restore register during runtime_suspend/resume cycle
when step into runtime_suspend, i2s pd will be disabled and loss state.
so need to restore register when runtime_resume.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-12 20:00:45 +01:00
Oder Chiou
a1338a7d4c ASoC: rt5514: make the volume TLV to match the units 0.01dB
The volume have a step of 0.375dB, but TLV uses the units 0.01dB. It should
be changed to a step of 0.75dB to match the units of TLV.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-12 20:00:12 +01:00
Takashi Iwai
3d2f4d0c0d Merge branch 'for-linus' into for-next
Back-merge from for-linus just to make the further development easier.
2016-09-11 09:33:12 +02:00
Masahiro Yamada
44cc4a017e ALSA: squash lines for simple wrapper functions
Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-07 20:35:29 +02:00
Srinivas Kandagatla
05f9033f74 ASoC: qcom: apq8016-sbc: add support to routing via DT
This patch adds support to allow audio routing via Device Tree.
This is mostly used to specify MICBIAS and other power supplies
relation.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-06 12:28:23 +01:00
Srinivas Kandagatla
1190300d03 ASoC: qcom: apq8016-sbc: add board specific dapm mic widgets
This patch adds support to board specific dapm mic widgets so that these
can be used to specify proper connections of various micbias supported by
the board and SOC.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-06 12:28:23 +01:00
Pierre-Louis Bossart
94ae3ce189 ASoC: Intel: Atom: fix IOSF_MBI dependency
fix issue reported by 0-Day with randconfig

The commit a68bc0d43e
("ASoC: Intel: Atom: auto-detection of Baytrail-CR")
added a dependency on IOSF_MBI. The code used the IS_ENABLED macro
to check for this dependency but this is not enough in case the SST
driver is built-in. This could be fixed with IS_REACHABLE but
Baytrail-CR would not be detected depending on combinations of options

Add dependency in Kconfig to solve this for good

Reported-by: 0 day tester <fengguang.wu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-03 20:29:44 +01:00
Charles Keepax
e87d9ae888 ASoC: arizona: Correct handling of FLL theta in synchroniser mode
Theta/lambda is used to give the fractional portion of the FLL
frequency multiplication. When the synchroniser is active the
reference path lambda value is hard coded in the hardware to
65536. This patch corrects the handling of theta such that it
is scaled to match this denominator, when the synchroniser is
active.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-03 12:08:22 +01:00
Colin Ian King
0fd67cee29 ASoC: Intel: sst: fix to spelling mistake: "susupend" -> "suspend"
trivial fix to spelling mistake in dev_err message and replace "cant"
with "can't"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-03 12:08:10 +01:00
Colin Ian King
c3d7abca99 ASoC: ux500: fix spelling mistake "Unsopported" -> "Unsupported"
Trivial fix to spelling mistakes in dev_err messages

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-03 11:59:37 +01:00
Colin Ian King
3bcc865672 ASoC: fsl_esai: fix spelling mistake "Transmition" -> "Transmission"
Trivial fix to spelling mistakes in dev_dbg messages

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-03 11:59:12 +01:00
Richard Fitzgerald
63d19e0693 ASoC: arizona: Wait for resume before enabling FLL
When enabling an FLL use pm_runtime_get_sync() instead of
pm_runtime_get() to ensure that all the register settings
have been written out and the codec is powered-up before
we write the enable bit.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:34:55 +01:00
Dharageswari R
b0fab9c6f6 ASoC: Intel: Skylake: Unload all the loadable modules
There could be more than one loadable module in a pipeline.
So unload all modules whilst parsing the list.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:27:41 +01:00
Jeeja KP
0b6d76bbd5 ASoC: Intel: Skylake: Fix DMA control config size
DMA control IPC structure wrong config array length,
So corrected the size

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-09-01 21:27:41 +01:00
Vinod Koul
fc94733e56 ASoC: Intel: Skylake: Fix the inverted logic check
While converting to new core hda capability parsing, one instance of
check had inverted logic which was converted wrongly.

Fixes: ec8ae5703d (ALSA: convert users to core bus_parse_capabilities)
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:27:41 +01:00
Vinod Koul
c15ad605be ASoC: Intel: Skylake: check manifest size
For some platforms manifest data may not be defined, thus the private
data would not be defined as well.

So check the size of private data and proceed only if it is valid.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:27:41 +01:00
Kuninori Morimoto
b0133d9c4d ASoC: simple-card: use kzalloc() for dai_props / dai_link
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

Now, simple card needs to 2 type of buffer for dai_props and dai_link.
But, these used different style for buffer allocation.
This patch make these same style as other simple card family.
(= use kzalloc() for both)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
2c86dda74c ASoC: simple-card: code sync: rename num_link to num
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

This patch renames num_link to num

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
0a6c7f2f78 ASoC: simple-card: code sync: use tag
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

This patch uses tag on asoc_simple_card_probe

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
387f5823f4 ASoC: simple-card: code sync: tidyup white line
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family.

This patch tidyups white line

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
a1dbfd0013 ASoC: simple-card: is GPL v2
It is indicating that this driver is GPL v2 on top of C code.
Let's fixup it on MODULE_LICENSE()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
c9a23ead02 ASoC: simple-card: code sync: use simple_priv_to_props() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
7e3353ddd2 ASoC: simple-card: code sync: tidyup simple_priv_to_xxx() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
f93b646d51 ASoC: simple-card: tidyup mclk-fs of_property_read_u32() usage
of_property_read_u32() do nothing in error case.
Let's tidyup useless usage.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
a03b0545c2 ASoC: simple-card: call of_node_put() for dai_link
We need to call of_node_put() if we used of_get_child_by_name(),
but missing it for "dai-link" loop.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:22:59 +01:00
Kuninori Morimoto
9f645421b8 ASoC: simple-scu-card: code sync: tidyup TDM setting position
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch tidyup TDM setting position

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Kuninori Morimoto
f4d70709c8 ASoC: simple-scu-card: code sync: move asoc_simple_card_of_match
simple sound card family are using very similar style, but because of its
historical reason, there are small differences. For example pointer style,
function name, caller postion etc...
This patch synchronized simple card style to other simple card family

This patch moves asoc_simple_card_of_match to bottom side, and rename
it to asoc_simple_of_match same as other simple card family.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Kuninori Morimoto
88da724f77 ASoC: simple-scu-card: depends on CONFIG_OF
simple-scu-card driver is under CONFIG_OF. This patch adds missing
config.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Kuninori Morimoto
83216f3acc ASoC: simple-scu-card: tidyup asoc_simple_card_parse_links() method
Current asoc_simple_card_parse_links() is setting dai_link daifmt.
But, asoc_simple_card_parse_links() is doing it.
This patch clean-up this point less method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Kuninori Morimoto
112a2ab5a7 ASoC: simple-scu-card: tidyup codec daifmt handling method
Current simple-scu-card is handling codec daifmt by using
for_each_child_of_node(), and low-level method.
Let's use of_get_child_by_name() instead it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Kuninori Morimoto
93bc047d76 ASoC: simple-scu-card: is GPL v2
It is indicating that this driver is GPL v2 on top of C code.
Let's fixup it on MODULE_LICENSE()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Kuninori Morimoto
5496ca5c65 ASoC: simple-scu-card: remove unused definitions
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:21:39 +01:00
Nicolin Chen
38d16f7916 ASoC: rt5659: Enable IRQ output for GPIO1 pin
Since it's possible to have an IRQ without enabling JD3, the
GPIO1 pin then would remain its default GPIO function which
is set as an input direction (seeing from rt5659). Meanwhile,
CPU would also listen this connection via its own GPIO input:
      [input]          [input]
    CPU GPIO <--------> RT5659 GPIO1

The result for the IRQ on the CPU side will be unexpectable.

So this patch enables the IRQ output for GPIO1 pin any way
as long as there's an IRQ assigned from platform data or DT:
      [input]          [IRQ output]
    CPU GPIO <--------< RT5659 GPIO1

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:10:21 +01:00
Nicolin Chen
c614a31287 ASoC: tegra_rt5640: Correct a copy and paste typo in the comments
This patch corrects a copy and paste typo.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:06:31 +01:00
Axel Lin
ec10396477 ASoC: nau8810: Fix memory leak in nau8810_eq_put error path
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:06:14 +01:00
Chen-Yu Tsai
a3930ed060 ASoC: dapm: Fix kcontrol creation for output driver widget
Commit d88429a695 ("ASoC: dapm: Add output driver widget") added
the snd_soc_dapm_out_drv ID for the output driver widget, which is
the same as the PGA widget, with a later power sequence number.

Commit 19a2557b76 ("ASoC: dapm: Add kcontrol support for PGAs")
then added kcontrol support for PGA widgets, but failed to account
for output driver widgets. Attempts to use kcontrols with output
driver widgets result in silent failures, with the developer having
little idea about what went on.

Add snd_soc_dapm_out_drv to the switch/case block under snd_soc_dapm_pga
in dapm_create_or_share_kcontrol, since they are essentially the same.

Fixes: 19a2557b76 (ASoC: dapm: Add kcontrol support for PGAs)
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:05:24 +01:00
Chen-Yu Tsai
071133a209 ASoC: dapm: Fix value setting for _ENUM_DOUBLE MUX's second channel
The value for the second channel in _ENUM_DOUBLE (double channel) MUXs
is not correctly updated, due to using the wrong bit shift.

Use the correct bit shift, so both channels toggle together.

Fixes: 3727b49684 (ASoC: dapm: Consolidate MUXs and value MUXs)
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:05:24 +01:00
Chen-Yu Tsai
01ad5e7de6 ASoC: dapm: Fix possible uninitialized variable in snd_soc_dapm_get_volsw()
If soc_dapm_read() fails, val will be uninitialized, and bogus values
will be written later:

	ret = soc_dapm_read(dapm, reg, &val);
	val = (val >> shift) & mask;

However, the compiler does not give a warning. Return on error before
val is really used to avoid this.

This is similar to the commit 6912831623 ("ASoC: dapm: Fix
uninitialized variable in snd_soc_dapm_get_enum_double()")

Fixes: ce0fc93ae5 (ASoC: Add DAPM support at the component level)
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:05:18 +01:00
Colin Ian King
3fb7b4e488 ASoC: hdac_hdmi: fix spelling mistake "montior" -> "monitor"
Trivial fix to spelling mistake in dev_warn message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:02:19 +01:00
Colin Ian King
ab387b4008 ASoC: wm8962: fix spelling mistake "mesurement" -> "measurement"
Trivial fix to spelling mistake in dev_err message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:01:41 +01:00
Arnd Bergmann
f506513ad8 ASoC: rockchip: use SPI dependency for rt5514
The rk3399 scans the spi_bus_type to find the rt5514 driver, but does not
actually have a Kconfig dependency on SPI, so we can end up with a link
failure:

sound/soc/codecs/snd-soc-rt5514-spi.o: In function `rt5514_spi_driver_init':
rt5514-spi.c:(.init.text+0x14): undefined reference to `__spi_register_driver'
sound/soc/codecs/snd-soc-rt5514-spi.o: In function `rt5514_spi_burst_read':
rt5514-spi.c:(.text.rt5514_spi_burst_read+0x18c): undefined reference to `spi_sync'
sound/soc/codecs/snd-soc-rt5514-spi.o: In function `rt5514_spi_burst_write':
rt5514-spi.c:(.text.rt5514_spi_burst_write+0x1b4): undefined reference to `spi_sync'
sound/soc/rockchip/snd-soc-rk3399-gru-sound.o: In function `rockchip_sound_probe':
rk3399_gru_sound.c:(.text.rockchip_sound_probe+0x128): undefined reference to `spi_bus_type'

This adds the missing dependency.

Fixes: c6eac8a36a (ASoC: rockchip: Add machine driver for RK3399 GRU Boards)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:01:14 +01:00
Nicolas Iooss
61ab0d403b ASoC: Intel: Atom: add a missing star in a memcpy call
In sst_prepare_and_post_msg(), when a response is received in "block",
the following code gets executed:

    *data = kzalloc(block->size, GFP_KERNEL);
    memcpy(data, (void *) block->data, block->size);

The memcpy() call overwrites the content of the *data pointer instead of
filling the newly-allocated memory (which pointer is hold by *data).
Fix this by merging kzalloc+memcpy into a single kmemdup() call.

Thanks Joe Perches for suggesting using kmemdup()

Fixes: 60dc8dbacb ("ASoC: Intel: sst: Add some helper functions")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2016-09-01 20:59:10 +01:00
Jaswinder Jassal
189f06c031 ASoC: core: fix shift used for second item in snd_soc_get_enum_double
Incorrect shift value was being used to extract the second item.

Signed-off-by: Jaswinder Jassal <jjassal@opensource.wolfsonmicro.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 20:58:05 +01:00
Peter Ujfalusi
9be072a6f9 ASoC: davinci-mcasp: off-by-one in davinci_mcasp_hw_rule_format()
The SNDRV_PCM_FORMAT_LAST is valid, we should not skip it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 20:56:30 +01:00
Christophe JAILLET
2961d6707c ASoC: omap-pcm: off-by-one in 'omap_pcm_limit_supported_formats'
When calling 'snd_pcm_format_physical_width', SNDRV_PCM_FORMAT_LAST is a
valid value, so don't skip it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 20:56:16 +01:00
Julia Lawall
f802d6c020 ASoC: constify snd_soc_codec_driver structures
Check for snd_soc_codec_driver structures that are only passed to
snd_soc_register_codec or memcpy (2nd arg), for which the corresponding
parameters are declared const.  Declare as const snd_soc_codec_driver
structures that have these properties.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_soc_codec_driver i@p = { ... };

@ok@
identifier r.i;
expression e1,e2,e3;
position p;
@@
(
snd_soc_register_codec(e1,&i@p,e2,e3)
|
memcpy(e1,&i@p,e2)
)

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_soc_codec_driver i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 20:55:31 +01:00
Richard Leitner
904a987345 ASoC: sgtl5000: add headphone and LINEOUT mute controls
These controls mute/unmute the LINEOUT and headphone outputs of SGTL5000
using its CHIP_ANA_CTRL register.

Signed-off-by: Richard Leitner <dev@g0hl1n.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 20:52:53 +01:00
Harsha Priya
de34dcfe70 ASoC: Intel: Atom: Fix message handling during drop stream
If a stream is being dropped, the period_elapsed received then after
need not be processed. Processing of the period_elapsed message causes
a time out in drop stream response processing. This patch adds a condition
to skip period_elapsed message processing if the stream is in INIT state.

Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Signed-off-by: Naveen M <naveen.m@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 20:52:13 +01:00
Nariman Poushin
c9991052ae ASoC: arizona: Don't change the FLLn_GAIN before entering FREERUN
When reclocking an active FLL, to ensure a clean transition, do
not change the gain setting until we have entered free run.

Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-30 17:54:48 +01:00
Mark Brown
cfb89f2e75 Merge remote-tracking branches 'asoc/fix/max98371', 'asoc/fix/nau8825', 'asoc/fix/omap', 'asoc/fix/samsung', 'asoc/fix/simple' and 'asoc/fix/wm2000' into asoc-linus 2016-08-24 19:05:25 +01:00
Mark Brown
e8f0f8aa4e Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/compress', 'asoc/fix/da7213' and 'asoc/fix/debugfs' into asoc-linus 2016-08-24 19:05:22 +01:00
Mark Brown
d520519518 Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus 2016-08-24 19:05:21 +01:00
Mark Brown
a74306fe94 Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus 2016-08-24 19:05:20 +01:00
Mark Brown
b5db6c57c9 Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus 2016-08-24 19:05:18 +01:00
Wei Yongjun
fd61576fdd ASoC: samsung: i2s: Add missing clk_disable_unprepare() on error in samsung_i2s_probe()
Add the missing clk_disable_unprepare() before return
from samsung_i2s_probe() in the error handling case.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 12:38:02 +01:00
Kuninori Morimoto
d12c6216c4 ASoC: rsrc-card: rename rsrc-card to simple-scu-card phase3
rsrc-card which is using DPCM feature was created for Renesas sound.
But not only Renesas, but many SoC can use this driver, because
it is based on simple-card driver.
To use it as more open driver, rsrc-card will be renamed to
simple-scu-card. In order to easy patch review, as 3rd step,
this patch moves rsrc-card driver to generic folder.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 11:19:16 +01:00
Kuninori Morimoto
64df0e6842 ASoC: rsrc-card: rename rsrc-card to simple-scu-card phase2
rsrc-card which is using DPCM feature was created for Renesas sound.
But not only Renesas, but many SoC can use this driver, because
it is based on simple-card driver.
To use it as more open driver, rsrc-card will be renamed to
simple-scu-card. In order to easy patch review, as 2nd step,
this patch adds new compatible "simple-scu-audio-card";

rcar-card used specific property, not "simple-audio-card",
but it should be now. Actually, rsrc-card is upstreamed driver,
but noone is using it on upstream. The user is only local,
and it is only me. Thus, there is no compatible break by this patch.
This patch uses "simple-audio-card" prefix.
And it removes rcar-card specifix compatible too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 11:19:16 +01:00
Kuninori Morimoto
53e682b600 ASoC: rsrc-card: rename rsrc-card to simple-scu-card phase1
rsrc-card which is using DPCM feature was created for Renesas sound.
But not only Renesas, but many SoC can use this driver, because
it is based on simple-card driver.
To use it as more open driver, rsrc-card will be renamed to
simple-scu-card. In order to easy patch review, as 1st step,
this patch renames "rsrc" function prefix to "asoc_simple".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 11:19:16 +01:00
Kuninori Morimoto
a323593830 ASoC: rsrc-card: remove board specific compatible
rsrc-card has board specific compatible (= lager/koelsh), but these were
created as 1st prototype, and it is used in my test environment only.
Now normal user can use generic compatible (= renesas,rsrc-card).
Removing these board specific compatible doesn't breake compatibility.
This patch remove these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 11:19:16 +01:00
Mark Brown
79e79e2ebc Merge branch 'topic/simple' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rcar 2016-08-24 11:19:08 +01:00
Peter Robinson
702650bda0 ASoC: sunxi: depend on ARCH_SUNXI
Depend on ARCH_SUNXI or COMPILE_TEST as it doesn't make sense to enable
these if the appropriate SoC they're embedded in isn't enabled.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 10:41:15 +01:00
Wei Yongjun
687df1ad84 ASoC: omap-abe-twl6040: Use devm_snd_soc_register_card()
Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 10:32:48 +01:00
Mark Brown
f6ccdc44dd Merge branch 'fix/omap' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-omap 2016-08-24 10:32:41 +01:00
Colin Ian King
e56375155e ASoC: tas5086: fix typo: "Inavlid" -> "Invalid"
trivial typo fix in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-24 10:11:55 +01:00
Shreyas NC
541070cec4 ASoC: Intel: Skylake: Parse manifest data
Topology manifest has lib names and lib count info. So,
define tokens to represent module private data and parse
these tokens to fill up the manifest structure in the driver
accordingly.

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-08-23 12:35:45 +01:00
Peter Ujfalusi
a871967068 ASoC: omap-mcpdm: Fix irq resource handling
Fixes: ddd17531ad ("ASoC: omap-mcpdm: Clean up with devm_* function")

Managed irq request will not doing any good in ASoC probe level as it is
not going to free up the irq when the driver is unbound from the sound
card.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reported-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-23 12:00:47 +01:00
John Hsu
78822e36dc ASoC: nau8810: fix compile warning in loopback switch control
Thank Stephen Rothwell for the message.
The patch is to fix the following compile error.

sound/soc/codecs/nau8810.c:441:3: error: initialization from incompatible
pointer type [-Werror=incompatible-pointer-types]
SND_SOC_DAPM_SWITCH("Digital Loopback", SND_SOC_NOPM, 0, 0,
&nau8810_loopback),
^
sound/soc/codecs/nau8810.c:441:3: note: (near initialization for
'nau8810_dapm_widgets[11].kcontrol_news')

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-23 11:40:19 +01:00
Mengdong Lin
f918e1697b ASoC: topology: ABI - Add sig_bits to stream caps
Kernel struct snd_soc_pcm_stream, SoC PCM stream information, needs this
field. Although current topology users don't configure this, we define it
for future extension.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-22 18:55:30 +01:00
Shreyas NC
33ece7f9c8 ASoC: Intel: Skylake: Remove dfw config and associated structures
The skl_dfw_config structure is no longer required as the module
config is populated by parsing and reading the token values.

So, remove the structure.

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-08-22 18:44:11 +01:00
Shreyas NC
6277e83292 ASoC: Intel: Skylake: Parse vendor tokens to build module data
Skl topology data is preceded by a descriptor for number of data
blocks, the size of the data block and type of data block. The
type of the data block can be either a tuple or a binary blob.

Private data is parsed based on data block type and module data
is filled accordingly.

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-08-22 18:44:11 +01:00
John Hsu
b6970b48e3 ASoC: nau8810: Add driver for Nuvoton codec chip NAU88C10
The driver is for codec NAU88C10 of Nuvoton Technology Corporation.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-22 17:48:11 +01:00
Wei Yongjun
209c721ce2 ASoC: max98371: Add terminate entry for i2c_device_id tables
Make sure i2c_device_id tables are NULL terminated.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-22 17:33:04 +01:00
Fabio Estevam
f3d8ac8c4a ASoC: fsl_asrc: Use np variable
The 'np' variable is already assigned to 'pdev->dev.of_node', so use
it to improve readability.

No functional change.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19 16:27:38 +01:00
Xing Zheng
e5abe95954 ASoC: rockchip: Add support rt5514 dsp summy dailink
This patch can attach automaticlly rt5514 spi DAI with driver name "rt5514"
in the snd_soc_find_dai process. Turn this feature on, we can enable the
voice wake up via rt5514 dsp for RK3399 Gru Boards.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19 16:23:42 +01:00
Fabio Estevam
32101d00ac ASoC: fsl_asrc: Remove unneeded driver registration message
There is no need to announce that the driver has been successfully
probed, so remove the unneeded message.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19 15:20:05 +01:00
Fabio Estevam
c029695085 ASoC: fsl_asrc: Propagate the real error code
Instead of returning -EINVAL on error, return the real error code.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19 15:20:05 +01:00
Peter Ujfalusi
21eb45db28 ASoC: omap-abe-twl6040: Correct dmic-codec device registration
The dmic-codec was registered within the platform_driver's probe function,
which can cause deferred probe to run in loops as reported and analyzed by
Russell King.

Use module_init/exit in the driver and handle the dmic-codec device
registration and removal at that level instead of the platform_driver
probe/remove.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19 15:18:43 +01:00
Mark Brown
d1e8142882 ASoC: core: Clean up DAPM before the card debugfs
Both the card and DAPM cleanups recursively delete their debugfs
directories.  Since the DAPM debugfs subdirectory for the card is
located within the card debugfs this means we end up trying to double
free the DAPM subdirectory.  Reorder the cleanup to free the card
debugfs after we've cleaned up DAPM and it has deleted its own
subdirectory.

Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
Tested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-19 10:17:26 +01:00
Peter Ujfalusi
479e2a86dc ASoC: omap-mcpdm: Drop pdmclk clock handling
This reverts commit 65aca64d05.

The patches for twl6040 MFD and clk missed the merge window and
causing the McPDM driver to never probe since it is put back to
the deferred list because the missing drivers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-18 16:00:25 +01:00
Colin Ian King
84ccd63686 ASoC: Intel: sst: fix ix spelling mistake: "capablities" -> "capabilites"
trivial fix to spelling mistake in dev_err message and reformat code
to avoid being over 80 chars wide per line

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-18 09:56:49 +01:00
Fabio Estevam
6ea9c7ddd9 ASoC: fsl_sai: Use 'np' variable
The 'np' variable is already assigned to 'pdev->dev.of_node', so use
it to improve readability.

No functional change.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-17 11:50:51 +01:00
Pierre-Louis Bossart
8f98307d02 ASoC: Intel: bytcr_rt5640: quirk for Acer Aspire SWS-012
Baytrail-CR platform needing SSP0-AIF1 routing
Also fix SSP0 while we are at it.

Suggested-by: Andrei Lavreniyuk <andy.lavr@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-17 10:32:11 +01:00
Pierre-Louis Bossart
cac17731df ASoC: Intel: atom: fix 0-day warnings
spurious __initconst copy/pasted from other drivers

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-17 10:32:11 +01:00
Peter Meerwald-Stadler
032ca4a76f ASoC: atmel-pdmic: Fix typos in comments and error messages
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Songjun Wu <songjun.wu@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-16 16:07:53 +01:00
Peter Meerwald-Stadler
c804600057 ASoC: dapm: Fix typos in comment
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-16 16:07:41 +01:00
Markus Elfring
408ef7e180 ASoC: max98371: Delete unnecessary assignment for the field "owner"
The field "owner" is set by the core.
Thus delete an unneeded initialisation.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-16 12:29:42 +01:00
Christoph Huber
3e103a6551 ASoC: atmel_ssc_dai: Don't unconditionally reset SSC on stream startup
commit cbaadf0f90 ("ASoC: atmel_ssc_dai: refactor the startup and
shutdown") refactored code such that the SSC is reset on every
startup; this breaks duplex audio (e.g. first start audio playback,
then start record, causing the playback to stop/hang)

Fixes: cbaadf0f90 (ASoC: atmel_ssc_dai: refactor the startup and shutdown)
Signed-off-by: Christoph Huber <c.huber@bct-electronic.com>
Signed-off-by: Peter Meerwald-Stadler <p.meerwald@bct-electronic.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2016-08-16 12:29:10 +01:00
Charles Keepax
b0f12c61de ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
After we have called dpcm_path_get we should make sure to call
dpcm_path_put on all error paths. This was not happening causing the
allocated widget list to be leaked, this patch corrects this by adding a
dpcm_path_put to the error path.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-16 11:52:31 +01:00
Pierre-Louis Bossart
d7e60d52ac ASoC: Intel: bytcr_rt5640: log quirks
use dev_info to provide better support for autodetection
and DMI-based quirks, no functional changes

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:15:18 +01:00
Pierre-Louis Bossart
ec1c90e777 ASoC: Intel: bytcr_rt5640: Add quirk for Teclast X98 Air 3G tablet
Add DMI-based quirk, routing from SSP0 to AIF1 is not very
usual

Suggested-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:15:13 +01:00
Irina Tirdea
0565e773c2 AsoC: Intel: Add quirks for MinnowBoard MAX
I2S MCLK has been routed to LSE connector on the MinnowBoard
starting with HW version 3. Older versions of the board do
not have MCLK wired.

Add dmi quirk to disable MCLK for MinnowBoard MAX (v2).

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Irina Tirdea
df1a2776a7 ASoC: Intel: bytcr_rt5640: add MCLK support
Use platform clocks "pmc_plt_clk_3" when MCLK quirk is defined.
By default always enable the 19.2 MHz PLL.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
59e8b6520c ASoC: Intel: bytcr_rt5640: add IN3 map
Some platforms have the analog mic connected to IN3,
add route accordingly

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
e214f5e78a ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR
Auto routing based on Baytrail/Baytrail-CR detection

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
038a50e735 ASoC: Intel: bytcr_rt5640: fix dai/clock setup for SSP0 routing
SSP0 uses 16 bits 2ch, SSP2 24 bits 2ch

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
f47088d5ae ASoC: Intel: bytcr_rt56040: additional routing quirks
Allow for all possible combinations of SSP0,SSP2, AIF1, AIF2
combination (only one at a time)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
89b8907ce2 ASoC: Intel: bytcr_rt5640: add SSP2_AIF2 routing
Add quirk to model routing on Baytrail-CR devices

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
a3f10de184 ASoC: Intel: atom: enable configuration of SSP0
Existing code used SSP2, make selection of SSP id
dependent on port name. This is required when the
machine driver uses non-default settings

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
3d240d73df ASoC: Intel: Atom: add definitions for modem/SSP0 interface
The Atom DPCM driver only allowed for the SSP2 interface, add
definitions for modem/SSP0.

These definitions might be used to route audio to a codec
connected to SSP0 (instead of a modem in traditional usages),
but there is a restriction to 2ch I2S. SSP2 is capable of
handling up to 4 slot TDM.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
a68bc0d43e ASoC: Intel: Atom: auto-detection of Baytrail-CR
BYT-CR needs special handling to deal with BIOS issues.
For some reason the IPC interrupt index is also modified from
the Baytrail-T reference.

Use PUNIT BIOS config bits to infer platform details.
Assume regular Baytrail configs if status is incorrect or
CONFIG_IOSF_MBI is not enabled.

SSP0 routing issues are solved without dedicated firmware
in following patches

Tested on Asus T100TA and T100TAF.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
5d98f58fd6 ASoC: Intel: bytcr_rt5640: enable differential mic quirk
Some Baytrail-CR devices rely on analog mics connected with
differential pairs and not the single-ended default
Add quirk and enable it for T00TAF

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
68817cdb3b ASoC: Intel: bytcr_rt5640: quirk for mono speaker
Some Baytrail devices only have a mono speaker, add quirk and enable
it for T100TAF.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Pierre-Louis Bossart
73442e3ccb ASoC: Intel: bytcr-rt5640: add Asus T100TAF quirks
Add quirk based on DMI string matching
Also fix matching to use DMI_EXACT_MATCH otherwise T100TA and T100TAF
will be using same quirk

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:14:57 +01:00
Mark Brown
0c0d539e33 Merge branch 'topic/rt5640' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2016-08-15 15:12:00 +01:00
Pierre-Louis Bossart
c49aed77d5 ASoC: rt5640: add internal clock source support
Adding missing definitions and flags to select internal
clock source as system clock, needed for jack detection.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15 15:09:09 +01:00
Marcel Ziswiler
04445681f7 ASoC: tegra: add tegra sgtl5000 machine driver
This binding and driver describe/support playback to headphones, and
capture from line-in and microphone.

This driver is useful for the Toradex Apalis T30, Apalis TK1 and
Colibri T30 modules.

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-12 13:36:54 +01:00
Wei Yongjun
979cf59acc ASoC: Intel: Skylake: Fix error return code in skl_probe()
Fix to return error code -ENODEV from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 87b2bdf022 ("ASoC: Intel: Skylake: Initialize NHLT table")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-By: Vinod Koul <vinod.kou@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-12 13:29:12 +01:00
Marcus Cooper
2f6963cb52 ASoC: sunxi: compatibility for sun6i to SPDIF
The A31 SoC uses the same SPDIF block as found in earlier SoCs, but its
reset is controlled via a separate reset controller.

The DMA also complains when the maxburst is set to 4 so it's been adjusted
to 8 which suites both the older and newer SoCs.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-12 12:00:34 +01:00
Peter Ujfalusi
4e85e7776e ASoC: omap-mcbsp: Enable TX/RX under and overflow interrupts
FIFO under or overflow can cause channel swaps and data loss. Reporting
them can help to identify such events.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-12 11:58:39 +01:00
Wei Yongjun
8ae3ea48df ASoC: topology: Fix error return code in soc_tplg_dapm_widget_create()
Fix to return error code -ENOMEM instead of 0 when failed to create
widget, as done elsewhere in this function.

Fixes: 8a9782346d ("ASoC: topology: Add topology core")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:26:08 +01:00
Wei Yongjun
61743bfaf0 ASoC: atmel-pdmic: add missing clk_disable_unprepare() on error in atmel_pdmic_cpu_dai_startup()
Add the missing clk_disable_unprepare() before return from
atmel_pdmic_cpu_dai_startup() in the error handling case.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:25:50 +01:00
Baoyou Xie
1d9d0c65d9 ASoC: fix W=1 build warnings
We get 1 warning about global functions without a declaration
in the ASoC sub-system when building with W=1:

sound/soc/sh/rcar/core.c:113:6: warning: no previous prototype for 'rsnd_mod_make_sure' [-Wmissing-prototypes]
 void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type)

In this case, the function 'rsnd_mod_make_sure' is declared in rsnd.h file,
but it only valid if the macro DEBUG is claimed.

so the implementation of function 'rsnd_mod_make_sure' need be
held by macro DEBUG.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:02:49 +01:00
Baoyou Xie
22e766146a ASoC: mediatek: mark symbols static where possible
We get 2 warnings about global functions without a declaration
in the ASoC mediatek module when building with W=1:

sound/soc/mediatek/common/mtk-afe-fe-dai.c:26:5: warning: no previous prototype for 'mtk_regmap_update_bits' [-Wmissing-prototypes]
 int mtk_regmap_update_bits(struct regmap *map, int reg, unsigned int mask,
         ^
sound/soc/mediatek/common/mtk-afe-fe-dai.c:34:5: warning: no previous prototype for 'mtk_regmap_write' [-Wmissing-prototypes]
 int mtk_regmap_write(struct regmap *map, int reg, unsigned int val)

In fact, all of those functions are only used in the file in which
they are declared and don't need a declaration, but can be made static.

so this patch marks it 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:02:28 +01:00
Baoyou Xie
6b0ffacdaf ASoC: atmel-pdmic: mark symbols static where possible
We get 1 warning about global functions without a declaration
in the ASoC atmel-pdmic driver when building with W=1:
sound/soc/atmel/atmel-pdmic.c:286:5: warning: no previous prototype for 'pdmic_get_mic_volsw' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is declared
and don't need a declaration, but can be made static.
so this patch marks it 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:02:16 +01:00
Charles Keepax
19c891924b ASoC: arizona: Connect ASRCs to both clock domains
The two clock domains are enabled based on each input and output of the
chip being connected to its respective clock domain. The ASRC however
can bridge the two domains and as such can function as an input/output
to either domain. The hardware also requires that both clocks are
enabled before the ASRC is. Ensure these constraints by linking the
ASRCs to both SYSCLK and ASYNCCLK.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:01:28 +01:00
Charles Keepax
fa54aade53 ASoC: wm2000: Fix return of uninitialised varible
Anything that sets ret in wm2000_anc_transition will have immediately
returned anyway as such we will always return an uninitialised ret at the
bottom of the function. Simply replace the return with a return 0;

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:01:02 +01:00
Charles Keepax
70fcad495b ASoC: Fix leak of rtd in soc_bind_dai_link
If we fail to find a platform we simply return EPROBE_DEFER,
but we have allocated the rtd pointer. All error paths before
soc_add_pcm_runtime need to call soc_free_pcm_runtime first to
avoid leaking the rtd pointer. A suitable error path already
exists and is used else where in the function so simply use that
here as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-11 15:00:44 +01:00
Kuninori Morimoto
239486baee ASoC: rsrc-card: use asoc_simple_card_clean_reference()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto
885fc0595a ASoC: simple-card: use asoc_simple_card_clean_reference()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto
0f4e0711b7 ASoC: simple-card-utils: add asoc_simple_card_clean_reference()
simple-card needs to decrease the reference count of the device nodes.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto
27b010815b ASoC: rsrc-card: use asoc_simple_card_canonicalize_cpu()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto
16f1de6f36 ASoC: simple-card: use asoc_simple_card_canonicalize_cpu()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Kuninori Morimoto
983cebd602 ASoC: simple-card-utils: add asoc_simple_card_canonicalize_cpu()
simple-card needs remove dai_link->cpu_dai_name if it CPU was
single DAI.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 21:03:25 +01:00
Vinod Koul
a657ae7e5c ASoC: Intel: Skylake: remove module id query at runtime
Now that we have balanced loading of the topology file and split of init
and fw_init and fill module data during asoc probe.

So remove it from runtime, but keep error check in case things fall apart.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 18:54:05 +01:00
Vinod Koul
64cb1d0ad0 ASoC: Intel: Skylake: Populate modules after loading
Once topology and firmware are loaded, we can parse the manifest. Use driver
pipe and widget list to get list of all modules and populate the data.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 18:54:05 +01:00
Dharageswari R
0556ba463b ASoC: Intel: Skylake: modify snd_skl_get_module_info args
snd_skl_get_module_info() takes skl_dfw_module as an argument. The users
then updates the topology data, so instead pass skl_module_cfg and let
snd_skl_get_module_info() fill that up.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-10 18:54:05 +01:00
Kuninori Morimoto
a09f383ef7 ASoC: rsrc-card: use asoc_simple_card_canonicalize_dailink()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto
600ee20855 ASoC: rsrc-card: use asoc_simple_card_init_dai()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto
c958374f1c ASoC: simple-card: use asoc_simple_card_canonicalize_dailink()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto
c262c9ab7a ASoC: simple-card-utils: add asoc_simple_card_canonicalize_dailink()
simple-card is assuming that sometimes platform and cpu are same.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto
d8cb9354c8 ASoC: simple-card: use asoc_simple_card_init_dai()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Kuninori Morimoto
21ba62f849 ASoC: simple-card-utils: add asoc_simple_card_init_dai()
simple-card is supporting clock/tdm slot initialization.
This patch makes this method simple style standard.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 12:43:55 +01:00
Mark Brown
da74273c49 Merge branch 'topic/hda-link-time' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-intel 2016-08-09 12:34:51 +01:00
Kuninori Morimoto
6adcbdcd4b ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata()
snd_soc_pcm_set_drvdata() will set driver data to rtd->dev,
but driver data of rtd->dev is already used as "rtd" on
soc_post_component_init().

	static int soc_post_component_init(xxx)
	{
		...
		dev_set_drvdata(rtd->dev, rtd);
		...
	}

To remove confusion, snd_soc_pcm_set/get_drvdata() should be
removed soon. This patch is for it.

qcom/lpass-platform.c sets struct lpass_pcm_data to rtd->dev today,
but we can replace it to struct lpass_data :: private_data.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-09 10:38:21 +01:00
Vinod Koul
ec8ae5703d ALSA: convert users to core bus_parse_capabilities
Now that we have the bus parse capabilities moved to core, we need to
convert users.

The SKL driver and HDA extended lib needs to converted in single patch,
otherwise we regress on the functionality.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-09 08:53:56 +02:00
Adam Thomson
72dce36892 ASoC: da7218: Improve driver efficiency with regards to MCLK usage
Currently MCLK remains enabled during bias STANDBY state, and this
is not necessary. This patch updates the code to handle enabling
and disabling of MCLK, if provided, when moving between STANDBY
and PREPARE states, therefore saving power when no active streams
present.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 15:57:07 +01:00
Adam Thomson
8799af0d82 ASoC: da7218: Remove 32KHz PLL mode from driver
Functionality has been removed in latest silicon variants. This
patch removes the feature from the driver to align.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 15:57:07 +01:00
Kuninori Morimoto
2c452dd8af ASoC: codec duplicated callback function goes to component on wm9713
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00
Kuninori Morimoto
3123e54b34 ASoC: codec duplicated callback function goes to component on wm9712
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00
Kuninori Morimoto
2fa1f30af9 ASoC: codec duplicated callback function goes to component on wm9705
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00
Kuninori Morimoto
216cf784dd ASoC: codec duplicated callback function goes to component on wm9081
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00
Kuninori Morimoto
38addd95b8 ASoC: codec duplicated callback function goes to component on wm8998
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00
Kuninori Morimoto
4df0f6203e ASoC: codec duplicated callback function goes to component on wm8997
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00
Kuninori Morimoto
efee13aa36 ASoC: codec duplicated callback function goes to component on wm8996
codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 11:57:57 +01:00