From: Brian Niebuhr bnieb...@efjohnson.com
Quit writing the same constant value determining the chip-select
mode when no transmissions are in progress in davinci_spi_chipelect().
Instead just setup the SPIDEF register once during probe.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
From: Brian Niebuhr bnieb...@efjohnson.com
The variable count in DaVinci SPI driver's private data is
largely unused and its minor use can easily be eliminated.
Remove the variable.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson
From: Brian Niebuhr bnieb...@efjohnson.com
Add copyright for EF Johnson Technologies since the driver
has been majorly overhauled by Brian.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
drivers/spi/davinci_spi.c |1 +
1 files changed, 1
From: Brian Niebuhr bnieb...@efjohnson.com
Remove unnecessary call to davinci_spi_setup_transfer() at the end
of davinci_spi_setup().
davinci_spi_setup_transfer() is registered as the setup_transfer
callback for the bitbang layer and is called independently by
the bitbang layer to setup the
From: Brian Niebuhr bnieb...@efjohnson.com
The EDMA acount (called data_type in davinci_spi_bufs_dma())
is simply the bytes_per_word obtained in the transfer setup
function. The current code calculates the acount value from
bytes_per_word in a convoluted manner. Simplify the code.
Signed-off-by:
From: Brian Niebuhr bnieb...@efjohnson.com
The function davinci_spi_bufs_prep() is doing stuff that
davinci_spi_setup() is doing. Eliminate it and move the work
to davinci_spi_setup()
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson
From: Brian Niebuhr bnieb...@efjohnson.com
Let DMA operation be specified on a per-device basis instead
of selecting it once during probe.
A side effect of this is the need to combine the PIO and DMA buffer
txrx_bufs routine. This is good since they anyway share some common
functionality.
From: Brian Niebuhr bnieb...@efjohnson.com
Do not stop SPI DMA event generation in either transmit or
receive DMA event call back because the single setting affects
both transmit and receive event generation.
Depending on the order in which the callbacks happen, transmit
or receive events can
From: Brian Niebuhr bnieb...@efjohnson.com
The interrupt mode support as it stands is another version
of poll mode. Even when interrupt mode is selected, the code
tight loops on interrupt status register, rendering it totally
useless. A completion variable is initialized, but never used.
Remove
From: Brian Niebuhr bnieb...@efjohnson.com
The DMA code does not use the existing completion variable 'done'
which is being used for interrupt mode transfers. Instead it uses
two different completion variables specific to DMA mode transfers.
Eliminate the usage of new completion variables for
From: Brian Niebuhr bnieb...@efjohnson.com
Simplify pre-scalar calculation and move it into a seprate
function.
Refuse to correct invalid pre-scalar values silently as this
might lead to unexpected bugs and lower performance. Instead
an error will force users to dig into the root-cause of the
From: Brian Niebuhr bnieb...@efjohnson.com
Consolidate the setup of SPIFMTn register under
davinci_spi_setup_transfer() simplifying the code
and avoiding unnecessary reads and writes to the
register.
The two inline functions {set|clear}_fmt_bits() can
be eliminated because of this.
Do not allocate (and de-allocate) SPI DMA channels during setup
(and cleanup) for each SPI device. Instead, allocate the DMA
channels once duing probe and use them for the life time of
the driver.
This makes sense since there are dedicated DMA channels meant
for SPI use.
This also helps remove
From: Brian Niebuhr bnieb...@efjohnson.com
The count member of davinci_spi is internal to the driver and
is not shared with framework. Eliminate its unnecessary update.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
From: Brian Niebuhr bnieb...@efjohnson.com
The SPI_READY bit of struct spi_device:mode serves the purpose
of letting the SPI master know if the slave can signal if it is
ready for transfer or not.
The 'wait_enable' platform data was duplicating this functionality.
Use the framework provided
From: Brian Niebuhr bnieb...@efjohnson.com
In the davinci_spi_{tx|rx}_u{8|16}() functions, check for
buffer pointer being valid before using it. While providing
for better error checking, this change will help simplify
code in the caller.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
From: Brian Niebuhr bnieb...@efjohnson.com
Sometimes, the chip selects provided by SPI module are
muxed with other functionality and cannot be used in
some designs. In such cases, it becomes convenient to use
an available GPIO line as chip select.
This patch enables the DaVinci SPI driver to
From: Brian Niebuhr bnieb...@efjohnson.com
Do not store DMA channel related information per chip-select since
that information does not depend on the chip select.
The same DMA channels can be used for transfers on all chip-selects
since the transfer happens one-at-a-time.
Signed-off-by: Brian
From: Brian Niebuhr bnieb...@efjohnson.com
Enable SPI only when active transfers are in progress. Keep
it in local low power when not in use.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
Signed-off-by: Sekhar Nori
From: Brian Niebuhr bnieb...@efjohnson.com
Use a dummy param slot linked to itself to take care of the
extra sync event that gets sent to EDMA controller after
the last byte has been transferred.
The dummy PaRAM slot that is linked to the actual DMA PaRAM
slot absorbs this event and prevents a
From: Brian Niebuhr bnieb...@efjohnson.com
Add support for SPI interrupt mode operation.
Define a per chip-select io type variable which
specifies if the transfers on this chip-select should
happen in interrupt mode or polled mode.
Introduce a new function davinci_spi_process_events()
to help
From: Brian Niebuhr bnieb...@efjohnson.com
Cleanup unnecessary white space from various
parts of the file.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
From: Brian Niebuhr bnieb...@efjohnson.com
The 'pdata' variable is unused in couple of routines.
Remove such occurences.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
Remove unused defines from code which should help
in easy reading of code.
Also, use the opportuinity to keep the SPIGCR1
register defines together.
Tested-By: Michael Williamson michael.william...@criticallink.com
Tested-By: Brian Niebuhr bnieb...@efjohnson.com
Signed-off-by: Sekhar Nori
Add manufacturer name to the Kconfig prompt string and move
the controller name to the begining of the prompt.
This helps locate the driver easily among the list of existing
drivers.
While at it, also add information about being able to build
the driver as module.
Tested-By: Brian Niebuhr
From: Brian Niebuhr bnieb...@efjohnson.com
Due to the full duplex nature of the SPI bus, the SPI master
on DaVinci needs transmit to be active even if the tranfer is
only meant to collect receive data.
The current code achieves this by using a temporary zeroed buffer
to provide DMA data in case
Remove unnecesary private data member 'region_size'
being used to store the size of SPI memory region.
Instead, get the memory resource size directly from
the platform data.
Tested-By: Brian Niebuhr bnieb...@efjohnson.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
drivers/spi/davinci_spi.c |
From: Brian Niebuhr bnieb...@efjohnson.com
Several members of struct davinci_spi_slave are unused in code.
Remove such members.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
From: Brian Niebuhr bnieb...@efjohnson.com
Setup chip-select timers values only if timer is enabled
(timer_disbled in spi configuration is false).
As a nice side effect, this patch removes code duplicated in
davinci_spi_bufs_pio() and davinci_spi_bufs_dma().
Signed-off-by: Brian Niebuhr
From: Brian Niebuhr bnieb...@efjohnson.com
The completion variable 'done' is unnecessarly initialized by
the function davinci_spi_bufs_dma() where as it is not used
for DMA transfers at all.
Remove the unnecessary initialization.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By:
From: Brian Niebuhr bnieb...@efjohnson.com
Setup the owner member of the platform driver to THIS_MODULE
instead of leaving it NULL.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
From: Brian Niebuhr bnieb...@efjohnson.com
On TI DaVinci's SPI controller, the SPIDAT1 register which
controls the chip slect status, also has data transmit register
in the lower 16 bits. Writing to the whole 32-bits triggers
an additional data transmit every time the chip select is disabled.
From: Brian Niebuhr bnieb...@efjohnson.com
In the davinci_spi_bufs_dma() function, SPI is briefly disabled
before enabling it immediately back again.
Remove this unnecessary disable.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson
Shorten names of local variables and structure members where
possible.
Local variables:
* 'davinci_spi' is being renamed 'dspi'
* 'davinci_spi_dma' is being renamed 'dma'
Structure members:
* 'dma_{tx|rx}_channel' is being renamed '{tx|rx}_channel'
since the structure containing them is
From: Brian Niebuhr bnieb...@efjohnson.com
The clk_internal platform data member which contols the
CLKMOD bit in Global Control Register 1 is not useful
since CLKMOD needs be set to 1 *always* to ensure master
mode operation.
Remove this platform data.
Signed-off-by: Brian Niebuhr
From: Brian Niebuhr bnieb...@efjohnson.com
In keeping with the full duplex nature of the SPI bus. Always
start receive DMA along with transmit DMA.
If there is no receive buffer provided with the transfer, use
a temporary buffer to receive the data to be thrown away.
From: Brian Niebuhr bnieb...@efjohnson.com
Use the fact that the get_tx and get_rx can now cope with
NULL buffer pointers to simplify the poll mode transfer
code.
While at it, check for SPI errors every transfer rather than
at the end of the whole transfer.
Signed-off-by: Brian Niebuhr
From: Brian Niebuhr bnieb...@efjohnson.com
The struct davinci_spi_slave has a single member. Eliminate it
and store the per-chipselect data in struct davinci_spi directly.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson michael.william...@criticallink.com
From: Brian Niebuhr bnieb...@efjohnson.com
Add comments describing the platform data members
and per-chip-select SPI configuration structure.
Also, add some comments describing the what happens
during the driver probe.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael
From: Brian Niebuhr bnieb...@efjohnson.com
Let davinci_spi_chipselect() perform both activation and
deactivation of chip selects. This lets spi_bitbang fully
control chip select activation, as intended by the SPI API.
With this change, the chip select activation code need not
be duplicated in
From: Brian Niebuhr bnieb...@efjohnson.com
Some chip-select specific paramterers like wdelay, parity, usage of
chip-select timers (and the actual timer values) are included in
platform data forcing the same behaviour across all chip-selects.
Create a new davinci_spi_config data structure which
From: Brian Niebuhr bnieb...@efjohnson.com
Do not simply clean the DMA channel on a DMA completion
error. Instead, use wcount and rcount members of davinci_spi
to detecion non-completion of DMA and signal EIO to the
application.
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By:
From: Brian Niebuhr bnieb...@efjohnson.com
Currently a series of EDMA API calls are being made to setup
various aspects of EDMA PaRAM slots for receive and transmit.
Instead setup the PaRAM using a local structure and write once
to the hardware using edma_write_slot()
Signed-off-by: Brian
From: Brian Niebuhr bnieb...@efjohnson.com
Fix the following checkpatch error:
WARNING: unnecessary whitespace before a quoted newline
+ dev_info(pdev-dev, Controller at 0x%p \n, davinci_spi-base);
Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
Tested-By: Michael Williamson
In davinci_spi_check_error(), Tx interrupt being set is
treated as error. This function is only meant to flag
bus error conditions and Tx interrupt being set at that
point is not a bus error but rather a driver bug.
Stop checking for Tx interrupt and flagging that as an
IO error.
Tested-By:
This patch series represents a break-up into reviewable portions
of the work originally done by Brian and posted here:
https://patchwork.kernel.org/patch/114924/
While this series does not exactly add up to what Brian's patch
is, it is pretty close functionally.
This series was tested by me on
The typecasting of SPI base address to davinci_spi_reg is
unused.
Remove it.
Tested-By: Michael Williamson michael.william...@criticallink.com
Tested-By: Brian Niebuhr bnieb...@efjohnson.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
drivers/spi/davinci_spi.c |3 +--
1 files changed, 1
Hello.
On 17-11-2010 13:43, Sekhar Nori wrote:
The typecasting of SPI base address to davinci_spi_reg is
unused.
You mean unnecessary?
Remove it.
Tested-By: Michael Williamsonmichael.william...@criticallink.com
Tested-By: Brian Niebuhrbnieb...@efjohnson.com
Signed-off-by: Sekhar
Hi Sergei,
On Wed, Nov 17, 2010 at 16:45:06, Sergei Shtylyov wrote:
Hello.
On 17-11-2010 13:43, Sekhar Nori wrote:
The typecasting of SPI base address to davinci_spi_reg is
unused.
You mean unnecessary?
I used unused because struct davinci_spi_reg is actually
undefined.
Thanks,
On Tue, Nov 16, 2010 at 07:17:18PM -0500, Cyril Chemparathy wrote:
The ability to wait on multiple devices may come handy. In this
This is essential for any helpers, otherwise we can't cope easily with
mixes of GPIO and power or with regulators from multiple chips (like an
extra DCDC, for
On Wed, Nov 17, 2010 at 04:13:32PM +0530, Sekhar Nori wrote:
This patch series represents a break-up into reviewable portions
of the work originally done by Brian and posted here:
https://patchwork.kernel.org/patch/114924/
While this series does not exactly add up to what Brian's patch
On Tue, Nov 16, 2010 at 07:17:18PM
-0500, Cyril Chemparathy wrote:
The ability to wait on multiple devices may come
handy.
... You mean you'd like to add such a
mechanism to the framework?
Or do you want a driver-specific
mechanism (non-portable)?
If I had
to do that, I'd just use
On Tue, Nov 16, 2010 at 07:17:18PM -0500, Cyril Chemparathy wrote:
On 11/16/2010 02:47 AM, Grant Likely wrote:
On Tue, Nov 16, 2010 at 12:22 AM, Grant Likely
grant.lik...@secretlab.ca wrote:
On Mon, Nov 15, 2010 at 02:12:06PM -0500, Cyril Chemparathy wrote:
This patch adds an SPI master
On Wed, Nov 17, 2010 at 09:11:30AM -0700, Grant Likely wrote:
To start, I'm not a fan of matching by name. It's fragile because it
makes assumptions about how devices will be names when they actually
appear (ie. Sometimes .id is dynamically assigned). Ideally I'd
prefer to have direct
On 11/17/2010 10:25 AM, David Brownell wrote:
On Tue, Nov 16, 2010 at 07:17:18PM
-0500, Cyril Chemparathy wrote:
The ability to wait on multiple devices may come
handy.
... You mean you'd like to add such a
mechanism to the framework?
Ideally in the framework. This appears to be a
On Wed, Nov 17, 2010 at 09:11:30AM -0700, Grant Likely wrote:
Also, any dependency tracking must work across bus_types. It is not
sufficient to only handle the platform_devices use-case. All bus
types have this need.
Agreed.
I see a few potential approaches.
Option 1: Add a list of
Hi Grant,
On Wed, Nov 17, 2010 at 20:54:26, Grant Likely wrote:
On Wed, Nov 17, 2010 at 04:13:32PM +0530, Sekhar Nori wrote:
This patch series represents a break-up into reviewable portions
of the work originally done by Brian and posted here:
https://patchwork.kernel.org/patch/114924/
57 matches
Mail list logo