diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2011-07-25 21:09:23 +0000 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2011-08-19 18:39:59 +0530 |
commit | 3c477482bb9f976e5451c50be7d3d60ea6f88646 (patch) | |
tree | 55bf7f439aed1e3fc5b691777c18cbb98dde0669 /drivers/dma/at_hdmac_regs.h | |
parent | c0ba5947370a0900b1823922fc4faf41515bc901 (diff) | |
download | talos-obmc-linux-3c477482bb9f976e5451c50be7d3d60ea6f88646.tar.gz talos-obmc-linux-3c477482bb9f976e5451c50be7d3d60ea6f88646.zip |
dmaengine: at_hdmac: add wrappers for testing channel state
Cyclic property and paused state are encoded as bits in the channel status
bitfield. Tests of those bits are wrapped in convenient helper functions.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/at_hdmac_regs.h')
-rw-r--r-- | drivers/dma/at_hdmac_regs.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h index 6f0c4a3eb091..aa4c9aebab7c 100644 --- a/drivers/dma/at_hdmac_regs.h +++ b/drivers/dma/at_hdmac_regs.h @@ -362,6 +362,23 @@ static inline int atc_chan_is_enabled(struct at_dma_chan *atchan) return !!(dma_readl(atdma, CHSR) & atchan->mask); } +/** + * atc_chan_is_paused - test channel pause/resume status + * @atchan: channel we want to test status + */ +static inline int atc_chan_is_paused(struct at_dma_chan *atchan) +{ + return test_bit(ATC_IS_PAUSED, &atchan->status); +} + +/** + * atc_chan_is_cyclic - test if given channel has cyclic property set + * @atchan: channel we want to test status + */ +static inline int atc_chan_is_cyclic(struct at_dma_chan *atchan) +{ + return test_bit(ATC_IS_CYCLIC, &atchan->status); +} /** * set_desc_eol - set end-of-link to descriptor so it will end transfer |