1
0
Fork 0
Commit Graph

25700 Commits (b2e2c85091710159b305735d557f4ef4695f5dff)

Author SHA1 Message Date
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
Vegard Nossum 11749e086b ALSA: timer: fix NULL pointer dereference in read()/ioctl() race
I got this with syzkaller:

    ==================================================================
    BUG: KASAN: null-ptr-deref on address 0000000000000020
    Read of size 32 by task syz-executor/22519
    CPU: 1 PID: 22519 Comm: syz-executor Not tainted 4.8.0-rc2+ #169
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2
    014
     0000000000000001 ffff880111a17a00 ffffffff81f9f141 ffff880111a17a90
     ffff880111a17c50 ffff880114584a58 ffff880114584a10 ffff880111a17a80
     ffffffff8161fe3f ffff880100000000 ffff880118d74a48 ffff880118d74a68
    Call Trace:
     [<ffffffff81f9f141>] dump_stack+0x83/0xb2
     [<ffffffff8161fe3f>] kasan_report_error+0x41f/0x4c0
     [<ffffffff8161ff74>] kasan_report+0x34/0x40
     [<ffffffff82c84b54>] ? snd_timer_user_read+0x554/0x790
     [<ffffffff8161e79e>] check_memory_region+0x13e/0x1a0
     [<ffffffff8161e9c1>] kasan_check_read+0x11/0x20
     [<ffffffff82c84b54>] snd_timer_user_read+0x554/0x790
     [<ffffffff82c84600>] ? snd_timer_user_info_compat.isra.5+0x2b0/0x2b0
     [<ffffffff817d0831>] ? proc_fault_inject_write+0x1c1/0x250
     [<ffffffff817d0670>] ? next_tgid+0x2a0/0x2a0
     [<ffffffff8127c278>] ? do_group_exit+0x108/0x330
     [<ffffffff8174653a>] ? fsnotify+0x72a/0xca0
     [<ffffffff81674dfe>] __vfs_read+0x10e/0x550
     [<ffffffff82c84600>] ? snd_timer_user_info_compat.isra.5+0x2b0/0x2b0
     [<ffffffff81674cf0>] ? do_sendfile+0xc50/0xc50
     [<ffffffff81745e10>] ? __fsnotify_update_child_dentry_flags+0x60/0x60
     [<ffffffff8143fec6>] ? kcov_ioctl+0x56/0x190
     [<ffffffff81e5ada2>] ? common_file_perm+0x2e2/0x380
     [<ffffffff81746b0e>] ? __fsnotify_parent+0x5e/0x2b0
     [<ffffffff81d93536>] ? security_file_permission+0x86/0x1e0
     [<ffffffff816728f5>] ? rw_verify_area+0xe5/0x2b0
     [<ffffffff81675355>] vfs_read+0x115/0x330
     [<ffffffff81676371>] SyS_read+0xd1/0x1a0
     [<ffffffff816762a0>] ? vfs_write+0x4b0/0x4b0
     [<ffffffff82001c2c>] ? __this_cpu_preempt_check+0x1c/0x20
     [<ffffffff8150455a>] ? __context_tracking_exit.part.4+0x3a/0x1e0
     [<ffffffff816762a0>] ? vfs_write+0x4b0/0x4b0
     [<ffffffff81005524>] do_syscall_64+0x1c4/0x4e0
     [<ffffffff810052fc>] ? syscall_return_slowpath+0x16c/0x1d0
     [<ffffffff83c3276a>] entry_SYSCALL64_slow_path+0x25/0x25
    ==================================================================

There are a couple of problems that I can see:

 - ioctl(SNDRV_TIMER_IOCTL_SELECT), which potentially sets
   tu->queue/tu->tqueue to NULL on memory allocation failure, so read()
   would get a NULL pointer dereference like the above splat

 - the same ioctl() can free tu->queue/to->tqueue which means read()
   could potentially see (and dereference) the freed pointer

We can fix both by taking the ioctl_lock mutex when dereferencing
->queue/->tqueue, since that's always held over all the ioctl() code.

