Commit Graph

445 Commits

Author SHA1 Message Date
Dan Carpenter b5c745fb75 ASoC: core: double free in snd_soc_add_platform()
There are three callers for this function, and none of them want it to
free platform for them.  It leads to a double free.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-22 11:00:05 +01:00
Takashi Iwai ef866ac0c2 ASoC: Final updates for v3.11
A few final updates:
 
  - A couple of additional bug fixes for the AC'97 refactoring.
  - Some fixes for the ADAU1701 driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJR0Ug0AAoJELSic+t+oim9WrkP+wb/5kcco7gsPqJAZLscl3iM
 RYnHMbssOpPprWttmgR6dk7nws9Q5x2tIDD07sir0u/3493JLNPuhutKib42w/yw
 A9v1nY3PaXww4YyFBr81nhqP1ntk4iNx0Xeh/sEGbs7z717xkDGeLazvKtqwxhSj
 FcJdexhPc2RNRvh9E1dXGC1Ipxz7tkJRglyYwzx+cCBwfSKrGLhGJhg4MuGsMv6A
 oZXDQLZZhgzOnWA4gC9NwY11u2J0DOk3e4zqwvv6IZFLRX+gIf+V6gJEwT8UECtl
 It/JGlRvwaw+tBHR5cHT90yFDiLXjbUa9A2/GExBk1qfw4p3fWD1lG/XFqu/M/rf
 MW+XNfPwadCo4m57o1BJedlpfK3XBnPOUxVDwTOH/yVdUfMcnePd5M3ZtqLM8GU1
 k66BWN7XZxQKZHXCdehGWpkXhMudIdFzwMkrA3hd9H7mvCoQcV/mvcCs4vCcI6Qc
 VnfSj6l8XGtXhSYVR1QPwBLgu0tie6iA/FO/TrzhI9vc0SYdtd9uOuAmm1EVHlYy
 aE76eJBFLdwoHVjcLUGQU03M7MZn0gGF1LCP1ix/XS7sj/IBr2tch9UZoOgXn0gt
 IxKSRVF1cQlY2dXYhGtTISFdKUGdW7IXVG2PsXP7eLFLzVon5vVDnSfQ0fyKy3IY
 VvtusZXKJ1bIXYOu4Olt
 =ZS3l
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Final updates for v3.11

A few final updates:

 - A couple of additional bug fixes for the AC'97 refactoring.
 - Some fixes for the ADAU1701 driver.
