1. 02 8月, 2014 4 次提交
  2. 01 8月, 2014 1 次提交
  3. 31 7月, 2014 1 次提交
  4. 30 7月, 2014 1 次提交
  5. 29 7月, 2014 1 次提交
    • T
      spi: orion: fix incorrect handling of cell-index DT property · e06871cd
      Thomas Petazzoni 提交于
      In commit f814f9ac ("spi/orion: add device tree binding"), Device
      Tree support was added to the spi-orion driver. However, this commit
      reads the "cell-index" property, without taking into account the fact
      that DT properties are big-endian encoded.
      
      Since most of the platforms using spi-orion with DT have apparently
      not used anything but cell-index = <0>, the problem was not
      visible. But as soon as one starts using cell-index = <1>, the problem
      becomes clearly visible, as the master->bus_num gets a wrong value
      (actually it gets the value 0, which conflicts with the first bus that
      has cell-index = <0>).
      
      This commit fixes that by using of_property_read_u32() to read the
      property value, which does the appropriate endianness conversion when
      needed.
      
      Fixes: f814f9ac ("spi/orion: add device tree binding")
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      Cc: <stable@vger.kernel.org> # v3.6+
      e06871cd
  6. 26 7月, 2014 5 次提交
  7. 18 7月, 2014 2 次提交
    • N
      spi: s3c64xx: use the generic SPI "cs-gpios" property · 306972ce
      Naveen Krishna Chatradhi 提交于
      The s3c64xx SPI driver uses a custom DT binding to specify
      the GPIO used to drive the chip select (CS) line instead of
      using the generic "cs-gpios" property already defined in:
      Documentation/devicetree/bindings/spi/spi-bus.txt.
      
      It's unfortunate that drivers are not using standard bindings
      and creating custom ones instead but in most cases this can't
      be changed without breaking Device Tree backward compatibility.
      
      But in the case of this driver, its DT binding has been broken
      for more than a year. Since after commit (dated June, 21 2013):
      
      3146beec ("spi: s3c64xx: Added provision for dedicated cs pin")
      
      DT backward compatibility was broken and nobody noticed until
      now when the commit was reverted. So it seems to be safe to
      change the binding to use the standard SPI "cs-gpios" property
      instead of using a custom one just for this driver.
      
      This patch also allows boards that don't use a GPIO pin for the
      CS to work with the driver since the SPI core will take care of
      setting spi->cs_gpio to -ENOENT if a board wants to use the built
      in CS instead of a GPIO as explained in the SPI bus DT binding:
      Documentation/devicetree/bindings/spi/spi-bus.txt.
      
      For non-DT platforms, spi->cs_gpio will be set to -ENOENT as well
      unless they specify a GPIO pin in their platform data. So both
      native and GPIO chip select is also supported for legacy boards.
      
      The above use case was what motivated commit 3146beec which broke
      the DT binding backward compatibility in the first place.
      Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      [javier.martinez@collabora.co.uk: split changes and improve commit message]
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      306972ce
    • J
      spi: s3c64xx: Revert "spi: s3c64xx: Added provision for dedicated cs pin" · e2689b94
      Javier Martinez Canillas 提交于
      This reverts commit 3146beec.
      
      This commit resulted in a DT backward compatibility breakage.
      
      Some devices use the native chip select (CS) instead of a GPIO
      pin to drive the CS line. But the SPI driver made it mandatory
      to specify a GPIO pin in the SPI device node controller-data.
      So, using the built-in CS was not possible with the driver.
      
      Commit 3146beec tried to fix that by adding a "cs-gpio" property
      which could be defined in the SPI device node to make the driver
      request the GPIO from the controller-data node.
      
      Unfortunately that changed the old DT binding semantics since
      now it's mandatory to have the "cs-gpio" property defined in
      the SPI device node in order to use a GPIO pin to drive the CS.
      
      As an example, a SPI device was defined before the commit with:
      
      spi@12d20000 {
          slave-node@0 {
              controller-data {
                   cs-gpio = <&gpb1 2 0>;
              }
         }
      }
      
      and after the commit, the following DTS snippet must be used:
      
      spi@12d20000 {
          cs-gpio;
          slave-node@0 {
              controller-data {
                   cs-gpio = <&gpb1 2 0>;
              }
         }
      }
      
      So, after commit 3146beec the driver does not look for the GPIO
      by default and it only looks for it if the top level "cs-gpio"
      property is defined while the default used to be the opposite.
      To always request the GPIO defined in the controller-data node.
      
      This means that old FDT that of course didn't have this added
      "cs-gpio" DT property in the SPI node broke after this change.
      
      The offending commit can't be reverted cleanly since more than
      a year have passed and other changes were made in the meantime
      but this patch partially reverts the driver to it's original
      state so old FDT can work again.
      
      This patch will break Device Trees that were relying on the new
      behavior of course but the patch should be reverted because:
      
      a) There aren't DTS in mainline that use this new property.
      b) They were relying on a behavior that broke DT compatibility.
      c) The new binding is awkard, needing two properties with the
         same name (cs-gpio) on different nodes is confusing at least.
      d) The new property was not added to the DT binding doc:
         Documentation/devicetree/bindings/spi/spi-samsung.txt
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      e2689b94
  8. 17 7月, 2014 5 次提交
  9. 13 7月, 2014 1 次提交
  10. 11 7月, 2014 9 次提交
  11. 10 7月, 2014 3 次提交
  12. 08 7月, 2014 1 次提交
  13. 07 7月, 2014 3 次提交
  14. 05 7月, 2014 3 次提交
    • M
      spi/rockchip: Add dependencies on relaxed I/O accessors · c1536908
      Mark Brown 提交于
      Without the dependencies for the accessors the driver can be enabled on
      architectures where it will fail to build.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      c1536908
    • H
      spi: au1550: Fix bug in deallocation of memory · 30670539
      Himangi Saraogi 提交于
      This patch fixes a bug on the deallocation of memory allocated using
      request_mem_region, by using release_mem_region instead of
      release_resource and kfree.
      Signed-off-by: NHimangi Saraogi <himangi774@gmail.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      30670539
    • A
      spi/rockchip: add driver for Rockchip RK3xxx SoCs integrated SPI · 64e36824
      addy ke 提交于
      In order to facilitate understanding, rockchip SPI controller IP design
      looks similar in its registers to designware. But IC implementation
      is different from designware, So we need a dedicated driver for Rockchip
      RK3XXX SoCs integrated SPI. The main differences:
      
      - dma request line: rockchip SPI controller have two DMA request line
        for tx and rx.
      
      - Register offset:
                        RK3288        dw
        SPI_CTRLR0      0x0000        0x0000
        SPI_CTRLR1      0x0004        0x0004
        SPI_SSIENR      0x0008        0x0008
        SPI_MWCR        NONE          0x000c
        SPI_SER         0x000c        0x0010
        SPI_BAUDR       0x0010        0x0014
        SPI_TXFTLR      0x0014        0x0018
        SPI_RXFTLR      0x0018        0x001c
        SPI_TXFLR       0x001c        0x0020
        SPI_RXFLR       0x0020        0x0024
        SPI_SR          0x0024        0x0028
        SPI_IPR         0x0028        NONE
        SPI_IMR         0x002c        0x002c
        SPI_ISR         0x0030        0x0030
        SPI_RISR        0x0034        0x0034
        SPI_TXOICR      NONE          0x0038
        SPI_RXOICR      NONE          0x003c
        SPI_RXUICR      NONE          0x0040
        SPI_MSTICR      NONE          0x0044
        SPI_ICR         0x0038        0x0048
        SPI_DMACR       0x003c        0x004c
        SPI_DMATDLR     0x0040        0x0050
        SPI_DMARDLR     0x0044        0x0054
        SPI_TXDR        0x0400        NONE
        SPI_RXDR        0x0800        NONE
        SPI_IDR         NONE          0x0058
        SPI_VERSION     NONE          0x005c
        SPI_DR          NONE          0x0060
      
      - register configuration:
        such as SPI_CTRLRO in rockchip SPI controller:
          cr0 = (CR0_BHT_8BIT << CR0_BHT_OFFSET)
              | (CR0_SSD_ONE << CR0_SSD_OFFSET);
          cr0 |= (rs->n_bytes << CR0_DFS_OFFSET);
          cr0 |= ((rs->mode & 0x3) << CR0_SCPH_OFFSET);
          cr0 |= (rs->tmode << CR0_XFM_OFFSET);
          cr0 |= (rs->type << CR0_FRF_OFFSET);
        For more information, see RK3288 chip manual.
      
      - Wait for idle: Must ensure that the FIFO data has been sent out
        before the next transfer.
      Signed-off-by: Naddy ke <addy.ke@rock-chips.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      64e36824