1. 16 5月, 2018 2 次提交
  2. 15 5月, 2018 1 次提交
    • F
      ALSA: hda/ca0132: fix array_size.cocci warnings · c5f13d75
      Fengguang Wu 提交于
      sound/pci/hda/patch_ca0132.c:5062:50-51: WARNING: Use ARRAY_SIZE
      sound/pci/hda/patch_ca0132.c:5092:50-51: WARNING: Use ARRAY_SIZE
      
       Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element
      
      Semantic patch information:
       This makes an effort to find cases where ARRAY_SIZE can be used such as
       where there is a division of sizeof the array by the sizeof its first
       element or by any indexed element or the element type. It replaces the
       division of the two sizeofs by ARRAY_SIZE.
      
      Generated by: scripts/coccinelle/misc/array_size.cocci
      
      Fixes: 47cdf76e ("ALSA: hda/ca0132: Add new control changes for SBZ + R3Di")
      CC: Connor McAdams <conmanx360@gmail.com>
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c5f13d75
  3. 13 5月, 2018 13 次提交
  4. 02 5月, 2018 1 次提交
  5. 13 10月, 2017 1 次提交
  6. 04 9月, 2017 1 次提交
  7. 01 4月, 2017 1 次提交
  8. 20 3月, 2017 1 次提交
    • M
      ALSA: hda/ca0132: Remove double parentheses · a16fbb85
      Matthias Kaehlcke 提交于
      The extra pairs of parantheses are not needed and causes clang to
      generate warnings like this:
      
      sound/pci/hda/patch_ca0132.c:1171:14: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
              if ((buffer == NULL))
                   ~~~~~~~^~~~~~~
      sound/pci/hda/patch_ca0132.c:1171:14: note: remove extraneous parentheses around the comparison to silence this warning
              if ((buffer == NULL))
                  ~       ^      ~
      sound/pci/hda/patch_ca0132.c:1171:14: note: use '=' to turn this equality comparison into an assignment
              if ((buffer == NULL))
      Signed-off-by: NMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a16fbb85
  9. 28 2月, 2017 1 次提交
  10. 12 1月, 2017 1 次提交
    • A
      ALSA: hda/ca0132 - fix possible NULL pointer use · 46a049da
      Arnd Bergmann 提交于
      gcc-7 caught what it considers a NULL pointer dereference:
      
      sound/pci/hda/patch_ca0132.c: In function 'dspio_scp.constprop':
      sound/pci/hda/patch_ca0132.c:1487:4: error: argument 1 null where non-null expected [-Werror=nonnull]
      
      This is plausible from looking at the function, as we compare 'reply'
      to NULL earlier in it. I have not tried to analyze if there are constraints
      that make it impossible to hit the bug, but adding another NULL check in
      the end kills the warning and makes the function more robust.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      46a049da
  11. 25 11月, 2016 1 次提交
  12. 12 9月, 2016 1 次提交
    • J
      ALSA: pci: constify local structures · 071f1344
      Julia Lawall 提交于
      For structure types defined in the same file or local header files, find
      top-level static structure declarations that have the following
      properties:
      1. Never reassigned.
      2. Address never taken
      3. Not passed to a top-level macro call
      4. No pointer or array-typed field passed to a function or stored in a
      variable.
      Declare structures having all of these properties as const.
      
      Done using Coccinelle.
      Based on a suggestion by Joe Perches <joe@perches.com>.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      071f1344
  13. 09 2月, 2016 1 次提交
    • T
      ALSA: hda - Fix bad dereference of jack object · 2ebab40e
      Takashi Iwai 提交于
      The hda_jack_tbl entries are managed by snd_array for allowing
      multiple jacks.  It's good per se, but the problem is that struct
      hda_jack_callback keeps the hda_jack_tbl pointer.  Since snd_array
      doesn't preserve each pointer at resizing the array, we can't keep the
      original pointer but have to deduce the pointer at each time via
      snd_array_entry() instead.  Actually, this resulted in the deference
      to the wrong pointer on codecs that have many pins such as CS4208.
      
      This patch replaces the pointer to the NID value as the search key.
      As an unexpected good side effect, this even simplifies the code, as
      only NID is needed in most cases.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2ebab40e
  14. 10 12月, 2015 1 次提交
  15. 26 10月, 2015 1 次提交
  16. 20 10月, 2015 1 次提交
    • T
      ALSA: hda - convert to hda_device_id · b9a94a9c
      Takashi Iwai 提交于
      Finally we have a proper infrastructure to generate the modaliases
      automatically, let's move to hda_device_id from the legacy
      hda_codec_preset that contains basically the same information.
      
      The patch function hook is stored in driver_data field, which is long,
      and we need an explicit cast.  Other than that, the conversion is
      mostly straightforward.  Each entry is even simplified using a macro,
      and the lengthy (and error-prone) manual modaliases got removed.
      
      As a result, we achieved a quite good diet:
       14 files changed, 407 insertions(+), 595 deletions(-)
      Reviewed-by: NVinod Koul <vinod.koul@intel.com>
      Tested-by: NSubhransu S Prusty <subhransu.s.prusty@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b9a94a9c
  17. 10 8月, 2015 1 次提交
    • T
      ALSA: hda - Fix pin config and mapping on Alienware 15 · fe14f39e
      Takashi Iwai 提交于
      Alienware 15 has CA0132 codec for its onboard sound, but the pin
      config and mapping seem quite different from other Creative boards.
      This patch corrects them, at least, for providing the right headphone
      and mic jack notification, as well as removing the non-existing SPDIF
      pins.
      
      Even with this fix, not all stuff works perfectly yet, mainly because
      of the badly written ca0132 driver code -- it has too many implicit
      assumptions of pin configs and maps.  Nevertheless, this is a small
      good step forward.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101981Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fe14f39e
  18. 29 5月, 2015 1 次提交
  19. 19 5月, 2015 1 次提交
  20. 16 4月, 2015 1 次提交
  21. 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
  22. 23 3月, 2015 1 次提交
  23. 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
  24. 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
  25. 11 11月, 2014 1 次提交