1. 07 8月, 2017 2 次提交
    • B
      ALSA: ice1712: add const to snd_akm4xxx structures · 3135432e
      Bhumika Goyal 提交于
      Declare snd_akm4xxx structures  as const as they are only passed
      to the function snd_ice1712_akm4xxx_init. This argument is of type
      const, so make the structures const.
      Done using Coccinelle:
      
      @match disable optional_qualifier@
      identifier s;
      position p;
      @@
      static struct snd_akm4xxx s@p={...};
      
      @good1@
      identifier match.s;
      position p;
      @@
      snd_ice1712_akm4xxx_init(...,&s@p,...)
      
      @bad@
      identifier match.s;
      position p!={match.p,good1.p};
      @@
      s@p
      
      @depends on !bad disable optional_qualifier@
      identifier match.s;
      @@
      static
      +const
      struct snd_akm4xxx s={...};
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3135432e
    • B
      ALSA: ice1712: add const to snd_ak4xxx_private structures · 4647e8d5
      Bhumika Goyal 提交于
      Declare snd_ak4xxx_private structures  as const as they are only passed
      to the function snd_ice1712_akm4xxx_init. This argument is of type const,
      so make the structures const.
      Done using Coccinelle:
      
      @match disable optional_qualifier@
      identifier s;
      position p;
      @@
      static struct snd_ak4xxx_private s@p={...};
      
      @good1@
      identifier match.s;
      position p;
      @@
      snd_ice1712_akm4xxx_init(...,&s@p,...)
      
      @bad@
      identifier match.s;
      position p!={match.p,good1.p};
      @@
      s@p
      
      @depends on !bad disable optional_qualifier@
      identifier match.s;
      @@
      static
      +const
      struct snd_ak4xxx_private s={...};
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4647e8d5
  2. 02 8月, 2017 1 次提交
  3. 26 7月, 2017 1 次提交
  4. 21 7月, 2017 2 次提交
  5. 18 7月, 2017 4 次提交
    • A
      ALSA: pcxhr: fix string overflow warnings · 50517352
      Arnd Bergmann 提交于
      With gcc-7, we get a warning about a possible string overflow:
      
      sound/pci/pcxhr/pcxhr.c: In function 'pcxhr_probe':
      sound/pci/pcxhr/pcxhr.c:1647:28: error: ' [PCM #' directive writing 7 bytes into a region of size between 1 and 32 [-Werror=format-overflow=]
      
      The shortname can simply be removed, and the longname can
      be changed into a shorter "name" string that is used in three
      places. Making it a little shorter (40 bytes) avoids the risk of
      overflowing completely, but I also use snprintf() here for
      extra clarity.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      50517352
    • A
      ALSA: rme9652: fix format overflow warnings · 7ad210ac
      Arnd Bergmann 提交于
      gcc-7 warns about a possible sprintf format string overflow with a
      temporary buffer that is used to print from another buffer of the same
      size:
      
      sound/pci/rme9652/hdspm.c: In function 'snd_hdspm_create_alsa_devices':
      sound/pci/rme9652/hdspm.c:2123:17: error: ' MIDIoverMADI' directive writing 13 bytes into a region of size between 1 and 32 [-Werror=format-overflow=]
      
      This extends the temporary buffer to twice the size, and changes
      the code to use the safer snprintf() across the entire file.
      The longer buffer is still necessary to avoid a format-truncation
      warning.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7ad210ac
    • A
      ALSA: mixart: fix string overflow warning · c6e486ff
      Arnd Bergmann 提交于
      Using a temporary string produces warnings about a possible overflow
      in sprintf:
      
      sound/pci/mixart/mixart.c: In function 'snd_mixart_probe':
      sound/pci/mixart/mixart.c:1353:28: error: ' [PCM #' directive writing 7 bytes into a region of size between 1 and 32 [-Werror=format-overflow=]
         sprintf(card->shortname, "%s [PCM #%d]", mgr->shortname, i);
                                  ^~~~~~~~~~~~~~
      sound/pci/mixart/mixart.c:1353:28: note: using the range [-2147483648, 2147483647] for directive argument
      sound/pci/mixart/mixart.c:1353:3: note: 'sprintf' output between 10 and 51 bytes into a destination of size 32
         sprintf(card->shortname, "%s [PCM #%d]", mgr->shortname, i);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      sound/pci/mixart/mixart.c:1354:27: error: ' [PCM #' directive writing 7 bytes into a region of size between 1 and 80 [-Werror=format-overflow=]
         sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i);
                                 ^~~~~~~~~~~~~~
      sound/pci/mixart/mixart.c:1354:27: note: using the range [-2147483648, 2147483647] for directive argument
      sound/pci/mixart/mixart.c:1354:3: note: 'sprintf' output between 10 and 99 bytes into a destination of size 80
      
      Skipping the intermediate, we can get gcc to see that it is in fact
      safe here.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c6e486ff
    • A
      ALSA: fm801: Initialize chip after IRQ handler is registered · 610e1ae9
      Andy Shevchenko 提交于
      The commit b56fa687 ("ALSA: fm801: detect FM-only card earlier")
      rearranged initialization calls, i.e. it makes snd_fm801_chip_init() to
      be called before we register interrupt handler and set PCI bus
      mastering.
      
      Somehow it prevents FM801-AU to work properly. Thus, partially revert
      initialization order changed by commit mentioned above.
      
      Fixes: b56fa687 ("ALSA: fm801: detect FM-only card earlier")
      Reported-by: NÉmeric MASCHINO <emeric.maschino@gmail.com>
      Tested-by: NÉmeric MASCHINO <emeric.maschino@gmail.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.5+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      610e1ae9
  6. 17 7月, 2017 1 次提交
  7. 15 7月, 2017 1 次提交
  8. 13 7月, 2017 1 次提交
  9. 11 7月, 2017 1 次提交
  10. 07 7月, 2017 1 次提交
  11. 04 7月, 2017 1 次提交
  12. 03 7月, 2017 2 次提交
  13. 30 6月, 2017 4 次提交
  14. 29 6月, 2017 1 次提交
  15. 28 6月, 2017 5 次提交
    • T
      ALSA: hda - Minor code refactoring for Intel HDMI codec parsers · 43f6c8d9
      Takashi Iwai 提交于
      No functional change, just a slight reduction of lines.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      43f6c8d9
    • T
      ALSA: hda - Bind with i915 component before codec binding · fcc88d91
      Takashi Iwai 提交于
      We used a on-demand i915 component binding for IvyBridge and
      SandyBridge HDMI codecs, but it has a potential problem of the nested
      module loading.  For avoiding that situation, assure the i915 binding
      happening at the controller driver level for PCH controller devices,
      where the initialization is performed in a detached work, instead of
      calling from the codec driver probe.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fcc88d91
    • T
      ALSA: hda - Skip card registration when no codec is found · 17890880
      Takashi Iwai 提交于
      It's nonsense to register a card object when no codec is bound on it,
      as we don't support the deferred codec binding.  Instead of
      registering an empty card object, just skip the registration by
      returning an error from azx_codec_configure().
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      17890880
    • T
      ALSA: hda - Fix endless loop of codec configure · d94815f9
      Takashi Iwai 提交于
      azx_codec_configure() loops over the codecs found on the given
      controller via a linked list.  The code used to work in the past, but
      in the current version, this may lead to an endless loop when a codec
      binding returns an error.
      
      The culprit is that the snd_hda_codec_configure() unregisters the
      device upon error, and this eventually deletes the given codec object
      from the bus.  Since the list is initialized via list_del_init(), the
      next object points to the same device itself.  This behavior change
      was introduced at splitting the HD-audio code code, and forgotten to
      adapt it here.
      
      For fixing this bug, just use a *_safe() version of list iteration.
      
      Fixes: d068ebc2 ("ALSA: hda - Move some codes up to hdac_bus struct")
      Reported-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d94815f9
    • H
      ALSA: hda - set input_path bitmap to zero after moving it to new place · a8f20fd2
      Hui Wang 提交于
      Recently we met a problem, the codec has valid adcs and input pins,
      and they can form valid input paths, but the driver does not build
      valid controls for them like "Mic boost", "Capture Volume" and
      "Capture Switch".
      
      Through debugging, I found the driver needs to shrink the invalid
      adcs and input paths for this machine, so it will move the whole
      column bitmap value to the previous column, after moving it, the
      driver forgets to set the original column bitmap value to zero, as a
      result, the driver will invalidate the path whose index value is the
      original colume bitmap value. After executing this function, all
      valid input paths are invalidated by a mistake, there are no any
      valid input paths, so the driver won't build controls for them.
      
      Fixes: 3a65bcdc ("ALSA: hda - Fix inconsistent input_paths after ADC reduction")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a8f20fd2
  16. 26 6月, 2017 1 次提交
    • H
      ALSA: hda/realtek - There is no loopback mixer in the ALC234/274/294 · 532a7784
      Hui Wang 提交于
      We have a Lenovo machine with the codec ALC294 on it, without the
      patch, the Node 0x0b is regarded as the loopback mixer, but the Node
      0x0b in this codec is "Vendor Defined Widget" instead of the audio
      mixer, please see the log below:
      
      Node 0x0b [Vendor Defined Widget] wcaps 0xf00000: Mono
        Control: name="Beep Playback Volume", index=0, device=0
          ControlAmp: chs=3, dir=In, idx=4, ofs=0
        Control: name="Beep Playback Switch", index=0, device=0
          ControlAmp: chs=3, dir=In, idx=4, ofs=0
      
      And I have consulted with Realtek, so far the ALC234/274/294 all don't
      have loopback mixer.
      
      Cc: Kailang Yang <kailang@realtek.com>
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      532a7784
  17. 21 6月, 2017 1 次提交
  18. 20 6月, 2017 4 次提交
  19. 16 6月, 2017 1 次提交
  20. 14 6月, 2017 1 次提交
  21. 12 6月, 2017 1 次提交
    • T
      ALSA: seq: Allow the modular sequencer registration · 111b0cdb
      Takashi Iwai 提交于
      Many drivers bind the sequencer stuff in off-load by another driver
      module, so that it's loaded only on demand.  In the current code, this
      mechanism doesn't work when the driver is built-in while the sequencer
      is module.  We check with IS_REACHABLE() and enable only when the
      sequencer is in the same level of build.
      
      However, this is basically a overshoot.  The binder code
      (snd-seq-device) is an individual module from the sequencer core
      (snd-seq), and we just have to make the former a built-in while
      keeping the latter a module for allowing the scenario like the above.
      
      This patch achieves that by rewriting Kconfig slightly.  Now, a driver
      that provides the manual sequencer device binding should select
      CONFIG_SND_SEQ_DEVICE in a way as
      	select SND_SEQ_DEVICE if SND_SEQUENCER != n
      
      Note that the "!=n" is needed here to avoid the influence of the
      sequencer core is module while the driver is built-in.
      
      Also, since rawmidi.o may be linked with snd_seq_device.o when
      built-in, we have to shuffle the code to make the linker happy.
      (the kernel linker isn't smart enough yet to handle such a case.)
      That is, snd_seq_device.c is moved to sound/core from sound/core/seq,
      as well as Makefile.
      
      Last but not least, the patch replaces the code using IS_REACHABLE()
      with IS_ENABLED(), since now the condition meets always when enabled.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      111b0cdb
  22. 10 6月, 2017 2 次提交
    • T
      ALSA: synth: Select snd-emux-synth explicitly · 82721155
      Takashi Iwai 提交于
      Instead of the non-standard way to enable the build of snd-emux-synth
      module inside Makefile, rewrite Kconfig to select the item explicitly
      from each driver (sbawe and emu10k1).  This is the standard way.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      82721155
    • T
      ALSA: seq: Reorganize kconfig and build · 0181307a
      Takashi Iwai 提交于
      This is a slightly intensive rewrite of Kconfig and Makefile about
      ALSA sequencer stuff.
      
      The first major change is that the kconfig items for the sequencer are
      moved to sound/core/seq/Kconfig.  OK, that's easy.
      
      The substantial change is that, instead of hackish top-level module
      selection in Makefile, we define a Kconfig item for each sequencer
      module.  The driver that requires such sequencer components select
      exclusively the kconfig items.  This is more straightforward and
      standard way.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0181307a
  23. 09 6月, 2017 1 次提交