1
0
Fork 0
Commit Graph

409 Commits (5d163336a77af9c1b4d6d08cbc8b1279df5f579e)

Author SHA1 Message Date
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
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
Tejun Heo 43829731dd workqueue: deprecate flush[_delayed]_work_sync()
flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
and convert all users to flush[_delayed]_work().

If you're cc'd and wondering what's going on: Now all workqueues are
non-reentrant and the regular flushes guarantee that the work item is
not pending or running on any CPU on return, so there's no reason to
use the sync flushes at all and they're going away.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Avi Kivity <avi@redhat.com>
2012-08-20 14:51:24 -07:00
Namarta Kohli 1245b7005d ASoC: add compress stream support
This patch adds the support to parse the compress dai's and then also adds the
soc-compress.c file while handles the compress stream operations, mostly analogus
to what is done in the soc-pcm.c and aditional handling of the compress
opertaions

Signed-off-by: Namarta Kohli <namartax.kohli@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-20 20:50:38 +01:00
Jerry Snitselaar 3876566a36 ASoC: core: remove unused variable in soc_probe() in linux-next
With commit 28d528c8 "ASoC: core: Remove pointless error on card
registration failure", the variable ret is no longer used in
soc_probe() and generates an unused variable warning during a build.

Signed-off-by: Jerry Snitselaar <dev@snitselaar.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-10 17:57:03 +01:00
Mark Brown 28d528c8db ASoC: core: Remove pointless error on card registration failure
If we fail to register the card we should say why somewhere else so there's
no point in repeating the same thing with less information.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-09 19:34:28 +01:00
Mark Brown fb099cb712 ASoC: core: Upgrade the severity of probe deferral errors to dev_err()
In the past when ASoC had a custom probe deferral mechanism people
complained about the logspam it generated and didn't want to know about
the fact that we were doing probe deferral so all the error messages for
it were at dev_dbg(), making diagnostics hard. Now that we have probe
deferral as an accepted thing and it's generating log messages anyway
there's no need to worry about this so upgrade the severity of all the
probe deferral sources to dev_err() so that they are displayed by default.

Also add one for missing aux_devs since there wasn't one.

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-09 19:34:04 +01:00
Peter Ujfalusi 5f800080ca ASoC: core: Set dapm->idle_bias_off for DAIs not mapped with a codec
The idle_bias_off flag is not configured for DAIs not mapped with a codec.
This causes the pm counter to be increased at probe time for the CPU dai
which unbalances the pm counter handling.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-07 15:09:58 +01:00
Mark Brown 98d3088e53 ASoC: core: Fix check before defaulting to regmap
Check if the chip has provided a write operation (which is mandatory for
I/O) rather than looking for control data as some of the MFDs use a global
for this. Also skip the attempt if there's no regmap available by device
in case things get confused by the attempt to default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
2012-08-02 11:43:45 +01:00
Matthias Kaehlcke b761c0ca2e ASoC: Free memory in the error paths of soc_of_parse_audio_routing()
Release the memory of the routing table before leaving the function upon errors
in the device tree

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-11 18:40:57 +01:00
Mark Brown 38cbf9598f ASoC: core: Try to use regmap if the driver doesn't set up any I/O
Since most new drivers are expected to use regmap and since frequently the
only thing we need to do in the CODEC probe function is configure the I/O
try to initialise the register I/O using regmap if the driver hasn't done
so after probe().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-07-03 20:11:00 +01:00
Stephen Warren 62ae68fa5d ASoC: probe CODECs and platforms before DAIs and links
soc_probe_dai_link() currently inter-mixes the probing of CODECs,
platforms, and DAIs. This can lead to problems such as a CODEC's DAI
being probed before the CODEC, if that DAI is used as the CPU-side of
a DAI link without any other of the CODEC's DAIs having been used as
the CODEC-side of any DAI link that was probed earlier.

To solve this, split soc_probe_dai_link() into soc_probe_link_components()
and soc_probe_link_dais(). The former is used to probe all CODECs and
platforms used by a card first, and then the latter is used to probe all
the DAIs and links later.

