1. 11 6月, 2015 1 次提交
  2. 04 6月, 2015 3 次提交
    • L
      ALSA: topology: Export ID types for TLV controls. · 932ae880
      Liam Girdwood 提交于
      Make sure userspace can define TLV controls for topology using the correct
      type numbers and channel mappings.
      Signed-off-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      Acked-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      932ae880
    • L
      ASoC: topology: Add topology core · 8a978234
      Liam Girdwood 提交于
      The topology core parses the FW topology file for known block types and
      instanciates any common ALSA/ASoC objects that it discovers. The core
      also passes any block that is does not understand to client component
      drivers for enumeration.
      
      The core exports some APIs to client drivers in order to load and unload
      firmware topology data as use case require.
      
      Currently the core deals with the following object types :-
      
       o kcontrols. This includes TLV, enumerated and bytes controls.
       o DAPM widgets. All types with any associated kcontrol.
       o DAPM graph.
       o FE PCM. FE PCM capabilities and configuration can be defined.
       o BE DAI Link. BE DAI link capabilities and configuration can be defined.
       o Codec <-> codec style links capabilities and configuration.
      Signed-off-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      8a978234
    • L
      ASoC: topology: Add topology UAPI header · c147c0e1
      Liam Girdwood 提交于
       The ASoC topology UAPI header defines the structures
       required to define any DSP firmware audio topology and control objects from
       userspace.
      
      The following objects are supported :-
       o kcontrols including TLV controls.
       o DAPM widgets and graph elements
       o Vendor bespoke objects.
       o Coefficient data
       o FE PCM capabilities and config.
       o BE link capabilities and config.
       o Codec <-> codec link capabilities and config.
       o Topology object manifest.
      
      The file format is simple and divided into blocks for each object type and
      each block has a header that defines it's size and type. Blocks can be in
      any order of type and can either all be in a single file or spread across
      more than one file. Blocks also have a group identifier ID so that they can
      be loaded and unloaded by ID.
      Signed-off-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c147c0e1
  3. 22 5月, 2015 1 次提交
  4. 12 5月, 2015 1 次提交
    • C
      ASoC: dapm: Add cache to speed up adding of routes · 45a110a1
      Charles Keepax 提交于
      Some CODECs have a significant number of DAPM routes and for each route,
      when it is added to the card, the entire card widget list must be
      searched. When adding routes it is very likely, however, that adjacent
      routes will require adjacent widgets. For example all the routes for a
      mux are likely added in a block and the sink widget will be the same
      each time and it is also quite likely that the source widgets are
      sequential located in the widget list.
      
      This patch adds a cache to the DAPM context, this cache will hold the
      source and sink widgets from the last call to snd_soc_dapm_add_route for
      that context. A small search of the widget list will be made from those
      points for both the sink and source. Currently this search only checks
      both the last widget and the one adjacent to it.
      
      On wm8280 which has approximately 500 widgets and 30000 routes (one of
      the largest CODECs in mainline), the number of paths that hit the cache
      is 24000, which significantly improves probe time.
      Signed-off-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      45a110a1
  5. 07 5月, 2015 4 次提交
  6. 29 4月, 2015 1 次提交
    • P
      ALSA: emu10k1: Emu10k2 32 bit DMA mode · 7241ea55
      Peter Zubaj 提交于
      Looks like audigy emu10k2 (probably emu10k1 - sb live too) support two
      modes for DMA. Second mode is useful for 64 bit os with more then 2 GB
      of ram (fixes problems with big soundfont loading)
      
      1) 32MB from 2 GB address space using 8192 pages (used now as default)
      2) 16MB from 4 GB address space using 4096 pages
      
      Mode is set using HCFG_EXPANDED_MEM flag in HCFG register.
      Also format of emu10k2 page table is then different.
      Signed-off-by: NPeter Zubaj <pzubaj@marticonet.sk>
      Tested-by: NTakashi Iwai <tiwai@suse.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7241ea55
  7. 28 4月, 2015 5 次提交
    • R
      ASoC: Update email-id of Rajeev Kumar · 9d7dd6cd
      Rajeev Kumar 提交于
      rajeev-dlh.kumar@st.com email-id doesn't exist anymore as I have left the
      company.  Replace ST's id with Rajeev Kumar <rajeevkumar.linux@gmail.com>
      Signed-off-by: NRajeev Kumar <rajeevkumar.linux@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      9d7dd6cd
    • L
      ASoC: Add helper functions bias level management · fa880775
      Lars-Peter Clausen 提交于
      Currently drivers are responsible for managing the bias_level field of
      their DAPM context. The DAPM state itself is managed by the DAPM core
      though and the core has certain expectations on how and when the bias_level
      field should be updated. If drivers don't adhere to these undefined
      behavior can occur.
      
      This patch adds a few helper functions for manipulating the DAPM context
      state, each function with a description on when it should be used and what
      its effects are. This will also help us to move more of the bias_level
      management from drivers to the DAPM core.
      
      For convenience also add snd_soc_codec_* wrappers around these helpers.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      fa880775
    • L
      ASoC: Add helper function getting CODEC's DAPM context · 39ed68c8
      Lars-Peter Clausen 提交于
      The DAPM context in the snd_soc_codec struct is redundant and scheduled to
      be replaced by the DAPM context in the snd_soc_component struct. This patch
      introduces a new helper function snd_soc_codec_get_dapm() which should be
      used for getting the DAPM context for a CODEC rather then directly
      accessing the dapm field. Once there are no more direct users of the dapm
      field left it is possible to transparently switch all drivers to the
      component DAPM context by updating snd_soc_codec_get_dapm() function.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      39ed68c8
    • K
      ASoC: soc.h: tidyup struct snd_soc_dai_link definition order · 2dc0f16b
      Kuninori Morimoto 提交于
      Current struct snd_soc_dai_link has many members, but definition order
      was random. Especially, bool / bit field are defined randomly.
      This patch tidyups these definition order to calculate data alignment
      easy.
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      2dc0f16b
    • L
      ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal · acde50a7
      Lars-Peter Clausen 提交于
      Whether residue can be reported or not is not a property of the audio
      controller but of the DMA controller. The FLAG_NO_RESIDUE was initially
      added when the DMAengine framework had no support for describing the residue
      reporting capabilities of the controller. Support for this was added quite a
      while ago and recently the DMAengine framework started to complain if a
      driver does not describe its capabilities and a lot of patches have been
      merged that add support for this where it was missing. So it should be safe
      to assume that driver on actively used platforms properly implement the DMA
      capabilities API.
      
      This patch makes the FLAG_NO_RESIDUE internal and no longer allows audio
      controller drivers to manually set the flag. If a DMA driver against
      expectations does not support reporting its capabilities for now the generic
      DMAengine PCM driver will now emit a warning and simply assume that residue
      reporting is not supported. In the future this might be changed to aborting
      with an error.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      acde50a7
  8. 23 4月, 2015 1 次提交
  9. 19 4月, 2015 1 次提交
  10. 13 4月, 2015 1 次提交
    • T
      ALSA: hda - Fix another race in runtime PM refcounting · c3aeda62
      Takashi Iwai 提交于
      Although some races in runtime PM refcount was fixed by the commit
      [664c7155: ALSA: hda - Work around races of power up/down with
      runtime PM], there is still a race in the following case:
      
      CPU0:                   CPU1 :
      runtime suspend:
        codec->in_pm = 1
                              snd_hdac_power_up_pm():
                                pm_runtime_get_sync() skipped
      suspend finished:
        codec->in_pm = 0
                              snd_hdac_power_down_pm():
                                pm_runtime_put_*() is called!
      
      For avoiding this situation, increment in_pm flag atomically when it's
      non-zero, and decrement accordingly, to ensure that in_pm is set
      consistently for the whole concurrent operations.
      
      Also, since atomic_inc_not_zero() and atomic_dec_if_positive() are
      lengthy inline functions, move snd_hdac_power_up_pm() and _down_pm()
      to sound/hda/hdac_device.c as no inline functions.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c3aeda62
  11. 09 4月, 2015 1 次提交
  12. 08 4月, 2015 1 次提交
    • T
      ALSA: hda - Work around races of power up/down with runtime PM · 664c7155
      Takashi Iwai 提交于
      Currently, snd_hdac_power_up()/down() helpers checks whether the codec
      is being in pm (suspend/resume), and skips the call of runtime get/put
      during it.  This is needed as there are lots of power up/down
      sequences called in the paths that are also used in the PM itself.  An
      example is found in hda_codec.c::codec_exec_verb(), where this can
      power up the codec while it may be called again in its power up
      sequence, too.
      
      The above works in most cases, but sometimes we really want to wait
      for the real power up.  For example, the control element get/put may
      want explicit power up so that the value change is assured to reach to
      the hardware.   Using the current snd_hdac_power_up(), however,
      results in a race, e.g. when it's called during the runtime suspend is
      being performed.  In the worst case, as found in patch_ca0132.c, it
      can even lead to the deadlock because the code assumes the power up
      while it was skipped due to the check above.
      
      For dealing with such cases, this patch makes snd_hdac_power_up() and
      _down() to two variants: with and without in_pm flag check.  The
      version with pm flag check is named as snd_hdac_power_up_pm() while
      the version without pm flag check is still kept as
      snd_hdac_power_up().  (Just because the usage of the former is fewer.)
      
      Then finally, the patch replaces each call potentially done in PM with
      the new _pm() variant.
      
      In theory, we can implement a unified version -- if we can distinguish
      the current context whether it's in the pm path.  But such an
      implementation is cumbersome, so leave the code like this a bit messy
      way for now...
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96271Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      664c7155
  13. 05 4月, 2015 1 次提交
  14. 04 4月, 2015 1 次提交
  15. 02 4月, 2015 2 次提交
  16. 27 3月, 2015 1 次提交
  17. 23 3月, 2015 13 次提交
    • T
      ALSA: hda - Add cache support for COEF read/write · 40ba66a7
      Takashi Iwai 提交于
      The 16bit COEF read/write is pretty standard for many codecs, and they
      can be cached in most cases -- more importantly, they need to be
      restored at resume.  For making this easier, add the cache support to
      regmap.  If the codec driver wants to cache the COEF access, set
      codec->cache_coef flag and issue AC_VERB_GET_PROC_COEF with the coef
      index in LSB 8 bits.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      40ba66a7
    • T
      ALSA: hda - Add a fake stereo amp register support · d313e0a8
      Takashi Iwai 提交于
      HD-audio spec is inconvenient regarding the handling of stereo volume
      controls.  It can set and get only single channel at once (although
      there is a special option to set the same value to both channels).
      This patch provides a fake pseudo-register via the regmap access so
      that the stereo channels can be read and written by a single call.
      It'd be useful, for example, for implementing DAPM widgets.
      
      A stereo amp pseudo register consists of the encoding like the normal
      amp verbs but it has both SET_LEFT (bit 13) and SET_RIGHT (bit 12)
      bits set.  The regmap reads and writes a 16bit value for this pseudo
      register where the upper 8bit is for the right chanel and the lower
      8bit for the left channel.
      
      Note that the driver doesn't recognize conflicts when both stereo and
      mono channel registers are mixed.  Mixing them would certainly confuse
      the operation.  So, use carefully.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d313e0a8
    • T
      ALSA: hda - Allow driver to add vendor-specific verbs for regmap · 5e56bcea
      Takashi Iwai 提交于
      Codecs may have own vendor-specific verbs, and we need to allow each
      driver to give such verbs for cached accesses.  Here a verb can be put
      into a single array and looked through it at readable and writeable
      callbacks.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5e56bcea
    • T
      ALSA: hda - Use regmap for parameter caches, too · faa75f8a
      Takashi Iwai 提交于
      The amp hash table was used for recording the cached reads of some
      capability values like pin caps or amp caps.  Now all these are moved
      to regmap as well.
      
      One addition to the regmap helper is codec->caps_overwriting flag.
      This is set in snd_hdac_override_parm(), and the regmap helper accepts
      any register while this flag is set, so that it can overwrite even the
      read-only verb like AC_VERB_PARAMETERS.  The flag is cleared
      immediately in snd_hdac_override_parm(), as it's a once-off flag.
      
      Along with these changes, the no longer needed amp hash and relevant
      fields are removed from hda_codec struct now.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      faa75f8a
    • T
      ALSA: hda - Implement uncached version of parameter reads · 9ba17b4d
      Takashi Iwai 提交于
      Sometimes we need the uncached reads, e.g. for refreshing the tree.
      This patch provides the helper function for that and uses it for
      refreshing widgets, reading subtrees and the whole proc reads.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9ba17b4d
    • T
      ALSA: hda - Use regmap for codec parameter reads · 01ed3c06
      Takashi Iwai 提交于
      Let's start converting the access functions to regmap.
      The first one is the simplest, just converting the codec parameter
      read helper function snd_hda_param_read().
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      01ed3c06
    • T
      ALSA: hda - Add regmap support · 4d75faa0
      Takashi Iwai 提交于
      This patch adds an infrastructure to support regmap-based verb
      accesses.  Because o the asymmetric nature of HD-audio verbs,
      especially the amp verbs, we need to translate the verbs as a sort of
      pseudo registers to be mapped uniquely in regmap.
      
      In this patch, a pseudo register is built from the NID, the
      AC_VERB_GET_* and 8bit parameters, i.e. almost in the form to be sent
      to HD-audio bus but without codec address field.  OTOH, for writing,
      the same pseudo register is translated to AC_VERB_SET_* automatically.
      The AC_VERB_SET_AMP_* verb is re-encoded from the corresponding
      AC_VERB_GET_AMP_* verb and parameter at writing.
      
      Some verbs has a single command for read but multiple for writes.  A
      write for such a verb is split automatically to multiple verbs.
      
      The patch provides also a few handy helper functions.  They are
      designed to be accessible even without regmap.  When no regmap is set
      up (e.g. before the codec device instantiation), the direct hardware
      access is used.  Also, it tries to avoid the unnecessary power-up.
      The power up/down sequence is performed only on demand.
      
      The codec driver needs to call snd_hdac_regmap_exit() and
      snd_hdac_regmap_exit() at probe and remove if it wants the regmap
      access.
      
      There is one flag added to hdac_device.  When the flag lazy_cache is
      set, regmap helper ignores a write for a suspended device and returns
      as if it was actually written.  It reduces the hardware access pretty
      much, e.g. when adjusting the mixer volume while in idle.  This
      assumes that the driver will sync the cache later at resume properly,
      so use it carefully.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4d75faa0
    • T
      ALSA: hda - Move generic array helpers to core lib · 71fc4c7e
      Takashi Iwai 提交于
      This will be used by the regmap support.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      71fc4c7e
    • T
      ALSA: hda - Support indirect execution of verbs · 05852448
      Takashi Iwai 提交于
      Add an overriding exec_verb op to struct hdac_device so that the call
      via snd_hdac_exec_verb() can switch to a different route depending on
      the setup.  The codec driver sets this field so that it can handle the
      errors or applying quirks appropriately.  Furthermore, this mechanism
      will be used for smooth transition for the regmap support in later
      patches.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      05852448
    • T
      ALSA: hda - Add widget sysfs tree · 3256be65
      Takashi Iwai 提交于
      This patch changes the sysfs files assigned to the codec device on the
      bus which were formerly identical with hwdep sysfs files.  Now it
      shows only a few core parameter, vendor_id, subsystem_id, revision_id,
      afg, mfg, vendor_name and chip_name.
      
      In addition, now a widget tree is added to the bus device sysfs
      directory for showing the widget topology and attributes.  It's just a
      flat tree consisting of subdirectories named as the widget NID
      including various attributes like widget capability bits.  The AFG
      (usually NID 0x01) is always found there, and it contains always
      amp_in_caps, amp_out_caps and power_caps files.  Each of these
      attributes show a single value.  The rest are the widget nodes
      belonging to that AFG.  Note that the child node might not start from
      0x02 but from another value like 0x0a.
      
      Each child node may contain caps, pin_caps, amp_in_caps, amp_out_caps,
      power_caps and connections files.  The caps (representing the widget
      capability bits) always contain a value.  The rest may contain
      value(s) if the attribute exists on the node.  Only connections file
      show multiple values while other attributes have zero or one single
      value.
      
      An example of ls -R output is like below:
      % ls -R /sys/bus/hdaudio/devices/hdaudioC0D0/
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/:
      01/  04/  07/  0a/  0d/  10/  13/  16/  19/  1c/  1f/  22/
      02/  05/  08/  0b/  0e/  11/  14/  17/  1a/  1d/  20/  23/
      03/  06/  09/  0c/  0f/  12/  15/  18/  1b/  1e/  21/
      
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/01:
      amp_in_caps  amp_out_caps  power_caps
      
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/02:
      amp_in_caps  amp_out_caps  caps  connections  pin_caps  pin_cfg
      power_caps
      
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/03:
      .....
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3256be65
    • T
      ALSA: hda - Move a part of hda_codec stuff into hdac_device · 7639a06c
      Takashi Iwai 提交于
      Now some codes and functionalities of hda_codec struct are moved to
      hdac_device struct.  A few basic attributes like the codec address,
      vendor ID number, FG numbers, etc are moved to hdac_device, and they
      are accessed like codec->core.addr.  The basic verb exec functions are
      moved, too.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7639a06c
    • T
      ALSA: hda - Move some codes up to hdac_bus struct · d068ebc2
      Takashi Iwai 提交于
      A few basic codes for communicating over HD-audio bus are moved to
      struct hdac_bus now.  It has only command and get_response ops in
      addition to the unsolicited event handling.
      
      Note that the codec-side tracing support is disabled temporarily
      during this transition due to the code shuffling.  It will be
      re-enabled later once when all pieces are settled down.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d068ebc2
    • T
      ALSA: hda - Make snd_hda_bus_type public · e3d280fc
      Takashi Iwai 提交于
      Define the common hd-audio driver and device types to bind over
      snd_hda_bus_type publicly.  This allows to implement other type of
      device and driver code over hd-audio bus.
      
      Now both struct hda_codec and struct hda_codec_driver inherit these
      new struct hdac_device and struct hdac_driver, respectively.
      
      The bus registration is done in subsys_initcall() to assure it
      before any other driver registrations.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e3d280fc
  18. 18 3月, 2015 1 次提交