Commit Graph
36 Commits
Author SHA1 Message Date
Maxime Ripard 2c55536ac3 dmaengine: td: Rename device_control
Rename the device_control callback of the Timberdal DMA driver to terminate_all
since it's all it's really doing. That will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2014-12-22 12:33:22 +05:30
Kiran Padwal cd166280b7 dmaengine: Remove .owner field for driver
There is no need to init .owner field.

Based on the patch from Peter Griffin <[email protected]>
"mmc: remove .owner field for drivers using module_platform_driver"

This patch removes the superflous .owner field for drivers which
use the module_platform_driver API, as this is overriden in
platform_driver_register anyway."

Signed-off-by: Kiran Padwal <[email protected]>
[for nvidia]
Acked-by: Thierry Reding <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2014-11-06 11:54:18 +05:30
Bartlomiej Zolnierkiewicz 54f8d501e8 dmaengine: remove DMA unmap from drivers
Remove support for DMA unmapping from drivers as it is no longer
needed (DMA core code is now handling it).

Cc: Vinod Koul <[email protected]>
Cc: Tomasz Figa <[email protected]>
Cc: Dave Jiang <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
[djbw: fix up chan2parent() unused warning in drivers/dma/dw/core.c]
Signed-off-by: Dan Williams <[email protected]>
2013-11-14 11:04:38 -08:00
Dan Williams d38a8c622a dmaengine: prepare for generic 'unmap' data
Add a hook for a common dma unmap implementation to enable removal of
the per driver custom unmap code.  (A reworked version of Bartlomiej
Zolnierkiewicz's patches to remove the custom callbacks and the size
increase of dma_async_tx_descriptor for drivers that don't care about
raid).

Cc: Vinod Koul <[email protected]>
Cc: Tomasz Figa <[email protected]>
Cc: Dave Jiang <[email protected]>
[bzolnier: prepare pl330 driver for adding missing unmap while at it]
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2013-11-13 16:25:06 -08:00
Jingoo Han d4adcc0160 dma: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2013-08-13 16:56:41 +05:30
Jingoo Han c1a9d391ad dma: timb_dma: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d06310
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2013-07-05 11:40:35 +05:30
Maxin B. John 234846d4c8 dma: timb_dma: Fix compiler warning
Fix this compiler warning:
warning: 'td_remove' defined but not used [-Wunused-function]

Signed-off-by: Maxin B. John <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2013-04-15 09:51:16 +05:30
Greg Kroah-Hartman 4bf27b8b33 Drivers: dma: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitconst,
and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Jeff Kirsher <[email protected]>
Cc: Alexander Duyck <[email protected]>
Cc: Russell King <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Jassi Brar <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Bill Pemberton <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-03 15:57:15 -08:00
Bill Pemberton 463a1f8b3c dma: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <[email protected]>
Cc: Li Yang <[email protected]>
Cc: Zhang Wei <[email protected]>
Cc: Barry Song <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28 12:42:36 -08:00
Alexandre Bounine 185ecb5f4f dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic
Add context parameter to device_prep_slave_sg() and device_prep_dma_cyclic()
interfaces to allow passing client/target specific information associated
with the data transfer.
Modify all affected DMA engine drivers.

Signed-off-by: Alexandre Bounine <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-21 19:20:23 +05:30
Vinod Koul 949ff5b8d4 dmaengine: fix for cookie changes and merge
Fixed trivial issues in drivers:
	drivers/dma/imx-sdma.c
	drivers/dma/intel_mid_dma.c
	drivers/dma/ioat/dma_v3.c
	drivers/dma/iop-adma.c
	drivers/dma/sirf-dma.c
	drivers/dma/timb_dma.c

Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:58:12 +05:30
Russell King - ARM Linux d3ee98cdcd dmaengine: consolidate initialization of cookies
Provide a common function to initialize a channels cookie values.

Signed-off-by: Russell King <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Jassi Brar <[email protected]>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:37:22 +05:30
Russell King - ARM Linux 96a2af41c7 dmaengine: consolidate tx_status functions
Now that we have the completed cookie in the dma_chan structure, we
can consolidate the tx_status functions by providing a function to set
the txstate structure and returning the DMA status.  We also provide
a separate helper to set the residue for cookies which are still in
progress.

