1. 28 9月, 2015 1 次提交
  2. 11 6月, 2015 1 次提交
    • T
      ALSA: hda - Re-add the lost fake mute support · a686ec4c
      Takashi Iwai 提交于
      Yet another regression by the transition to regmap cache; for better
      usability, we had the fake mute control using the zero amp value for
      Conexant codecs, and this was forgotten in the new hda core code.
      
      Since the bits 4-7 are unused for the amp registers (as we follow the
      syntax of AMP_GET verb), the bit 4 is now used to indicate the fake
      mute.  For setting this flag, snd_hda_codec_amp_update() becomes a
      function from a simple macro.  The bonus is that it gained a proper
      function description.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a686ec4c
  3. 04 4月, 2015 1 次提交
  4. 23 3月, 2015 3 次提交
    • 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 - 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