1. 27 Jul, 2018 13 commits
    • Takashi Iwai's avatar
      ALSA: hda: Proper endian notations for BDL pointers · 7362b0fc
      Takashi Iwai authored
      The BDL pointer used in snd_hdac_dsp_prepare() should be declared as
      __le32, as warned by sparse:
        sound/hda/hdac_stream.c:655:47: warning: incorrect type in argument 4 (different base types)
        sound/hda/hdac_stream.c:655:47:    expected restricted __le32 [usertype] **bdlp
        sound/hda/hdac_stream.c:655:47:    got unsigned int [usertype] **<noident>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7362b0fc
    • Takashi Iwai's avatar
      ALSA: trident: Proper endian notations · 752089fe
      Takashi Iwai authored
      The TLB entries in Trident driver are represented in little-endian,
      hence they should be declared as __le32.
      
      This patch fixes the sparse warnings like:
        sound/pci/trident/trident_memory.c:226:17: warning: incorrect type in assignment (different base types)
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      752089fe
    • Takashi Iwai's avatar
      ALSA: ymfpci: Proper endian notations · d3c63763
      Takashi Iwai authored
      The bank values are all little-endians, so they should be defined with
      __le32.  This fixes lots of sparse warnings like:
        sound/pci/ymfpci/ymfpci_main.c:315:23: warning: cast to restricted __le32
        sound/pci/ymfpci/ymfpci_main.c:342:32: warning: incorrect type in assignment (different base types)
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d3c63763
    • Takashi Iwai's avatar
      ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits · 3ac14b39
      Takashi Iwai authored
      The open codes with the bit shift in xen_snd_front_alsa.c give sparse
      warnings as the PCM format type is with __bitwise.
      There is already a standard macro to get the format bits, so let's use
      it instead.
      
      This fixes sparse warnings like:
        sound/xen/xen_snd_front_alsa.c:191:47: warning: restricted snd_pcm_format_t degrades to integer
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3ac14b39
    • Takashi Iwai's avatar
      ALSA: sb: Fix sparse warning wrt PCM format type · e5d3765b
      Takashi Iwai authored
      The PCM format type is with __bitwise, and it can't be converted from
      integer implicitly.  Instead of an ugly cast, declare the function
      argument of snd_sb_csp_autoload() with the proper snd_pcm_format_t
      type.
      
      This fixes the sparse warnings like:
        sound/isa/sb/sb16_csp.c:743:22: warning: restricted snd_pcm_format_t degrades to integer
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e5d3765b
    • Takashi Iwai's avatar
      ALSA: sb: Fix PCM format bit calculation · 55ff2d1e
      Takashi Iwai authored
      The PCM format type in snd_pcm_format_t can't be treated as integer
      implicitly since it's with __bitwise.  We have already a helper
      function to get the bit index of the given type, and use it in each
      place instead.
      
      This fixes sparse warnings like:
        sound/isa/sb/sb16_main.c:61:44: warning: restricted snd_pcm_format_t degrades to integer
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      55ff2d1e
    • Takashi Iwai's avatar
      ALSA: wss: Fix sparse warning wrt PCM format type · 6be9a60e
      Takashi Iwai authored
      The PCM format type is with __bitwise, and it can't be converted from
      integer implicitly.  Instead of an ugly cast, declare the function
      argument of snd_wss_get_format() with the proper snd_pcm_format_t
      type.
      
      This fixes the sparse warnings like:
        sound/isa/wss/wss_lib.c:551:14: warning: restricted snd_pcm_format_t degrades to integer
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6be9a60e
    • Takashi Iwai's avatar
      ALSA: asihpi: Fix PCM format notations · a91a0e77
      Takashi Iwai authored
      asihpi driver treats -1 as an own invalid PCM format, but this needs
      a proper cast with __force prefix since PCM format type is __bitwise.
      Define a constant with the proper type and use it allover.
      
      This fixes sparse warnings like:
        sound/pci/asihpi/asihpi.c:315:9: warning: incorrect type in initializer (different base types)
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a91a0e77
    • Takashi Iwai's avatar
      ALSA: au88x0: Fix sparse warning wrt PCM format type · 10d3d91e
      Takashi Iwai authored
      The PCM format type is with __bitwise, and it can't be converted from
      integer implicitly.  Instead of an ugly cast, declare the function
      argument of vortex_alsafmt_aspfmt() with the proper snd_pcm_format_t
      type.
      
      This fixes the sparse warning like:
        sound/pci/au88x0/au88x0_core.c:2778:14: warning: restricted snd_pcm_format_t degrades to integer
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      10d3d91e
    • Takashi Iwai's avatar
      ALSA: ad1816a: Fix sparse warning wrt PCM format type · d63f33d3
      Takashi Iwai authored
      The PCM format type is with __bitwise, and it can't be converted from
      integer implicitly.  Instead of an ugly cast, declare the function
      argument of snd_ad1816a_get_format() with the proper snd_pcm_format_t
      type.
      
      This fixes the sparse warning like:
        sound/isa/ad1816a/ad1816a_lib.c:93:14: warning: restricted snd_pcm_format_t degrades to integer
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d63f33d3
    • Takashi Iwai's avatar
      ALSA: pcm: Fix sparse warning wrt PCM format type · f8b6c0cf
      Takashi Iwai authored
      The PCM format type is with __bitwise, hence it needs the explicit
      cast with __force.  It's ugly, but there is a reason for that cost...
      
      This fixes the sparse warning:
        sound/core/oss/pcm_oss.c:1854:55: warning: incorrect type in argument 1 (different base types)
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f8b6c0cf
    • Takashi Iwai's avatar
      ALSA: riptide: Fix PCM format type conversion · 94dfee0c
      Takashi Iwai authored
      The PCM format type is with __bitwise, hence it needs to be explicitly
      declared as snd_pcm_format_t, as warned by sparse:
        sound/pci/riptide/riptide.c:1028:34: warning: incorrect type in argument 1 (different base types)
        sound/pci/riptide/riptide.c:1028:34:    expected restricted snd_pcm_format_t [usertype] format
        sound/pci/riptide/riptide.c:1028:34:    got unsigned char [unsigned] format
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      94dfee0c
    • Takashi Iwai's avatar
      ALSA: hda: Fix implicit PCM format type conversion · a6ea5fe9
      Takashi Iwai authored
      The PCM format type is defined with __bitwise, hence it can't be
      passed as integer but needs an explicit cast.  In this patch, instead
      of the messy cast flood, define the format argument of
      snd_hdac_calc_stream_format() to be the proper snd_pcm_format_t type.
      
      This fixes sparse warnings like:
        sound/hda/hdac_device.c:760:38: warning: incorrect type in argument 1 (different base types)
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a6ea5fe9
  2. 26 Jul, 2018 14 commits
  3. 24 Jul, 2018 1 commit
    • Takashi Iwai's avatar
      ALSA: hda/i915: Allow delayed i915 audio component binding · f9b54e19
      Takashi Iwai authored
      Currently HD-audio i915 audio binding doesn't support any delayed
      binding, and supposes that the i915 driver registers the component
      immediately.  This has been OK, so far, but the work-in-progress
      change in i915 may introduce the asynchronous binding, which
      effectively delays the component registration.
      
      For addressing it, implement a completion to be synced with the master
      binding.  The timeout is set to 10 seconds which should be long enough
      and hopefully be not too annoying if anyone boots up a debugging
      session with i915 KMS turned off.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f9b54e19
  4. 23 Jul, 2018 1 commit
  5. 22 Jul, 2018 1 commit
    • Srikanth K H's avatar
      ALSA: timer: catch invalid timer object creation · d10ee9c5
      Srikanth K H authored
      A timer object for the classes SNDRV_TIMER_CLASS_CARD and
      SNDRV_TIMER_CLASS_PCM has to be associated with a card object, but we
      have no check at creation time.  Such a timer object with NULL card
      causes various unexpected problems, e.g. NULL dereference at reading
      the sound timer proc file.
      
      So as preventive measure while the creating the sound timer object is
      created the card information availability is checked for the mentioned
      entries and returned error if its NULL.
      Signed-off-by: default avatarSrikanth K H <srikanth.h@samsung.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d10ee9c5
  6. 19 Jul, 2018 2 commits
  7. 18 Jul, 2018 3 commits
  8. 17 Jul, 2018 5 commits
    • Takashi Iwai's avatar
      ALSA: rawmidi: Minor code refactoring · f5beb598
      Takashi Iwai authored
      Unify a few open codes with helper functions to improve the
      readability.  Minor behavior changes (rather fixes) are:
      - runtime->drain clearance is done within lock
      - active_sensing is updated before resizing buffer in
        SNDRV_RAWMIDI_IOCTL_PARAMS ioctl.
      Other than that, simply code cleanups.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f5beb598
    • Takashi Iwai's avatar
      ALSA: rawmidi: Simplify error paths · 7fdc9b08
      Takashi Iwai authored
      Apply the standard idiom: rewrite the multiple unlocks in error paths
      in the goto-error-and-single-unlock way.
      
      Just a code refactoring, and no functional changes.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7fdc9b08
    • Takashi Iwai's avatar
      ALSA: rawmidi: Tidy up coding styles · 5bed9139
      Takashi Iwai authored
      Just minor coding style fixes like removal of superfluous white space,
      adding missing blank lines, etc.  No actual code changes at all.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5bed9139
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · ed6b83d2
      Takashi Iwai authored
      Back-merge for further cleanup / improvements on rawmidi and HD-audio
      stuff.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ed6b83d2
    • Takashi Iwai's avatar
      ALSA: hda: Make audio component support more generic · a57942bf
      Takashi Iwai authored
      This is the final step for more generic support of DRM audio
      component.  The generic audio component code is now moved to its own
      file, and the symbols are renamed from snd_hac_i915_* to
      snd_hdac_acomp_*, respectively.  The generic code is enabled via the
      new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
      kept as the super-class.
      
      Along with the split, three new callbacks are added to audio_ops:
      pin2port is for providing the conversion between the pin number and
      the widget id, and master_bind/master_unbin are called at binding /
      unbinding the master component, respectively.  All these are optional,
      but used in i915 implementation and also other later implementations.
      
      A note about the new snd_hdac_acomp_init() function: there is a slight
      difference between this and the old snd_hdac_i915_init().  The latter
      (still) synchronizes with the master component binding, i.e. it
      assures that the relevant DRM component gets bound when it returns, or
      gives a negative error.  Meanwhile the new function doesn't
      synchronize but just leaves as is.  It's the responsibility by the
      caller's side to synchronize, or the caller may accept the
      asynchronous binding on the fly.
      
      v1->v2: Fix missing NULL check in master_bind/unbind
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a57942bf