Just looking at the code I find it likely that there are more problems
here such as tu->qhead pointing outside the buffer if the size is
changed concurrently using SNDRV_TIMER_IOCTL_PARAMS.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02 15:13:08 +02:00
Julia Lawall 8c91d7d09e ALSA: bt87x: 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>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:51:03 +02:00
Julia Lawall bc9a910b15 ALSA: oxygen: 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>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:50:42 +02:00
Julia Lawall d602efcaf5 ALSA: ad1889: 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: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:50:24 +02:00
Julia Lawall 5116ffc32d ALSA: firewire: 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>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:50:11 +02:00
Julia Lawall 6769e988b0 ALSA: 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: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:49:10 +02:00
Julia Lawall 9d5262ae9b ALSA: cs5535audio: 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: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:48:56 +02: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
Colin Ian King 16f0f01d4f ALSA: cs46xx: fix typo "seconadry" -> "secondary"
Trivial fix to typos dev_dbg messages and comment.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-01 14:21:53 +02:00
Takashi Sakamoto 6b1ca4bcad ALSA: fireworks: accessing to user space outside spinlock
In hwdep interface of fireworks driver, accessing to user space is in a
critical section with disabled local interrupt. Depending on architecture,
accessing to user space can cause page fault exception. Then local
processor stores machine status and handles the synchronous event. A
handler corresponding to the event can call task scheduler to wait for
preparing pages. In a case of usage of single core processor, the state to
disable local interrupt is worse because it don't handle usual interrupts
from hardware.

This commit fixes this bug, performing the accessing outside spinlock. This
commit also gives up counting the number of queued response messages to
simplify ring-buffer management.

Reported-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Cc: stable@vger.kernel.org
Fixes: 555e8a8f7f14('ALSA: fireworks: Add command/response functionality into hwdep interface')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-31 16:17:15 +02:00
Takashi Sakamoto 04b2d9c9c3 ALSA: firewire-tascam: accessing to user space outside spinlock
In hwdep interface of firewire-tascam driver, accessing to user space is
in a critical section with disabled local interrupt. Depending on
architecture, accessing to user space can cause page fault exception. Then
local processor stores machine status and handle the synchronous event. A
handler corresponding to the event can call task scheduler to wait for
preparing pages. In a case of usage of single core processor, the state to
disable local interrupt is worse because it doesn't handle usual interrupts
from hardware.

This commit fixes this bug, by performing the accessing outside spinlock.

Reported-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Cc: stable@vger.kernel.org
Fixes: e5e0c3dd257b('ALSA: firewire-tascam: add hwdep interface')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-31 14:24:37 +02:00
Takashi Sakamoto 4127e80a93 ALSA: seq: initialize whole fields of automatic variable with union type
Currently, automatic variable of 'union ioctl_arg' type is initialized
by designated initialization. Although, the actual effect is interpretation
of early element of int type and initialization of 'int pversion'.
Therefore the first field corresponding to int type is initialized to zero.
This is against my expectation to initialize whole fields.

This commit uses memset() to initialize the variable, instead of designated
initialization.

Fixes: 04a56dd8ed ('ALSA: seq: change ioctl command operation to get data in kernel space')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-31 14:09:05 +02: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
Kai-Heng Feng fd06c77eb9 ALSA: hda - Enable subwoofer on Dell Inspiron 7559
The subwoofer on Inspiron 7559 was disabled originally.
Applying a pin fixup to node 0x1b can enable it and make it work.

Old pin: 0x411111f0
New pin: 0x90170151

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-30 09:41:05 +02:00
Shrirang Bagul 311042d1b6 ALSA: hda - Add headset mic quirk for Dell Inspiron 5468
This patch enables headset microphone on some variants of
Dell Inspiron 5468. (Dell SSID 0x07ad)

BugLink: https://bugs.launchpad.net/bugs/1617900
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-30 07:45:43 +02:00
Ken Lin 83d9956b7e ALSA: usb-audio: Add sample rate inquiry quirk for B850V3 CP2114
Avoid getting sample rate on B850V3 CP2114 as it is unsupported and
causes noisy "current rate is different from the runtime rate" messages
when playback starts.

