History log of /drivers/dma/imx-dma.c
Revision Date Author Comments
60f2951e3ad9b833bc12e2ea7652be2611771792 20-Apr-2012 Vinod Koul <vinod.koul@linux.intel.com> dmaengine: imx-dma: dont complete descriptor for cyclic dma

the cookie updates completed the cyclic dma descriptor wrongly. This caused the
BUG_ON to be hit as submit is called for completed descriptor

Fix this by not marking the cyclic descriptor as complete

Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
660cd0dd94eba5201c69cd10f2d2fefb52807fa8 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: i.MX: Fix merge of cookie branch.

When merging DMA cookie changes a small chunk
of code was dropped. This broke imx-dma driver.

This patch adds this chunk again and fixes the problem.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
f606ab897b6d7f35b57c7474424676e30457520b 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: i.MX: Add support for interleaved transfers.

i.MX2 and i.MX1 chips have the possibility to do
interleaved transfers with two constraints:
- Only one chunk can be used (i.e. only 2D transfers are allowed).
- Only 2 interleaved configurations can be applied at the same time
for all channels.

Since this patch adds a new resource 'slots_2d' which is shared
by all the DMA channels and to avoid disgustin locking BUGs, the
'lock' member has been moved to the global 'imxdma_engine' structure.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
f9b283a6e41be584f4b1f4c6634625f41ff0c728 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: use 'dev_dbg' and 'dev_warn' for messages.

There were some 'pr_crit' and 'pr_debug' messages due to the
initial merge. Replace them by 'dev_dbg' and 'dev_warn' to be
consistent.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
cd5cf9da020293118800864641e09b71e23ba41c 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove 'imx_dmav1_baseaddr' and 'dma_clk'.

These global variables are integrated into the dmaengine structure.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
a6cbb2d87d20817e555a6ffa3131bfa1cdd9ab73 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove unused arg of imxdma_sg_next.

Since this function is always used with 'desc' as first argument
and 'desc->sg' as second argument, the latter is clearly redundant
and can be removed.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
2d9c2fc59a74e625eff795a788cacc65648290d6 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove internal structure.

This structure was created to allow an smoothless
merge but was meant to be removed. Remaining members
'hw_chaining' and 'watchdog' are moved to the channel
structure.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
6b0e2f55e3ebc7089abf5e4770f03fb264b6d2ea 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove 'resbytes' field of 'internal' structure.

Use per-descriptor 'len' field to keep track of the remaining bytes
instead. This goes on the direction of eventually removing the
'internal' structure.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
e4756b5e068d866239b6880a7030c9d31400b254 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove 'in_use' field of 'internal' structure.

It makes no sense keeping an 'in_use' flag when the multiple descriptor
mechanism already prevents a new DMA transfer to be issued when another
one is in course.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
833bc03bf14ef6d3f82d86845c29aa1f7e2037e3 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove sg member from internal structure.

This member is redundant, because it is already present in
descriptor structure. Removing it will make further removing
of 'internal' structure easier.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
359291a1a095a8a402405cd9c4bab46684e7bcfe 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove 'imxdma_setup_sg_hw' function.

Removing this function allows moving 'ccr_to_device' and
'ccr_from_device' from internal struct to channel struct.
This repesents a step forward towards removing auxiliary
'internal' structure.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
bdc0c7534c80c479b2336aed3e4016f4743f4853 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove 'imxdma_config_channel_hw' function.

This function is only used once in the driver and uses some
intermediary variables that are not needed anymore. For this
reason it's been merged with 'imxdma_control'.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
3b4b6dfc202dc5bedb03f2fae4ccc3f5b95dd563 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove 'imxdma_setup_mem2mem_hw' function.

This function is only used once in the driver and has a lot of checks
that are not needed anymore. For this reason it's been merged
with 'imxdma_enable_hw'.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
2efc3449d7b11f36f532180cb738364fd2c28e03 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove dma_mode member of internal structure.

