1. 02 Jun, 2017 6 commits
  2. 30 May, 2017 2 commits
    • Colin Ian King's avatar
      ALSA: pcm: include pcm_local.h and remove some extraneous tabs · 7421a167
      Colin Ian King authored
      We need to include pcm_local.h to clean up some smatch warnings:
      
      symbol 'snd_pcm_timer_done' was not declared. Should it be static?
      symbol 'snd_pcm_timer_init' was not declared. Should it be static?
      symbol 'snd_pcm_timer_resolution_change' was not declared. Should
        it be static?
      
      Also remove some extraneous tabs on empty lines and replace space
      intentation with a tab.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7421a167
    • Bhumika Goyal's avatar
      ALSA: declare snd_kcontrol_new structures as const · 905e46ac
      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;
      
      Cross compiled these files:
      sound/aoa/codecs/tas.c - powerpc
      sound/mips/{hal2.c/sgio2audio.c} - mips
      sound/ppc/{awacs.c/beep.c/tumbler.c} - powerpc
      sound/soc/sh/siu_dai.c - sh
      Could not find an architecture to compile sound/sh/aica.c.
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      905e46ac
  3. 26 May, 2017 1 commit
  4. 25 May, 2017 7 commits
  5. 24 May, 2017 3 commits
    • Takashi Sakamoto's avatar
      ALSA: sb: remove needless evaluation in implementation for copy callback · 6dbaf8b9
      Takashi Sakamoto authored
      In design of ALSA pcm core, 'struct snd_pcm_ops.copy' is expected to
      copy PCM frames, according to frame alignment on intermediate buffer for
      userspace and dedicated buffer for data transmission. In this callback,
      value of 'channel' argument depends on the frame alignment, which drivers
      registers to runtime of PCM substream. When target devices can handle
      non-interleaved buffer, this value has positive value, otherwise negative.
      
      ALSA driver for PCM component of EMU8000 chip is programmed with local
      macro to switch the frame alignment. The 'copy' operation in
      non-interleaved side has evaluation of the 'channel' argument (actually
      it's 'voice' argument). This is useless.
      
      This commit remove the evaluation.
      
      [tiwai: the negative channel argument was the inheritance from the old
       code where -1 was meant for interleaved mode.  The mix-up was dropped
       meanwhile, thus it's correct to assume that we receive no longer -1
       there, and it's safe to cleanup the relevant code.
      
       Also, voice=0 for channel==1 is trivial, and it can be dropped, too.]
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6dbaf8b9
    • Takashi Sakamoto's avatar
      ALSA: gus: remove unused local flag · 097a7fe3
      Takashi Sakamoto authored
      ALSA driver series for devices of Gravis Ultra Sound includes local
      variable 'snd_gf1_pcm_use_dma'. Although this is a flag to change
      behaviours of local implementations for 'struct snd_pcm_ops.copy' and
      'struct snd_pcm_ops.silence', it's invariable during module lifetime.
      
      This commit removes this local variable and the relevant operations.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      097a7fe3
    • Takashi Sakamoto's avatar
      ALSA: control: remove entry limitation for list operation · 4e361d3c
      Takashi Sakamoto authored
      In current implementation of ALSA control core, list operation has
      a limitation to handle 16384 entries at once. This seems due to
      allocation in kernel space to copy data from user space.
      
      With a commit 53e7bf45 ("ALSA: control: Simplify snd_ctl_elem_list()
      implementation"), for the operation, ALSA control core copies data
      into user space directly. No need to care of kernel spaces anymore.
      
      This commit purges the limitation.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4e361d3c
  6. 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
  7. 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
  8. 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
  9. 18 May, 2017 2 commits
  10. 17 May, 2017 9 commits