1. 25 2月, 2014 5 次提交
    • 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
    • T
      ALSA: hda - Add sysfs to codec object, too · 648a8d27
      Takashi Iwai 提交于
      We have currently sysfs attributes for each hwdep, but basically these
      should belong to the codec itself, per se.  Let's add them to the
      codec object while keeping them for hwdep as is for compatibility.
      
      While we are at it, split the sysfs-related stuff into a separate
      source file, hda_sysfs.c, and keep only the stuff necessary for hwdep
      in hda_hwdep.c.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      648a8d27
    • T
      ALSA: hda - Create own device struct for each codec · 13aeaf68
      Takashi Iwai 提交于
      As the HD-audio is treated individually in each codec driver, it's
      more convenient to assign an own struct device to each codec object.
      Then we'll be able to use dev_err() more easily for each codec, for
      example.
      
      For achieving it, this patch just creates an object "hdaudioCxDy".
      It belongs to sound class instead of creating a new bus, just for
      simplicity, at this stage.  No pm ops is implemented in the device
      struct level but currently it's merely a container.  The PCM and hwdep
      devices are now children of this codec device.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      13aeaf68
    • T
      ALSA: hda - Manage each codec instance individually · 2565c899
      Takashi Iwai 提交于
      Now each snd_hda_codec instance is managed via the device chain, the
      registration and release are done by its callback instead of calling
      from bus.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2565c899
    • T
      ALSA: Create sysfs attribute files via groups · caa751ba
      Takashi Iwai 提交于
      Instead of calling each time device_create_file(), create the groups
      of sysfs attribute files at once in a normal way.  Add a new helper
      function, snd_get_device(), to return the associated device object,
      so that we can handle the sysfs addition locally.
      
      Since the sysfs file addition is done differently now,
      snd_add_device_sysfs_file() helper function is removed.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      caa751ba
  2. 19 2月, 2014 1 次提交
  3. 15 2月, 2014 1 次提交
  4. 10 2月, 2014 1 次提交
    • T
      ALSA: hda - Fix undefined symbol due to builtin/module mixup · ef8e39b5
      Takashi Iwai 提交于
      Even after the fix for leftover kconfig handling (commit f8f1becf),
      the current code still doesn't handle properly the builtin/module
      mixup case between the core snd-hda-codec and other codec drivers.
      For example, when CONFIG_SND_HDA_INTEL=y and
      CONFIG_SND_HDA_CODEC_HDMI=m, it'll end up with an unresolved symbol
      snd_hda_parse_hdmi_codec.  This patch fixes the issue.
      
      Now codec->parser points to the parser object *only* when a module
      (either generic or HDMI parser) is loaded and bound.  When a builtin
      symbol is used, codec->parser still points to NULL.  This is the
      difference from the previous versions.
      
      Fixes: f8f1becf ('ALSA: hda - Fix leftover ifdef checks after modularization')
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ef8e39b5
  5. 07 2月, 2014 1 次提交
  6. 13 1月, 2014 1 次提交
  7. 19 12月, 2013 1 次提交
  8. 06 12月, 2013 1 次提交
  9. 29 11月, 2013 1 次提交
  10. 27 11月, 2013 2 次提交
    • M
      ALSA: hda - resume codecs in parallel · 12edb893
      Mengdong Lin 提交于
      To reduce driver resume time, this patch resumes the codecs in parallel
      if there are multiple codecs on the bus.
      
      - The PM workqueue of bus is also used to parallel resuming multiple codecs.
      - The work item 'pm_work' is renamed to 'suspend_work' to parallel suspending
        codecs.
      - Add a work item 'resume_work' to parallel resuming codecs.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      12edb893
    • M
      ALSA: hda - suspend codecs in parallel · 0e24dbb7
      Mengdong Lin 提交于
      The time to suspend a single codec may be several hundreds of ms. When runtime
      power saving is disabled, driver suspend time can be long especially when there
      are more than one codec on the bus.
      
      To reduce driver suspend time, this patch creates a work queue for the bus, and
      suspends the codecs in parallel if there are multiple codecs on the bus.
      
      [fixed cosmetic issues by tiwai]
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0e24dbb7
  11. 26 11月, 2013 4 次提交
  12. 20 11月, 2013 1 次提交
    • T
      ALSA: hda - Fix unbalanced runtime PM notification at resume · 0fc28fc0
      Takashi Iwai 提交于
      When a codec is resumed, it keeps the power on while the resuming
      phase via hda_keep_power_on(), then turns down via
      snd_hda_power_down().  At that point, snd_hda_power_down() notifies
      the power down to the controller, and this may confuse the refcount if
      the codec was already powered up before the resume.
      
      In the end result, the controller goes to runtime suspend even before
      the codec is kicked off to the power save, and the communication
      stalls happens.
      
      The fix is to add the power-up notification together with
      hda_keep_power_on(), and clears the flag appropriately.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0fc28fc0
  13. 14 11月, 2013 1 次提交
    • T
      ALSA: hda - Don't clear the power state at snd_hda_codec_reset() · d183b4fc
      Takashi Iwai 提交于
      snd_hda_codec_reset() is called either in resetting the whole setup at
      error paths or hwdep clear/reconfig sysfs triggers.  But all of these
      don't assume that the power has to be off, rather they want to keep
      the power state unchanged (e.g. reconfig_codec() calls the power
      up/down by itself).  Thus, unconditionally clearing the power state in
      snd_hda_codec_reset() leads to the inconsistency, confuses the further
      operation.   This patch gets rid of the lines doing that bad thing.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d183b4fc
  14. 05 11月, 2013 2 次提交
  15. 29 10月, 2013 1 次提交
  16. 24 10月, 2013 1 次提交
    • T
      ALSA: hda - Fix unbalanced runtime PM refcount after S3/S4 · e6bbe666
      Takashi Iwai 提交于
      When a machine goes to S3/S4 after power-save is enabled, the runtime
      PM refcount might be incorrectly decreased because the power-down
      triggered soon after resume assumes that the controller was already
      powered up, and issues the pm_notify down.
      
      This patch fixes the incorrect pm_notify call simply by checking the
      current value properly.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e6bbe666
  17. 18 10月, 2013 1 次提交
    • T
      ALSA: hda - Treat zero connection as non-error · 4758fed9
      Takashi Iwai 提交于
      The zero-length connection list happens so often on Haswell HDMI, and
      it results in warning messages like
          ALSA: hda_codec: invalid CONNECT_LIST verb 5[1]:0
      at each time the codec resumes from the power-save, which is fairly
      annoying.
      
      Since this is no real error, make it shown only in the verbose debug
      mode.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4758fed9
  18. 10 10月, 2013 1 次提交
  19. 27 8月, 2013 1 次提交
  20. 29 7月, 2013 1 次提交
    • W
      ALSA: hda - jack poll once if jackpoll_interval==0 · 18e60627
      Wang Xingchao 提交于
      With jackpoll_interval != 0, it's used to poll jack event periodically
      in a delayed work. if it's 0, give the caller chance to probe jack status
      but will not restart the delayed work.
      
      In the next patch which enable WAKEEN feature, HDA controller was able to wake
      up system when it's in D3, it's useful to detect Jack hotplug event and notify
      userspace. By default the jackpoll_interval=0, this patch let jack poll once
      without starting the delayed work.
      Signed-off-by: NWang Xingchao <xingchao.wang@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      18e60627
  21. 28 6月, 2013 1 次提交
  22. 06 6月, 2013 3 次提交
    • T
      ALSA: hda - Don't take unresponsive D3 transition too serious · 63e51fd7
      Takashi Iwai 提交于
      When a codec is powered off, some systems don't respond properly after
      D3 FG transition, while the driver still expects the response and
      tries to fall back to different modes (polling and single-cmd).  When
      the fallback happens, the driver stays in that mode, and falling back
      to the single-cmd mode means it'll loose the unsol event handling,
      too.
      
      The unresponsiveness at D3 isn't too serious, thus this fallback is
      mostly superfluous.  We can gracefully ignore the error there so that
      the driver keeps the normal operation mode.
      
      This patch adds a new bit flag for codec read/write, set in the power
      transition stage, which is notified to the controller driver via a new
      bus->no_response_fallback flag.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      63e51fd7
    • T
      ALSA: hda - Introduce bit flags to snd_hda_codec_read/write() · e7ecc27e
      Takashi Iwai 提交于
      snd_hda_codec_read(), snd_hda_codec_write() & co take the argument
      "direct" that indicates whether the given NID is a direct reference or
      an indirect reference.  However, the indirect reference is practically
      unimplemented and never exists.  And moreover, we don't need the
      indication of indirect reference at this high level, as NID can be
      represented in 16bit values at this point.
      
      Meanwhile, there are some cases where it'd be nice to give some
      operational options to these functions.  So, we can reuse this
      argument as a new bit flag!  Pretty frugal, eh?
      
      All callers so far pass zero to this argument, thus there is no
      behavior change by this replacement.
      
      The real usage of this new bit option will be added in the following
      patches.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e7ecc27e
    • T
      ALSA: hda - Drop hard dependency on CONFIG_SND_DYNAMIC_MINORS · 36bb00d4
      Takashi Iwai 提交于
      Currently HDMI codec driver sets the hard dependency (reverse
      selection) on CONFIG_SND_DYNAMIC_MINORS because the recent codecs may
      support more than two PCMs.  But, this doesn't mean that we need
      always this option, since there can be a single PCM stream even with
      the modern codecs.
      
      This patch drops the hard dependency again but give more sensible
      error message when no enough PCMs are available due to the lack of
      this option.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      36bb00d4
  23. 10 5月, 2013 1 次提交
  24. 07 5月, 2013 1 次提交
    • W
      ALSA: HDA: Fix Oops caused by dereference NULL pointer · 2195b063
      Wang YanQing 提交于
      The interrupt handler azx_interrupt will call azx_update_rirb,
      which may call snd_hda_queue_unsol_event, snd_hda_queue_unsol_event
      will dereference chip->bus pointer.
      
      The problem is we alloc chip->bus in azx_codec_create
      which will be called after we enable IRQ and enable unsolicited
      event in azx_probe.
      
      This will cause Oops due dereference NULL pointer. I meet it, good luck:)
      
      [Rearranged the NULL check before the tracepoint and added another
       NULL check of bus->workq -- tiwai]
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2195b063
  25. 18 4月, 2013 2 次提交
    • T
      ALSA: hda - Disable the sanity check in snd_hda_add_pincfg() · d5657ec9
      Takashi Iwai 提交于
      When pin default configs are overridden via patch option, these are
      evaluated before fixups are applied.  Since some fixups change the
      whole codec trees and/or add pins dynamically, this sanity check might
      not pass when pins aren't present at the time the function is called.
      
      We may reorder the execution, but an easier fix is simply to disable
      this sanity check.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d5657ec9
    • T
      ALSA: hda - Don't call vmaster hook when bus->shutdown is set · 594813ff
      Takashi Iwai 提交于
      The flag bus->shutdown implies that the control elements might have
      been already destroyed.  When a codec is resumed at this state and
      tries to call vmaster hook (e.g. in snd_hda_gen_init()), it would
      refer to a non-existing object, resulting in Oops in the end.
      
      This patch just adds a check of the flag in the caller side for
      avoiding such a crash.
      
      Though, the best would be to clear hook->sw_kctl by the destructor of
      the corresponding ctl element, but vmaster uses its own private_free,
      it can't be done easily.  So let it be for a while.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      594813ff
  26. 04 4月, 2013 1 次提交
  27. 20 3月, 2013 1 次提交
  28. 14 3月, 2013 1 次提交
    • T
      ALSA: hda - Don't apply EAPD power filter as default · ba615b86
      Takashi Iwai 提交于
      So far, the driver doesn't power down the widget at going down to D3
      when the widget node has an EAPD capability and EAPD is actually set
      on all codecs unless codec->power_filter is set explicitly.
      This caused a problem on some Conexant codecs, leading to click
      noises, and we set it as NULL there.  But it is very unlikely that the
      problem hits only these codecs.
      
      Looking back at the development history, this workaround for EAPD was
      introduced just for some laptops with STAC9200 codec, then we applied
      it blindly for all.  Now, since it's revealed to have an ill effect,
      we should disable this workaround per default and apply only for the
      known requiring systems.
      
      The EAPD workaround is implemented now as snd_hda_codec_eapd_power_filter(),
      and this has to be set explicitly by the codec driver when needed.
      As of now, only patch_stac9200() sets this one.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ba615b86