1. 25 2月, 2014 2 次提交
    • T
      ALSA: Use priority list for managing device list · 289ca025
      Takashi Iwai 提交于
      Basically, the device type specifies the priority of the device to be
      registered / freed, too.  However, the priority value isn't well
      utilized but only it's checked as a group.  This results in
      inconsistent register and free order (where each of them should be in
      reversed direction).
      
      This patch simplifies the device list management code by simply
      inserting a list entry at creation time in an incremental order for
      the priority value.  Since we can just follow the link for register,
      disconnect and free calls, we don't have to specify the group; so the
      whole enum definitions are also simplified as well.
      
      The visible change to outside is that the priorities of some object
      types are revisited.  For example, now the SNDRV_DEV_LOWLEVEL object
      is registered before others (control, PCM, etc) and, in return,
      released after others.  Similarly, SNDRV_DEV_CODEC is in a lower
      priority than SNDRV_DEV_BUS for ensuring the dependency.
      
      Also, the unused SNDRV_DEV_TOPLEVEL, SNDRV_DEV_LOWLEVEL_PRE and
      SNDRV_DEV_LOWLEVEL_NORMAL are removed as a cleanup.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      289ca025
    • T
      ALSA: Create sysfs attribute files via groups · caa751ba
      Takashi Iwai 提交于
      Instead of calling each time device_create_file(), create the groups
      of sysfs attribute files at once in a normal way.  Add a new helper
      function, snd_get_device(), to return the associated device object,
      so that we can handle the sysfs addition locally.
      
      Since the sysfs file addition is done differently now,
      snd_add_device_sysfs_file() helper function is removed.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      caa751ba
  2. 14 2月, 2014 3 次提交
    • T
      ALSA: Drop __bitwise and typedefs for snd_device attributes · 9ce50543
      Takashi Iwai 提交于
      Using __bitwise and typedefs for the attributes of snd_device struct
      isn't so useful, and rather it worsens the readability.  Let's drop
      them and use the straightforward enum.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9ce50543
    • T
      ALSA: Use standard device refcount for card accounting · f2464064
      Takashi Iwai 提交于
      Drop the own refcount but use the standard device refcounting via
      get_device() and put_device().  Introduce a new completion to snd_card
      instead of the wait queue for syncing the last release, which is used
      in snd_card_free().
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f2464064
    • T
      ALSA: Embed card device into struct snd_card · 8bfb181c
      Takashi Iwai 提交于
      As prepared in the previous patch, we are ready to create a device
      struct for the card object in snd_card_create() now.  This patch
      changes the scheme from the old style to:
      
      - embed a device struct for the card object into snd_card struct,
      - initialize the card device in snd_card_create() (but not register),
      - registration is done in snd_card_register() via device_add()
      
      The actual card device is stored in card->card_dev.  The card->dev
      pointer is kept unchanged and pointing to the parent device as before
      for compatibility reason.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8bfb181c
  3. 12 2月, 2014 2 次提交
    • T
      ALSA: Mandate to pass a device pointer at card creation time · 393aa9c1
      Takashi Iwai 提交于
      This is a part of preliminary works for modernizing the ALSA device
      structure.  So far, we set card->dev at later point after the object
      creation.  Because of this, the core layer doesn't always know which
      device is being handled before it's actually registered, and it makes
      impossible to show the device in error messages, for example.  The
      first goal is to achieve a proper struct device initialization at the
      very beginning of probing.
      
      As a first step, this patch introduces snd_card_new() function (yes
      there was the same named function in the very past), in order to
      receive the parent device pointer from the very beginning.
      snd_card_create() is marked as deprecated.
      
      At this point, there is no functional change other than that.  The
      actual change of the device creation scheme will follow later.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      393aa9c1
    • T
      ALSA: Drop unused name argument in snd_register_oss_device() · 80d7d771
      Takashi Iwai 提交于
      The last argument, name, of snd_oss_register_device() is nowhere
      referred in the function in the current code.  Let's drop it.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      80d7d771
  4. 19 8月, 2013 1 次提交
    • T
      ALSA: pcm: Add snd_printd_ratelimit() · bcbb1553
      Tim Gardner 提交于
      Direct calls to printk_limit() will emit log noise even when CONFIG_SND_DEBUG is not
      defined. Add a wrapper macro around printk_limit() that is conditionally defined by
      CONFIG_SND_DEBUG.
      
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Yacine Belkadi <yacine.belkadi.1@gmail.com>
      Signed-off-by: NTim Gardner <tim.gardner@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bcbb1553
  5. 24 5月, 2013 1 次提交
    • T
      ALSA: Add kconfig to specify the max card numbers · 7bb2491b
      Takashi Iwai 提交于
      Currently ALSA supports up to 32 card instances when the dynamic minor
      is used.  While 32 cards are usually big enough for normal use cases,
      there are sometimes weird requirements with more card support.
      
      Actually, this limitation, 32, comes from the index option, where you
      can pass the bit mask to assign the card.  Other than that, we can
      actually give more cards up to the minor number limits (currently 256,
      which can be extended more, too).
      
      This patch adds a new Kconfig to specify the max card numbers, and
      changes a few places to accept more than 32 cards.
      
      The only incompatibility with high card numbers would be the handling
      of index option.  The index option can be still used to pass the
      bitmask for card assignments, but this works only up to 32 slots.
      More than 32, no bitmask style option is available but only a single
      slot can be specified via index option.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7bb2491b
  6. 12 3月, 2013 1 次提交
  7. 11 3月, 2013 1 次提交
  8. 26 1月, 2013 1 次提交
    • T
      ALSA: Make snd_printd() and snd_printdd() inline · 86b27237
      Takashi Iwai 提交于
      Because currently snd_printd() and snd_printdd() macros are expanded
      to empty when CONFIG_SND_DEBUG=n, a compile warning like below
      appears sometimes, and we had to covert it by ugly ifdefs:
        sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’:
        sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable]
      
      For "fixing" these issues better, this patch replaces snd_printd() and
      snd_printdd() definitions with empty inline functions instead of
      macros.  This should have the same effect but shut up warnings like
      above.
      
      But since we had already put ifdefs, changing to inline functions
      would trigger compile errors.  So, such ifdefs is removed in this
      patch.
      
      In addition, snd_pci_quirk name field is defined only when
      CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in
      snd_printdd() argument triggers the build errors, too.  For avoiding
      these errors, introduce a new macro snd_pci_quirk_name() that is
      defined no matter how the debug option is set.
      Reported-by: NStratos Karafotis <stratosk@semaphore.gr>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      86b27237
  9. 30 10月, 2012 1 次提交
  10. 10 4月, 2012 1 次提交
  11. 16 3月, 2012 1 次提交
    • P
      device.h: audit and cleanup users in main include dir · 313162d0
      Paul Gortmaker 提交于
      The <linux/device.h> header includes a lot of stuff, and
      it in turn gets a lot of use just for the basic "struct device"
      which appears so often.
      
      Clean up the users as follows:
      
      1) For those headers only needing "struct device" as a pointer
      in fcn args, replace the include with exactly that.
      
      2) For headers not really using anything from device.h, simply
      delete the include altogether.
      
      3) For headers relying on getting device.h implicitly before
      being included themselves, now explicitly include device.h
      
      4) For files in which doing #1 or #2 uncovers an implicit
      dependency on some other header, fix by explicitly adding
      the required header(s).
      
      Any C files that were implicitly relying on device.h to be
      present have already been dealt with in advance.
      
      Total removals from #1 and #2: 51.  Total additions coming
      from #3: 9.  Total other implicit dependencies from #4: 7.
      
      As of 3.3-rc1, there were 110, so a net removal of 42 gives
      about a 38% reduction in device.h presence in include/*
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      313162d0
  12. 30 1月, 2012 1 次提交
  13. 23 12月, 2011 1 次提交
  14. 01 11月, 2011 2 次提交
    • J
      treewide: use __printf not __attribute__((format(printf,...))) · b9075fa9
      Joe Perches 提交于
      Standardize the style for compiler based printf format verification.
      Standardized the location of __printf too.
      
      Done via script and a little typing.
      
      $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
        grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
        xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'
      
      [akpm@linux-foundation.org: revert arch bits]
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b9075fa9
    • P
      include: replace linux/module.h with "struct module" wherever possible · de477254
      Paul Gortmaker 提交于
      The <linux/module.h> pretty much brings in the kitchen sink along
      with it, so it should be avoided wherever reasonably possible in
      terms of being included from other commonly used <linux/something.h>
      files, as it results in a measureable increase on compile times.
      
      The worst culprit was probably device.h since it is used everywhere.
      This file also had an implicit dependency/usage of mutex.h which was
      masked by module.h, and is also fixed here at the same time.
      
      There are over a dozen other headers that simply declare the
      struct instead of pulling in the whole file, so follow their lead
      and simply make it a few more.
      
      Most of the implicit dependencies on module.h being present by
      these headers pulling it in have been now weeded out, so we can
      finally make this change with hopefully minimal breakage.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      de477254
  15. 23 10月, 2010 1 次提交
    • K
      driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices · 39aba963
      Kay Sievers 提交于
      This patch removes the old CONFIG_SYSFS_DEPRECATED_V2 config option,
      but it keeps the logic around to handle block devices in the old manner
      as some people like to run new kernel versions on old (pre 2007/2008)
      distros.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      39aba963
  16. 17 10月, 2010 1 次提交
  17. 14 1月, 2010 1 次提交
  18. 07 9月, 2009 2 次提交
  19. 28 8月, 2009 1 次提交
  20. 27 8月, 2009 1 次提交
    • T
      ALSA: Add debug module option · 36ce99c1
      Takashi Iwai 提交于
      Add debug module option to snd core.
      This controls the debug print level.  When CONFIG_SND_DEBUG_VERBOSE
      is set, you can suppress the debug messages by giving or changing this
      parameter to a lower value.  debug=0 means no debug messsages.
      As default, it's set to the verbose level 2.
      
      Since this option can be changed dynamically via sysfs file, you can
      suppress the verbose debug messages on the fly, which wasn't possible
      before.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      36ce99c1
  21. 02 6月, 2009 1 次提交
    • J
      ALSA: Core - add snd_card_set_id() function · 10a8ebbb
      Jaroslav Kysela 提交于
      Introduce snd_card_set_id() function to allow lowlevel drivers to set
      default identification name for card slot. The function checks also
      for identification name collisions and tries to create unique name.
      
      Also, the snd_card_create() function is simplified, because this new
      function is used. As bonus, proper name collision checks are evaluated
      at the card create time.
      Signed-off-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      10a8ebbb
  22. 21 4月, 2009 1 次提交
  23. 09 3月, 2009 1 次提交
  24. 10 2月, 2009 1 次提交
  25. 12 1月, 2009 1 次提交
    • T
      ALSA: Introduce snd_card_create() · 53fb1e63
      Takashi Iwai 提交于
      Introduced snd_card_create() function as a replacement of snd_card_new().
      The new function returns a negative error code so that the probe callback
      can return the proper error code, while snd_card_new() can give only NULL
      check.
      
      The old snd_card_new() is still provided as an inline function but with
      __deprecated attribute.  It'll be removed soon later.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      53fb1e63
  26. 07 11月, 2008 3 次提交
  27. 10 10月, 2008 1 次提交
  28. 29 8月, 2008 1 次提交
  29. 13 8月, 2008 3 次提交
  30. 30 7月, 2008 1 次提交
    • M
      ALSA: Add jack reporting API · e76d8cea
      Mark Brown 提交于
      Currently very few systems provide information about jack status to user
      space, even though many have hardware facilities to do detection. Those
      systems that do use an input device with the existing SW_HEADPHONE_INSERT
      switch type to do so, often independently of ALSA.
      
      This patch introduces a standard method for representing jacks to user
      space into ALSA. It allows drivers to register jacks for a sound card with
      the input subsystem, binding the input device to the card to help user
      space associate the input devices with their sound cards. The created
      input devices are named in the form "card longname jack" where jack is
      provided by the driver when allocating a jack. By default the parent for
      the input device is the sound card but this can be overridden by the
      card driver.
      
      The existing user space API with SW_HEADPHONE_INSERT is preserved.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NJaroslav Kysela <perex@perex.cz>
      e76d8cea