1. 08 1月, 2018 1 次提交
  2. 11 11月, 2017 3 次提交
    • T
      spi: imx: Don't require platform data chipselect array · ffd4db9e
      Trent Piepho 提交于
      If the array is not present, assume all chip selects are native.  This
      is the standard behavior for SPI masters configured via the device
      tree and the behavior of this driver as well when it is configured via
      device tree.
      
      This reduces platform data vs DT differences and allows most of the
      platform data based boards to remove their chip select arrays.
      
      CC: Shawn Guo <shawnguo@kernel.org>
      CC: Sascha Hauer <kernel@pengutronix.de>
      CC: Fabio Estevam <fabio.estevam@nxp.com>
      CC: Mark Brown <broonie@kernel.org>
      Signed-off-by: NTrent Piepho <tpiepho@impinj.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      ffd4db9e
    • T
      spi: imx: Fix failure path leak on GPIO request error · 4e21791e
      Trent Piepho 提交于
      If the code that requests any chip select GPIOs fails, the cleanup of
      spi_bitbang_start() by calling spi_bitbang_stop() is not done.  Add this
      to the failure path.
      
      Note that spi_bitbang_start() has to be called before requesting GPIOs
      because the GPIO data in the spi master is populated when the master is
      registed, and that doesn't happen until spi_bitbang_start() is called.
      
      CC: Shawn Guo <shawnguo@kernel.org>
      CC: Sascha Hauer <kernel@pengutronix.de>
      CC: Fabio Estevam <fabio.estevam@nxp.com>
      CC: Mark Brown <broonie@kernel.org>
      CC: Oleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NTrent Piepho <tpiepho@impinj.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      4e21791e
    • T
      spi: imx: GPIO based chip selects should not be required · 881a0b99
      Trent Piepho 提交于
      The driver will fail to load if no gpio chip selects are specified,
      this patch changes this so that it no longer fails.
      
      It's possible to use all native chip selects, in which case there is
      no reason to have a gpio chip select array.  This is what happens if
      the *optional* device tree property "cs-gpios" is omitted.
      
      The spi core already checks for the absence of gpio chip selects in
      the master and assigns any slaves the gpio_cs value of -ENOENT.
      
      Also have the driver respect the standard SPI device tree property "num-cs"
      to allow setting the number of chip selects without using cs-gpios.
      
      CC: Mark Brown <broonie@kernel.org>
      CC: Shawn Guo <shawnguo@kernel.org>
      CC: Sascha Hauer <kernel@pengutronix.de>
      CC: Fabio Estevam <fabio.estevam@nxp.com>
      CC: Oleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NTrent Piepho <tpiepho@impinj.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      881a0b99
  3. 04 11月, 2017 2 次提交
  4. 03 11月, 2017 2 次提交
  5. 02 11月, 2017 3 次提交
    • C
      spi: orion: remove redundant assignment of status to zero · f747c310
      Colin Ian King 提交于
      The assignment of status to zero is never read, status is either
      updated in the next iteration of the of the loop or several
      lines after the end of the loop.  Remove it, cleans up clang warning:
      
      drivers/spi/spi-orion.c:674:4: warning: Value stored to 'status'
      is never read
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      f747c310
    • H
      spi: sh-msiof: Fix DMA transfer size check · 36735783
      Hiromitsu Yamasaki 提交于
      DMA supports 32-bit words only,
      even if BITLEN1 of SITMDR2 register is 16bit.
      
      Fixes: b0d0ce8b ("spi: sh-msiof: Add DMA support")
      Signed-off-by: NHiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
      Signed-off-by: NSimon Horman <horms+renesas@verge.net.au>
      Acked-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NDirk Behme <dirk.behme@de.bosch.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      36735783
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  6. 31 10月, 2017 4 次提交
  7. 25 10月, 2017 1 次提交
  8. 17 10月, 2017 1 次提交
  9. 14 10月, 2017 1 次提交
  10. 12 10月, 2017 1 次提交
  11. 10 10月, 2017 2 次提交
  12. 09 10月, 2017 1 次提交
  13. 06 10月, 2017 1 次提交
    • A
      spi: spreadtrum adi: add hwspinlock dependency · e83f3742
      Arnd Bergmann 提交于
      With CONFIG_HWSPINLOCK=m, the new driver fails to link as a built-in driver:
      
      drivers/spi/spi-sprd-adi.o: In function `sprd_adi_remove':
      spi-sprd-adi.c:(.text+0x18): undefined reference to `hwspin_lock_free'
      drivers/spi/spi-sprd-adi.o: In function `sprd_adi_probe':
      spi-sprd-adi.c:(.text+0xfc): undefined reference to `of_hwspin_lock_get_id'
      spi-sprd-adi.c:(.text+0x108): undefined reference to `hwspin_lock_request_specific'
      spi-sprd-adi.c:(.text+0x268): undefined reference to `hwspin_lock_free'
      
      This adds a hard Kconfig dependency on HWSPINLOCK for the !COMPILE_TEST
      case, and allows compile-testing with HWSPINLOCK completely disabled,
      which will then rely on the existing stub API.
      
      Fixes: 7e2903cb ("spi: Add ADI driver for Spreadtrum platform")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      e83f3742
  14. 04 10月, 2017 2 次提交
  15. 28 9月, 2017 1 次提交
  16. 26 9月, 2017 3 次提交
  17. 20 9月, 2017 1 次提交
  18. 19 9月, 2017 2 次提交
    • J
      spi: imx: Add support for SPI Slave mode · 71abd290
      jiada wang 提交于
      Previously i.MX SPI controller only works in Master mode.
      This patch adds support to i.MX51, i.MX53 and i.MX6 ECSPI
      controller to work also in Slave mode.
      
      Currently SPI Slave mode support patch has the following limitations:
      1. The stale data in RXFIFO will be dropped when the Slave does any new
         transfer.
      2. One transfer can be finished only after all transfer->len data been
         transferred to master device
      3. Slave device only accepts transfer->len data. Any data longer than this
         from master device will be dropped. Any data shorter than this from
         master will cause SPI to stuck due to mentioned HW limitation 2.
      4. Only PIO transfer is supported in Slave mode.
      5. Dynamic burst size adjust isn't supported in Slave mode.
      
      Following HW limitation applies:
      1.  ECSPI has a HW issue when works in Slave mode, after 64
          words written to TXFIFO, even TXFIFO becomes empty,
          ECSPI_TXDATA keeps shift out the last word data,
          so we have to disable ECSPI when in slave mode after the
          transfer completes
      2.  Due to Freescale errata ERR003775 "eCSPI: Burst completion by Chip
          Select (SS) signal in Slave mode is not functional" burst size must
          be set exactly to the size of the transfer. This limit SPI transaction
          with maximum 2^12 bits. This errata affects i.MX53 and i.MX6 ECSPI
          controllers.
      Signed-off-by: NJiada Wang <jiada_wang@mentor.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      71abd290
    • B
      spi: Add ADI driver for Spreadtrum platform · 7e2903cb
      Baolin Wang 提交于
      This patch adds ADI driver based on SPI framework for
      Spreadtrum SC9860 platform.
      Signed-off-by: NBaolin Wang <baolin.wang@spreadtrum.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      7e2903cb
  19. 14 9月, 2017 3 次提交
  20. 01 9月, 2017 1 次提交
    • H
      spi: spi-falcon: drop check of boot select · 1a41aa13
      Hauke Mehrtens 提交于
      Do not check which flash type the SoC was booted from before
      using this driver. Assume that the device tree is correct and use this
      driver when it was added to device tree. This also removes a build
      dependency to the SoC code.
      
      All device trees I am aware of only have one correct flash device entry
      in it. The device tree is anyway bundled with the kernel in all systems
      using device tree I know of.
      
      The boot mode can be specified with some pin straps and will select the
      flash type the rom code will boot from. One SPI, NOR or NAND flash chip
      can be connect to the EBU and used to load the first stage boot loader
      from.
      Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: linux-spi@vger.kernel.org
      Signed-off-by: NMark Brown <broonie@kernel.org>
      1a41aa13
  21. 30 8月, 2017 1 次提交
    • G
      spi: imx: fix use of native chip-selects with devicetree · 602c8f44
      Greg Ungerer 提交于
      The commonly used mechanism of specifying the hardware or native
      chip-select on an SPI device in devicetree (that is "cs-gpios = <0>")
      does not result in the native chip-select being configured for use.
      So external SPI devices that require use of the native chip-select
      will not work.
      
      You can successfully specify native chip-selects if using a platform
      setup by specifying the cs-gpio as negative offset by 32. And that
      works correctly. You cannot use the same method in devicetree.
      
      The logic in the spi-imx.c driver during probe uses core spi function
      of_spi_register_master() in spi.c to parse the "cs-gpios" devicetree tag.
      For valid GPIO values that will be recorded for use, all other entries in
      the cs_gpios list will be set to -ENOENT. So entries like "<0>" will be
      set to -ENOENT in the cs_gpios list.
      
      When the SPI device registers are setup the code will use the GPIO
      listed in the cs_gpios list for the desired chip-select. If the cs_gpio
      is less then 0 then it is intended to be for a native chip-select, and
      its cs_gpio value is added to 32 to get the chipselect number to use.
      Problem is that with devicetree this can only ever be -ENOENT (which
      is -2), and that alone results in an invalid chip-select number. But also
      doesn't allow selection of the native chip-select at all.
      
      To fix, if the cs_gpio specified for this spi device is not a
      valid GPIO then use the "chip_select" (that is the native chip-select
      number) for hardware setup.
      Signed-off-by: NGreg Ungerer <gerg@linux-m68k.org>
      Reviewed-by: NVladimir Zapolskiy <vz@mleia.com>
      Tested-by: NVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      602c8f44
  22. 24 8月, 2017 1 次提交
  23. 23 8月, 2017 1 次提交
    • A
      spi: imx: fix little-endian build · 5904c9d3
      Arnd Bergmann 提交于
      The newly added dynamic burst code produces a harmless warning
      on big-endian configurations:
      
      drivers/spi/spi-imx.c: In function 'spi_imx_buf_rx_swap_u32':
      drivers/spi/spi-imx.c:284:15: error: unused variable 'bytes_per_word' [-Werror=unused-variable]
        unsigned int bytes_per_word;
                     ^~~~~~~~~~~~~~
      drivers/spi/spi-imx.c: In function 'spi_imx_buf_tx_swap_u32':
      drivers/spi/spi-imx.c:319:15: error: unused variable 'bytes_per_word' [-Werror=unused-variable]
        unsigned int bytes_per_word;
      
      This adds another #ifdef around the variable declaration matching
      the one on the use.
      
      Fixes: 1673c81d ("spi: imx: dynamic burst length adjust for PIO mode")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      5904c9d3
  24. 18 8月, 2017 1 次提交