1. 24 2月, 2015 2 次提交
  2. 08 1月, 2015 2 次提交
  3. 06 1月, 2015 1 次提交
    • A
      spi: dw: Fix detecting FIFO depth · d297933c
      Axel Lin 提交于
      Current code tries to find the highest valid fifo depth by checking the value
      it wrote to DW_SPI_TXFLTR. There are a few problems in current code:
      1) There is an off-by-one in dws->fifo_len setting because it assumes the latest
         register write fails so the latest valid value should be fifo - 1.
      2) We know the depth could be from 2 to 256 from HW spec, so it is not necessary
         to test fifo == 257. In the case fifo is 257, it means the latest valid
         setting is fifo = 256. So after the for loop iteration, we should check
         fifo == 2 case instead of fifo == 257 if detecting the FIFO depth fails.
      This patch fixes above issues.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Reviewed-and-tested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      d297933c
  4. 07 11月, 2014 1 次提交
    • T
      spi: dw: Fix dynamic speed change. · 0a8727e6
      Thor Thayer 提交于
      An IOCTL call that calls spi_setup() and then dw_spi_setup() will
      overwrite the persisted last transfer speed. On each transfer, the
      SPI speed is compared to the last transfer speed to determine if the
      clock divider registers need to be updated (did the speed change?).
      This bug was observed with the spidev driver using spi-config to
      update the max transfer speed.
      
      This fix: Don't overwrite the persisted last transaction clock speed
      when updating the SPI parameters in dw_spi_setup(). On the next
      transaction, the new speed won't match the persisted last speed
      and the hardware registers will be updated.
      On initialization, the persisted last transaction clock
      speed will be 0 but will be updated after the first SPI
      transaction.
      
      Move zeroed clock divider check into clock change test because
      chip->clk_div is zero on startup and would cause a divide-by-zero
      error. The calculation was wrong as well (can't support odd #).
      Reported-by: NVlastimil Setka <setka@vsis.cz>
      Signed-off-by: NVlastimil Setka <setka@vsis.cz>
      Signed-off-by: NThor Thayer <tthayer@opensource.altera.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      0a8727e6
  5. 09 10月, 2014 1 次提交
  6. 24 9月, 2014 2 次提交
  7. 14 9月, 2014 2 次提交
  8. 04 9月, 2014 1 次提交
    • J
      spi: dw: Fix checkpatch issue · fadcace7
      Jingoo Han 提交于
      Fix the following checkpatch warnings.
      
        WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required
        WARNING: min() should probably be min_t(u32, rx_left, dw_readw(dws, DW_SPI_RXFLR))
        WARNING: else is not generally useful after a break or return
        WARNING: Missing a blank line after declarations
        WARNING: void function return statements are not generally useful
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      fadcace7
  9. 02 9月, 2014 1 次提交
    • A
      spi: dw: Don't use devm_kzalloc in master->setup callback · a97c883a
      Axel Lin 提交于
      device_add() expects that any memory allocated via devm_* API is only
      done in the device's probe function.
      
      Fix below boot warning:
      WARNING: CPU: 1 PID: 1 at drivers/base/dd.c:286 driver_probe_device+0x2b4/0x2f4()
      Modules linked in:
      CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.16.0-10474-g835c90b-dirty #160
      [<c0016364>] (unwind_backtrace) from [<c001251c>] (show_stack+0x20/0x24)
      [<c001251c>] (show_stack) from [<c04eaefc>] (dump_stack+0x7c/0x98)
      [<c04eaefc>] (dump_stack) from [<c0023d4c>] (warn_slowpath_common+0x78/0x9c)
      [<c0023d4c>] (warn_slowpath_common) from [<c0023d9c>] (warn_slowpath_null+0x2c/0x34)
      [<c0023d9c>] (warn_slowpath_null) from [<c0302c60>] (driver_probe_device+0x2b4/0x2f4)
      [<c0302c60>] (driver_probe_device) from [<c0302d90>] (__device_attach+0x50/0x54)
      [<c0302d90>] (__device_attach) from [<c0300e60>] (bus_for_each_drv+0x54/0x9c)
      [<c0300e60>] (bus_for_each_drv) from [<c0302958>] (device_attach+0x84/0x90)
      [<c0302958>] (device_attach) from [<c0301f10>] (bus_probe_device+0x94/0xb8)
      [<c0301f10>] (bus_probe_device) from [<c03000c0>] (device_add+0x434/0x4fc)
      [<c03000c0>] (device_add) from [<c0342dd4>] (spi_add_device+0x98/0x164)
      [<c0342dd4>] (spi_add_device) from [<c03444a4>] (spi_register_master+0x598/0x768)
      [<c03444a4>] (spi_register_master) from [<c03446b4>] (devm_spi_register_master+0x40/0x80)
      [<c03446b4>] (devm_spi_register_master) from [<c0346214>] (dw_spi_add_host+0x1a8/0x258)
      [<c0346214>] (dw_spi_add_host) from [<c0346920>] (dw_spi_mmio_probe+0x1d4/0x294)
      [<c0346920>] (dw_spi_mmio_probe) from [<c0304560>] (platform_drv_probe+0x3c/0x6c)
      [<c0304560>] (platform_drv_probe) from [<c0302a98>] (driver_probe_device+0xec/0x2f4)
      [<c0302a98>] (driver_probe_device) from [<c0302d3c>] (__driver_attach+0x9c/0xa0)
      [<c0302d3c>] (__driver_attach) from [<c0300f0c>] (bus_for_each_dev+0x64/0x98)
      [<c0300f0c>] (bus_for_each_dev) from [<c0302518>] (driver_attach+0x2c/0x30)
      [<c0302518>] (driver_attach) from [<c0302134>] (bus_add_driver+0xdc/0x1f4)
      [<c0302134>] (bus_add_driver) from [<c03035c8>] (driver_register+0x88/0x104)
      [<c03035c8>] (driver_register) from [<c030445c>] (__platform_driver_register+0x58/0x6c)
      [<c030445c>] (__platform_driver_register) from [<c0700f00>] (dw_spi_mmio_driver_init+0x18/0x20)
      [<c0700f00>] (dw_spi_mmio_driver_init) from [<c0008914>] (do_one_initcall+0x90/0x1d4)
      [<c0008914>] (do_one_initcall) from [<c06d7d90>] (kernel_init_freeable+0x178/0x248)
      [<c06d7d90>] (kernel_init_freeable) from [<c04e687c>] (kernel_init+0x18/0xfc)
      [<c04e687c>] (kernel_init) from [<c000ecd8>] (ret_from_fork+0x14/0x20)
      Reported-by: NThor Thayer <tthayer@opensource.altera.com>
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      a97c883a
  10. 28 8月, 2014 1 次提交
  11. 13 5月, 2014 1 次提交
  12. 25 4月, 2014 2 次提交
  13. 28 3月, 2014 1 次提交
  14. 03 3月, 2014 1 次提交
  15. 23 2月, 2014 1 次提交
  16. 31 12月, 2013 2 次提交
  17. 30 12月, 2013 1 次提交
  18. 17 10月, 2013 1 次提交
  19. 30 5月, 2013 1 次提交
  20. 08 12月, 2012 1 次提交
  21. 06 4月, 2012 1 次提交
    • S
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd 提交于
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      tree.
      
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      
      This replacement was done with the following semantic patch:
      
      <smpl>
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      @@
      -int open_f(struct inode *i, struct file *f)
      -{
      (
      -if (i->i_private)
      -f->private_data = i->i_private;
      |
      -f->private_data = i->i_private;
      )
      -return 0;
      -}
      
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...
      -.open = open_f,
      +.open = simple_open,
      ...
      };
      </smpl>
      
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      234e3405
  22. 01 11月, 2011 1 次提交
  23. 21 9月, 2011 1 次提交
    • H
      spi: spi-dw: fix all sparse warnings · 7eb187b3
      H Hartley Sweeten 提交于
      The dw_{read,write}[lw] macros produce sparse warnings everytime they
      are used.  The "read" ones cause:
      
      warning: cast removes address space of expression
      warning: incorrect type in argument 1 (different address spaces)
         expected void const volatile [noderef] <asn:2>*addr
         got unsigned int *<noident>
      
      And the "write" ones:
      
      warning: cast removes address space of expression
      warning: incorrect type in argument 2 (different address spaces)
         expected void volatile [noderef] <asn:2>*addr
         got unsigned int *<noident>
      
      Fix this by removing struct dw_spi_reg and converting all the register
      offsets to #defines. Then convert the macros into inlined functions so
      that proper type checking can occur.
      
      While here, also fix the three sparse warnings in spi-dw-mid.c due to
      the return value of ioremap_nocache being stored in a u32 * not a
      void __iomem *.
      
      With these changes the spi-dw* files all build with no sparse warnings.
      Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Acked-by: NFeng Tang <feng.tang@intel.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      7eb187b3
  24. 09 7月, 2011 1 次提交
  25. 06 6月, 2011 1 次提交
  26. 08 4月, 2011 1 次提交
  27. 31 3月, 2011 5 次提交
  28. 19 3月, 2011 1 次提交
    • G
      spi/dw_spi: move dw_spi.h into drivers/spi · 568a60ed
      Grant Likely 提交于
      include/linux/dw_spi.h only includes driver internal data.  It doesn't
      expose a platform_data configuration structure or similar (at least
      nothing in-tree).  This patch moves the header into drivers/spi so
      that the scope is limited to only the dw_spi_*.c driver files
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: spi-devel-general@lists.sourceforge.net
      568a60ed
  29. 31 12月, 2010 1 次提交
  30. 24 12月, 2010 1 次提交