dmaengine now provides 'enum dma_transfer_direction' to properly
specify DMA transfer direction. For this reason, DMA_MODE_* defines
are replaced by this new type and therefore dma_mode member becomes
redundant.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
232e3c2c7961fb3312a80df3747f1c29f0ed512e 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: remove data member from internal structure.

Internal structure is just an auxiliary structure used for the initial
merge which is meant to be gone. As data member is not use anywhere
we can simply remove it.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
6bd081277ea03e2b165fc68534b61bc64db93990 22-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c

It is mainly a simple merge changing the prefix of some
functions to fit the imx-dma namings.

As there are no users of the old dma-v1.c api we can safely
remove this file.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
185ecb5f4fd43911c35956d4cc7d94a1da30417f 08-Mar-2012 Alexandre Bounine <alexandre.bounine@idt.com> 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 <alexandre.bounine@idt.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
8ac695463f37af902e953d575d3f782e32e170da 06-Mar-2012 Russell King - ARM Linux <linux@arm.linux.org.uk> dmaengine: ensure all DMA engine drivers initialize their cookies

Ensure all DMA engine drivers initialize their cookies in the same way,
so that they all behave in a similar fashion. This means their first
issued cookie will be 2 rather than 1, and will increment to INT_MAX
before returning 1 and starting over.

In connection with this, Dan Williams said:
> Russell King wrote:
> > Secondly, some DMA engine drivers initialize the dma_chan cookie to 0,
> > others to 1.  Is there a reason for this, or are these all buggy?
>
> I know that ioat and iop-adma expect 0 to mean "I have cleaned up this
> descriptor and it is idle", and would break if zero was an in-flight
> cookie value. The reserved usage of zero is an driver internal
> concern, but I have no problem formalizing it as a reserved value.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd 06-Mar-2012 Russell King - ARM Linux <linux@arm.linux.org.uk> 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 <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
f7fbce07c6ce26a25b4e0cb5f241c361fde87901 06-Mar-2012 Russell King - ARM Linux <linux@arm.linux.org.uk> 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 <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
884485e1f12dcd39390f042e772cdbefc9ebb750 06-Mar-2012 Russell King - ARM Linux <linux@arm.linux.org.uk> 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 <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
d2ebfb335b0426deb1a4fb14e4e926d81ecd8235 06-Mar-2012 Russell King - ARM Linux <linux@arm.linux.org.uk> 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 <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
4d4e58de32a192fea65ab84509d17d199bd291c8 06-Mar-2012 Russell King - ARM Linux <linux@arm.linux.org.uk> 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 <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
5170c051a56244816d948c43592c1b2805ed4f3a 09-Mar-2012 Vinod Koul <vinod.koul@linux.intel.com> Revert "drivers/dma: linux/module.h included twice"

This reverts commit 865d9438eb1f7670d2e88849f059db551b320887.

The module.h incsuion twice has been updated tree wide hence this is not
required to be merged.

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
9e15db7ce949e9f2d8bb6ce32a74212a4f662370 02-Mar-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: Add support for multiple descriptors for imx-dma.

dmaengine specifies the possibility that several descriptors
can be queued for transfer. It also indicates that tasklets
must be used for DMA callbacks.

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
6c05f09155f40368c51ce00b8291401858e49bcb 28-Feb-2012 Javier Martin <javier.martin@vista-silicon.com> dmaengine: Add support for MEMCPY for imx-dma.

MEMCPY transfers allow DMA copies from memory to
memory. This patch has been tested with dmatest
device driver.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
865d9438eb1f7670d2e88849f059db551b320887 15-Feb-2012 Danny Kukawka <danny.kukawka@bisect.de> drivers/dma: linux/module.h included twice

drivers/dma/imx-dma.c and drivers/dma/imx-sdma.c included
'linux/module.h' twice, remove the duplicates.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
13ae246db4a02971ef4f557af1f6d3e21d64b710 29-Jan-2012 Paul Gortmaker <paul.gortmaker@windriver.com> includecheck: delete any duplicate instances of module.h

Different tree maintainers picked up independently generated
trivial compile fixes based on linux-next testing, resulting
in some cases where a file would have got more than one addition
of module.h once everything was all merged together.

