16 Dec, 2019
1 commit
-
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.By using dma_request_chan() directly the driver can support deferred
probing against DMA.Signed-off-by: Peter Ujfalusi
Link: https://lore.kernel.org/r/20191212135550.4634-7-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown
05 Sep, 2019
1 commit
-
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.Reported-by: Hulk Robot
Signed-off-by: YueHaibing
Link: https://lore.kernel.org/r/20190904135918.25352-28-yuehaibing@huawei.com
Signed-off-by: Mark Brown
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
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
29 Jun, 2017
1 commit
-
Trivial fix to spelling mistake in dev_info message
Signed-off-by: Colin Ian King
Signed-off-by: Mark Brown
26 May, 2015
2 commits
-
USP-based SPI need a disable and enable, otherwise it doesn't work.
this patch adds it as HW initialization.Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Signed-off-by: Mark Brown -
this job has been done by spi core.
Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Acked-by: Geert Uytterhoeven
Signed-off-by: Mark Brown
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
07 May, 2015
2 commits
-
Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Signed-off-by: Mark Brown -
move spi controller's gpio request work out from probe() to spi device
register stage, so after spi device register spi controller can deactive
device's gpio chipselect. old code can't do it because gpio request has
not be done until device register is finised in spi_bitbang_start.
and add cleanup function to free CS gpio.Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Signed-off-by: Mark Brown
28 Apr, 2015
1 commit
-
return error for unsupported bits-per-word format, BUG() is not right
for this scenerios as we are not an ASSERT but an error handler.Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Signed-off-by: Mark Brown
07 Jan, 2015
1 commit
-
"sirf,marco-spi" is redundant as all SPI controllers in CSR SiRFSoC are
compatible with prima2-spi.
at the same time, the whole marco project was dropped and its replacement
atlas7 is also compatible with prima2 in SPI.Signed-off-by: Barry Song
Signed-off-by: Mark Brown
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
...
08 Dec, 2014
1 commit
-
…chip', 'spi/topic/samsung' and 'spi/topic/sirf' into spi-next
22 Nov, 2014
1 commit
-
in SPI boot mode, romcode uses SPI controller to fetch data from NOR
flash. Here we need to reset the hardware IP to restore its state.Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Signed-off-by: Mark Brown
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 -
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 - DWORDFixes: 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
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
03 Oct, 2014
1 commit
-
…/rspi', 'spi/topic/sh-msiof' and 'spi/topic/sirf' into spi-next
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 -
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 -
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 -
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 -
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
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 endby 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
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 -
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 -
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 -
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 -
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 -
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
13 Mar, 2014
1 commit
-
This is required since commit 2025172e3280 "spi/bitbang: Use core message pump".
spi-bitbang now uses core message pump, so it needs to call spi_master_suspend/
spi_master_resume to stop/start the queue while suspend/resume.Signed-off-by: Axel Lin
Signed-off-by: Mark Brown
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
27 Feb, 2014
1 commit
-
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han
Acked-by: Barry Song
Signed-off-by: Mark Brown
24 Feb, 2014
2 commits
-
use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries, this makes the codes
clean and also enable the ability of hibernation support for sirf SPI.Signed-off-by: Qipan Li
Signed-off-by: Barry Song
Signed-off-by: Mark Brown -
sirf-dma driver enabled generic dt binding for dma channels.
see here we remove self-defined dma channel prop and move to
use generic dma_request_slave_channel.
related changes in dts is something like:
dmas = ,
;
dma-names = "rx", "tx";Signed-off-by: Barry Song
Signed-off-by: Mark Brown
03 Feb, 2014
1 commit
-
Trivial cleanup to avoid duplicate code in various bits_per_word cases.
Signed-off-by: Axel Lin
Signed-off-by: Mark Brown
17 Jan, 2014
1 commit
-
The implementation in spi_setup() already set spi->bits_per_word = 8 when
spi->bits_per_word is 0 before calling spi->master->setup.
So we don't need to do it again in setup() callback.Signed-off-by: Axel Lin
Acked-by: Marek Vasut
Acked-by: Barry Song
Acked-by: Guenter Roeck
Signed-off-by: Mark Brown
15 Nov, 2013
1 commit
-
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: Wolfram Sang
Acked-by: Linus Walleij (personally at LCE13)
Cc: Ingo Molnar
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
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