2013-07-01 11:23:13 +02:00
Kevin Hilman f74b5e253a ASoC: ac97: fixup multi-platform AC'97 module build failure
commit b047e1cc (ASoC: ac97: Support multi-platform AC'97) introduced
some build failures for modules wanting to access the generic
soc_ac97_ops.  For example:

ERROR: "soc_ac97_ops" [sound/soc/codecs/snd-soc-wm9712.ko] undefined!

To fix, export soc_ac97_ops to modules.

Cc: Mark Brown <broonie@linaro.org>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-29 13:24:34 +01:00
Takashi Iwai accaf69da1 ASoC: More updates for v3.11
Some more fixes and enhancements, and also a bunch of refectoring for
 AC'97 support which enables more than one AC'97 controller driver to be
 built in.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRzXInAAoJELSic+t+oim9jBoQAJjGBiMyEyPv51CV5h2Cfo7c
 SGvoYwC+Q90fBsCLt4J/ei0rP+LUEbNUdnvs+xFeRiCqWHYs/d3/PeIZnuPMUQvZ
 VQOen7L1S+zd6mvDAr45LFmQOpAi74QkqRL1cwtuxWYeLJvFJwvYFTME6pYgjLi4
 HYAmZPZjMhOu3oNZmQIb+4Cmrf0/YbaIserI5kzHWd4b+pC8QCneBqvfwIaMowe0
 qBHw/bSB/haLTpjjbxZGw8NtnJyBvTT90ixgmv1akcZY/8NEh2bMIlzu52olNCci
 ZsCaS0HnjnICV7X5j6bBSjoqt7BQfXdQGFM7mbLn7BqW16MW/R0ONoSk1vE0RQQ0
 RGNYRA/X5yG4XReFE+93sHbJ2esGYnynwbykJd19DNFq0JRpdEpBUuudk8GsTEGh
 jsdh7YbRRGz1EUCxjiyMKiN7jHUhYGB9RRXjbR8Fo4GmTI1HHkOuv07gUfWr7v8F
 o2EcgvNdsEYtOrHP/Y7NCqkd7GkZOzDm3Xfp8Z5Wb81uKhJ3vbldvvUyjWBHrXLO
 Lzb2EACJYE8rqNN3FPsmNDBiuVlRrHeQQmtLL21lz5ZBK7b93+/NK44jN5OnNgU1
 D1PyErveZwogvtAUhZamx7FoZfnHxXQ4nNUWlLacBl3gRLrjzVqB8LQ9IdTyV1/V
 rqTrG1nTPJRCJLN0DLqq
 =UZaY
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: More updates for v3.11

Some more fixes and enhancements, and also a bunch of refectoring for
AC'97 support which enables more than one AC'97 controller driver to be
built in.
2013-06-28 13:36:22 +02:00
Mark Brown b047e1cce8 ASoC: ac97: Support multi-platform AC'97
Currently we can only have a single platform built in with AC'97 support
due to the use of a global variable to provide the bus operations. Fix
this by making that variable a pointer and having the bus drivers set the
operations prior to registering.

This is not a particularly good or nice approach but it avoids blocking
multiplatform and a real fix involves fixing the fairly deep problems
with AC'97 support - we should be converting it to a real bus.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-27 09:48:42 +01:00
Lars-Peter Clausen 2b58107435 ASoC: core: Use kasprintf instead of opencoding it
kasprintf calculates the size of the result string, allocates a buffer large
enough to hold the string and then performs the format string operation. There
are a couple of places in ASoC where these three steps are done by hand and
where kasprintf can be used instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-14 16:52:52 +04:00
Lars-Peter Clausen 90996f43b3 ASoC: core: Move snd_soc_set_runtime_hwparams() to soc-pcm.c
snd_soc_set_runtime_hwparams() is the only PCM related function that lives in
soc-core.c. All other PCM related functions live in soc-pcm.c, so move
snd_soc_set_runtime_hwparams() over as well for a bit more consistency.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-14 16:52:43 +04:00
Michał Mirosław 10e8aa9af1 ASoC: fix kernel message grepability
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-12 20:44:18 +04:00
Takashi Iwai 8dd2b66d1a ASoC: More updates for v3.10
The main additional change here is Lars-Peter's DMA work plus the
 platform conversions which have been tested - getting this in mainline
 will make life easier for development after the merge window.  These
 factor a large chunk of code out of the drivers for the platforms using
 dmaengine, greatly simplifying development.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRb/60AAoJELSic+t+oim9vL8P+wfaXRBGDtxhzMnTCf/cR2sc
 vlRnmSjA4s14vCoPffQJI0zaGLwDT5FnQtg6DAkP/8vXRoUz4Hgb0UwwDPiQNGED
 6Wmqm7mU+XGWgo4bPBA1e3Bt/9phVVO62rNPMNEnNqcp/Fa3RrdFAfxy4EUz9sKa
 lX4KJETCbIvLpOJmgq3H/WGtgYEnULHSCCNUQQ+fEY/VRQLsMtY5+tnZIJilMez0
 Ff6B084kE5oQpMsxdf89q8O5Uqc8lB0Xleluh0yQ1YZK3lxELMgr1Z7BkitysaJh
 uid+Ze8Vj2n5duI87OZcHN1Z2SibgTzqUwsd6YGCUKK3D3KVcSYgaYNn3zY09KNG
 tYlckAOJgVXqe1jedsfyuKTraz2JBY+jWYcIf8cRbwxxZpItG4Oj3idIBAKw+FrE
 /0DGqW7U9wXKx8pg7BH3dE6J6WVZ5uryaQX9d+nC8CGGjpcCla5L5jl/8stgGniW
 StTk4ETB6PP6iApv11p/7CXaTqXi+9UHmlcHFo11oQKiJFx4kG21DKQCXS0ycocM
 j0/gRGesWrVawYwJ86dhciUJjWlTHwproE/75i1JsTd3eRX6ybjBeNTTAI2ll/BJ
 BFDTS7tbX7GVcNbwXCvxW6pKOPpqV9jh0yMgpaB4jtkXOTKV/Z73ThPEql5w27c5
 OTBtONmiYeBcZGvgKQ3r
 =MXrq
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: More updates for v3.10

The main additional change here is Lars-Peter's DMA work plus the
platform conversions which have been tested - getting this in mainline
will make life easier for development after the merge window.  These
factor a large chunk of code out of the drivers for the platforms using
dmaengine, greatly simplifying development.
2013-04-18 16:24:31 +02:00
Mark Brown 753e23ea58 Linux 3.9-rc7
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQEcBAABAgAGBQJRa02/AAoJEHm+PkMAQRiGDRoH/08Cu2LpmX4VN+YMC3BkGWxn
 4oOHGqdN0hrIQ4TysC43QNL6g7QJUnIR6fChn7pRJ6a8ljdzKjDHr/tZSIPJE3Ns
 UAGIDaaQWnZvGmHPzpbo4gmdMOTxg9xmpgac6Qpk6QowPIPc6fhl6AichP9OdH2G
 Fp6Irfznn5ZCBldJYg2+umoHyFTZARCxtdOKmmUnB7zH0GaX5ZRf/R6nmZEPlxE+
 5qJC1yxRxJE+I7gjNRFovxaLPuAmjPy5j6NJuGP8rR6epkhcJ2EVHSliI3KDKAO6
 D3Fy9T5qHv2A2gvSxtC0m5/1WrutXZqxZ/DOB/uv9U7vqomiIs/EsHIuvc9qFBY=
 =NrST
 -----END PGP SIGNATURE-----

Merge tag 'v3.9-rc7' into asoc-dma

Linux 3.9-rc7
2013-04-17 14:24:35 +01:00
Lars-Peter Clausen 71a45cda44 ASoC: Add snd_soc_{add, remove}_platform
snd_soc_{add,remove}_platform are similar to snd_soc_register_platform and
snd_soc_unregister_platform with the difference that they won't allocate and
free the snd_soc_platform structure.

Also add snd_soc_lookup_platform which looks up a platform by the device it has
been registered for.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17 14:18:26 +01:00
Mark Brown 56c32c751c Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2013-04-12 13:56:58 +01:00
Mark Brown 1341962577 Merge remote-tracking branch 'asoc/topic/component' into asoc-next 2013-04-12 13:56:56 +01:00
Lars-Peter Clausen d79e57db84 ASoC: Constify the 'driver' field of snd_soc_platform
The ASoC core does no not modify the driver of a platform. Making it const
allows ASoC platform drivers to declare the snd_soc_platform_driver struct as
const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-27 23:08:35 +00:00
Stephen Warren 2e1cc199fc ASoC: export snd_soc_register_component
Without this, modules will fail to link against those symbols.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26 22:52:26 +00:00
Kuninori Morimoto f53179c026 ASoC: snd_soc_[un]register_dai[s]() become non global function
All drivers are using snd_soc_register_component()
instead of snd_soc_register_dai[s]()
snd_soc_[un]register_dai[s]() are no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26 21:57:54 +00:00
Kuninori Morimoto a1422b8cb4 ASoC: snd_soc_register_component() uses properly snd_soc_register_dai[s]()
snd_soc_register_dai()  uses fmt_single_name(), and
snd_soc_register_dais() uses fmt_multiple_name()
for dai->name which is used for name based matching.
This patch uses properly snd_soc_register_dai() it it was single driver,
and uses snd_register_dais() if it were multiple drivers.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-26 21:55:21 +00:00
Joonyoung Shim 0eaa6cca1f ASoC: core: Fix to check return value of snd_soc_update_bits_locked()
It can be 0 or 1 return value of snd_soc_update_bits_locked() when it is
success. So just check return value is negative.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
2013-03-26 14:10:02 +00:00
Silviu-Mihai Popescu f7ba716f1e ASoC: core: fix invalid free of devm_ allocated data
The objects allocated by devm_* APIs are managed by devres and are freed when
the device is detached. Hence there is no need to use kfree() explicitly.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-20 11:05:56 +01:00
Kuninori Morimoto 030e79f658 ASoC: add snd_soc_register_component()
Current ASoC has register function for platform/codec/dai/card,
but doesn't have for cpu.
It often produces confusion and fault on ASoC.

As result of ASoC community discussion,
we consider new struct snd_soc_component for CPU/CODEC,
and will switch over to use it.

This patch adds very basic struct snd_soc_component,
and register function for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-13 11:07:58 +00:00
Wei Yongjun e8b18addee ASoC: core: fix possible memory leak in snd_soc_bytes_put()
'data' is malloced in snd_soc_bytes_put() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-12 18:42:59 +00:00
Kuninori Morimoto e1328a832c ASoC: core: remove codec from list if registration failed
Current snd_soc_register_codec() adds codec to list, and calls
snd_soc_register_dais().
But, this listed codec should be removed if dais registration
was failed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-12 18:34:59 +00:00
Kuninori Morimoto 5acd7dfbd7 ASoC: core: use snd_soc_register_dais() on codec
snd_soc_register_dais() considers dai counts inside.
snd_soc_register_codec() does not need to care for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04 11:07:43 +08:00
Kuninori Morimoto f790b94d78 ASoC: core: tidyup snd_soc_register_codec() fail case
kfree() on snd_soc_register_codec() was summarized to one place.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-04 11:07:43 +08:00
Linus Torvalds 9043a2650c The sweeping change is to make add_taint() explicitly indicate whether to disable
lockdep, but it's a mechanical change.
 
 Cheers,
 Rusty.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRJAcuAAoJENkgDmzRrbjxsw0P/3eXb+LddYnx0V0uHYdKpCUf
 4vdW7X0fX3Z+aUK69IWRL/6ahoO4TpaHYGHBDjEoivyQ0GDq14X7JNWsYYt3LdMf
 3wmDgRc2cn/mZOJbFeVpNV8ox5l/xc0CUvV+iQ8tMjfQItXMXgWUFZKMECsXKSO6
 eex3lrw9M2jAX2uL8LQPp9W8xtKu24nSZRC6tH5riE/8fCzi1cZPPAqfxP5c8Lee
 ZXtbCRSyAFENZLpKyMe1PC7HvtJyi5NDn9xwOQiXULZV/VOlvP94DGBLIKCM/6dn
 4QvZxpG0P0uOlpCgRAVLyh/z7g4XY4VF/fHopLCmEcqLsvgD+V2LQpQ9zWUalLPC
 Z+pUpz2vu0gIddPU1nR8R6oGpEdJ8O12aJle62p/RSXWZGx12qUQ+Tamu0tgKcv1
 AsiJfbUGNDYfxgU6sHsoQjl2f68LTVckCU1C1LqEbW/S104EIORtGx30CHM4LRiO
 32kDC5TtgYDBKQAIqJ4bL48ZMh+9W3uX40p7xzOI5khHQjvswUKa3jcxupU0C1uv
 lx8KXo7pn8WT33QGysWC782wJCgJuzSc2vRn+KQoqoynuHGM6agaEtR59gil3QWO
 rQEcxH63BBRDgHlg4FM9IkJwwsnC3PWKL8gbX0uAWXAPMbgapJkuuGZAwt0WDGVK
 +GszxsFkCjlW0mK0egTb
 =tiSY
 -----END PGP SIGNATURE-----

Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module update from Rusty Russell:
 "The sweeping change is to make add_taint() explicitly indicate whether
  to disable lockdep, but it's a mechanical change."

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  MODSIGN: Add option to not sign modules during modules_install
  MODSIGN: Add -s <signature> option to sign-file
  MODSIGN: Specify the hash algorithm on sign-file command line
  MODSIGN: Simplify Makefile with a Kconfig helper
  module: clean up load_module a little more.
  modpost: Ignore ARC specific non-alloc sections
  module: constify within_module_*
  taint: add explicit flag to show whether lock dep is still OK.
  module: printk message when module signature fail taints kernel.
2013-02-25 15:41:43 -08:00
Mark Brown 556d8b55d0 Merge remote-tracking branch 'asoc/topic/of' into asoc-next 2013-02-11 11:06:38 +00:00
Mark Brown d289323286 Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2013-02-11 11:06:30 +00:00
Mark Brown da18396f94 ASoC: core: Allow digital mute for capture
Help avoid noise from the power up of the capture path propagating through
into the start of the recording (especially noise caused by the ramp of
microphone biases) by keeping the capture muted until after we've finished
powering things up with DAPM in the same manner we do for playback. This
allows us to take advantage of soft mute support in the hardware more
effectively and is more consistent.

The core code using the existing digital mute operation is updated to take
advantage of this. Some additional cases in the soc-pcm code and suspend
will need separate handling but these are less practically relevant than
the main runtime stream start/stop case.

Rather than refactor the digital mute function in every single driver a
new operation is added for drivers taking advantage of this functionality,
the old operation should be phased out over time.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2013-02-08 11:08:44 +00:00
Kuninori Morimoto 8c2d6a9f9c ASoC: clock gating is decided by bool on snd_soc_of_parse_daifmt()
ASoC clock gate settings are continuous/gated only.
This patch decides it as bool, then, gated clock will be default.
Special thanks to Stephen

Cc: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-30 16:42:31 +08:00
Kuninori Morimoto a7930ed458 ASoC: add snd_soc_of_parse_daifmt() for DeviceTree
This patch adds snd_soc_of_parse_daifmt() and supports below style on DT.

        [prefix]format = "i2c";
        [prefix]clock-gating = "continuous";
        [prefix]bitclock-inversion;
        [prefix]bitclock-master;
        [prefix]frame-master;

Each driver can use specific [prefix]
(ex simple-card,cpu,dai,format = xxx;)

This sample will be
SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CONT |
SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-27 11:41:54 +08:00
Mark Brown b5a8fe439a ASoC: core: Ensure SND_SOC_BYTES writes are from DMA safe memory
With some buses the transfers may DMAed, especially for larger blocks.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-21 17:49:52 +09:00
Rusty Russell 373d4d0997 taint: add explicit flag to show whether lock dep is still OK.
Fix up all callers as they were before, with make one change: an
unsigned module taints the kernel, but doesn't turn off lockdep.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-01-21 17:17:57 +10:30
Chuansheng Liu d3bf156125 ASoC: core: fix the memory leak in case of remove_aux_dev()
When probing aux_dev, initializing is as below:
device_initialize()
device_add()

So when remove aux_dev, we need do as below:
device_del()
device_put()
Otherwise, the rtd_release() will not be called.

So here using device_unregister() to replace device_del(),
like the action in soc_remove_link_dais().
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-27 16:14:43 +00:00
Chuansheng Liu 865df9cb12 ASoC: core: fix the memory leak in case of device_add() failure
After called device_initialize(), even device_add() returns
error, we still need use the put_device() to release the reference
to call rtd_release(), which will do the free() action.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-27 16:14:43 +00:00
Chuansheng Liu ff541f4b2a ASoC: core: giving WARN when device starting from non-off bias with idle_bias_off
Just found some cases that some codec drivers set the bias to _STANDBY and
set idle_bias_off to 1 during probing.
It will cause unpaired runtime_get_sync/put() issue. Also as Mark suggested,
there is no reason to start from _STANDBY bias with idle_bias_off == 1.

So here giving one warning when detected (dapm.idle_bias_off == 1) and
(dapm.bias_level != SND_SOC_BIAS_OFF) just after driver->probe().

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24 15:35:34 +00:00
Fabio Estevam 5db1bc1892 ASoC: soc-core: Remove unused 'ret' variable
commit 9bde4f0b1c (ASoC: core: Fix SOC_DOUBLE_RANGE() macros) introduced
the following build warning:

sound/soc/soc-core.c:2999:6: warning: unused variable 'ret' [-Wunused-variable]

Remove the unused 'ret' variable.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24 15:20:16 +00:00
Mark Brown 9bde4f0b1c ASoC: core: Fix SOC_DOUBLE_RANGE() macros
Although we've had macros defining double _RANGE controls for a while now
they've not actually been backed up properly by the implementation, it's
treated everything as mono. Fix that by implementing the handling in the
stereo controls, ensuring that the mono controls don't mistakenly get
treated as stereo.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-12-20 17:46:55 +00:00
Mark Brown 36adf15107 Merge remote-tracking branch 'asoc/topic/log' into asoc-next 2012-12-15 23:56:45 +09:00
Mark Brown c871bd0b2e ASoC: core: Fix splitting of log messages
Don't wrap log messages over multiple lines, it makes them hard to grep
for.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10 16:19:52 +09:00
Mark Brown 4301aecbdf Merge remote-tracking branch 'asoc/topic/log' into asoc-next 2012-12-10 00:22:14 +09:00
Liam Girdwood f110bfc7ac ASoC: core: Standardise ASoC messages
Currently ASoC has a mixture of message prefixes e.g. "ASoC", "asoc"
or none and message types e.g. pr_debug or dev_dbg.

Make sure all ASoC core messages use the same "ASoC" prefix and
convert any component device specific messages to use dev_dbg
instead of pr_debug.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-21 11:40:00 +09:00
Bill Pemberton f6e6574499 ASoC: remove use of __devinitconst
CONFIG_HOTPLUG is going away as an option so __devinitconst is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20 10:58:34 +09:00
Mukund Navada d055852ee8 ASoC: core: Double control update err for snd_soc_put_volsw_sx
snd_soc_put_volsw_sx function fails to update second control
if first control is updated by snd_soc_update_bits_locked.

Signed-off-by: Mukund Navada <navada@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
2012-11-09 16:32:05 +00:00
Linus Torvalds f5a246eab9 Sound updates for 3.7-rc1
This contains pretty many small commits covering fairly large range of
 files in sound/ directory.  Partly because of additional API support
 and partly because of constantly developed ASoC and ARM stuff.
 
 Some highlights:
 
 - Introduced the helper function and documentation for exposing the
   channel map via control API, as discussed in Plumbers; most of PCI
   drivers are covered, will follow more drivers later
 
 - Most of drivers have been replaced with the new PM callbacks (if
   the bus is supported)
 
 - HD-audio controller got the support of runtime PM and the support of
   D3 clock-stop.  Also changing the power_save option in sysfs kicks
   off immediately to enable / disable the power-save mode.
 
 - Another significant code change in HD-audio is the rewrite of
   firmware loading code.  Other than that, most of changes in HD-audio
   are continued cleanups and standardization for the generic auto
   parser and bug fixes (HBR, device-specific fixups), in addition to
   the support of channel-map API.
 
 - Addition of ASoC bindings for the compressed API, used by the
   mid-x86 drivers.
 
 - Lots of cleanups and API refreshes for ASoC codec drivers and
   DaVinci.
 
 - Conversion of OMAP to dmaengine.
 
 - New machine driver for Wolfson Microelectronics Bells.
 
 - New CODEC driver for Wolfson Microelectronics WM0010.
 
 - Enhancements to the ux500 and wm2000 drivers
 
 - A new driver for DA9055 and the support for regulator bypass mode.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQcpeWAAoJEGwxgFQ9KSmkpi4P/2etDDz5aEkEHNa1l4xEmFcm
 ymiGTgjaalqpUAVbM/gYx9G59EFMEbzUl1BHAqE5La4wO/v9lNPb+VrdUo+B+NZ7
 WSxIPWcNqdinSuoSqyYPjoPMVnhs3EMtNOqmf4jm1JOvdqA+4rO29xQVAqK/5Gfu
 LpMOyPiRi5ODnbQ1BOIWwpKICioY/mLwGJudK3z0i/fYVA7gLub20f+w+sOjKIA4
 wmwQAMTjAR798Cg/tVy4fQmf4SLw+c2nIgGe/PD+2gVlGXLNKBrJfMonHPTbmwKu
 lmJO/EtnijNOnpbn6up7ryUQ9cSoZAUZOfdIOgmAeQgQ/LWR0f+zf2IQehSPwrul
 g6hqOnQI2DNN7ugT3cYVbYnsh56TjyhnxhhxZgkapqh706QkqHGyKJNMRetzuXmP
 1O//MnZJrFQWd6sOKLlTL2ZzRvnxEJcNVGaE6bbwZTfQMtPeo9l1842uIq1dLUtG
 VxZb/svKUkMXv4is1dwUYUkpDsKxsgMEmabmuovceGf2N7jj/irkXgqxf6LWkaY1
 JQ7ZFWUJyDzEMXRaFfzdGO15T532CfB84wvFX5xoPMwMste2AA7QuybFBVstXhKu
 AtKNDgRJFUTlnLIxydpPBWdWH3UJdEaFwwsSfuNKI8OmmGKhWC/aP83k4hzueu9H
 KYLvY/0ObMSMqiwh/ndQ
 =uNqD
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This contains pretty many small commits covering fairly large range of
  files in sound/ directory.  Partly because of additional API support
  and partly because of constantly developed ASoC and ARM stuff.

  Some highlights:

   - Introduced the helper function and documentation for exposing the
     channel map via control API, as discussed in Plumbers; most of PCI
     drivers are covered, will follow more drivers later

   - Most of drivers have been replaced with the new PM callbacks (if
     the bus is supported)

   - HD-audio controller got the support of runtime PM and the support
     of D3 clock-stop.  Also changing the power_save option in sysfs
     kicks off immediately to enable / disable the power-save mode.

   - Another significant code change in HD-audio is the rewrite of
     firmware loading code.  Other than that, most of changes in
     HD-audio are continued cleanups and standardization for the generic
     auto parser and bug fixes (HBR, device-specific fixups), in
     addition to the support of channel-map API.

   - Addition of ASoC bindings for the compressed API, used by the
     mid-x86 drivers.

   - Lots of cleanups and API refreshes for ASoC codec drivers and
     DaVinci.

   - Conversion of OMAP to dmaengine.

   - New machine driver for Wolfson Microelectronics Bells.

   - New CODEC driver for Wolfson Microelectronics WM0010.

   - Enhancements to the ux500 and wm2000 drivers

   - A new driver for DA9055 and the support for regulator bypass mode."

Fix up various arm soc header file reorg conflicts.

* tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (339 commits)
  ALSA: hda - Add new codec ALC283 ALC290 support
  ALSA: hda - avoid unneccesary indices on "Headphone Jack" controls
  ALSA: hda - fix indices on boost volume on Conexant
  ALSA: aloop - add locking to timer access
  ALSA: hda - Fix hang caused by race during suspend.
  sound: Remove unnecessary semicolon
  ALSA: hda/realtek - Fix detection of ALC271X codec
  ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310
  ALSA: hda - make Realtek/Sigmatel/Conexant use the generic unsol event
  ALSA: hda - make a generic unsol event handler
  ASoC: codecs: Add DA9055 codec driver
  ASoC: eukrea-tlv320: Convert it to platform driver
  ALSA: ASoC: add DT bindings for CS4271
  ASoC: wm_hubs: Ensure volume updates are handled during class W startup
  ASoC: wm5110: Adding missing volume update bits
  ASoC: wm5110: Add OUT3R support
  ASoC: wm5110: Add AEC loopback support
  ASoC: wm5110: Rename EPOUT to HPOUT3
  ASoC: arizona: Add more clock rates
  ASoC: arizona: Add more DSP options for mixer input muxes
  ...
2012-10-09 07:07:14 +09:00
Linus Torvalds 033d9959ed Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue changes from Tejun Heo:
 "This is workqueue updates for v3.7-rc1.  A lot of activities this
  round including considerable API and behavior cleanups.

   * delayed_work combines a timer and a work item.  The handling of the
     timer part has always been a bit clunky leading to confusing
     cancelation API with weird corner-case behaviors.  delayed_work is
     updated to use new IRQ safe timer and cancelation now works as
     expected.

   * Another deficiency of delayed_work was lack of the counterpart of
     mod_timer() which led to cancel+queue combinations or open-coded
     timer+work usages.  mod_delayed_work[_on]() are added.

     These two delayed_work changes make delayed_work provide interface
     and behave like timer which is executed with process context.

   * A work item could be executed concurrently on multiple CPUs, which
     is rather unintuitive and made flush_work() behavior confusing and
     half-broken under certain circumstances.  This problem doesn't
     exist for non-reentrant workqueues.  While non-reentrancy check
     isn't free, the overhead is incurred only when a work item bounces
     across different CPUs and even in simulated pathological scenario
     the overhead isn't too high.

     All workqueues are made non-reentrant.  This removes the
     distinction between flush_[delayed_]work() and
     flush_[delayed_]_work_sync().  The former is now as strong as the
     latter and the specified work item is guaranteed to have finished
     execution of any previous queueing on return.

   * In addition to the various bug fixes, Lai redid and simplified CPU
     hotplug handling significantly.

   * Joonsoo introduced system_highpri_wq and used it during CPU
     hotplug.

  There are two merge commits - one to pull in IRQ safe timer from
  tip/timers/core and the other to pull in CPU hotplug fixes from
  wq/for-3.6-fixes as Lai's hotplug restructuring depended on them."

Fixed a number of trivial conflicts, but the more interesting conflicts
were silent ones where the deprecated interfaces had been used by new
code in the merge window, and thus didn't cause any real data conflicts.

Tejun pointed out a few of them, I fixed a couple more.

* 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (46 commits)
  workqueue: remove spurious WARN_ON_ONCE(in_irq()) from try_to_grab_pending()
  workqueue: use cwq_set_max_active() helper for workqueue_set_max_active()
  workqueue: introduce cwq_set_max_active() helper for thaw_workqueues()
  workqueue: remove @delayed from cwq_dec_nr_in_flight()
  workqueue: fix possible stall on try_to_grab_pending() of a delayed work item
  workqueue: use hotcpu_notifier() for workqueue_cpu_down_callback()
  workqueue: use __cpuinit instead of __devinit for cpu callbacks
  workqueue: rename manager_mutex to assoc_mutex
  workqueue: WORKER_REBIND is no longer necessary for idle rebinding
  workqueue: WORKER_REBIND is no longer necessary for busy rebinding
  workqueue: reimplement idle worker rebinding
  workqueue: deprecate __cancel_delayed_work()
  workqueue: reimplement cancel_delayed_work() using try_to_grab_pending()
  workqueue: use mod_delayed_work() instead of __cancel + queue
  workqueue: use irqsafe timer for delayed_work
  workqueue: clean up delayed_work initializers and add missing one
  workqueue: make deferrable delayed_work initializer names consistent
  workqueue: cosmetic whitespace updates for macro definitions
  workqueue: deprecate system_nrt[_freezable]_wq
  workqueue: deprecate flush[_delayed]_work_sync()
  ...
2012-10-02 09:54:49 -07:00
Lars-Peter Clausen 86767b7d5b ASoC: Avoid recalculating the bitmask for SOC_ENUM controls
For ENUM controls the bitmask is calculated based on the number of items.
Currently this is done each time the control is accessed. And while the
performance impact of this should be negligible we can easily do better. The
roundup_pow_of_two macro performs the same calculation which is currently done
manually, but it is also possible to use this macro with compile time constants
and so it can be used to initialize static data. So we can use it to initialize
the mask field of a ENUM control during its declaration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-18 22:51:23 -04:00
Peter Senna Tschudin ab7af5c8d4 ASoC: core: Remove useless kfree
Remove useless kfree() and clean up code related to the removal.

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

// <smpl>
@r exists@
position p1,p2;
expression x;
@@

if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; }

@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@

if (x@p1 == NULL) { ... when != I(x,...) S
                        when != e = e1
                        when != e += e1
                        when != e -= e1
                        when != ++e
                        when != --e
                        when != e++
                        when != e--
                        when != &e
   kfree@p2(x); ... return ...; }

@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@

... when != true x@p1 == NULL
kfree@p2(x);

@depends on !ok && unchanged@
position r.p2;
expression x;
@@

*kfree@p2(x);
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-13 12:30:33 +08:00
Mark Brown da8b8e0f15 ASoC: core: Mark regmap CODEC register maps as dirty when suspending
The core has for a long time had support for marking the register maps of
devices dirty when suspending so that they are resynced on resume. Also
implement this feature for CODECs using regmap.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-09-13 11:14:59 +08:00
Mark Brown e2d32ff6ce ASoC: dapm: Ensure bypass paths are suspended and resumed
Since bypass paths aren't part of DAPM streams and we may not have any
DAPM streams there may not be anything that triggers a DAPM sync for
them. Mark all input and output widgets as dirty and then sync to do so
at the end of suspend and resume.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-09-06 08:22:19 +08:00
Mark Brown 75d8f2931a Merge branch 'asoc-omap' into for-3.7 2012-09-05 20:05:11 +08:00