A similar change is made to soc_remove_dai_links().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-13 13:18:05 +01:00
Stephen Warren d12cd198cb ASoC: factor out soc_remove_platform()
This change simply factors out part of soc_remove_dai_link() into a
standalone function. This makes platform and CODEC removal much more
similar at the call-sites.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-13 13:18:04 +01:00
Stephen Warren 18d756440e ASoC: when removing a CPU DAI, clean up its DAPM context
When a standalone CPU DAI (one not part of a CODEC) is probed, widgets
are created for it. Add a call to snd_soc_dapm_free() in order to clean
these up when the CPU DAI is removed.

In order for snd_soc_dapm_free() to work, the CPU DAI's DAPM context's
list member must be initialized, since snd_soc_dapm_free() removes that
from the list it's part of. Add it to the card's list of DAPM contexts.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-13 13:18:04 +01:00
Stephen Warren a9db7dbee0 ASoC: when initializing CPU DAI, don't duplicate any CODEC init
If the CPU-side of a DAI link is a CODEC rather than a standalone DAI,
the codec initialization will call try_module_get() and create the DAI
widgets. Ensure that this isn't duplicated when the CPU DAI itself is
probed, if the CPU DAI is part of a CODEC.

Note that this is not a complete fix on its own, since there's no
guarantee that the CODEC itself will be initialized - currently that only
happens if the CODEC is also used as the CODEC-side of a DAI link, and
that initialization may happen before or after the DAIs within the CODEC
are initialized. However, such a scenario doesn't necessarily currently
work, and I don't think this change alone makes it any worse. This is
fixed in a couple patches time.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-13 13:18:04 +01:00
Adam Thomson 6c9d8cf637 ASoC: core: Add single controls with specified range of values
Control type added for cases where a specific range of values
within a register are required for control.

Added convenience macros:

SOC_SINGLE_RANGE
SOC_SINGLE_RANGE_TLV

Added accessor implementations:

snd_soc_info_volsw_range
snd_soc_put_volsw_range
snd_soc_get_volsw_range

Signed-off-by: Michal Hajduk <Michal.Hajduk@diasemi.com>
Signed-off-by: Adam Thomson <Adam.Thomson@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:06:41 +01:00
Stephen Warren bc92657a11 ASoC: make snd_soc_dai_link more symmetrical
Prior to this patch, the CPU side of a DAI link was specified using a
single name. Often, this was the result of calling dev_name() on the
device providing the DAI, but in the case of a CPU DAI driver that
provided multiple DAIs, it needed to mix together both the device name
and some device-relative name, in order to form a single globally unique
name.

However, the CODEC side of the DAI link was specified using separate
fields for device (name or OF node) and device-relative DAI name.

This patch allows the CPU side of a DAI link to be specified in the same
way as the CODEC side, separating concepts of device and device-relative
DAI name.

I believe this will be important in multi-codec and/or dynamic PCM
scenarios, where a single CPU driver provides multiple DAIs, while also
booting using device tree, with accompanying desire not to hard-code the
CPU side device's name into the original .cpu_dai_name field.

Ideally, both the CPU DAI and CODEC DAI loops in soc_bind_dai_link()
would now be identical. However, two things prevent that at present:

1) The need to save rtd->codec for the CODEC side, which means we have
to search for the CODEC explicitly, and not just the CODEC side DAI.

2) Since we know the CODEC side DAI is part of a codec, and not just
a standalone DAI, it's slightly more efficient to convert .codec_name/
.codec_of_node into a codec first, and then compare each DAI's .codec
field, since this avoids strcmp() on each DAI's CODEC's name within
the loop.

However, the two loops are essentially semantically equivalent.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:06:41 +01:00
Stephen Warren fe33d4c5e2 ASoC: don't flip master of DT-instantiated DAI links
Commit 4924082 "ASoC: core: Flip master for CODECs in the CPU slot of a
CODEC<->CODEC link" added code that was conditional on there being no
PCM/DMA driver for the link. However, it failed to cover the case where
the link was instantiated from device tree, and hence was specified by
DT node rather than name.