Signed-off-by: Russell King <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Jassi Brar <[email protected]>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:37:14 +05:30
Russell King - ARM Linux f7fbce07c6 dmaengine: provide a common function for completing a dma descriptor
Provide a common function to do the cookie mechanics for completing
a DMA descriptor.

Signed-off-by: Russell King <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Jassi Brar <[email protected]>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:37:01 +05:30
Russell King - ARM Linux 884485e1f1 dmaengine: consolidate assignment of DMA cookies
Everyone deals with assigning DMA cookies in the same way (it's part of
the API so they should be), so lets consolidate the common code into a
helper function to avoid this duplication.

Signed-off-by: Russell King <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Jassi Brar <[email protected]>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:36:52 +05:30
Russell King - ARM Linux d2ebfb335b dmaengine: add private header file
Add a local private header file to contain definitions and declarations
which should only be used by DMA engine drivers.

We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
multiple inclusion.

Signed-off-by: Russell King <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Jassi Brar <[email protected]>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:36:44 +05:30
Russell King - ARM Linux 4d4e58de32 dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie
in their private dma channel structures.  This is pointless, and
forces driver specific code.  Move this out into the common dma_chan
structure.

Signed-off-by: Russell King <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Jassi Brar <[email protected]>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2012-03-13 11:36:06 +05:30
Axel Lin c94e910535 dmaengine: convert drivers/dma/* to use module_platform_driver()
This patch converts the drivers in drivers/dma/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Dan Williams <[email protected]>
Cc: Piotr Ziecik <[email protected]>
Cc: Rongjun Ying <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Pelagicore AB <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2011-12-05 08:25:54 +05:30
Vinod Koul d5613947ad dmaengine: timb_dma: fix the spare warinings
Sparse warns:

drivers/dma/timb_dma.c:168:17: warning: mixing different enum types
drivers/dma/timb_dma.c:168:17:     int enum dma_transfer_direction versus
drivers/dma/timb_dma.c:168:17:     int enum dma_data_direction
drivers/dma/timb_dma.c:172:32: warning: mixing different enum types
drivers/dma/timb_dma.c:172:32:     int enum dma_transfer_direction versus
drivers/dma/timb_dma.c:172:32:     int enum dma_data_direction

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2011-11-28 08:51:16 +05:30
Vinod Koul db8196df4b dmaengine: move drivers to dma_transfer_direction
fixup usage of dma direction by introducing dma_transfer_direction,
this patch moves dma/drivers/* to use new enum

Cc: Jassi Brar <[email protected]>
Cc: Russell King <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Mika Westerberg <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Li Yang <[email protected]>
Cc: Zhang Wei <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Yong Wang <[email protected]>
Cc: Tomoya MORINAGA <[email protected]>
Cc: Boojin Kim <[email protected]>
Cc: Barry Song <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2011-10-27 20:53:43 +05:30
Dan Carpenter f80befe081 dma/timberdale: free_irq() on an error path
There was an error path that skipped the free_irq() step by mistake.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2011-10-07 10:23:11 +05:30
Barry Song 463894705e dmaengine: delete redundant chan_id and chancnt initialization in dma drivers
dma_async_device_register will re-init chan_id and chancnt,
so whatever chan_id and chancnt are set in drivers, they will
be re-written by dma_async_device_register.

Cc: Nicolas Ferre <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Piotr Ziecik <[email protected]>
Cc: Yong Wang <[email protected]>
Cc: Jaswinder Singh <[email protected]>
Cc: Pelagicore AB <[email protected]>
Signed-off-by: Barry Song <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2011-09-20 11:51:33 +05:30
Samuel Ortiz 3271d382c3 mfd: Use mfd cell platform_data for timberdale cells platform bits
With the addition of a device platform mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Acked-by: Richard Röjfors <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
2011-05-26 19:45:05 +02:00
Andres Salomon e46dccff34 mfd: mfd_cell is now implicitly available to timberdale drivers
The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Note that the mfd's platform_data is marked __devinitdata.  This
is still correct in all cases except for the timbgpio driver, whose
remove hook has been changed to no longer reference the pdata.

Signed-off-by: Andres Salomon <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
2011-03-23 10:41:52 +01:00
Justin P. Mattock ae0e47f02a Remove one to many n's in a word
Signed-off-by: Justin P. Mattock <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
2011-03-01 15:47:58 +01:00
Nicolas Kaiser 9cb047d4d1 dma/timberdale: simplify conditional
Simplify: ((a && b) || (!a && !b)) => (a == b)

Signed-off-by: Nicolas Kaiser <[email protected]>
Acked-by: Jack Stone <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-10-19 15:20:11 -07:00
Julia Lawall 4856800501 drivers/dma: Eliminate a NULL pointer dereference
If td_desc is NULL, just skip both kfrees.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-07-01 02:27:35 -07:00
Dan Carpenter efcc289817 dma/timb_dma: compile warning on 32 bit
This silences a compile warning on 32 bit systems:
drivers/dma/timb_dma.c:203: warning: cast to pointer from integer of different size

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-07-01 02:27:31 -07:00
Alexey Dobriyan 4be929be34 kernel-wide: replace USHORT_MAX, SHORT_MAX and SHORT_MIN with USHRT_MAX, SHRT_MAX and SHRT_MIN
- C99 knows about USHRT_MAX/SHRT_MAX/SHRT_MIN, not
  USHORT_MAX/SHORT_MAX/SHORT_MIN.

- Make SHRT_MIN of type s16, not int, for consistency.

[[email protected]: fix drivers/dma/timb_dma.c]
[[email protected]: fix security/keys/keyring.c]
Signed-off-by: Alexey Dobriyan <[email protected]>
Acked-by: WANG Cong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-05-25 08:07:02 -07:00
Linus Walleij 058276303d DMAENGINE: extend the control command to include an arg
This adds an argument to the DMAengine control function, so that
we can later provide control commands that need some external data
passed in through an argument akin to the ioctl() operation
prototype.

[[email protected]: fix up some missed conversions]
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-05-17 16:30:42 -07:00
Stephen Rothwell 6a3cd3ea48 async_tx: use of kzalloc/kfree requires the include of slab.h
Signed-off-by: Stephen Rothwell <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-03-29 15:26:06 -07:00
Dan Williams bca3469205 dmaengine: provide helper for setting txstate
Simple conditional struct filler to cut out some duplicated code.

Signed-off-by: Dan Williams <[email protected]>
2010-03-26 16:52:10 -07:00
Linus Walleij 0793448187 DMAENGINE: generic channel status v2
Convert the device_is_tx_complete() operation on the
DMA engine to a generic device_tx_status()operation which
can return three states, DMA_TX_RUNNING, DMA_TX_COMPLETE,
DMA_TX_PAUSED.

[[email protected]: update for timberdale]
Signed-off-by: Linus Walleij <[email protected]>
Acked-by: Mark Brown <[email protected]>
Cc: Maciej Sosnowski <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Li Yang <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Roland Dreier <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-03-26 16:50:49 -07:00
Linus Walleij c3635c78e5 DMAENGINE: generic slave control v2
Convert the device_terminate_all() operation on the
DMA engine to a generic device_control() operation
which can now optionally support also pausing and
resuming DMA on a certain channel. Implemented for the
COH 901 318 DMAC as an example.

[[email protected]: update for timberdale]
Signed-off-by: Linus Walleij <[email protected]>
Acked-by: Mark Brown <[email protected]>
Cc: Maciej Sosnowski <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Li Yang <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Roland Dreier <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-03-26 16:44:01 -07:00
Richard Röjfors 0f65169b1b dma: timb-dma: Update comment and fix compiler warning
An incremental patch which clarifies what the spinlock is used for
and fixes a compiler warning.

Signed-off-by: Richard Röjfors <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-03-26 16:08:20 -07:00
Richard Röjfors de5d4453c5 dma: Add timb-dma
Adds the support for the DMA engine withing the timberdale FPGA.

The DMA channels are strict device to host, or host to device
and can not be used for generic memcpy.

Signed-off-by: Richard Röjfors <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
2010-03-25 17:18:43 -07:00