diff options
author | Jonas Aaberg <jonas.aberg@stericsson.com> | 2010-08-09 08:08:02 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-09-22 17:53:45 -0400 |
commit | b55912c66a317d9aaf4749488ca43d510c8a8a87 (patch) | |
tree | ee040835dc1e5e4471bd50f167ee81880a9a9f5e /drivers | |
parent | 1b00348d5d0b3423fe21f499bf30d40a4d1dc594 (diff) |
DMAENGINE: ste_dma40: Code clean-up and removed an unneeded suspend request
This patch cleans up some code and removes a suspend request that was pointless
since the hw was never configured nor running when it was called.
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/ste_dma40.c | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 538c35d05a57..1adaebf49774 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -652,29 +652,10 @@ static u32 d40_chan_has_events(struct d40_chan *d40c) | |||
652 | return val; | 652 | return val; |
653 | } | 653 | } |
654 | 654 | ||
655 | static void d40_config_enable_lidx(struct d40_chan *d40c) | 655 | static void d40_config_write(struct d40_chan *d40c) |
656 | { | ||
657 | /* Set LIDX for lcla */ | ||
658 | writel((d40c->phy_chan->num << D40_SREG_ELEM_LOG_LIDX_POS) & | ||
659 | D40_SREG_ELEM_LOG_LIDX_MASK, | ||
660 | d40c->base->virtbase + D40_DREG_PCBASE + | ||
661 | d40c->phy_chan->num * D40_DREG_PCDELTA + D40_CHAN_REG_SDELT); | ||
662 | |||
663 | writel((d40c->phy_chan->num << D40_SREG_ELEM_LOG_LIDX_POS) & | ||
664 | D40_SREG_ELEM_LOG_LIDX_MASK, | ||
665 | d40c->base->virtbase + D40_DREG_PCBASE + | ||
666 | d40c->phy_chan->num * D40_DREG_PCDELTA + D40_CHAN_REG_SSELT); | ||
667 | } | ||
668 | |||
669 | static int d40_config_write(struct d40_chan *d40c) | ||
670 | { | 656 | { |
671 | u32 addr_base; | 657 | u32 addr_base; |
672 | u32 var; | 658 | u32 var; |
673 | int res; | ||
674 | |||
675 | res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ); | ||
676 | if (res) | ||
677 | return res; | ||
678 | 659 | ||
679 | /* Odd addresses are even addresses + 4 */ | 660 | /* Odd addresses are even addresses + 4 */ |
680 | addr_base = (d40c->phy_chan->num % 2) * 4; | 661 | addr_base = (d40c->phy_chan->num % 2) * 4; |
@@ -700,9 +681,20 @@ static int d40_config_write(struct d40_chan *d40c) | |||
700 | d40c->phy_chan->num * D40_DREG_PCDELTA + | 681 | d40c->phy_chan->num * D40_DREG_PCDELTA + |
701 | D40_CHAN_REG_SDCFG); | 682 | D40_CHAN_REG_SDCFG); |
702 | 683 | ||
703 | d40_config_enable_lidx(d40c); | 684 | /* Set LIDX for lcla */ |
685 | writel((d40c->phy_chan->num << D40_SREG_ELEM_LOG_LIDX_POS) & | ||
686 | D40_SREG_ELEM_LOG_LIDX_MASK, | ||
687 | d40c->base->virtbase + D40_DREG_PCBASE + | ||
688 | d40c->phy_chan->num * D40_DREG_PCDELTA + | ||
689 | D40_CHAN_REG_SDELT); | ||
690 | |||
691 | writel((d40c->phy_chan->num << D40_SREG_ELEM_LOG_LIDX_POS) & | ||
692 | D40_SREG_ELEM_LOG_LIDX_MASK, | ||
693 | d40c->base->virtbase + D40_DREG_PCBASE + | ||
694 | d40c->phy_chan->num * D40_DREG_PCDELTA + | ||
695 | D40_CHAN_REG_SSELT); | ||
696 | |||
704 | } | 697 | } |
705 | return res; | ||
706 | } | 698 | } |
707 | 699 | ||
708 | static void d40_desc_load(struct d40_chan *d40c, struct d40_desc *d40d) | 700 | static void d40_desc_load(struct d40_chan *d40c, struct d40_desc *d40d) |
@@ -1730,14 +1722,8 @@ static int d40_alloc_chan_resources(struct dma_chan *chan) | |||
1730 | * resource is free. In case of multiple logical channels | 1722 | * resource is free. In case of multiple logical channels |
1731 | * on the same physical resource, only the first write is necessary. | 1723 | * on the same physical resource, only the first write is necessary. |
1732 | */ | 1724 | */ |
1733 | if (is_free_phy) { | 1725 | if (is_free_phy) |
1734 | err = d40_config_write(d40c); | 1726 | d40_config_write(d40c); |
1735 | if (err) { | ||
1736 | dev_err(&d40c->chan.dev->device, | ||
1737 | "[%s] Failed to configure channel\n", | ||
1738 | __func__); | ||
1739 | } | ||
1740 | } | ||
1741 | fail: | 1727 | fail: |
1742 | spin_unlock_irqrestore(&d40c->lock, flags); | 1728 | spin_unlock_irqrestore(&d40c->lock, flags); |
1743 | return err; | 1729 | return err; |