This prevents the following error on Toshiba AC100:
aplay: pcm_write:1603: write error: Input/output error

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-16 09:44:18 +01:00
Mark Brown dc2af52c0d Linux 3.4-rc7
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJPrxCRAAoJEHm+PkMAQRiGQAgH/icr6rDF/e7Y7LoNErjVag94
 +PUhYx851xH3ApPlB1fBaU1ZTvQS2Pb34B8G8WrqWJ+yTs4XfE9sCPj2yb+7ySA8
 vb0vPsErVvAcRWv8sP22NF2ERKNFj/PtSNAcAUJHb5djrRmJcZJ3aw03cdY/INAS
 2OqJEoMc2IBa5Z+WePQJ8N+J2YgDSDdCnpBKNuSHDGN0rBm4suiWY8PWXgTzMAhG
 TNgNrKIlN8bnaX4hPJr6ooN+sxInkUl8ZglAPxwwjVtmYvGch4FiowpDC7BQbSGB
 WFSVsIuv3jMI6VaYDo/NQOFDQqqoK4h7DmBIqbL5eXBRTJg9xW+1A8zloGd4Rks=
 =IWBQ
 -----END PGP SIGNATURE-----

Merge tag 'v3.4-rc7' into for-3.5

Linux 3.4-rc7

Conflicts):
	drivers/base/regmap/regmap.c         (overlap with bug fixes)
	sound/soc/blackfin/bf5xx-ssm2602.c   (overlap with bug fixes)
2012-05-13 13:32:54 +01:00
Linus Torvalds 1c2f954806 sound fixes for 3.4-rc6
As good as nothing exciting here; just a few trivial fixes for
 various ASoC stuff.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPpRa+AAoJEGwxgFQ9KSmkM4sP/jsd/scLYP3T1tu1pqiU6zyZ
 qNDu8ghU3AVuGe3qxAVb8AjrXALyqkqg1GXHY66R+Q/BmgtjOfTNyNV+ypGRuGif
 TJcLqWim0CVASZRFGkg/C9fEmeN5CDKcmZF7B53nAL2PRzm2/OrNhVBBKFc9bcbI
 S73pRGg+MoHbA3OrroZnBIA4dyG3+K+p2h9VlXUj1gdxu5+uzoiZwSbu/nGdLi/W
 5CCw9VceFi7sRkjBHuFL9grCgGASP5T89O6+lUH79JVnFdLXV63zpQt+zc6JUM8e
 mvosfcJZ6uln6aG+ACA0xgEwExImLLXiPl0BScIJo+HmwGoCbPIS06lBmjLBac1p
 78CYNYfhV3AzWCKbmMZXMEiu3g1O33N9UuOxKvnH02TH5b8B6OUdTFkf6JUA32Zw
 wtCe4yT48zJ+Iu5+YU/7dvDrtUdMVQ7ogSUyMnKFee+uh5a5I5r1T7ybJ8igF/qe
 2YqhpeUW4AEFA9VlPxVP4itVVQK8V0GL1+N0ny5COoT8ldImqqjCCpCJRdljCHDr
 xTK5n0FVZBP0hh2MwJZDNOwtNV2fKrA3vPJYjFhNfhzj+Sha9rxDXg4KnW5PA2P2
 H6I88vETSsrer5JlOzGp7myzdzrqb5gpMKTuWKpjxbCl3aihN16NiKQa8NzizSzg
 ZQldGV1KrK6GNFOkoSeQ
 =ZPkR
 -----END PGP SIGNATURE-----

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

Pull sound sound fixes from Takashi Iwai:
 "As good as nothing exciting here; just a few trivial fixes for various
  ASoC stuff."

* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: omap-pcm: Free dma buffers in case of error.
  ASoC: s3c2412-i2s: Fix dai registration
  ASoC: wm8350: Don't use locally allocated codec struct
  ASoC: tlv312aic23: unbreak resume
  ASoC: bf5xx-ssm2602: Set DAI format
  ASoC: core: check of_property_count_strings failure
  ASoC: dt: sgtl5000.txt: Add description for 'reg' field
  ASoC: wm_hubs: Make sure we don't disable differential line outputs