Signed-off-by: Ken Lin <ken.lin@advantech.com.tw>
Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-29 16:49:18 +02:00
Vegard Nossum 8ddc05638e ALSA: timer: fix NULL pointer dereference on memory allocation failure
I hit this with syzkaller:

    kasan: CONFIG_KASAN_INLINE enabled
    kasan: GPF could be caused by NULL-ptr deref or user memory access
    general protection fault: 0000 [#1] PREEMPT SMP KASAN
    CPU: 0 PID: 1327 Comm: a.out Not tainted 4.8.0-rc2+ #190
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    task: ffff88011278d600 task.stack: ffff8801120c0000
    RIP: 0010:[<ffffffff82c8ba07>]  [<ffffffff82c8ba07>] snd_hrtimer_start+0x77/0x100
    RSP: 0018:ffff8801120c7a60  EFLAGS: 00010006
    RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000007
    RDX: 0000000000000009 RSI: 1ffff10023483091 RDI: 0000000000000048
    RBP: ffff8801120c7a78 R08: ffff88011a5cf768 R09: ffff88011a5ba790
    R10: 0000000000000002 R11: ffffed00234b9ef1 R12: ffff880114843980
    R13: ffffffff84213c00 R14: ffff880114843ab0 R15: 0000000000000286
    FS:  00007f72958f3700(0000) GS:ffff88011aa00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000603001 CR3: 00000001126ab000 CR4: 00000000000006f0
    Stack:
     ffff880114843980 ffff880111eb2dc0 ffff880114843a34 ffff8801120c7ad0
     ffffffff82c81ab1 0000000000000000 ffffffff842138e0 0000000100000000
     ffff880111eb2dd0 ffff880111eb2dc0 0000000000000001 ffff880111eb2dc0
    Call Trace:
     [<ffffffff82c81ab1>] snd_timer_start1+0x331/0x670
     [<ffffffff82c85bfd>] snd_timer_start+0x5d/0xa0
     [<ffffffff82c8795e>] snd_timer_user_ioctl+0x88e/0x2830
     [<ffffffff8159f3a0>] ? __follow_pte.isra.49+0x430/0x430
     [<ffffffff82c870d0>] ? snd_timer_pause+0x80/0x80
     [<ffffffff815a26fa>] ? do_wp_page+0x3aa/0x1c90
     [<ffffffff8132762f>] ? put_prev_entity+0x108f/0x21a0
     [<ffffffff82c870d0>] ? snd_timer_pause+0x80/0x80
     [<ffffffff816b0733>] do_vfs_ioctl+0x193/0x1050
     [<ffffffff813510af>] ? cpuacct_account_field+0x12f/0x1a0
     [<ffffffff816b05a0>] ? ioctl_preallocate+0x200/0x200
     [<ffffffff81002f2f>] ? syscall_trace_enter+0x3cf/0xdb0
     [<ffffffff815045ba>] ? __context_tracking_exit.part.4+0x9a/0x1e0
     [<ffffffff81002b60>] ? exit_to_usermode_loop+0x190/0x190
     [<ffffffff82001a97>] ? check_preemption_disabled+0x37/0x1e0
     [<ffffffff81d93889>] ? security_file_ioctl+0x89/0xb0
     [<ffffffff816b167f>] SyS_ioctl+0x8f/0xc0
     [<ffffffff816b15f0>] ? do_vfs_ioctl+0x1050/0x1050
     [<ffffffff81005524>] do_syscall_64+0x1c4/0x4e0
     [<ffffffff83c32b2a>] entry_SYSCALL64_slow_path+0x25/0x25
    Code: c7 c7 c4 b9 c8 82 48 89 d9 4c 89 ee e8 63 88 7f fe e8 7e 46 7b fe 48 8d 7b 48 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 84 c0 7e 65 80 7b 48 00 74 0e e8 52 46
    RIP  [<ffffffff82c8ba07>] snd_hrtimer_start+0x77/0x100
     RSP <ffff8801120c7a60>
    ---[ end trace 5955b08db7f2b029 ]---

This can happen if snd_hrtimer_open() fails to allocate memory and
returns an error, which is currently not checked by snd_timer_open():

    ioctl(SNDRV_TIMER_IOCTL_SELECT)
     - snd_timer_user_tselect()
	- snd_timer_close()
	   - snd_hrtimer_close()
	      - (struct snd_timer *) t->private_data = NULL
        - snd_timer_open()
           - snd_hrtimer_open()
              - kzalloc() fails; t->private_data is still NULL

    ioctl(SNDRV_TIMER_IOCTL_START)
     - snd_timer_user_start()
	- snd_timer_start()
	   - snd_timer_start1()
	      - snd_hrtimer_start()
		- t->private_data == NULL // boom

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-29 09:06:15 +02:00
Vegard Nossum 6b760bb2c6 ALSA: timer: fix division by zero after SNDRV_TIMER_IOCTL_CONTINUE
I got this:

    divide error: 0000 [#1] PREEMPT SMP KASAN
    CPU: 1 PID: 1327 Comm: a.out Not tainted 4.8.0-rc2+ #189
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    task: ffff8801120a9580 task.stack: ffff8801120b0000
    RIP: 0010:[<ffffffff82c8bd9a>]  [<ffffffff82c8bd9a>] snd_hrtimer_callback+0x1da/0x3f0
    RSP: 0018:ffff88011aa87da8  EFLAGS: 00010006
    RAX: 0000000000004f76 RBX: ffff880112655e88 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffff880112655ea0 RDI: 0000000000000001
    RBP: ffff88011aa87e00 R08: ffff88013fff905c R09: ffff88013fff9048
    R10: ffff88013fff9050 R11: 00000001050a7b8c R12: ffff880114778a00
    R13: ffff880114778ab4 R14: ffff880114778b30 R15: 0000000000000000
    FS:  00007f071647c700(0000) GS:ffff88011aa80000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000603001 CR3: 0000000112021000 CR4: 00000000000006e0
    Stack:
     0000000000000000 ffff880114778ab8 ffff880112655ea0 0000000000004f76
     ffff880112655ec8 ffff880112655e80 ffff880112655e88 ffff88011aa98fc0
     00000000b97ccf2b dffffc0000000000 ffff88011aa98fc0 ffff88011aa87ef0
    Call Trace:
     <IRQ>
     [<ffffffff813abce7>] __hrtimer_run_queues+0x347/0xa00
     [<ffffffff82c8bbc0>] ? snd_hrtimer_close+0x130/0x130
     [<ffffffff813ab9a0>] ? retrigger_next_event+0x1b0/0x1b0
     [<ffffffff813ae1a6>] ? hrtimer_interrupt+0x136/0x4b0
     [<ffffffff813ae220>] hrtimer_interrupt+0x1b0/0x4b0
     [<ffffffff8120f91e>] local_apic_timer_interrupt+0x6e/0xf0
     [<ffffffff81227ad3>] ? kvm_guest_apic_eoi_write+0x13/0xc0
     [<ffffffff83c35086>] smp_apic_timer_interrupt+0x76/0xa0
     [<ffffffff83c3416c>] apic_timer_interrupt+0x8c/0xa0
     <EOI>
     [<ffffffff83c3239c>] ? _raw_spin_unlock_irqrestore+0x2c/0x60
     [<ffffffff82c8185d>] snd_timer_start1+0xdd/0x670
     [<ffffffff82c87015>] snd_timer_continue+0x45/0x80
     [<ffffffff82c88100>] snd_timer_user_ioctl+0x1030/0x2830
     [<ffffffff8159f3a0>] ? __follow_pte.isra.49+0x430/0x430
     [<ffffffff82c870d0>] ? snd_timer_pause+0x80/0x80
     [<ffffffff815a26fa>] ? do_wp_page+0x3aa/0x1c90
     [<ffffffff815aa4f8>] ? handle_mm_fault+0xbc8/0x27f0
     [<ffffffff815a9930>] ? __pmd_alloc+0x370/0x370
     [<ffffffff82c870d0>] ? snd_timer_pause+0x80/0x80
     [<ffffffff816b0733>] do_vfs_ioctl+0x193/0x1050
     [<ffffffff816b05a0>] ? ioctl_preallocate+0x200/0x200
     [<ffffffff81002f2f>] ? syscall_trace_enter+0x3cf/0xdb0
     [<ffffffff815045ba>] ? __context_tracking_exit.part.4+0x9a/0x1e0
     [<ffffffff81002b60>] ? exit_to_usermode_loop+0x190/0x190
     [<ffffffff82001a97>] ? check_preemption_disabled+0x37/0x1e0
     [<ffffffff81d93889>] ? security_file_ioctl+0x89/0xb0
     [<ffffffff816b167f>] SyS_ioctl+0x8f/0xc0
     [<ffffffff816b15f0>] ? do_vfs_ioctl+0x1050/0x1050
     [<ffffffff81005524>] do_syscall_64+0x1c4/0x4e0
     [<ffffffff83c32b2a>] entry_SYSCALL64_slow_path+0x25/0x25
    Code: e8 fc 42 7b fe 8b 0d 06 8a 50 03 49 0f af cf 48 85 c9 0f 88 7c 01 00 00 48 89 4d a8 e8 e0 42 7b fe 48 8b 45 c0 48 8b 4d a8 48 99 <48> f7 f9 49 01 c7 e8 cb 42 7b fe 48 8b 55 d0 48 b8 00 00 00 00
    RIP  [<ffffffff82c8bd9a>] snd_hrtimer_callback+0x1da/0x3f0
     RSP <ffff88011aa87da8>
    ---[ end trace 6aa380f756a21074 ]---

The problem happens when you call ioctl(SNDRV_TIMER_IOCTL_CONTINUE) on a
completely new/unused timer -- it will have ->sticks == 0, which causes a
divide by 0 in snd_hrtimer_callback().

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-29 09:05:49 +02:00
Takashi Iwai a820cd3d25 ASoC: Fixes for v4.8
A clutch of fixes for v4.8.  These are mainly driver specific, the most
 notable ones being those for OMAP which fix a series of issues that
 broke boot on some platforms there when deferred probe kicked in.
 There's also one core fix for an issue when unbinding a card which for
 some reason had managed to not manifest until recently.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXvxOuAAoJECTWi3JdVIfQA4oH/ic3TRw9RB1gLgkBrjZshk+v
 07H9eGIbnblYnvq4Y3l3IYb+F9UhdbR5SS7neE7zf0ufVBzxNMJpI+r7qSDsx9m0
 L8HVpKXRYMtQs85tSzrxFgtezvlEGOZq2ojgQOfRJfM+AhBwJaAydKjVZByG/UOS
 4c0AQZRTT1B2ATyF+oW2U221swKFhMqG2lhLvVTSWmmp7oOdpmOcNRdPEeLF/0Pv
 yK3jH1zgulKabbsFebcK1173RwiQh940bFFZiCp4+AxglaufrtFw4UKYv1zHl8ww
 goQ+yeCOsxvhj/tBm1x9rwfXBMGw85o9I/DlNfTJOnXyTDkXN05QP6BrJWNuiO4=
 =5rCd
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v4.8

A clutch of fixes for v4.8.  These are mainly driver specific, the most
notable ones being those for OMAP which fix a series of issues that
broke boot on some platforms there when deferred probe kicked in.
There's also one core fix for an issue when unbinding a card which for
some reason had managed to not manifest until recently.
2016-08-25 17:56:09 +02:00
Aaro Koskinen 34b64e5ebf ALSA: snd-aoa: enable sound on PowerBook G4 12"
Enable sound on PowerBook G4 12".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-25 16:48:54 +02: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
Mark Brown ae16842306 Merge remote-tracking branch 'asoc/fix/core' into asoc-linus 2016-08-24 19:05:17 +01:00
Takashi Sakamoto e15c282eff ALSA: bebob: unify configurations for some models produced by Yamaha/Terratec
The below models were developed with a cooperation by Yamaha and Terratec.
 - Yamaha GO 44/Terratec PHASE 24 FW
 - Yamaha GO 46/Terratec PHASE X24 FW

They have the same configurations, thus it's better to unify corresponding
codes.

This commit merges them to reduce the amount of maintained codes.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-24 15:35:11 +02:00
Takashi Sakamoto df6a886611 ALSA: bebob: rename file with vendor-dependent code so that it's for Yamaha/Terratec
Once Yamaha and Terratec cooperated to develop some audio and music units
on IEEE 1394 bus. On these models, the same embedded board is used, and
similar configurations are also applied.

This commit renames file for Yamaha's configuration so that it's for both
of Yamaha and Terratec.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-24 15:35:03 +02: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
Anisse Astier abaa227481 ALSA: hda/realtek - fix headset mic detection for MSI MS-B120
MSI Cubi MS-B120 needs the same fixup as the Gigabyte BXBT-2807 for its
mic to work.

They both use a single 3-way jack for both mic and headset with an
ALC283 codec, with the same pins used.

Cc: Daniel Drake <drake@endlessm.com>
Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-24 10:19:54 +02: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
Colin Ian King 07cb3272af ALSA: hdspm: fix spelling mistake "Externel" -> "External"
Trivial fix to spelling mistake in dev_warn message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 14:07:10 +02:00
Markus Elfring c2f14ba749 ALSA: compress: Use memdup_user() rather than duplicating its implementation
Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 14:04:18 +02:00
Shawn Lin 1bc00f32b8 ALSA: usb-audio: rmove print for failure of kmalloc
kmalloc already print similar error once failing to alloc
enough memory, so let's remove this dump here.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:41:02 +02:00
Daniel Mack 36e1ac3cf8 ALSA: usb: fine-tune Tenor error compensation value
Users of devices affected by the Tenor feedback data error report
buffer underruns, even with the +/- 0x1.0000 quirk applied.
Compensating the error with 0xf000 instead seems to reliably fix
that issue.

See

  https://sourceforge.net/p/alsa/mailman/message/35230259/

Reported-and-tested-by: Norman Nolte <norman.nolte@gmx.net>
Reported-and-tested-by: Thomas Gresens <T.Gresens@intershop.de>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:40:04 +02:00
Daniel Mack ca0dd2736a ALSA: usb: use TEAC UD-H01 quirk for more devices
The quirk seems to be necessary not only for TEAC UD-H01 devices, but to
more that are based on the Tenor 8802TL chipset. Devices built by T+A
are affected too, and they apparently all use the same USB PID:PID.

Extend the quirky handling for that device as well, and rename the
quirks flag.

Reported-and-tested-by: Thomas Gresens <T.Gresens@intershop.de>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:39:56 +02:00
Daniel Mack 9abc134167 ALSA: usb: move udh01_fb_quirk setting to quirks.c
That's a quirk, after all, so move it where to all the other quirks
live.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:39:42 +02:00
Andrej Krutak b027d11263 ALSA: line6: Fix POD sysfs attributes segfault
The commit 02fc76f6a changed base of the sysfs attributes from device to card.
The "show" callbacks dereferenced wrong objects because of this.

Fixes: 02fc76f6a7 ('ALSA: line6: Create sysfs via snd_card_add_dev_attr()')
Cc: <stable@vger.kernel.org> # v4.0+
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Andrej Krutak <dev@andree.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:37:31 +02:00
Andrej Krutak adc8a43a6d ALSA: line6: Give up on the lock while URBs are released.
Done, because line6_stream_stop() locks and calls line6_unlink_audio_urbs(),
which in turn invokes audio_out_callback(), which tries to lock 2nd time.

Fixes:

=============================================
[ INFO: possible recursive locking detected ]
4.4.15+ #15 Not tainted
---------------------------------------------
mplayer/3591 is trying to acquire lock:
 (&(&line6pcm->out.lock)->rlock){-.-...}, at: [<bfa27655>] audio_out_callback+0x70/0x110 [snd_usb_line6]

but task is already holding lock:
 (&(&line6pcm->out.lock)->rlock){-.-...}, at: [<bfa26aad>] line6_stream_stop+0x24/0x5c [snd_usb_line6]

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(&line6pcm->out.lock)->rlock);
  lock(&(&line6pcm->out.lock)->rlock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by mplayer/3591:
 #0:  (snd_pcm_link_rwlock){.-.-..}, at: [<bf8d49a7>] snd_pcm_stream_lock+0x1e/0x40 [snd_pcm]
 #1:  (&(&substream->self_group.lock)->rlock){-.-...}, at: [<bf8d49af>] snd_pcm_stream_lock+0x26/0x40 [snd_pcm]
 #2:  (&(&line6pcm->out.lock)->rlock){-.-...}, at: [<bfa26aad>] line6_stream_stop+0x24/0x5c [snd_usb_line6]

stack backtrace:
CPU: 0 PID: 3591 Comm: mplayer Not tainted 4.4.15+ #15
Hardware name: Generic AM33XX (Flattened Device Tree)
[<c0015d85>] (unwind_backtrace) from [<c001253d>] (show_stack+0x11/0x14)
[<c001253d>] (show_stack) from [<c02f1bdf>] (dump_stack+0x8b/0xac)
[<c02f1bdf>] (dump_stack) from [<c0076f43>] (__lock_acquire+0xc8b/0x1780)
[<c0076f43>] (__lock_acquire) from [<c007810d>] (lock_acquire+0x99/0x1c0)
[<c007810d>] (lock_acquire) from [<c06171e7>] (_raw_spin_lock_irqsave+0x3f/0x4c)
[<c06171e7>] (_raw_spin_lock_irqsave) from [<bfa27655>] (audio_out_callback+0x70/0x110 [snd_usb_line6])
[<bfa27655>] (audio_out_callback [snd_usb_line6]) from [<c04294db>] (__usb_hcd_giveback_urb+0x53/0xd0)
[<c04294db>] (__usb_hcd_giveback_urb) from [<c046388d>] (musb_giveback+0x3d/0x98)
[<c046388d>] (musb_giveback) from [<c04647f5>] (musb_urb_dequeue+0x6d/0x114)
[<c04647f5>] (musb_urb_dequeue) from [<c042ac11>] (usb_hcd_unlink_urb+0x39/0x98)
[<c042ac11>] (usb_hcd_unlink_urb) from [<bfa26a87>] (line6_unlink_audio_urbs+0x6a/0x6c [snd_usb_line6])
[<bfa26a87>] (line6_unlink_audio_urbs [snd_usb_line6]) from [<bfa26acb>] (line6_stream_stop+0x42/0x5c [snd_usb_line6])
[<bfa26acb>] (line6_stream_stop [snd_usb_line6]) from [<bfa26fe7>] (snd_line6_trigger+0xb6/0xf4 [snd_usb_line6])
[<bfa26fe7>] (snd_line6_trigger [snd_usb_line6]) from [<bf8d47b7>] (snd_pcm_do_stop+0x36/0x38 [snd_pcm])
[<bf8d47b7>] (snd_pcm_do_stop [snd_pcm]) from [<bf8d462f>] (snd_pcm_action_single+0x22/0x40 [snd_pcm])
[<bf8d462f>] (snd_pcm_action_single [snd_pcm]) from [<bf8d46f9>] (snd_pcm_action+0xac/0xb0 [snd_pcm])
[<bf8d46f9>] (snd_pcm_action [snd_pcm]) from [<bf8d4b61>] (snd_pcm_drop+0x38/0x64 [snd_pcm])
[<bf8d4b61>] (snd_pcm_drop [snd_pcm]) from [<bf8d6233>] (snd_pcm_common_ioctl1+0x7fe/0xbe8 [snd_pcm])
[<bf8d6233>] (snd_pcm_common_ioctl1 [snd_pcm]) from [<bf8d6779>] (snd_pcm_playback_ioctl1+0x15c/0x51c [snd_pcm])
[<bf8d6779>] (snd_pcm_playback_ioctl1 [snd_pcm]) from [<bf8d6b59>] (snd_pcm_playback_ioctl+0x20/0x28 [snd_pcm])
[<bf8d6b59>] (snd_pcm_playback_ioctl [snd_pcm]) from [<c016714b>] (do_vfs_ioctl+0x3af/0x5c8)

Fixes: 63e20df1e5 ('ALSA: line6: Reorganize PCM stream handling')
Cc: <stable@vger.kernel.org> # v4.0+
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Andrej Krutak <dev@andree.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:37:16 +02:00
Andrej Krutak 7e4379eae0 ALSA: line6: Remove double line6_pcm_release() after failed acquire.
If there's an error, pcm is released in line6_pcm_acquire already.

Fixes: 247d95ee6d ('ALSA: line6: Handle error from line6_pcm_acquire()')
Cc: <stable@vger.kernel.org> # v4.0+
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Andrej Krutak <dev@andree.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:36:58 +02:00
Takashi Sakamoto e12ec251e4 ALSA: seq: obsolete change of address limit
Former commits change existent functions so that they don't handle data in
kernel space. Copying from/to userspace is done outside of the functions,
thus no need to change address limit of running task.

This commit obsoletes get_fs()/set_fs() and applies corresponding changes.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:11:05 +02:00
Takashi Sakamoto 04a56dd8ed ALSA: seq: change ioctl command operation to get data in kernel space
In previous commit, a new table for functions with data in kernel space
is added to replace current table.

This commit changes existent functions to fit the table. These functions
are added to the new table and removed from the old table.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:11:04 +02:00
Takashi Sakamoto 8ce8eb601c ALSA: seq: add an alternative way to handle ioctl requests
ALSA sequencer is designed with two types of clients; application and
kernel. Operations for each ioctl command should handle data in both of
user space and kernel space, while current implementation just allows them
to handle data in user space. Data in kernel space is handled with change
of address limit of running tasks.

This commit adds a new table to map ioctl commands to corresponding
functions. The functions get data in kernel space. Helper functions to
operate kernel and application clients seek entries from the table.
Especially, the helper function for application is responsible for coping
from user space to kernel space or vise versa.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:11:03 +02:00
Takashi Sakamoto 77dfa8d319 ALSA: seq: add documentation for snd_seq_kernel_client_ctl
This kernel API is used by kernel implementation. Currently, it's used for
kernel clients of ALSA sequencer, while it can be used for application
clients. The difference is just on address spaces of argument. In short,
this kernel API can be available for application client with data in kernel
space.

This commit adds a document about this.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-22 11:11:02 +02: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
Wolfram Sang 289ef67908 ALSA: usb: caiaq: audio: don't print error when allocating urb fails
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-11 23:05:57 +02: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
Takashi Iwai a52ff34e5e ALSA: hda - Manage power well properly for resume
For SKL and later Intel chips, we control the power well per codec
basis via link_power callback since the commit [03b135cebc47: ALSA:
hda - remove dependency on i915 power well for SKL].
However, there are a few exceptional cases where the gfx registers are
accessed from the audio driver: namely the wakeup override bit
toggling at (both system and runtime) resume.  This seems causing a
kernel warning when accessed during the power well down (and likely
resulting in the bogus register accesses).

This patch puts the proper power up / down sequence around the resume
code so that the wakeup bit is fiddled properly while the power is
up.  (The other callback, sync_audio_rate, is used only in the PCM
callback, so it's guaranteed in the power-on.)

Also, by this proper power up/down, the instantaneous flip of wakeup
bit in the resume callback that was introduced by the commit
[033ea349a7cd: ALSA: hda - Fix Skylake codec timeout] becomes
superfluous, as snd_hdac_display_power() already does it.  So we can
clean it up together.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96214
Fixes: 03b135cebc ('ALSA: hda - remove dependency on i915 power well for SKL')
Cc: <stable@vger.kernel.org> # v4.2+
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-10 15:05:17 +02: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
Takashi Iwai 8355aaf6d3 Merge branch 'topic/hda-link-time' into for-next 2016-08-09 08:55:31 +02:00
Guneshwor Singh bfcba288b9 ALSA - hda: Add support for link audio time reporting
The HDA controller from SKL onwards support additional timestamp
reporting of the link time. The link time is read from HW
registers and converted to audio values.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-09 08:53:56 +02:00
Guneshwor Singh 50279d9b5f ALSA - hda: Add support for parsing new HDA capabilities
Skylake onwards HDA controller supports new capabilities like
Global Time Stamping (GTS) capability. So add support to parse
these new capabilities.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
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
Vinod Koul 404735c9fd ALSA - Ext hda: remove bus_parse_capabilities
Remove the unused one as we have moved it up to hdac core.

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
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
Vinod Koul 6720b38420 ALSA: hda - move bus_parse_capabilities to core
HDA capability introduced recently are move to hdac core so that it can
be used by legacy driver as well. Also move the capability pointers up
to hdac_bus object.

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
Vittorio Gambaletta (VittGam) 41f5e3bdbf ALSA: usb-audio: Add quirk for ELP HD USB Camera
The ELP HD USB Camera (05a3:9420) needs this quirk for suppressing
the unsupported sample rate inquiry.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98481
Cc: <stable@vger.kernel.org>
Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-09 08:49:18 +02:00
Piotr Karasinski 7627e40c66 ALSA: usb-audio: Add a sample rate quirk for Creative Live! Cam Socialize HD (VF0610)
VF0610 does not support reading the sample rate which leads to many
lines of "cannot get freq at ep 0x82". This patch adds the USB ID
(0x041E:4080) to snd_usb_get_sample_rate_quirk() list.

Signed-off-by: Piotr Karasinski <peter.karasinski@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-09 08:46:40 +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
Kuninori Morimoto af84d1c4dd ASoC: codec duplicated callback function goes to component on wm8995
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 4664b5e2bf ASoC: codec duplicated callback function goes to component on wm8991
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 0b71b898ff ASoC: codec duplicated callback function goes to component on wm8990
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 11f851f563 ASoC: codec duplicated callback function goes to component on wm8988
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 c79dc99cda ASoC: codec duplicated callback function goes to component on wm8983
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 d792e7b678 ASoC: codec duplicated callback function goes to component on wm8971
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 5e731b7e3b ASoC: codec duplicated callback function goes to component on wm8961
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 11f473eab1 ASoC: codec duplicated callback function goes to component on wm8955
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 90a60b06f4 ASoC: codec duplicated callback function goes to component on wm8940
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 496360f5a8 ASoC: codec duplicated callback function goes to component on wm8900
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 f56531d019 ASoC: codec duplicated callback function goes to component on wm8782
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 59b06efb23 ASoC: codec duplicated callback function goes to component on wm8727
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 7b5deb2d62 ASoC: codec duplicated callback function goes to component on wm8400
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 667a806906 ASoC: codec duplicated callback function goes to component on wm8350
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 098c075693 ASoC: codec duplicated callback function goes to component on wm5110
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 4214c34605 ASoC: codec duplicated callback function goes to component on wm5102
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 99a95b23a2 ASoC: codec duplicated callback function goes to component on wm5100
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 b68f37aa2e ASoC: codec duplicated callback function goes to component on wm2200
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 bd22e11e1b ASoC: codec duplicated callback function goes to component on wm2000
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 c6c0a21400 ASoC: codec duplicated callback function goes to component on wm1250-ev1
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