linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [RFC PATCH v4 1/6] i2c: add a message flag for DMA safe buffers
Date: Thu, 17 Aug 2017 16:14:44 +0200	[thread overview]
Message-ID: <20170817141449.23958-2-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20170817141449.23958-1-wsa+renesas@sang-engineering.com>

I2C has no requirement that the buffer of a message needs to be DMA
safe. In case it is, it can now be flagged, so drivers wishing to
do DMA can use the buffer directly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 include/uapi/linux/i2c.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/i2c.h b/include/uapi/linux/i2c.h
index 009e27bb9abe19..1c683cb319e4b7 100644
--- a/include/uapi/linux/i2c.h
+++ b/include/uapi/linux/i2c.h
@@ -71,6 +71,9 @@ struct i2c_msg {
 #define I2C_M_RD		0x0001	/* read data, from slave to master */
 					/* I2C_M_RD is guaranteed to be 0x0001! */
 #define I2C_M_TEN		0x0010	/* this is a ten bit chip address */
+#define I2C_M_DMA_SAFE		0x0200	/* the buffer of this message is DMA safe */
+					/* makes only sense in kernelspace */
+					/* userspace buffers are copied anyway */
 #define I2C_M_RECV_LEN		0x0400	/* length will be first received byte */
 #define I2C_M_NO_RD_ACK		0x0800	/* if I2C_FUNC_PROTOCOL_MANGLING */
 #define I2C_M_IGNORE_NAK	0x1000	/* if I2C_FUNC_PROTOCOL_MANGLING */
-- 
2.11.0

  reply	other threads:[~2017-08-17 14:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 14:14 [RFC PATCH v4 0/6] i2c: document DMA handling and add helpers for it Wolfram Sang
2017-08-17 14:14 ` Wolfram Sang [this message]
2017-08-17 14:14 ` [RFC PATCH v4 2/6] i2c: add helpers to ease DMA handling Wolfram Sang
2017-08-17 14:14 ` [RFC PATCH v4 3/6] i2c: add docs to clarify " Wolfram Sang
2017-08-27 11:37   ` Mauro Carvalho Chehab
2017-09-08  8:56     ` Wolfram Sang
2017-09-08 11:08       ` Mauro Carvalho Chehab
2017-09-09 15:27         ` Wolfram Sang
2017-09-09 19:34           ` Mauro Carvalho Chehab
2017-09-20 17:18     ` Wolfram Sang
2017-09-20 18:22       ` Mauro Carvalho Chehab
2017-09-20 18:45         ` Wolfram Sang
2017-08-17 14:14 ` [RFC PATCH v4 4/6] i2c: sh_mobile: use helper to decide if DMA is useful Wolfram Sang
2017-08-17 14:14 ` [RFC PATCH v4 5/6] i2c: rcar: skip DMA if buffer is not safe Wolfram Sang
2017-08-17 14:14 ` [RFC PATCH v4 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE Wolfram Sang
2017-08-20 10:14 ` [RFC PATCH v4 0/6] i2c: document DMA handling and add helpers for it Jonathan Cameron

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=20170817141449.23958-2-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).