2012-05-05 10:07:06 -07:00
Liam Girdwood cd0f8911c5 ASoC: core: Fix dai_link dereference.
We should check dailess before dereferencing.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-30 11:09:13 +01:00
Linus Torvalds 2390c0fca6 sound fixes for 3.4-rc5
A workaround for an ASUS laptop and a few ASoC changes;
 most of the commits are tagged for stable, too.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPmUKpAAoJEGwxgFQ9KSmk3eIP/iGu1az70dixqEjfOifTcJcv
 V3VS5HIko0n3+iAkBQr+lo7RLnMQsqy5DQzv6h8FVzuyYgYVvT2eKLPEUh1p+LNw
 tZaosfrrnvGhthF5uDVKUeDe69wujfW68gLJJdp+dnUU28RG/cCuUu4+ae2nCBE+
 Glus4Zn5wC06P2Uuv67AHYiraCahiuwbrrXAYa0X8glEE7Vpg5t09d3l/KHBIbFH
 g46UF5D7LYoMHEThgeyYgq8lEK2THUJlLl887dZTjSqS9ps52cOyRlQmljRvvDXw
 BNdOSSu0YqRBX0ja7kIkadCVfZpQEyqfW6ISETozchPYogO9SHXz0plEB/OXWB+q
 dUwJGRdoWeJtW/jyd4RHIJlxYektY1ygUsrCeKdIM3lO3M8RnwMosUcy0rW9yKsA
 C8BIJz6KdEsiOHpTvvadln5MoarvoPIQXdw8yahJnisd5Kbrx1bQX8PPLhOatRpF
 U125ywvif5miV66+0ocnTB2eNJTy4zyokpR6JAQ1z9I+IZOF4mwH+OgLEGlTm28k
 Dn/UCxYhEGvLH0vrtU/WiPXE42Jw1ZeRRn56ErWPWOpRBzaJjK4hRu9zFK3cL9xh
 bBfP4hsMq2X8lW5nIFz5FLeocnIaMe0CCyNH9X+EoH+BS9HVx274a63t0te8fKtV
 E457r7iBnssONY4WIG2l
 =KjOE
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A workaround for an ASUS laptop and a few ASoC changes; most of the
  commits are tagged for stable, too."

* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: wm8994: Improve sequencing of AIF channel enables
  ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E
  ASoC: fsi: update for dmaengine prep_slave_sg fallout.
  ASoC: core: Fix card RTD count for deferred probe.
  ASoC: cs42l73: don't use negative array index
  ASoC: dapm: Ensure power gets managed for line widgets
2012-04-26 15:32:39 -07:00
Liam Girdwood 47c88ffff7 ASoC: dpcm: Add API for DAI link substream and runtime lookup
Some component drivers will need to be able to look up their
DAI link substream and RTD data. Provide a mechanism for this.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26 17:48:19 +01:00
Liam Girdwood f86dcef87b ASoC: dpcm: Add debugFS support for DPCM
Add debugFS files for DPCM link management information.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26 17:48:19 +01:00
Liam Girdwood 01d7584cd2 ASoC: dpcm: Add Dynamic PCM core operations.
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.

Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.

e.g. pcm:0,0 routing digital data to 2 external codecs.

FE pcm:0,0  ----> BE (McBSP.0) ----> CODEC 0
             +--> BE (McPDM.0) ----> CODEC 1

e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec.

FE pcm:0,0 ---
             +--> BE (McBSP.0) ----> CODEC
FE pcm:0,1 ---

The digital audio routing is controlled by the usual ALSA method
of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the
routing based upon the mixer settings and configures the BE PCMs
based on routing and the FE HW params.

DPCM is designed so that most ASoC component drivers will need no
modification at all. It's intended that existing CODEC, DAI and
platform drivers can be used in DPCM based audio devices without
any changes. However, there will be some cases where minor changes
are required (e.g. for very tightly coupled HW) and there are
helpers to support this too.