Delete any duplicates so includecheck isn't complaining about
anything related to module.h/export.h changes.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
5b3168763f507fd46285b7310fc2d18dafe7f1c7 09-Jan-2012 Sascha Hauer <s.hauer@pengutronix.de> dma: imx-dma: start transfer in issue_pending

The DMA engine API requires that transfers are started in issue_pending
instead of tx_submit. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[corrected change log to DMA engine API insteadof DMA API]
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
5c45ad77ffd0108596627816a37de71a04d5cb6d 31-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> drivers/dma: Add module.h to files implicitly using it.

Fix files that were implicitly using module.h but not
calling it out for inclusion directly. We'll break those
once we remove the implicit presence otherwise

[With input from Uwe Kleine-König <u.kleine-koenig@pengutronix.de>]

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
db8196df4bb6f117caa163aa73b0f16fd62290bd 13-Oct-2011 Vinod Koul <vinod.koul@linux.intel.com> 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 <jaswinder.singh@linaro.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Viresh Kumar <viresh.kumar@st.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Cc: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Zhang Wei <zw@zh-kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Yong Wang <yong.y.wang@intel.com>
Cc: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
Cc: Boojin Kim <boojin.kim@samsung.com>
Cc: Barry Song <Baohua.Song@csr.com>
Acked-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
f8de8f4ce2a83ccf7571ee13d41d02a9040797f9 30-Aug-2011 Axel Lin <axel.lin@gmail.com> dmaengine i.MX DMA/SDMA: add missing include of linux/module.h

Add missing include of linux/module.h to fix build error.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
6584cb8825e4c74915a5a13756b1902523391d78 06-Jul-2011 Sascha Hauer <s.hauer@pengutronix.de> ARM i.MX dma: Fix burstsize settings

dmaengine expects the maxburst parameter in words, not bytes.
The imxdma driver and its users do this wrong. Fix this.

As a side note the imx-pcm-dma-mx2 driver was 'fixed' to work
with imx-dma. This broke the driver with imx-sdma support which
correctly takes the maxburst parameter in words. This patch
puts the sdma based sound back to work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
f8a356ff96a9070156f863e4f7716e2a0eb8c995 31-Jan-2011 Sascha Hauer <s.hauer@pengutronix.de> dmaengine i.MX dma: initialize dma capabilities outside channel loop

The capabilities are device specific fields, not channel specific fields.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
97a43dfe84119528ec2576129b91d619219ab716 31-Jan-2011 Sascha Hauer <s.hauer@pengutronix.de> dmaengine i.MX DMA: do not initialize chan_id field

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
d07102a1bb0e759ce4571df30c62998ef5d8a8d3 12-Jan-2011 Sascha Hauer <s.hauer@pengutronix.de> dmaengine i.MX dma: check sg entries for valid addresses and lengths

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1e070a60997f5bbaadd498c34380e2aa110336cf 12-Jan-2011 Sascha Hauer <s.hauer@pengutronix.de> dmaengine i.MX dma: set maximum segment size for our device

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
cbeae41888bddb2d8c23db281de5f38f4be6a9bb 02-Nov-2010 Axel Lin <axel.lin@gmail.com> dma: imx-dma: fix imxdma_probe error path

otherwise, i will be -1 inside the latest iteration of the while loop.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
8267f16e8b67ea272f37f7072933dc0d3839693d 20-Oct-2010 Sascha Hauer <s.hauer@pengutronix.de> dma: imx-dma: fix signedness bug

mxdmac->channel was unsigned, so check (imxdmac->channel < 0) for
failed imx_dma_request_by_prio() made no sence. Explicitly check
signed values.
Also, fix uninitialzed use of ret.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1f1846c6ceed07c03ef036a27864befe0f773997 06-Oct-2010 Sascha Hauer <s.hauer@pengutronix.de> dmaengine: Add Freescale i.MX1/21/27 DMA driver

This driver is currently implemented as a user to the old i.MX
DMA API. This allows us to convert each user of the old API to
the dmaengine API one by one. Once this is done the old DMA
driver can be merged into the i.MX dmaengine driver.

V2: remove some debug leftovers and unused variables

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>