1. 24 May, 2017 1 commit
  2. 23 May, 2017 3 commits
    • Takashi Iwai's avatar
      ALSA: info: Use kvzalloc() for a temporary write buffer · ffb73b08
      Takashi Iwai authored
      We used to use kmalloc (more exactly, krealloc()) for creating and
      growing the temporary buffer for text proc write.  It can grow up to
      16kB, and it's already a bit doubtful whether it's always safe to use
      kmalloc().  With the recent addition of kvmalloc(), we can have a
      better chance for succeed of memory allocation, so let's switch to
      that new API.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ffb73b08
    • Takashi Iwai's avatar
      ALSA: pcm: Remove set_fs() in PCM core code · c2c86a97
      Takashi Iwai authored
      PCM core code has a few usages of set_fs(), mostly for two codepaths:
      - The DELAY ioctl call from pcm_compat.c
      - The ioctl wrapper in kernel context for PCM OSS and other
      
      This patch removes the set_fs() usage in these places by a slight code
      refactoring.  For the former point, snd_pcm_delay() is changed to
      return the  value directly instead of putting the value to the given
      address.  Each caller stores the result in an appropriate manner.
      
      For fixing the latter, snd_pcm_lib_kernel_ioctl() is changed to call
      the functions directly as well.  For achieving it, now the function
      accepts only the limited set of ioctls that have been used, so far.
      The primary user of this function is the PCM OSS layer, and the only
      other user is USB UAC1 gadget driver.  Both drivers don't need the
      full set of ioctls.
      Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c2c86a97
    • Takashi Iwai's avatar
      ALSA: control: Simplify snd_ctl_elem_list() implementation · 53e7bf45
      Takashi Iwai authored
      This patch simplifies the code of snd_ctl_elem_list() in the following
      ways:
      
      - Avoid a vmalloc() temporary buffer but do copy in each iteration;
        the vmalloc buffer was introduced at the time we took the spinlock
        for the ctl element management.
      
      - Use the standard list_for_each_entry() macro
      
      - Merge two loops into one;
        it used to be a loop for skipping until offset becomes zero and
        another loop to copy the data.  They can be folded into a single
        loop easily.
      Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Tested-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      53e7bf45
  3. 22 May, 2017 1 commit
    • Takashi Sakamoto's avatar
      ALSA: firewire: remove support for 16 bit PCM samples in playback substream · a02cb8f8
      Takashi Sakamoto authored
      In IEC 61883-6, AM824 is described as format of data block. In this
      format, one data block consists of several data channels, which is aligned
      to 32 bit. One data channel has 8 bit label field and 24 bit data field.
      PCM frames are transferred in Multi Bit Linear Audio (MBLA) data channel.
      This channel can include 16/20/24 bit PCM sample.
      
      As long as I know, models which support IEC 61883-1/6 doesn't allow to
      switch bit length of PCM sample in MBLA data channel. They always
      transmit/receive PCM frames of 24 bit length. This can be seen for the
      other models which support protocols similar to IEC 61883-1/6.
      
      On the other hand, current drivers for these protocols supports 16 bit
      length PCM sample in playback substream. In this case, PCM sample is put
      into the MBLA data channel with 8 bit padding in LSB side. Although 16
      bit PCM sample is major because it's in CD format, this doesn't represent
      device capability as is.
      
      This commit removes support for 16 bit PCM samples in playback substream.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Acked-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a02cb8f8
  4. 21 May, 2017 6 commits
    • Bhumika Goyal's avatar
      ALSA: mixart: constify snd_kcontrol_new structures · 665170f7
      Bhumika Goyal authored
      Declare snd_kcontrol_new structures as const as they are only passed an
      argument to the function snd_ctl_new1. This argument is of type const,
      so snd_kcontrol_new structures having this property can be made const.
      Done using Coccinelle:
      
      @r disable optional_qualifier@
      identifier x;
      position p;
      @@
      static struct snd_kcontrol_new x@p={...};
      
      @ok@
      identifier r.x;
      position p;
      @@
      snd_ctl_new1(&x@p,...)
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.x;
      @@
      x@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.x;
      @@
      +const
      struct snd_kcontrol_new x;
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      665170f7
    • Bhumika Goyal's avatar
      ALSA: cs46xx: constify snd_kcontrol_new structures · 30b5817e
      Bhumika Goyal authored
      Declare snd_kcontrol_new structures as const as they are only passed an
      argument to the function snd_ctl_new1. This argument is of type const,
      so snd_kcontrol_new structures having this property can be made const.
      Done using Coccinelle:
      
      @r disable optional_qualifier@
      identifier x;
      position p;
      @@
      static struct snd_kcontrol_new x@p={...};
      
      @ok@
      identifier r.x;
      position p;
      @@
      snd_ctl_new1(&x@p,...)
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.x;
      @@
      x@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.x;
      @@
      +const
      struct snd_kcontrol_new x;
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      30b5817e
    • Bhumika Goyal's avatar
      ALSA: ice1712: constify snd_kcontrol_new structures · 6ba1ad38
      Bhumika Goyal authored
      Declare snd_kcontrol_new structures as const as they are only passed an
      argument to the function snd_ctl_new1. This argument is of type const,
      so snd_kcontrol_new structures having this property can be made const.
      Done using Coccinelle:
      
      @r disable optional_qualifier@
      identifier x;
      position p;
      @@
      static struct snd_kcontrol_new x@p={...};
      
      @ok@
      identifier r.x;
      position p;
      @@
      snd_ctl_new1(&x@p,...)
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.x;
      @@
      x@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.x;
      @@
      +const
      struct snd_kcontrol_new x;
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6ba1ad38
    • Bhumika Goyal's avatar
      ALSA: sound/isa: constify snd_kcontrol_new structures · 3a84d6c9
      Bhumika Goyal authored
      Declare snd_kcontrol_new structures as const as they are only passed an
      argument to the function snd_ctl_new1. This argument is of type const,
      so snd_kcontrol_new structures having this property can be made const.
      Done using Coccinelle:
      
      @r disable optional_qualifier@
      identifier x;
      position p;
      @@
      static struct snd_kcontrol_new x@p={...};
      
      @ok@
      identifier r.x;
      position p;
      @@
      snd_ctl_new1(&x@p,...)
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.x;
      @@
      x@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.x;
      @@
      +const
      struct snd_kcontrol_new x;
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3a84d6c9
    • Takashi Iwai's avatar
      ALSA: pcm: Simplify forward/rewind codes · e0327a0f
      Takashi Iwai authored
      Factor out the common codes in snd_pcm_*_forward() and *_rewind()
      functions to simplify the codes.  No functional changes.
      Reviewd-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e0327a0f
    • Takashi Iwai's avatar
      ALSA: pcm: Use a common helper for PCM state check and hwsync · f839cc1c
      Takashi Iwai authored
      The mostly same codes for checking the current PCM state and calling
      hwsync are found in a few places.  This patch simplifies them by
      creating a common helper function.
      
      It also fixes a couple of cases where we missed the proper state check
      (e.g. PAUSED state wasn't handled in rewind and snd_pcm_hwsync()),
      too.
      Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f839cc1c
  5. 18 May, 2017 2 commits
  6. 17 May, 2017 23 commits
  7. 15 May, 2017 4 commits