Somethimes the HW params of a FE and BE do not match or are
incompatible, so in these cases the machine driver can reconfigure
any hw_params and make any DSP perform sample rate / format conversion.

This patch adds the core DPCM code and contains :-

 o The FE and BE PCM operations.
 o FE and BE DAI link support.
 o FE and BE PCM creation.
 o BE support API.
 o BE and FE link management.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26 17:48:19 +01:00
Fabio Estevam f20c2cb999 ASoC: core: Remove unused variable 'min'
commit 4183eed2 (ASoC: core: Add signed multi register control) introduced
the variable 'min',but it is not used.

Remove it to fix the following build warning:

sound/soc/soc-core.c: In function 'snd_soc_put_xr_sx':
sound/soc/soc-core.c:2990: warning: unused variable 'min'

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26 10:29:13 +01:00
Richard Zhao c34ce320d9 ASoC: core: check of_property_count_strings failure
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
2012-04-24 12:06:27 +01:00
Kristoffer KARLSSON dd7b10b30c ASoC: core: Add strobe control
Added support for a control that strobes a bit in
a register to high then back to low (or the inverse).

This is typically useful for hardware that requires
strobing a singe bit to trigger some functionality
and where exposing the bit in a normal single control
would require the user to first manually set then
again unset the bit again for the strobe to trigger.

Added convenience macro.

SOC_SINGLE_STROBE

Added accessor implementations.

snd_soc_get_strobe
snd_soc_put_strobe

Signed-off-by: Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23 20:05:06 +01:00
Kristoffer KARLSSON 4183eed288 ASoC: core: Add signed multi register control
Added control type that can span multiple consecutive codec registers
forming a single signed value in a MSB/LSB manner.
The control dynamically adjusts to the register word size configured
in driver.

Added convenience macro.

SOC_SINGLE_XR_SX

Added accessor implementations.

snd_soc_info_xr_sx
snd_soc_get_xr_sx
snd_soc_put_xr_sx

Signed-off-by: Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23 20:05:06 +01:00
Liam Girdwood a7dbb60342 ASoC: core: Fix card RTD count for deferred probe.
Currently we increment the number of RTD's per card during the DAI link
bind. This can cause an incorrect RTD count when we cannot find a component
and defer the probe (and hence perform the DAI link bind for the card again).

Fix the count so that it is cleared before every card registration
and bind attempt.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-17 20:52:19 +01:00
Mark Brown d5efccd5b6 Linux 3.4-rc3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEbBAABAgAGBQJPi3XOAAoJEHm+PkMAQRiGnsUH9RjHwH4YFVyuP/DKtKa6zs74
 wqkpT15yITQ5WWMog4JaJFFg5rJCUd8QZr7AS/HSn0ijDyZX5VU7Rcs9cMudDzNR
 H/5K/AscS4fjb0HwWVqoltTWHRb9QGSwVN3+E3VCDLt9P89YJ0o3QztkkuEX5dkZ
 jc7reVXTfRnCcILEa9jleOzrn+OLM3j/jAjQ2hGunl8EDLzD4b17HHPoli4jEZ/5
 5ibpSVsPD+AqzN+glbXvYjVItl12D0IQos/JdOwfuZriCVWLxysSSwHZTbPCyvBZ
 LHH4HR5T+XLSXbjJeNkUFHLzqU+d5gVRadIoWtJCxqxFjKbOs2YtzJ5Ai0nDiw==
 =kTkC
 -----END PGP SIGNATURE-----

ASoC: Merge tag 'v3.4-rc3' into for-3.5

Linux 3.4-rc3 contains a bunch of Tegra changes which are conflicting
annoyingly with the new development that's going on for Tegra so merge
it up to resolve those conflicts.

Conflicts:
	sound/soc/soc-core.c
	sound/soc/tegra/tegra_i2s.c
	sound/soc/tegra/tegra_spdif.c
