1. 31 5月, 2017 1 次提交
  2. 30 5月, 2017 1 次提交
    • B
      ALSA: declare snd_kcontrol_new structures as const · 905e46ac
      Bhumika Goyal 提交于
      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: NBhumika Goyal <bhumirks@gmail.com>
      Acked-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      905e46ac
  3. 26 5月, 2017 8 次提交
  4. 25 5月, 2017 2 次提交
    • T
      ALSA: sb: remove needless evaluation in implementation for copy callback · 6dbaf8b9
      Takashi Sakamoto 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6dbaf8b9
    • T
      ALSA: gus: remove unused local flag · 097a7fe3
      Takashi Sakamoto 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      097a7fe3
  5. 24 5月, 2017 1 次提交
  6. 23 5月, 2017 3 次提交
    • T
      ALSA: info: Use kvzalloc() for a temporary write buffer · ffb73b08
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      ffb73b08
    • T
      ALSA: pcm: Remove set_fs() in PCM core code · c2c86a97
      Takashi Iwai 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c2c86a97
    • T
      ALSA: control: Simplify snd_ctl_elem_list() implementation · 53e7bf45
      Takashi Iwai 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Tested-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      53e7bf45
  7. 22 5月, 2017 1 次提交
    • T
      ALSA: firewire: remove support for 16 bit PCM samples in playback substream · a02cb8f8
      Takashi Sakamoto 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a02cb8f8
  8. 21 5月, 2017 6 次提交
    • B
      ALSA: mixart: constify snd_kcontrol_new structures · 665170f7
      Bhumika Goyal 提交于
      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: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      665170f7
    • B
      ALSA: cs46xx: constify snd_kcontrol_new structures · 30b5817e
      Bhumika Goyal 提交于
      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: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      30b5817e
    • B
      ALSA: ice1712: constify snd_kcontrol_new structures · 6ba1ad38
      Bhumika Goyal 提交于
      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: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6ba1ad38
    • B
      ALSA: sound/isa: constify snd_kcontrol_new structures · 3a84d6c9
      Bhumika Goyal 提交于
      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: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3a84d6c9
    • T
      ALSA: pcm: Simplify forward/rewind codes · e0327a0f
      Takashi Iwai 提交于
      Factor out the common codes in snd_pcm_*_forward() and *_rewind()
      functions to simplify the codes.  No functional changes.
      Reviewd-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e0327a0f
    • T
      ALSA: pcm: Use a common helper for PCM state check and hwsync · f839cc1c
      Takashi Iwai 提交于
      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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f839cc1c
  9. 18 5月, 2017 2 次提交
  10. 17 5月, 2017 15 次提交