1. 23 9月, 2009 2 次提交
    • A
      spi: prefix modalias with "spi:" · e0626e38
      Anton Vorontsov 提交于
      This makes it consistent with other buses (platform, i2c, vio, ...).  I'm
      not sure why we use the prefixes, but there must be a reason.
      
      This was easy enough to do it, and I did it.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Cc: Samuel Ortiz <sameo@openedhand.com>
      Cc: "John W. Linville" <linville@tuxdriver.com>
      Acked-by: NMike Frysinger <vapier.adi@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e0626e38
    • A
      spi: add support for device table matching · 75368bf6
      Anton Vorontsov 提交于
      With this patch spi drivers can use standard spi_driver.id_table and
      MODULE_DEVICE_TABLE() mechanisms to bind against the devices.  Just like
      we do with I2C drivers.
      
      This is useful when a single driver supports several variants of devices
      but it is not possible to detect them in run-time (like non-JEDEC chips
      probing in drivers/mtd/devices/m25p80.c), and when platform_data usage is
      overkill.
      
      This patch also makes life a lot easier on OpenFirmware platforms, since
      with OF we extensively use proper device IDs in modaliases.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      75368bf6
  2. 19 6月, 2009 3 次提交
  3. 14 4月, 2009 1 次提交
  4. 07 1月, 2009 1 次提交
  5. 17 10月, 2008 2 次提交
  6. 15 8月, 2008 1 次提交
    • D
      spi: bugfix spi_add_device() with duplicate chipselects · e48880e0
      David Brownell 提交于
      When reviewing a recent patch I noticed a potential trouble spot in the
      registration of new SPI devices.  The SPI master driver is told to set
      the device up before adding it to the driver model, so that it's always
      properly set up when probe() is called.  (This is important, because in
      the case of inverted chipselects, this device can make the bus misbehave
      until it's properly deselected.  It's got to be set up even if no driver
      binds to the device.)
      
      The trouble spot is that it doesn't first verify that no other device
      has been added using that chipselect.  If such a device has been added,
      its configuration gets trashed.  (Fortunately this has not been a common
      error!)
      
      The fix here adds an explicit check, and a mutex to protect the relevant
      critical region.
      
      [akpm@linux-foundation.org: make the lock local to spi_add_device()]
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e48880e0
  7. 26 7月, 2008 1 次提交
    • G
      spi: split up spi_new_device() to allow two stage registration. · dc87c98e
      Grant Likely 提交于
      spi_new_device() allocates and registers an spi device all in one swoop.
      If the driver needs to add extra data to the spi_device before it is
      registered, then this causes problems.  This is needed for OF device
      tree support so that the SPI device tree helper can add a pointer to
      the device node after the device is allocated, but before the device
      is registered.  OF aware SPI devices can then retrieve data out of the
      device node to populate a platform data structure.
      
      This patch splits the allocation and registration portions of code out
      of spi_new_device() and creates two new functions; spi_alloc_device()
      and spi_register_device().  spi_new_device() is modified to use the new
      functions for allocation and registration.  None of the existing users
      of spi_new_device() should be affected by this change.
      
      Drivers using the new API can forego the use of spi_board_info
      structure to describe the device layout and populate data into the
      spi_device structure directly.
      
      This change is in preparation for adding an OF device tree parser to
      generate spi_devices based on data in the device tree.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      dc87c98e
  8. 25 7月, 2008 1 次提交
    • G
      spi: make spi_board_info.modalias a char array · 102eb975
      Grant Likely 提交于
      Currently, 'modalias' in the spi_device structure is a 'const char *'.
      The spi_new_device() function fills in the modalias value from a passed in
      spi_board_info data block.  Since it is a pointer copy, the new spi_device
      remains dependent on the spi_board_info structure after the new spi_device
      is registered (no other fields in spi_device directly depend on the
      spi_board_info structure; all of the other data is copied).
      
      This causes a problem when dynamically propulating the list of attached
      SPI devices.  For example, in arch/powerpc, the list of SPI devices can be
      populated from data in the device tree.  With the current code, the device
      tree adapter must kmalloc() a new spi_board_info structure for each new
      SPI device it finds in the device tree, and there is no simple mechanism
      in place for keeping track of these allocations.
      
      This patch changes modalias from a 'const char *' to a fixed char array.
      By copying the modalias string instead of referencing it, the dependency
      on the spi_board_info structure is eliminated and an outside caller does
      not need to maintain a separate spi_board_info allocation for each device.
      
      If searched through the code to the best of my ability for any references
      to modalias which may be affected by this change and haven't found
      anything.  It has been tested with the lite5200b platform in arch/powerpc.
      
      [dbrownell@users.sourceforge.net: cope with linux-next changes: KOBJ_NAME_LEN obliterated, etc]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      102eb975
  9. 22 7月, 2008 1 次提交
  10. 07 2月, 2008 2 次提交
  11. 25 1月, 2008 1 次提交
  12. 06 12月, 2007 2 次提交
  13. 15 11月, 2007 1 次提交
  14. 17 10月, 2007 1 次提交
  15. 13 10月, 2007 1 次提交
    • K
      Driver core: change add_uevent_var to use a struct · 7eff2e7a
      Kay Sievers 提交于
      This changes the uevent buffer functions to use a struct instead of a
      long list of parameters. It does no longer require the caller to do the
      proper buffer termination and size accounting, which is currently wrong
      in some places. It fixes a known bug where parts of the uevent
      environment are overwritten because of wrong index calculations.
      
      Many thanks to Mathieu Desnoyers for finding bugs and improving the
      error handling.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      7eff2e7a
  16. 01 8月, 2007 1 次提交
    • D
      spi device setup gets better error checking · 082c8cb4
      David Brownell 提交于
      This updates some error reporting paths in SPI device setup:
      
       - Move validation logic for SPI chipselects to spi_new_device(),
         which is where it should always have been.
      
       - In spi_new_device(), emit error messages if the device can't
         be created.  This is LOTS better than a silent failure; though
         eventually, the calling convention should probably change to
         use the <linux/err.h> conventions.
      
       - Includes one previously-missing check:  SPI masters must always
         have at least one chipselect, even for dedicated busses which
         always keep it selected!
      
      It also adds a FIXME (IDR for dynamic ID allocation) so the issue doesn't live
      purely in my mailbox.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      082c8cb4
  17. 22 7月, 2007 1 次提交
  18. 18 7月, 2007 1 次提交
  19. 05 6月, 2007 1 次提交
  20. 09 5月, 2007 1 次提交
  21. 28 3月, 2007 1 次提交
  22. 13 2月, 2007 1 次提交
  23. 08 2月, 2007 2 次提交
  24. 27 1月, 2007 1 次提交
    • A
      [PATCH] SPI: alternative fix for spi_busnum_to_master · 1e9a51dc
      Atsushi Nemoto 提交于
      If a SPI master device exists, udev (udevtrigger) causes kernel crash, due
      to wrong kobj pointer in kobject_uevent_env().  This problem was not in
      2.6.19.
      
      The backtrace (on MIPS) was:
      [<8024db6c>] kobject_uevent_env+0x54c/0x5e8
      [<802a8264>] store_uevent+0x1c/0x3c  (in drivers/class.c)
      [<801cb14c>] subsys_attr_store+0x2c/0x50
      [<801cb80c>] flush_write_buffer+0x38/0x5c
      [<801cb900>] sysfs_write_file+0xd0/0x190
      [<80181444>] vfs_write+0xc4/0x1a0
      [<80181cdc>] sys_write+0x54/0xa0
      [<8010dae4>] stack_done+0x20/0x3c
      
      flush_write_buffer() passes kobject of spi_master_class.subsys to
      subsys_addr_store(), then subsys_addr_store() passes a pointer to a struct
      subsystem to store_uevent() which expects a pointer to a struct
      class_device.  The problem seems subsys_attr_store() called instead of
      class_device_attr_store().
      
      This mismatch was caused by commit
      3bd0f694, which overrides kset of master
      class.  This made spi_master_class.subsys.kset.ktype NULL so
      subsys_sysfs_ops is used instead of class_dev_sysfs_ops.
      
      The commit was to fix spi_busnum_to_master().  Here is a patch fixes
      this function in other way, just searching children list of
      class_device.
      Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1e9a51dc
  25. 08 12月, 2006 4 次提交
  26. 04 11月, 2006 1 次提交
  27. 04 7月, 2006 1 次提交
  28. 29 6月, 2006 1 次提交
  29. 22 5月, 2006 1 次提交
  30. 17 5月, 2006 1 次提交