1. 30 12月, 2013 1 次提交
  2. 24 11月, 2013 1 次提交
    • M
      spi: Factor validation and initialisation of messages outside lock · 90808738
      Mark Brown 提交于
      Currently we do a bunch of per-message validation and initialisation in
      __spi_async() which is called with the bus lock held. Since none of this
      validation depends on the current bus status there's no need to hold the
      lock to do it so split it out into a separate __spi_validate() function
      which is called prior to taking the bus lock.
      
      This could be slightly neater but keep things simple for now to show the
      code motion clearly.
      
      Based on observations from Martin Sperl.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      90808738
  3. 15 11月, 2013 3 次提交
    • W
      tree-wide: use reinit_completion instead of INIT_COMPLETION · 16735d02
      Wolfram Sang 提交于
      Use this new function to make code more comprehensible, since we are
      reinitialzing the completion, not initializing.
      
      [akpm@linux-foundation.org: linux-next resyncs]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      16735d02
    • J
      spi: Use stable dev_name for ACPI enumerated SPI slaves · e13ac47b
      Jarkko Nikula 提交于
      Current spi bus_num.chip_select "spix.y" based device naming scheme may not
      be stable enough to be used in name based matching, for instance within
      ALSA SoC subsystem.
      
      This can be problem in PC kind of platforms if there are changes in SPI bus
      configuration, amount of busses or probe order.
      
      This patch addresses the problem by using the ACPI device name with
      "spi-" prefix for ACPI enumerated SPI slave. For them device name
      "spix.y" becomes "spi-INTABCD:ij".
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NMark Brown <broonie@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e13ac47b
    • R
      ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node · 7b199811
      Rafael J. Wysocki 提交于
      Modify struct acpi_dev_node to contain a pointer to struct acpi_device
      associated with the given device object (that is, its ACPI companion
      device) instead of an ACPI handle corresponding to it.  Introduce two
      new macros for manipulating that pointer in a CONFIG_ACPI-safe way,
      ACPI_COMPANION() and ACPI_COMPANION_SET(), and rework the
      ACPI_HANDLE() macro to take the above changes into account.
      Drop the ACPI_HANDLE_SET() macro entirely and rework its users to
      use ACPI_COMPANION_SET() instead.  For some of them who used to
      pass the result of acpi_get_child() directly to ACPI_HANDLE_SET()
      introduce a helper routine acpi_preset_companion() doing an
      equivalent thing.
      
      The main motivation for doing this is that there are things
      represented by struct acpi_device objects that don't have valid
      ACPI handles (so called fixed ACPI hardware features, such as
      power and sleep buttons) and we would like to create platform
      device objects for them and "glue" them to their ACPI companions
      in the usual way (which currently is impossible due to the
      lack of valid ACPI handles).  However, there are more reasons
      why it may be useful.
      
      First, struct acpi_device pointers allow of much better type checking
      than void pointers which are ACPI handles, so it should be more
      difficult to write buggy code using modified struct acpi_dev_node
      and the new macros.  Second, the change should help to reduce (over
      time) the number of places in which the result of ACPI_HANDLE() is
      passed to acpi_bus_get_device() in order to obtain a pointer to the
      struct acpi_device associated with the given "physical" device,
      because now that pointer is returned by ACPI_COMPANION() directly.
      Finally, the change should make it easier to write generic code that
      will build both for CONFIG_ACPI set and unset without adding explicit
      compiler directives to it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> # on Haswell
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: Aaron Lu <aaron.lu@intel.com> # for ATA and SDIO part
      7b199811
  4. 15 10月, 2013 1 次提交
    • J
      spi: Fix checkpatch issue · 5fe5f05e
      Jingoo Han 提交于
      Fix the following checkpatch error and warnings.
      
        ERROR: space required after that ',' (ctx:VxV)
        WARNING: quoted string split across lines
        WARNING: max() should probably be max_t(int, nb, master->num_chipselect)
        WARNING: sizeof *spi should be sizeof(*spi)
        WARNING: sizeof *master should be sizeof(*master)
        WARNING: sizeof x should be sizeof(x)
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      5fe5f05e
  5. 12 10月, 2013 2 次提交
    • M
      spi: Provide common spi_message processing loop · b158935f
      Mark Brown 提交于
      The loops which SPI controller drivers use to process the list of transfers
      in a spi_message are typically very similar and have some error prone areas
      such as the handling of /CS. Help simplify drivers by factoring this code
      out into the core - if drivers provide a transfer_one() function instead
      of a transfer_one_message() function the core will handle processing at the
      message level.
      
      /CS can be controlled by either setting cs_gpio or providing a set_cs
      function. If this is not possible for hardware reasons then both can be
      omitted and the driver should continue to implement manual /CS handling.
      
      This is a first step in refactoring and it is expected that there will be
      further enhancements, for example factoring out of the mapping of transfers
      for DMA and the initiation and completion of interrupt driven transfers.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      b158935f
    • M
      spi: Provide per-message prepare and unprepare operations · 2841a5fc
      Mark Brown 提交于
      Many SPI drivers perform setup and tear down on every message, usually
      doing things like DMA mapping the message. Provide hooks for them to use
      to provide such operations.
      
      This is of limited value for drivers that implement transfer_one_message()
      but will be of much greater utility with future factoring out of standard
      implementations of that function.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      2841a5fc
  6. 11 10月, 2013 2 次提交
  7. 08 10月, 2013 2 次提交
  8. 27 9月, 2013 2 次提交
  9. 17 9月, 2013 1 次提交
  10. 01 9月, 2013 2 次提交
    • W
      spi: quad: fix the name of DT property · a110f93d
      wangyuhang 提交于
      spi: quad: fix the name of DT property in patch
      
      The previous property name spi-tx-nbits and spi-rx-nbits looks not
      human-readable. To make it consistent with other devices, using property
      name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
      specify the number of data wires that spi controller will work in.
      Add the specification in spi-bus.txt.
      Signed-off-by: Nwangyuhang <wangyuhang2014@gmail.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      a110f93d
    • A
      spi: core: Fix spi_register_master error handling · e93b0724
      Axel Lin 提交于
      In the case spi_master_initialize_queue() fails, current code calls
      device_unregister() before return error from spi_register_master().
      However, all the drivers call spi_master_put() in the error path if
      spi_register_master() fails. Thus we should call device_del() rather than
      device_unregister() before return error from spi_register_master().
      
      This also makes all the spi_register_master() error handling consistent,
      because all other error paths of spi_register_master() expect drivers to
      call spi_master_put() if spi_register_master() fails.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      e93b0724
  11. 31 8月, 2013 2 次提交
  12. 23 8月, 2013 2 次提交
    • A
      spi: Remove a redundant test for master->running in spi_queued_transfer · 96b3eace
      Axel Lin 提交于
      We have tested master->running immediately after grab the master->queue_lock.
      The status of master->running won't be changed until we release the lock.
      Thus remove a redundant test for master->running.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      96b3eace
    • S
      spi: conditional checking of mode and transfer bits. · db90a441
      Sourav Poddar 提交于
      There is a bug in the following patch:
      http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420
      
      spi: DUAL and QUAD support
      
          fix the previous patch some mistake below:
          1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
             "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
             previous way to get the property in @of_register_spi_devices().
          2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
             SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
          3. Add the following check
             (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
                single, dual and quad.
             (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
                example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
                         to QUAD(SPI_NBITS_QUAD)
             (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
                single(SPI_NBITS_SINGLE)
      
      Checking of the tx/rx transfer bits and mode bits should be done conditionally
      based on type of buffer filled else EINVAL condition will
      always get hit either for rx or tx.
      Signed-off-by: NSourav Poddar <sourav.poddar@ti.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      db90a441
  13. 22 8月, 2013 1 次提交
    • W
      spi: DUAL and QUAD support · f477b7fb
      wangyuhang 提交于
      fix the previous patch some mistake below:
      1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
         "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
         previous way to get the property in @of_register_spi_devices().
      2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
         SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
      3. Add the following check
         (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
            single, dual and quad.
         (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
            example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
                     to QUAD(SPI_NBITS_QUAD)
         (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
            single(SPI_NBITS_SINGLE)
      Signed-off-by: Nwangyuhang <wangyuhang2014@gmail.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      f477b7fb
  14. 15 8月, 2013 1 次提交
    • G
      spi: limit default transfer speed to controller's max speed · 56ede94a
      Gabor Juhos 提交于
      Since the 'spi: Support transfer speed checking in the core'
      change, the SPI core validates the desired speed of a given
      transfer against the minimum and maximum speeds supported by
      the controller.
      
      If the speed of a transfer is not specified, the core uses
      the maximum speed of the actual SPI device. However if the
      maximum speed of the actual device is greater than the
      maximum speed of the controller, the core will reject the
      transfer due to the aforementioned change.
      
      Change the code to use the maximum speed of the controller
      by default if that is below the device's maximum speed.
      Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      56ede94a
  15. 30 7月, 2013 1 次提交
  16. 18 7月, 2013 1 次提交
  17. 15 7月, 2013 2 次提交
  18. 04 7月, 2013 1 次提交
  19. 04 6月, 2013 1 次提交
  20. 07 4月, 2013 2 次提交
  21. 02 4月, 2013 1 次提交
  22. 01 4月, 2013 2 次提交
  23. 13 2月, 2013 1 次提交
  24. 11 2月, 2013 1 次提交
  25. 08 2月, 2013 1 次提交
  26. 07 2月, 2013 1 次提交
  27. 05 2月, 2013 2 次提交