Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1219667

[PATCH v4 06/10] dmaengine: add API for getting dma controller's quirk

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!bofh.it!news.nic.it!robomod
From Shawn Lin <shawn.lin@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH v4 06/10] dmaengine: add API for getting dma controller's quirk
Date Sun, 06 Sep 2015 03:20:01 +0200
Message-ID <q5wMF-Cb-1@gated-at.bofh.it> (permalink)
References <q5wMF-Cb-3@gated-at.bofh.it>
X-Original-To Vinod Koul <vinod.koul@intel.com>, Heiko Stuebner <heiko@sntech.de>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>
X-263anti-Spam KSV:0;
X-Mail-Gray 1
X-Abs-Checked 4
X-Rl-Sender shawn.lin@rock-chips.com
X-Fst-To vinod.koul@intel.com
X-Sender-IP 58.22.7.114
X-Login-Name shawn.lin@rock-chips.com
X-Unique-Tag <67d586a36956e1d26ff595e69977e715>
X-Sender lintao@rock-chips.com
X-Mailer git-send-email 1.8.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 51
Organization linux.* mail to news gateway
X-Original-Cc Doug Anderson <dianders@chromium.org>, Olof Johansson <olofj@google.com>, Sonny Rao <sonnyrao@chromium.org>, Addy Ke <addy.ke@rock-chips.com>, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, Shawn Lin <shawn.lin@rock-chips.com>
X-Original-Date Sun, 6 Sep 2015 09:12:44 +0800
X-Original-Message-ID <1441501964-13952-1-git-send-email-shawn.lin@rock-chips.com>
X-Original-References <1441501881-13700-1-git-send-email-shawn.lin@rock-chips.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1219667

Show key headers only | View raw


Add dmaengine_get_quirks API for peripheral devices to query
quirks if they need it to make special workaround due to broken
dma controller design.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None
Changes in v1: None

 include/linux/dmaengine.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index e2f5eb4..5174ca4 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -704,6 +704,7 @@ struct dma_device {
 
 	int (*device_config)(struct dma_chan *chan,
 			     struct dma_slave_config *config);
+	int (*device_get_quirks)(struct dma_chan *chan);
 	int (*device_pause)(struct dma_chan *chan);
 	int (*device_resume)(struct dma_chan *chan);
 	int (*device_terminate_all)(struct dma_chan *chan);
@@ -723,6 +724,14 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
 	return -ENOSYS;
 }
 
+static inline int dmaengine_get_quirks(struct dma_chan *chan)
+{
+	if (chan->device->device_get_quirks)
+		return chan->device->device_get_quirks(chan);
+
+	return -ENOSYS;
+}
+
 static inline bool is_slave_direction(enum dma_transfer_direction direction)
 {
 	return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM);
-- 
2.3.7


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v4 06/10] dmaengine: add API for getting dma controller's quirk Shawn Lin <shawn.lin@rock-chips.com> - 2015-09-06 03:20 +0200

csiph-web