30 Dec, 2020

1 commit

  • [ Upstream commit ee5558a9084584015c8754ffd029ce14a5827fa8 ]

    pm_runtime_get_sync will increment pm usage counter even it
    failed. Forgetting to pm_runtime_put_noidle will result in
    reference leak in img_spfi_resume, so we should fix it.

    Fixes: deba25800a12b ("spi: Add driver for IMG SPFI controller")
    Signed-off-by: Zhang Qilong
    Link: https://lore.kernel.org/r/20201102145651.3875-1-zhangqilong3@huawei.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Zhang Qilong
     

02 Jul, 2020

1 commit

  • This converts the IMG SPFI SPI driver to use GPIO descriptors
    as obtained from the core instead of GPIO numbers.

    The driver was already relying on the core code to look up
    the GPIO numbers from the device tree and allocate memory for
    storing state etc. By moving to use descriptors handled by
    the core we can delete the setup/cleanup functions and
    the device state handler that were only dealing with this.

    Signed-off-by: Linus Walleij
    Cc: Ionela Voinescu
    Cc: Sifan Naeem
    Link: https://lore.kernel.org/r/20200625201422.208640-1-linus.walleij@linaro.org
    Signed-off-by: Mark Brown

    Linus Walleij
     

16 Dec, 2019

1 commit


06 Nov, 2019

1 commit

  • The channels spfi->tx_ch and spfi->rx_ch are not set to NULL after they
    are released. As a result, they will be released again, either on the
    error handling branch in the same function or in the corresponding
    remove function, i.e. img_spfi_remove(). This patch fixes the bug by
    setting the two members to NULL.

    Signed-off-by: Pan Bian
    Link: https://lore.kernel.org/r/1573007769-20131-1-git-send-email-bianpan2016@163.com
    Signed-off-by: Mark Brown

    Pan Bian
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 101 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190113.822954939@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

30 Jul, 2018

1 commit


28 Jul, 2016

1 commit


31 Aug, 2015

2 commits


06 Aug, 2015

1 commit

  • drivers/spi/spi-img-spfi.c: In function 'img_spfi_setup':
    drivers/spi/spi-img-spfi.c:446: warning: 'ret' may be used
    uninitialized in this function.

    Fixes: commit b03ba9e314c1 ("spi: img-spfi: fix multiple calls to request gpio")
    Signed-off-by: Sifan Naeem
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Sifan Naeem
     

05 Aug, 2015

1 commit

  • spfi_setup may be called many times by the spi framework, but
    gpio_request_one can only be called once without freeing, repeatedly
    calling gpio_request_one will cause an error to be thrown, which
    causes the request to spi_setup to be marked as failed.

    We can have a per-spi_device flag that indicates whether or not the
    gpio has been requested. If the gpio has already been requested use
    gpio_direction_output to set the direction of the gpio.

    Fixes: 8c2c8c03cdcb ("spi: img-spfi: Control CS lines with GPIO")
    Signed-off-by: Sifan Naeem
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Sifan Naeem
     

29 Jul, 2015

1 commit

  • Calling spfi_wait_all_done is not required if the transfer has timed
    out before all data is transferred.

    spfi_wait_all_done polls for Alldone interrupt which is triggered to
    mark the transfer as complete and to indicate it is now safe to issue
    a new transfer.

    Fixes: 8c2c8c0 ("spi: img-spfi: Control CS lines with GPIO")
    Signed-off-by: Sifan Naeem
    Reviewed-by: Andrew Bresticker
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Sifan Naeem
     

07 Jul, 2015

1 commit

  • Maximum speed supported by spfi is limited to 1/4 of the spfi clock.

    But in some SoCs the maximum speed supported by the spfi block can
    be limited to less than 1/4 of the spfi clock. In such cases we have
    to define the limit in the device tree so that the driver can pick
    it up.

    Signed-off-by: Sifan Naeem
    Signed-off-by: Mark Brown

    Sifan Naeem
     

22 Jun, 2015

1 commit

  • Setting the Same Edge bit indicates to the spfi block to receive and
    transmit data on the same edge of the spfi clock, which in turn
    doubles the operating frequency of spfi.

    The maximum supported frequency is limited to 1/4th of the spfi input
    clock, but without this bit set the maximum would be 1/8th of the
    input clock.

    The current driver calculates the divisor with maximum speed at 1/4th
    of the input clock, this would fail if the requested frequency is
    higher than 1/8 of the input clock. Any requests for 1/8th of the
    input clock would still pass.

    Fixes: 8543d0e72d43 ("spi: img-spfi: Limit bit clock to 1/4th of input clock")
    Signed-off-by: Sifan Naeem
    Signed-off-by: Mark Brown
    Cc:

    Sifan Naeem
     

09 Apr, 2015

5 commits


08 Apr, 2015

1 commit

  • Setting the transfer length in the TRANSACTION register after the
    CONTROL register is programmed causes intermittent timeout issues in
    SPFI transfers when using the SPI framework to control the CS GPIO
    lines. To avoid this issue, set transfer length before programming
    the CONTROL register.

    Signed-off-by: Sifan Naeem
    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mark Brown

    Sifan Naeem
     

07 Apr, 2015

2 commits


03 Mar, 2015

2 commits

  • Removing the udelay between setting and clearing the soft reset bit in
    the spfi control register as it is not required.

    Signed-off-by: Sifan Naeem
    Reviewed-by: Andrew Bresticker
    Signed-off-by: Mark Brown

    Sifan Naeem
     
  • Maximum transfer length supported by SPFI is 65535, this is limited
    by the number of bits available in SPFI TSize register to represent
    the transfer size.
    For transfer requests larger than the maximum supported the driver
    will return an invalid argument error.

    Signed-off-by: Sifan Naeem
    Reviewed-by: Andrew Bresticker
    Signed-off-by: Mark Brown

    Sifan Naeem
     

24 Dec, 2014

2 commits


23 Dec, 2014

1 commit


19 Dec, 2014

1 commit

  • A couple of new CONFIG_PM_RUNTIME users have been added recently
    in the SPI subsystem.

    However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
    PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so
    #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to
    depend on CONFIG_PM.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
    drivers/spi/ (again).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Mark Brown

    Rafael J. Wysocki
     

17 Nov, 2014

1 commit