1. 20 6月, 2009 5 次提交
    • A
      spi_mpc83xx: remove dead code · aef79d82
      Anton Vorontsov 提交于
      This patch removes #if 0'ed code, and spi_mpc83xx->busy variable that is
      used by that dead snippet only.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: David Brownell <david-b@pacbell.net>
      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>
      aef79d82
    • A
      spi_mpc83xx: split mpc83xx_spi_work() into two routines · b9b9af11
      Anton Vorontsov 提交于
      mpc83xx_spi_work() is quite large, with up to five indentation levels and
      is quite difficult to read.
      
      So, split the function in two parts:
      1. mpc83xx_spi_work() now only traverse queued spi messages;
      2. mpc83xx_spi_do_one_msg() only manages single messages.
      
      There should be no functional changes.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: David Brownell <david-b@pacbell.net>
      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>
      b9b9af11
    • A
      spi_mpc83xx: fix checkpatch issues · 9effb959
      Anton Vorontsov 提交于
      Checkpatch is spitting errors when seeing the rename patch, so fix the
      errors prior to moving.
      
      Following errors and warnings were fixed:
      
         WARNING: Use #include <linux/io.h> instead of <asm/io.h>
         #1027: FILE: drivers/spi/spi_mpc8xxx.c:37:
         +#include <asm/io.h>
      
         ERROR: "foo * bar" should be "foo *bar"
         #1111: FILE: drivers/spi/spi_mpc8xxx.c:121:
         +static inline void mpc83xx_spi_write_reg(__be32 __iomem * reg, u32 val)
      
         ERROR: "foo * bar" should be "foo *bar"
         #1116: FILE: drivers/spi/spi_mpc8xxx.c:126:
         +static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg)
      
         ERROR: "foo * bar" should be "foo *bar"
         #1125: FILE: drivers/spi/spi_mpc8xxx.c:135:
         +       type * rx = mpc83xx_spi->rx;                                      \
      
         ERROR: "foo * bar" should be "foo *bar"
         #1135: FILE: drivers/spi/spi_mpc8xxx.c:145:
         +       const type * tx = mpc83xx_spi->tx;                      \
      
         WARNING: suspect code indent for conditional statements (16, 25)
         #1504: FILE: drivers/spi/spi_mpc8xxx.c:514:
         +               while (((event =
         [...]
         +                        cpu_relax();
      
      Following warnings were left over, since fixing them will hurt the
      readability.  We'd better fix them by lowering the indentation level by
      splitting mpc83xx_spi_work function into two parts.
      
         WARNING: line over 80 characters
         #1371: FILE: drivers/spi/spi_mpc8xxx.c:381:
         +                                       status = mpc83xx_spi_setup_transfer(spi, t);
      
         WARNING: line over 80 characters
         #1392: FILE: drivers/spi/spi_mpc8xxx.c:402:
         +                               mpc83xx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: David Brownell <david-b@pacbell.net>
      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>
      9effb959
    • A
      spi_mpc83xx: add small delay after asserting chip-select line · 5afbf098
      Anton Vorontsov 提交于
      This is needed for some underlaying GPIO controllers that may be a bit
      slow, or if chip-select signal need some time to stabilize.
      
      For what it's worth, we already have the similar delay for chip-select
      de-assertion case.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: David Brownell <david-b@pacbell.net>
      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>
      5afbf098
    • A
      spi_mpc83xx: quieten down the "Requested speed is too low" message · fd8a11e1
      Anton Vorontsov 提交于
      When a platform is running at high frequencies it's not always possible to
      scale-down a frequency to a requested value, and using mmc_spi driver this
      leads to the following printk flood during card polling:
      
        ...
        mmc_spi spi32766.0: Requested speed is too low: 400000 Hz. Will use
        520828 Hz instead.
        mmc_spi spi32766.0: Requested speed is too low: 400000 Hz. Will use
        520828 Hz instead.
        ...
      
      Fix this by using WARN_ONCE(), it's better than the flood, and also better
      than turning dev_err() into dev_dbg(), since we actually want to warn that
      some things may not work correctly.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: David Brownell <david-b@pacbell.net>
      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>
      fd8a11e1
  2. 19 6月, 2009 2 次提交
  3. 17 6月, 2009 1 次提交
  4. 01 4月, 2009 3 次提交
    • A
      spi_mpc83xx: add OF platform driver bindings · 35b4b3c0
      Anton Vorontsov 提交于
      Implement full support for OF SPI bindings.  Now the driver can manage its
      own chip selects without any help from the board files and/or fsl_soc
      constructors.
      
      The "legacy" code is well isolated and could be removed as time goes by.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      35b4b3c0
    • A
      spi_mpc83xx: rework chip selects handling · 364fdbc0
      Anton Vorontsov 提交于
      The main purpose of this patch is to pass 'struct spi_device' to the chip
      select handling routines.  This is needed so that we could implement
      full-fledged OpenFirmware support for this driver.
      
      While at it, also:
      - Replace two {de,activate}_cs routines by single cs_contol().
      - Don't duplicate platform data callbacks in mpc83xx_spi struct.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      364fdbc0
    • A
      spi_mpc83xx: fix sparse warnings · 34c8a20c
      Anton Vorontsov 提交于
      The patch fixes following sparse warnings:
      
        CHECK   spi_mpc83xx.c
      spi_mpc83xx.c:145:1: warning: symbol 'mpc83xx_spi_rx_buf_u8' was not declared. Should it be static?
      spi_mpc83xx.c:146:1: warning: symbol 'mpc83xx_spi_rx_buf_u16' was not declared. Should it be static?
      spi_mpc83xx.c:147:1: warning: symbol 'mpc83xx_spi_rx_buf_u32' was not declared. Should it be static?
      spi_mpc83xx.c:148:1: warning: symbol 'mpc83xx_spi_tx_buf_u8' was not declared. Should it be static?
      spi_mpc83xx.c:149:1: warning: symbol 'mpc83xx_spi_tx_buf_u16' was not declared. Should it be static?
      spi_mpc83xx.c:150:1: warning: symbol 'mpc83xx_spi_tx_buf_u32' was not declared. Should it be static?
      spi_mpc83xx.c:175:32: warning: incorrect type in initializer (different address spaces)
      spi_mpc83xx.c:175:32:    expected void *tmp_ptr
      spi_mpc83xx.c:175:32:    got unsigned int [noderef] <asn:2>*<noident>
      spi_mpc83xx.c:183:26: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:183:26:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:183:26:    got void *tmp_ptr
      spi_mpc83xx.c:184:26: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:184:26:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:184:26:    got void *tmp_ptr
      spi_mpc83xx.c:287:31: warning: incorrect type in initializer (different address spaces)
      spi_mpc83xx.c:287:31:    expected void *tmp_ptr
      spi_mpc83xx.c:287:31:    got unsigned int [noderef] <asn:2>*<noident>
      spi_mpc83xx.c:295:25: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:295:25:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:295:25:    got void *tmp_ptr
      spi_mpc83xx.c:296:25: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:296:25:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:296:25:    got void *tmp_ptr
      spi_mpc83xx.c:486:13: warning: symbol 'mpc83xx_spi_irq' was not declared. Should it be static?
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34c8a20c
  5. 25 3月, 2009 1 次提交
  6. 14 9月, 2008 2 次提交
  7. 25 7月, 2008 1 次提交
  8. 13 5月, 2008 1 次提交
  9. 28 4月, 2008 1 次提交
  10. 11 4月, 2008 1 次提交
  11. 28 1月, 2008 1 次提交
  12. 17 10月, 2007 1 次提交
    • D
      SPI driver runtime footprint shrinkage · d1e44d9c
      David Brownell 提交于
      Shrink the runtime footprint of various SPI drivers:
      
        - Move the probe() routine into the init section where practical,
          using platform_driver_probe() to make that safe.  This often saves
          around 1KB.  Using platform_driver_probe() can also be a correctness
          fix, if the probe routine is already marked __init but the driver
          struct keeps a dangling pointer to it after init section removal.
      
        - Likewise move remove() routines into the exit sections.
      
      These changes would be inappropriate iff the platform devices were
      actually hotpluggable (e.g. they're found on optional addon cards,
      or in an FPGA that's dynamically reprogrammed).  In these cases,
      that's not the situation; it's an SOC controller and the only device
      is initialized before these drivers.
      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>
      d1e44d9c
  13. 12 9月, 2007 1 次提交
  14. 31 8月, 2007 1 次提交
  15. 12 8月, 2007 2 次提交
  16. 01 8月, 2007 5 次提交
  17. 18 7月, 2007 3 次提交
  18. 31 12月, 2006 1 次提交
    • D
      [PATCH] SPI: define null tx_buf to mean "shift out zeroes" · 4b1badf5
      David Brownell 提交于
      Some issues were recently turned up with the current specification of what
      it means for spi_transfer.tx_buf to be null, as part of transfers which are
      (from the SPI protocol driver perspective) pure reads.
      
      Specifically, that it seems better to change the TX behaviour there from
      "undefined" to "will shift zeroes".  This lets protocol drivers (like the
      ads7846 driver) depend on that behavior.  It's what most controller drivers
      in the tree are already doing (with one exception and one case of driver
      wanting-to-oops), it's what Microwire hardware will necessarily be doing,
      and it removes an issue whereby certain security audits would need to
      define such a value anyway as part of removing covert channels.
      
      This patch changes the specification to require shifting zeroes, and
      updates all currently merged SPI controller drivers to do so.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4b1badf5
  19. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  20. 22 5月, 2006 1 次提交