2012-04-16 19:40:27 +01:00
Mark Brown c74184ed30 ASoC: core: Support transparent CODEC<->CODEC DAI links
Rather than having the user half start a stream but avoid any DMA to
trigger data flow on links which don't pass through the CPU create a
DAPM route between the two DAI widgets using a hw_params configuration
provided by the machine driver with the new 'params' member of the
dai_link struct.  If no configuration is provided in the dai_link then
use the old style even for CODEC<->CODEC links to avoid breaking
systems.

This greatly simplifies the userspace usage of such links, making them
as simple as analogue connections with the stream configuration being
completely transparent to them.

This is achieved by defining a new dai_link widget type which is created
when CODECs are linked and triggering the configuration of the link via
the normal PCM operations from there.  It is expected that the bias
level callbacks will be used for clock configuration.

Currently only the DAI format, rate and channel count can be configured
and currently the only DAI operations which can be called are hw_params
and digital_mute().  This corresponds well to the majority of CODEC
drivers which only use other callbacks for constraint setting but there
is obviously much room for extension here.  We can't simply call
hw_params() on startup as things like the system clocking configuration
may change at runtime and in future it will be desirable to offer some
configurability of the link parameters.

At present we are also restricted to a single DAPM link for the entire
DAI.  Once we have better support for channel mapping it would also be
desirable to extend this feature so that we can propagate per-channel
power state over the link.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-04-16 19:36:29 +01:00
Mark Brown 054880febe ASoC: core: Bind DAIs to CODECs at registration time
We should always have a CODEC already there when registering a CODEC DAI
and for CODEC<->CODEC links a dai_link will have two CODECs so it's much
simpler to do things at registration time.

This results in a slight change in the error handling for failed CODEC
DAI registrations but practically speaking these are never supposed to
fail so there shouldn't be much issue. The change is that we don't fail
the overall CODEC registration if the DAI registration fails; this seems
more robust anyway as we may not need to use a given DAI in a particular
system.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-16 19:36:29 +01:00
Mark Brown f04209a7b0 ASoC: core: Flip master for CODECs in the CPU slot of a CODEC<->CODEC link
When two CODEC DAIs are linked directly to each other then if we give the
same master mode settings to both devices things won't work as either
neither will drive or they'll drive against each other. Flip the settings
for the DAI in the CPU slot of the DAI link.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-16 19:36:29 +01:00
Mark Brown 04570c628f ASoC: core: Return -ENOTSUPP instead of -EINVAL if mute is not supported
This helps us ignore errors in callers if the operation failed due to not
being available as opposed to an error.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-04-16 19:36:29 +01:00
Linus Torvalds a1ada08606 sound fixes for 3.4-rc3
- A series of fixes for Conexant 20549 HD-audio codec chip
 - A workaround for HDMI hotplug debug prints that annoyed people
 - A fix for the new support of platform DAPM contexts
 - Many driver-specific minor fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPhWH/AAoJEGwxgFQ9KSmk0KoP+gNjARkNkiTh7rnQN+x0y8+O
 ejv13pUlfSA+KLYNQtBAq21t5JCZfoelcJ0Yt5Dbq79/XK/jzQog8wcp0obLzdVt
 WiWbkUVTN1udjlGUfjpCaIvtXG7dnxysYTeO+4ajOqs87hnoJLmRzw2EnD1dtqt+
 rkdySKbrE2tSmgIQwZDaeo2UFiyRavpFnKOOjTXKIiWlDIiMYKjCtOnMd2uyoDDU
 hTNUXocpHL27uuSgDgS4jGoWTldd4rgDwcQ1dSDYxdqkaWjqnimFCXJUcZeLkx6G
 eb0Plk58ceka/hKa8DFIbOjs14hy5lZvc8bALPldCAbvG+/IQTg0ucS4DFIHq962
 LvG5kQ9aHl7cMVz1ZjcEbRQ5Y2qbb5bwmIFQZIiAy7B8JeZs9sZPeOt242teUUjw
 ijSpE3R/cv/jvSUr1if26PcpVZA+BmEUUThCpvPw9X83lEdlb9n9EjrAUfi46+LT
 fpfc76+II6K86jtRaU+qnadSO3AZ5ji7o06CuoBgoCbxjKz1iIRjxMKgvdZw0pmp
 RAwqcPL8G2AOSJqQi8wJhqi+/Cx0VGcwIQQKuHMNg9AJDruUFQzERozl6O7MV4b6
 hF80VXIkkTU6cSfB5CrksPy5OX4v0ruYbqygKf2X4Wnq17TKeZHzATQi+WiWEY/P
 CAx2WuIIN6GWWEhqvrkK
 =HeDy
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 - A series of fixes for Conexant 20549 HD-audio codec chip
 - A workaround for HDMI hotplug debug prints that annoyed people
 - A fix for the new support of platform DAPM contexts
 - Many driver-specific minor fixes

* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - hide HDMI/ELD printks unless snd.debug=2
  ALSA: sound/isa/sscape.c: add missing resource-release code
  sound: sound/oss/msnd_pinnacle.c: add vfrees
  ALSA: hda - clean up CX20549 test mixer setup
  ALSA: hda - CX20549 doesn't need pin_amp_workaround.
  ALSA: hda - Remove CD control from model=benq for CX20549
  ALSA: hda - fix record volume controls of CX20459 ("Venice")
  ALSA: hda - Rename capture sources of CX20549 to match common conventions
  ALSA: hda - Fix proc output for ADC amp values of CX20549
  ASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS
  ASoC: set idle_bias_off=1 for all platform DAPM contexts
  ASoC: imx-audmux: Check for NULL pointer
  ASoC: imx-audmux: Fix ssi port numbers in sysfs
  ASoC: ak4642: fixup: mute needs +1 step
  MAINTAINERS: Don't list everyone working on Wolfson drivers
  MAINTAINERS: Add missing ASoC OMAP co-maintainer
  ASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro
  ASoC: tegra: ensure clocks are enabled when touching registers
  ASoC: sgtl5000: Enable VAG when DAC/ADC up
  ALSA: asihpi - fix return value of hpios_locked_mem_alloc()
2012-04-11 11:07:38 -07:00
Mark Brown 1eecb8280b Linux 3.4-rc2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJPgOpXAAoJEHm+PkMAQRiG8eUIAJ3Hjo0o5hqzxol8LWHDGF8s
 3h59qwRtts82u2psStZULPLbBzw6yjn8U5Mcrh7pffwCG2BzBL5rXcmXfvoPaET3
 TjylIj986Jv+jwZyuyZcLzYyoUtgjtq7hnt4tgVVEPlexYs7LxUl8vO8QjxT+bVO
 7eKgzLsXlBC9kw4P5M7kOBQ9NE5vmEcKf+fB3Hu3DqfVJtw9Lb7EeDQj/cbQsGqI
 vavSxe7lMTPsgMP2+hRz4txGTDJNRazkO2BdwfYrcNwTSa8tfBFlamww3y4+eJtq
 MFQfdNxQpumh2++T4IC2i/nLaawH7kWj2EdaRCRLMy9hVlb/v8/wcgd+1nfLkU8=
 =0on9
 -----END PGP SIGNATURE-----

Merge tag 'v3.4-rc2' into for-3.5

Linux 3.4-rc2 contains some bug fixes we need, including the addition of
an export for regcache_sync_region().
2012-04-09 11:53:45 +01:00
Stephen Boyd 234e340582 simple_open: automatically convert to simple_open()
Many users of debugfs copy the implementation of default_open() when
they want to support a custom read/write function op.  This leads to a
proliferation of the default_open() implementation across the entire
tree.

Now that the common implementation has been consolidated into libfs we
can replace all the users of this function with simple_open().

This replacement was done with the following semantic patch:

<smpl>
@ open @
identifier open_f != simple_open;
identifier i, f;
@@
-int open_f(struct inode *i, struct file *f)
-{
(
-if (i->i_private)
-f->private_data = i->i_private;
|
-f->private_data = i->i_private;
)
-return 0;
-}

@ has_open depends on open @
identifier fops;
identifier open.open_f;
@@
struct file_operations fops = {
...
-.open = open_f,
+.open = simple_open,
...
};
</smpl>

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-05 15:25:50 -07:00