1. 23 3月, 2015 2 次提交
    • T
      ALSA: hda - Use regmap for amp accesses · eeecd9d1
      Takashi Iwai 提交于
      This patch converts the amp access functions to the regmap helpers.
      The amp values were formerly cached in the own hash table.  Now it's
      dropped by the regmap's cache.
      
      The only tricky conversion is snd_hda_codec_amp_init().  This function
      shouldn't do anything if the amp was already initialized.  For
      achieving this behavior, a value is read once at first temporarily in
      the cache-only mode.  Only if it returns an error,  i.e. the item
      still doesn't exist in the cache, it proceeds to the update.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      eeecd9d1
    • 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
  2. 03 3月, 2015 3 次提交
    • T
      ALSA: hda - Use standard workqueue for unsol and jack events · 2f35c630
      Takashi Iwai 提交于
      The events that are handled by HD-audio drivers are no frequent and
      urgent ones, so we can use the standard workqueue without any problem
      nowadays.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2f35c630
    • T
      ALSA: hda - Allocate hda_pcm objects dynamically · bbbc7e85
      Takashi Iwai 提交于
      So far, the hda_codec object kept the hda_pcm list in an array, and
      the codec driver was expected to assign the array.  However, this
      makes the object life cycle management harder, because the assigned
      array is freed at the codec driver detach while it might be still
      accessed by the opened streams.
      
      In this patch, we allocate each hda_pcm object dynamically and manage
      it as a linked list.  Each object has a kref refcount, and both the
      codec driver binder and the PCM open/close touches it, so that the
      object won't be freed while in use.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bbbc7e85
    • T
      ALSA: hda - Add card field to hda_codec struct · 6efdd851
      Takashi Iwai 提交于
      Allow the codec object to have an individual card pointer.  Not only
      this simplifies the redirections in many places, also this will allow
      us to make each codec assigned to a different card object.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6efdd851
  3. 23 2月, 2015 1 次提交
    • T
      ALSA: hda - Bind codecs via standard bus · d8a766a1
      Takashi Iwai 提交于
      Now we create the standard HD-audio bus (/sys/bus/hdaudio), and bind
      the codec driver with the codec device over there.  This is the first
      step of the whole transition so that the changes to each codec driver
      are kept as minimal as possible.
      
      Each codec driver needs to register hda_codec_driver struct containing
      the currently existing preset via the new helper macro
      module_hda_codec_driver().  The old hda_codec_preset_list is replaced
      with this infrastructure.  The generic parsers (for HDMI and other)
      are also included in the preset with the special IDs to bind
      uniquely.
      
      In HD-audio core side, the device binding code is split to
      hda_bind.c.  It provides the snd_hda_bus_type implementation to match
      the codec driver with the given codec vendor ID.  It also manages the
      module auto-loading by itself like before: when the matching isn't
      found, it tries to probe the corresponding codec modules, and finally
      falls back to the generic drivers.  (The special ID mentioned above is
      set at this stage.)
      
      The only visible change to outside is that the hdaudio sysfs entry now
      appears in /sys/bus/devices, not as a sound class device.
      
      More works to move the suspend/resume and remove ops will be
      (hopefully) done in later patches.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d8a766a1
  4. 07 1月, 2015 1 次提交
  5. 16 12月, 2014 1 次提交
  6. 15 12月, 2014 1 次提交
  7. 20 10月, 2014 1 次提交
    • A
      ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug · 6acce400
      Anssi Hannula 提交于
      The ELD ALSA control change event is sent by hdmi_present_sense() when
      eld_changed is true.
      
      Currently, it is only true when the ELD buffer contents have been
      modified. However, the user-visible ELD controls also change to a
      zero-length value and back when eld_valid is unset/set, and no event is
      currently sent in such cases (such as when unplugging or replugging a
      sink).
      
      Fix the code to always set eld_changed if eld_valid value is changed,
      and therefore to always send the change event when the user-visible
      value changes.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: David Henningsson <david.henningsson@canonical.com>
      Cc: <stable@vger.kernel.org> # 3.9+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6acce400
  8. 16 9月, 2014 1 次提交
    • T
      ALSA: hda - Allow multiple callbacks for jack · 1a4f69d5
      Takashi Iwai 提交于
      So far, hda_jack infrastructure allows only one callback per jack, and
      this makes things slightly complicated when a driver wants to assign
      multiple tasks to a jack, e.g. the standard auto-mute with a power
      up/down sequence.  This can be simplified if the hda_jack accepts
      multiple callbacks.
      
      This patch is such an extension: the callback-specific part (the
      function and private_data) is split to another struct from
      hda_jack_tbl, and multiple such objects can be assigned to a single
      hda_jack_tbl entry.
      
      The new struct hda_jack_callback is passed to each callback function
      now, thus the patch became bigger than expected.  But these changes
      are mostly trivial.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1a4f69d5
  9. 11 9月, 2014 1 次提交
    • T
      ALSA: hda - Get rid of action field from struct hda_jack_tbl · 62f949bf
      Takashi Iwai 提交于
      The action value assigned to each hda_jack_tbl entry is mostly
      superfluous.  The actually used values are either the widget NID or a
      value specific to the callback.
      
      The former case can be simply replaced by a reference to widget NID
      itself.  The only place doing the latter is STAC/IDT codec driver for
      the powermap handling.  But, the code doesn't need to check the action
      field at all -- the function jack_update_power() is called either with
      a specific pin or with NULL.  So the check of jack->action can be
      removed completely there, too.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      62f949bf
  10. 19 8月, 2014 2 次提交
  11. 04 8月, 2014 1 次提交
  12. 08 7月, 2014 1 次提交
  13. 25 6月, 2014 1 次提交
  14. 23 6月, 2014 1 次提交
  15. 12 6月, 2014 1 次提交
    • M
      ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV · b4f75aea
      Mengdong Lin 提交于
      This patch will verify the pin's coverter selection for an active stream
      when an unsol event reports this pin becomes available again after a display
      mode change or hot-plug event.
      
      For Haswell+ and Valleyview: display mode change or hot-plug can change the
      transcoder:port connection and make all the involved audio pins share the 1st
      converter. So the stream using 1st convertor will flow to multiple pins
      but active streams using other converters will fail. This workaround
      is to assure the pin selects the right conveter and an assigned converter is
      not shared by other unused pins.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b4f75aea
  16. 20 5月, 2014 1 次提交
  17. 13 5月, 2014 1 次提交
  18. 05 5月, 2014 2 次提交
    • A
      ALSA: hda - hdmi: Set infoframe and channel mapping even without sink · 561a7d6e
      Anssi Hannula 提交于
      Currently infoframe contents and channel mapping are only set when a
      sink (monitor) is present.
      
      However, this does not make much sense, since
      1) We can make a very reasonable guess on CA after 18e39186 ("ALSA:
         hda - hdmi: Fallback to ALSA allocation when selecting CA") or by
         relying on a previously valid ELD (or we may be using a
         user-specified channel map).
      2) Not setting infoframe contents and channel count simply means they
         are left at a possibly incorrect state - playback is still allowed
         to proceed (with missing or wrongly mapped channels).
      
      Reasons for monitor_present being 0 include disconnected cable, video
      driver issues, or codec not being spec-compliant. Note that in
      actual disconnected-cable case it should not matter if these settings
      are wrong as they will be re-set after jack detection, though.
      
      Change the behavior to allow the infoframe contents and the channel
      mapping to be set even without a sink/monitor, either based on the
      previous valid ELD contents, if any, or based on sensible defaults
      (standard channel layouts or provided custom map, sink type HDMI).
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Tested-by: NStephan Raue <stephan@openelec.tv>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      561a7d6e
    • A
      ALSA: hda - hdmi: Set converter channel count even without sink · f06ab794
      Anssi Hannula 提交于
      Since commit 1df5a06a ("ALSA: hda - hdmi: Fix programmed active channel
      count") channel count is no longer being set if monitor_present is 0.
      This is because setting the count was moved after the CA value is
      determined, which is only after the monitor_present check in
      hdmi_setup_audio_infoframe().
      
      Unfortunately, in some cases, such as with a non-spec-compliant codec or
      with a problematic video driver, monitor_present is always 0. As a
      specific example, this seems to happen with gen1 ATV (SiI1390 codec),
      causing left-channel-only stereo playback (multi-channel playback has
      apparently never worked with this codec despite it reporting 8 channels,
      reason unknown).
      
      Simply setting converter channel count without setting the pin infoframe
      and channel mapping as well does not theoretically make much sense as
      this will just mean they are out-of-sync and multichannel playback will
      have a wrong channel mapping.
      
      However, adding back just setting the converter channel count even in
      no-monitor case is the safest change which at least fixes the stereo
      playback regression on SiI1390 codec. Do that.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Reported-by: NStephan Raue <stephan@openelec.tv>
      Tested-by: NStephan Raue <stephan@openelec.tv>
      Cc: <stable@vger.kernel.org> # 3.12+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f06ab794
  19. 20 3月, 2014 1 次提交
    • M
      ALSA: hda - verify pin:cvt connection on preparing a stream for Intel HDMI codec · 2df6742f
      Mengdong Lin 提交于
      This is a temporary fix for some Intel HDMI codecs to avoid no sound output for
      a resuming playback after S3.
      
      After S3, the audio driver restores pin:cvt connection selections by
      snd_hda_codec_resume_cache(). However this can happen before the gfx side is
      ready and such connect selection is overlooked by HW. After gfx is ready, the
      pins make the default selection again. And this will cause multiple pins share
      a same convertor and mute control will affect each other. Thus a resumed audio
      playback become silent after S3.
      
      This patch verifies pin:cvt connection on preparing a stream, to assure the pin
      selects the right convetor and an assigned convertor is not shared by other
      unused pins. Apply this fix-up on Haswell, Broadwell and Valleyview (Baytrail).
      
      We need this temporary fix before a reliable software communication channel is
      established between audio and gfx, to sync audio/gfx operations.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2df6742f
  20. 11 3月, 2014 1 次提交
  21. 25 2月, 2014 1 次提交
    • T
      ALSA: hda - Replace with standard printk · 4e76a883
      Takashi Iwai 提交于
      Use dev_err() and co for messages from HD-audio controller and codec
      drivers.  The codec drivers are mostly bound with codec objects, so
      some helper macros, codec_err(), codec_info(), etc, are provided.
      They merely wrap the corresponding dev_xxx().
      
      There are a few places still calling snd_printk() and its variants
      as they are called without the codec or device context.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4e76a883
  22. 01 2月, 2014 1 次提交
    • S
      ALSA: hda/hdmi - allow PIN_OUT to be dynamically enabled · 75fae117
      Stephen Warren 提交于
      Commit 384a48d7 "ALSA: hda: HDMI: Support codecs with fewer cvts
      than pins" dynamically enabled each pin widget's PIN_OUT only when the
      pin was actively in use. This was required on certain NVIDIA CODECs for
      correct operation. Specifically, if multiple pin widgets each had their
      mux input select the same audio converter widget and each pin widget had
      PIN_OUT enabled, then only one of the pin widgets would actually receive
      the audio, and often not the one the user wanted!
      
      However, this apparently broke some Intel systems, and commit
      6169b673 "ALSA: hda - Always turn on pins for HDMI/DP" reverted the
      dynamic setting of PIN_OUT. This in turn broke the afore-mentioned NVIDIA
      CODECs.
      
      This change supports either dynamic or static handling of PIN_OUT,
      selected by a flag set up during CODEC initialization. This flag is
      enabled for all recent NVIDIA GPUs.
      Reported-by: NUosis <uosisl@gmail.com>
      Cc: <stable@vger.kernel.org> # v3.13
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      75fae117
  23. 09 1月, 2014 2 次提交
  24. 19 12月, 2013 1 次提交
  25. 18 12月, 2013 1 次提交
    • D
      ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense · da4a7a39
      David Henningsson 提交于
      This should help us avoid the following mutex deadlock:
      
      [] mutex_lock+0x2a/0x50
      [] hdmi_present_sense+0x53/0x3a0 [snd_hda_codec_hdmi]
      [] generic_hdmi_resume+0x5a/0x70 [snd_hda_codec_hdmi]
      [] hda_call_codec_resume+0xec/0x1d0 [snd_hda_codec]
      [] snd_hda_power_save+0x1e4/0x280 [snd_hda_codec]
      [] codec_exec_verb+0x5f/0x290 [snd_hda_codec]
      [] snd_hda_codec_read+0x5b/0x90 [snd_hda_codec]
      [] snd_hdmi_get_eld_size+0x1e/0x20 [snd_hda_codec_hdmi]
      [] snd_hdmi_get_eld+0x2c/0xd0 [snd_hda_codec_hdmi]
      [] hdmi_present_sense+0x9a/0x3a0 [snd_hda_codec_hdmi]
      [] hdmi_repoll_eld+0x34/0x50 [snd_hda_codec_hdmi]
      Signed-off-by: NDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      da4a7a39
  26. 11 12月, 2013 1 次提交
    • A
      ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices · c9a6338a
      Anssi Hannula 提交于
      In case a single HDA card has both HDMI and S/PDIF outputs, the S/PDIF
      outputs will have their IEC958 controls created starting from index 16
      and the HDMI controls will be created starting from index 0.
      
      However, HDMI simple_playback_build_controls() as used by old VIA and
      NVIDIA codecs incorrectly requests the IEC958 controls to be created
      with an S/PDIF type instead of HDMI.
      In case the card has other codecs that have HDMI outputs, the controls
      will be created with wrong index=16, causing them to e.g. be unreachable
      by the ALSA "hdmi" alias.
      
      Fix that by making simple_playback_build_controls() request controls
      with HDMI indexes.
      
      Not many cards have an affected configuration, but e.g. ASUS M3N78-VM
      contains an integrated NVIDIA HDA "card" with:
      - a VIA codec that has, among others, an S/PDIF pin incorrectly
        labelled as an HDMI pin, and
      - an NVIDIA MCP7x HDMI codec.
      
      Reported-by: MysterX on #openelec
      Tested-by: MysterX on #openelec
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: <stable@vger.kernel.org> # 3.8+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c9a6338a
  27. 06 12月, 2013 1 次提交
  28. 04 12月, 2013 1 次提交
  29. 26 11月, 2013 3 次提交
  30. 12 11月, 2013 2 次提交
  31. 07 11月, 2013 1 次提交