1. 06 2月, 2015 1 次提交
    • T
      ALSA: Add a helper to add a new attribute group to card · 6bbc7fed
      Takashi Iwai 提交于
      For assigning sysfs entries for a card device from the driver,
      introduce a new helper function, snd_card_add_dev_attr().  In this
      way, we can avoid the possible race between the device registration
      and the sysfs addition / removal.
      
      The driver can pass a new attribute group to add freely.  This has to
      be called before snd_card_register().
      
      Currently, up to two extra groups can be added.  More than that, it'll
      return an error.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6bbc7fed
  2. 02 2月, 2015 1 次提交
  3. 30 10月, 2014 1 次提交
  4. 18 6月, 2014 1 次提交
  5. 25 2月, 2014 2 次提交
    • T
      ALSA: Clean up snd_device_*() codes · 72620d60
      Takashi Iwai 提交于
      A few code cleanups and optimizations.  In addition, drop
      snd_device_disconnect() that isn't used at all, and drop the return
      values from snd_device_free*().
      
      Another slight difference by this change is that now the device state
      will become always SNDRV_DEV_REGISTERED no matter whether dev_register
      ops is present or not.  It's for better consistency.  There should be
      no impact for the current tree, as the state isn't checked.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      72620d60
    • 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
  6. 19 2月, 2014 1 次提交
    • T
      ALSA: core: Fix missing card sysfs contents · b203dbab
      Takashi Iwai 提交于
      While moving the card device into struct snd_card, the reference to
      the assigned card in sysfs show/store callbacks were forgotten to be
      refreshed, still accessing to the no longer used drvdata.  Fix these
      places to refer correctly via container_of().
      
      Also, remove the superfluous NULL checks since it's guaranteed to be
      non-NULL now.
      
      Fixes: 8bfb181c ('ALSA: Embed card device into struct snd_card')
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b203dbab
  7. 14 2月, 2014 4 次提交
  8. 12 2月, 2014 1 次提交
    • 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
  9. 10 2月, 2014 1 次提交
    • T
      ALSA: Replace with IS_ENABLED() · 8eeaa2f9
      Takashi Iwai 提交于
      Replace the lengthy #if defined(XXX) || defined(XXX_MODULE) with the
      new IS_ENABLED() macro.
      
      The patch still doesn't cover all ifdefs.  For example, the dependency
      on CONFIG_GAMEPORT is still open-coded because this also has an extra
      dependency on MODULE.  Similarly, an open-coded ifdef in pcm_oss.c and
      some sequencer-related stuff are left untouched.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8eeaa2f9
  10. 23 1月, 2014 2 次提交
  11. 29 10月, 2013 2 次提交
  12. 24 5月, 2013 2 次提交
    • 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
    • T
      ALSA: Fix the default suffix string with high card number · 8edbb198
      Takashi Iwai 提交于
      ALSA core tries to add a suffix as "_1" automatically when the given
      id string conflicts.  The current code assumes implicitly that the max
      card number is 16 so that the single hex "_X" suffix can be put.
      However, with the dynamic device management, the card can be at most
      32, so it can put even a non-hex character there.  Also, when the max
      card number is increased in future, this would result in worse.
      
      This patch rewrites the code to add the suffix string in a simpler
      (thus cleaner) way.  It can support up to three digits, so it should
      suffice for most requirements.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8edbb198
  13. 12 3月, 2013 1 次提交
  14. 30 10月, 2012 1 次提交
  15. 12 3月, 2012 1 次提交
    • P
      device.h: cleanup users outside of linux/include (C files) · 51990e82
      Paul Gortmaker 提交于
      For files that are actively using linux/device.h, make sure
      that they call it out.  This will allow us to clean up some
      of the implicit uses of linux/device.h within include/*
      without introducing build regressions.
      
      Yes, this was created by "cheating" -- i.e. the headers were
      cleaned up, and then the fallout was found and fixed, and then
      the two commits were reordered.  This ensures we don't introduce
      build regressions into the git history.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      51990e82
  16. 10 3月, 2012 1 次提交
  17. 01 11月, 2011 1 次提交
  18. 26 5月, 2011 1 次提交
  19. 04 4月, 2011 1 次提交
  20. 26 3月, 2011 1 次提交
  21. 02 11月, 2010 1 次提交
  22. 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
  23. 16 9月, 2010 1 次提交
  24. 07 9月, 2009 1 次提交
  25. 04 6月, 2009 2 次提交
    • J
      ALSA: Core - clean up snd_card_set_id* calls and remove possible id collision · 5fdc18d9
      Jaroslav Kysela 提交于
      Move locking outside snd_card_set_id_internal() function and rename it
      to snd_card_set_id_no_lock() for better function description.
      
      User defined id is just copied to card structure at allocation time.
      The real unique id procedure is called in snd_card_register() to
      ensure real atomicity.
      Signed-off-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5fdc18d9
    • M
      ALSA: Fix double locking of card list in snd_card_register() · 872c7820
      Mark Brown 提交于
      The introduction of snd_card_set_id() added a lock on the card list
      to the old choose_default_id() function when using it to implement
      the new API call. This lock is needed to allow us to walk the list
      and check to see if our new name is a duplicate. Unfortunately this
      causes a lockup when called from snd_card_register() (in cases
      where no ID is supplied for the card) since the card list is already
      locked there.
      
      Fix this fairly hideously by factoring out the implementation and
      using a flag to indicate if the lock should be held. A better fix
      would probably be to refactor snd_card_register() to move the
      _set_id() outside the locking region but I can't immediately see
      anything I can convince myself is safe.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      872c7820
  26. 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
  27. 09 3月, 2009 1 次提交
  28. 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
  29. 19 11月, 2008 1 次提交
  30. 13 11月, 2008 1 次提交
  31. 12 11月, 2008 1 次提交
  32. 02 11月, 2008 1 次提交
    • A
      saner FASYNC handling on file close · 233e70f4
      Al Viro 提交于
      As it is, all instances of ->release() for files that have ->fasync()
      need to remember to evict file from fasync lists; forgetting that
      creates a hole and we actually have a bunch that *does* forget.
      
      So let's keep our lives simple - let __fput() check FASYNC in
      file->f_flags and call ->fasync() there if it's been set.  And lose that
      crap in ->release() instances - leaving it there is still valid, but we
      don't have to bother anymore.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      233e70f4