16 Dec, 2019

1 commit


05 Sep, 2019

1 commit


21 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    licensed under gplv2 or later

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154040.961286471@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Jan, 2018

1 commit

  • This driver creates various const structures that it stores in the
    data field of an of_device_id array.

    Adding const to the declaration of the location that receives the
    const value from the data field ensures that the compiler will
    continue to check that the value is not modified. Furthermore, the
    const-discarding cast on the extraction from the data field is no
    longer needed.

    Done using Coccinelle.

    Signed-off-by: Julia Lawall
    Signed-off-by: Mark Brown

    Julia Lawall
     

29 Jun, 2017

1 commit


26 May, 2015

2 commits


21 May, 2015

1 commit

  • USP is a general purpose serial port in SiRFSoC, which can work as SPI.
    the most data flow of USP and pure SPI is same with main differences
    in registers layout.
    this patch moves registers layout to private data, and use flags to
    differentiate other minor differences between prima2-spi, prima2-usp
    and atlas7-usp for hardware configuration.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     

07 May, 2015

2 commits


28 Apr, 2015

1 commit


07 Jan, 2015

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

08 Dec, 2014

1 commit


22 Nov, 2014

1 commit


18 Nov, 2014

2 commits

  • if spi device has no frequency, spi core will setup the default frequency
    to max_speed_hz of spi_master according to
    int spi_setup(struct spi_device *spi)
    {
    ...
    if (!spi->max_speed_hz)
    spi->max_speed_hz = spi->master->max_speed_hz;
    ...
    }
    this patch moves CSR SiRFSoC SPI frequency set to follow SPI core behaviour.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • commit 8c328a262f ("spi: sirf: Avoid duplicate code in various
    bits_per_word cases") is wrong in setting data width register of
    fifo is not right, it should use sspi->word_width >> 1 to set
    related bits. According to hardware spec, the mapping between
    register value and data width:
    0 - byte
    1 - WORD
    2 - DWORD

    Fixes: 8c328a262f ("spi: sirf: Avoid duplicate code in various bits_per_word cases") is wrong in setting data width register of
    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Qipan Li
     

20 Oct, 2014

1 commit


03 Oct, 2014

1 commit


05 Sep, 2014

5 commits

  • let "#define" statement keep same indentation. the old code layout is
    pretty ugly.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • for command mode spi transfer, HW spec requires to do fifo reset work to
    clear FIFO status.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • unify 'cmd_transfer' like 'pio_transfer' and 'dma_transfer' as void
    function, and also change left_rx_word according to transfer result.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • in spi interrupt handler, we need check RX_IO_DMA status to ensure
    rx fifo have received the specify count data.

    if not set, the while statement in spi isr function will keep loop,
    at last, make the kernel hang.

    [The code is actually there in the interrupt handler but apparently it
    needs the interrupt unmasking so the handler sees the status -- broonie]

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Qipan Li
     
  • the old codes check the cs-gpios, if the gpio number is 0 like:
    , the driver will use the only hardware chipselect.

    this is wrong because of_spi_register_master() can read property
    cs-gpios from device node and set the spi master's cs number and
    gpio cs automatically based on whether the cs-gpios is valid.

    this patch fixes the beviour of CSR spi driver and move to a core
    level supported way.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     

21 May, 2014

1 commit

  • current PIO tranfer method be described as follows:
    1. fill as much as bytes but no more than 256 bytes(fifo size)
    2. enable oflow/uflow/txfifo_empty interrupt
    3. isr process 3 interrupt signal, do complete works.
    4. after isr done, if there are left bytes go into 1 else go into 5
    5. transfer end

    by current PIO transfer method:
    1. reduce interrupt counts in spi interrupt line.
    2. reduce interrupt latency because no do data fill/fetch in isr.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     

15 Apr, 2014

6 commits

  • split sirfsoc_spi_transfer function into 3 sub-functions:
    spi_sirfsoc_cmd_transfer, spi_sirfsoc_pio_transfer and
    spi_sirfsoc_dma_transfer.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • sometimes t->tx can be equal with t->rx. for example, spidev will make
    tx and rx point to spidev->buffer at the same time. currently, for this
    case, we map the buffer BIDIRECTION to fix the cache consistency.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • fix a lot of "line over 80 characters" checkpatch issues, on which
    the users of the driver, key customers care about this very much.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • orignal GPIO chipslect is not standard because it don't take care to the
    chipselect signal: BITBANG_CS_ACTIVE and BITBANG_CS_INACTIVE.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • SPI bitbang supply "chipselect" interface for change chip-select line
    , in the SiRFSoC SPI controller, we need to enable "SPI_CS_IO_MODE",
    otherwise, spi_sirfsoc_chipselect() has no effect.
    now the driver is working is because SPI controller will control CS
    automatically without SPI_CS_IO_MODE. this patch makes the CS controller
    really controlled by software.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     
  • the old code uses wrong marco - SIRFSOC_SPI_FIFO_FULL is not for
    FIFO interrupt status, it is for FIFO status. here in the ISR,
    SIRFSOC_SPI_TXFIFO_EMPTY is the right bit for SPI TXFIFO interrupt
    status.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     

13 Mar, 2014

1 commit


03 Mar, 2014

1 commit

  • there are many SPI clients which use the following protocal:
    step 1: send command bytes to clients(rx buffer is empty)
    step 2: send data bytes to clients or receive data bytes from
    clients.
    SiRFprimaII provides a shortcut for this kind of SPI transfer.
    when tx buf is less or equal than 4 bytes and rx buf is null
    in a transfer, we think it as 'command' data and use hardware
    command register for the transfer.
    here we can save some CPU loading than doing both tx and rx
    for a normal transfer.

    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown

    Qipan Li
     

27 Feb, 2014

1 commit


24 Feb, 2014

2 commits


03 Feb, 2014

1 commit


17 Jan, 2014

1 commit


15 Nov, 2013

1 commit


17 Sep, 2013

1 commit

  • Many drivers that use bitbang library have a leak on probe error paths.
    This is because once a spi_master_get() call succeeds, we need an additional
    spi_master_put() call to free the memory.

    Fix this issue by moving the code taking a reference to master to
    spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
    success. With this change, the caller is responsible for calling
    spi_bitbang_stop() to decrement the reference and spi_master_put() as
    counterpart of spi_alloc_master() to prevent a memory leak.

    So now we have below patten for drivers using bitbang library:

    probe:
    spi_alloc_master -> Init reference count to 1
    spi_bitbang_start -> Increment reference count
    remove:
    spi_bitbang_stop -> Decrement reference count
    spi_master_put -> Decrement reference count (reference count reaches 0)

    Fixup all users accordingly.

    Signed-off-by: Axel Lin
    Suggested-by: Uwe Kleine-Koenig
    Acked-by: Uwe Kleine-Koenig
    Signed-off-by: Mark Brown

    Axel Lin