1. 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
  2. 28 4月, 2015 1 次提交
  3. 23 4月, 2015 1 次提交
  4. 19 4月, 2015 1 次提交
  5. 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
  6. 09 4月, 2015 1 次提交
  7. 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
  8. 05 4月, 2015 1 次提交
  9. 04 4月, 2015 1 次提交
  10. 02 4月, 2015 2 次提交
  11. 27 3月, 2015 1 次提交
  12. 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
  13. 18 3月, 2015 1 次提交
  14. 16 3月, 2015 1 次提交
  15. 11 3月, 2015 1 次提交
  16. 05 3月, 2015 2 次提交
    • L
      ASoC: Remove snd_soc_jack_new() · 77c71765
      Lars-Peter Clausen 提交于
      There are no users of snd_soc_jack_new() left and new users should use
      snd_soc_card_jack_new() instead. So remove the function.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      77c71765
    • L
      ASoC: Allow to register jacks at the card level · 97093996
      Lars-Peter Clausen 提交于
      Jacks are typically card level elements, but are currently registered with a
      CODEC. When it was originally introduced snd_soc_jack_new() took a
      snd_soc_card as its parameter, but at that time DAPM was only implemented at
      the CODEC level and there was only one CODEC per card. This made it clear
      which CODEC to use for the jack DAPM operations. But the multi-component
      patchset added support for having multiple CODECs per card and with it the
      API was updated to register jacks with a specific CODEC instance instead.
      Subsequently DAPM support at the card level has been introduced, but the
      snd_soc_jack_new() API has so remained unchanged.
      
      This leaves us with the issue that the DAPM pins that are managed by the
      jack detection logic usually are part of the card DAPM context but are
      accessed through a CODEC DAPM context. Currently this works fine, but might
      break in the future if we take a more hierarchical approach to DAPM
      contexts.
      
      Furthermore with componentization progressing systems that do not register
      a snd_soc_codec might appear, while these system may still want to able to
      register a jack.
      
      This patch addresses these issues by adding a new function called
      snd_soc_card_jack_new() that can be used to register jacks with the card
      rather than a CODEC.
      
      This new function is mostly identical to snd_soc_jack_new() except that it
      additionally allows to directly specify the DAPM pins associated with the
      jack. This was done since most users of snd_soc_jack_new() typically call
      snd_soc_jack_add_pins() right after it, which is not necessary with the new
      API and allows to reduce the amount of boiler plate code.
      
      The old snd_soc_jack_new() is re-implemented as a wrapper around
      snd_soc_card_jack_new().
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      97093996
  17. 04 3月, 2015 1 次提交
  18. 03 3月, 2015 1 次提交
  19. 24 2月, 2015 1 次提交
    • N
      ASoC: core: Add extra dapm properties for Device Tree · f23e860e
      Nicolin Chen 提交于
      The current helper functions, snd_soc_of_parse_audio_simple_widgets()
      and snd_soc_of_parse_audio_routing(), set dapm_widgets and dapm_routes
      without caring if they are already set by using build-in widgets and
      routes in the card driver. So there could be one of them, build-in one
      or Device Tree one, overrided by the other depending on which one was
      assigned later.
      
      This patch adds an extra pair of dapm_widgets and dapm_routes for DT
      use only so as to prevent unexpected overriding.
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      f23e860e
  20. 23 2月, 2015 2 次提交
  21. 21 2月, 2015 3 次提交
  22. 12 2月, 2015 2 次提交
    • T
      ALSA: seq: Drop snd_seq_autoload_lock() and _unlock() · 54a721ab
      Takashi Iwai 提交于
      The autoload lock became already superfluous due to the recent rework
      of autoload code.  Let's drop them now.  This allows us to simplify a
      few codes nicely.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      54a721ab
    • T
      ALSA: seq: Define driver object in each driver · 05662205
      Takashi Iwai 提交于
      This patch moves the driver object initialization and allocation to
      each driver's module init/exit code like other normal drivers.  The
      snd_seq_driver struct is now published in seq_device.h, and each
      driver is responsible to define it with proper driver attributes
      (name, probe and remove) with snd_seq_driver specific attributes as id
      and argsize fields.  The helper functions snd_seq_driver_register(),
      snd_seq_driver_unregister() and module_snd_seq_driver() are used for
      simplifying codes.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      05662205