mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vinod.koul@intel.com>,
	linux-kernel@vger.kernel.org
Cc: qi.wang@intel.com, yong.y.wang@intel.com, joel.clark@intel.com,
	kok.howg.ewe@intel.com, toshiharu-linux@dsn.okisemi.com,
	Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Subject: [PATCH 2/4] pch_dma: fix dma direction issue for ML7213 IOH video-in
Date: Tue, 26 Apr 2011 19:05:51 +0900	[thread overview]
Message-ID: <1303812353-6712-2-git-send-email-tomoya-linux@dsn.okisemi.com> (raw)
In-Reply-To: <1303812353-6712-1-git-send-email-tomoya-linux@dsn.okisemi.com>

Currently, even-channel number is set as tx direction and odd is set as rx.
However, though video-in uses ch6, the direction is not tx but rx.
This patch sets video-in's DMA direction correctly.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
---
 drivers/dma/pch_dma.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index 9421ed5..cd7bf83 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -59,6 +59,14 @@
 #define DMA_DESC_FOLLOW_WITHOUT_IRQ	0x2
 #define DMA_DESC_FOLLOW_WITH_IRQ	0x3
 
+/* PCI Device ID of DMA device */
+#define PCI_VENDOR_ID_ROHM             0x10DB
+#define PCI_DEVICE_ID_EG20T_PCH_DMA_8CH        0x8810
+#define PCI_DEVICE_ID_EG20T_PCH_DMA_4CH        0x8815
+#define PCI_DEVICE_ID_ML7213_DMA1_8CH	0x8026
+#define PCI_DEVICE_ID_ML7213_DMA2_8CH	0x802B
+#define PCI_DEVICE_ID_ML7213_DMA3_4CH	0x8034
+
 #define MAX_CHAN_NR			8
 
 static unsigned int init_nr_desc_per_channel = 64;
@@ -853,7 +861,12 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev,
 
 		pd_chan->membase = &regs->desc[i];
 
-		pd_chan->dir = (i % 2) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
+		/* D10:F0 DMA ch6 "video input" is rx direction */
+		if ((id->device == PCI_DEVICE_ID_ML7213_DMA1_8CH) && (i == 6))
+			pd_chan->dir = DMA_FROM_DEVICE;
+		else
+			pd_chan->dir = (i % 2) ? DMA_FROM_DEVICE : \
+								DMA_TO_DEVICE;
 
 		spin_lock_init(&pd_chan->lock);
 
@@ -925,14 +938,6 @@ static void __devexit pch_dma_remove(struct pci_dev *pdev)
 	}
 }
 
-/* PCI Device ID of DMA device */
-#define PCI_VENDOR_ID_ROHM             0x10DB
-#define PCI_DEVICE_ID_EG20T_PCH_DMA_8CH        0x8810
-#define PCI_DEVICE_ID_EG20T_PCH_DMA_4CH        0x8815
-#define PCI_DEVICE_ID_ML7213_DMA1_8CH	0x8026
-#define PCI_DEVICE_ID_ML7213_DMA2_8CH	0x802B
-#define PCI_DEVICE_ID_ML7213_DMA3_4CH	0x8034
-
 static const struct pci_device_id pch_dma_id_table[] = {
 	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), 8 },
 	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), 4 },
-- 
1.7.4


  reply	other threads:[~2011-04-26 10:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 10:05 [PATCH 1/4] pch_dma: Modify for checkpatch Tomoya MORINAGA
2011-04-26 10:05 ` Tomoya MORINAGA [this message]
2011-05-02  6:16   ` [PATCH 2/4] pch_dma: fix dma direction issue for ML7213 IOH video-in Koul, Vinod
2011-04-26 10:05 ` [PATCH 3/4] pch_dma: Fix DMA setting issue Tomoya MORINAGA
2011-04-26 10:05 ` [PATCH 4/4] pch_dma: Support I2S for ML7213 IOH Tomoya MORINAGA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303812353-6712-2-git-send-email-tomoya-linux@dsn.okisemi.com \
    --to=tomoya-linux@dsn.okisemi.com \
    --cc=dan.j.williams@intel.com \
    --cc=joel.clark@intel.com \
    --cc=kok.howg.ewe@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qi.wang@intel.com \
    --cc=toshiharu-linux@dsn.okisemi.com \
    --cc=vinod.koul@intel.com \
    --cc=yong.y.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®