From: Daniel Scheller <d.scheller.oss@gmail.com>
To: linux-media@vger.kernel.org, mchehab@kernel.org,
mchehab@s-opensource.com, mchehab+samsung@kernel.org
Subject: [PATCH v3 2/3] [media] ddbridge: uAPI header for IOCTL definitions and related data structs
Date: Sat, 12 May 2018 13:24:31 +0200 [thread overview]
Message-ID: <20180512112432.30887-3-d.scheller.oss@gmail.com> (raw)
In-Reply-To: <20180512112432.30887-1-d.scheller.oss@gmail.com>
From: Daniel Scheller <d.scheller@gmx.net>
Add a uAPI header to define the IOCTLs and the related data structs used by
ddbridge, which currently are IOCTL_DDB_FLASHIO and IOCTL_DDB_IO. The
header can be included by userspace applications directly to make use of
the IOCTLs, and they even should use this header to keep things matching
with the kernel driver.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
---
MAINTAINERS | 1 +
include/uapi/linux/ddbridge-ioctl.h | 61 +++++++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+)
create mode 100644 include/uapi/linux/ddbridge-ioctl.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 0a919a84d344..6b7da989fbed 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8710,6 +8710,7 @@ W: https://linuxtv.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/pci/ddbridge/*
+F: include/uapi/linux/ddbridge-ioctl.h
MEDIA DRIVERS FOR FREESCALE IMX
M: Steve Longerbeam <slongerbeam@gmail.com>
diff --git a/include/uapi/linux/ddbridge-ioctl.h b/include/uapi/linux/ddbridge-ioctl.h
new file mode 100644
index 000000000000..5b28a797da41
--- /dev/null
+++ b/include/uapi/linux/ddbridge-ioctl.h
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * ddbridge-ioctl.h: Digital Devices bridge IOCTL API
+ *
+ * Copyright (C) 2010-2017 Digital Devices GmbH
+ * Ralph Metzler <rjkm@metzlerbros.de>
+ * Marcus Metzler <mocm@metzlerbros.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 only, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __LINUX_DDBRIDGE_IOCTL_H__
+#define __LINUX_DDBRIDGE_IOCTL_H__
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+/******************************************************************************/
+
+#define DDB_IOCTL_MAGIC 0xDD
+#define DDB_IOCTL_SEQIDX 0xE0
+
+/* DDB_IOCTL_FLASHIO */
+struct ddb_flashio {
+ /* write_*: userspace -> flash */
+ __user __u8 *write_buf;
+ __u32 write_len;
+ /* read_*: flash -> userspace */
+ __user __u8 *read_buf;
+ __u32 read_len;
+ /* card/addon link */
+ __u32 link;
+};
+
+/* DDB_IOCTL_ID */
+struct ddb_id {
+ /* card/PCI device data, FPGA/regmap info */
+ __u16 vendor;
+ __u16 device;
+ __u16 subvendor;
+ __u16 subdevice;
+ __u32 hw;
+ __u32 regmap;
+};
+
+/* IOCTLs */
+#define DDB_IOCTL_FLASHIO \
+ _IOWR(DDB_IOCTL_MAGIC, (DDB_IOCTL_SEQIDX + 0x00), struct ddb_flashio)
+#define DDB_IOCTL_ID \
+ _IOR(DDB_IOCTL_MAGIC, (DDB_IOCTL_SEQIDX + 0x03), struct ddb_id)
+
+/******************************************************************************/
+
+#endif /* __LINUX_DDBRIDGE_IOCTL_H__ */
--
2.16.1
next prev parent reply other threads:[~2018-05-12 11:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-12 11:24 [PATCH v3 0/3] IOCTLs in ddbridge Daniel Scheller
2018-05-12 11:24 ` [PATCH v3 1/3] Documentation: ioctl-number: add ddbridge IOCTLs Daniel Scheller
2018-05-12 11:24 ` Daniel Scheller [this message]
2018-05-12 11:24 ` [PATCH v3 3/3] [media] ddbridge: implement IOCTL handling Daniel Scheller
2018-07-04 16:08 ` [PATCH v3 0/3] IOCTLs in ddbridge Mauro Carvalho Chehab
2018-07-04 17:08 ` Daniel Scheller
2018-07-04 20:20 ` Jasmin J.
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=20180512112432.30887-3-d.scheller.oss@gmail.com \
--to=d.scheller.oss@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=mchehab@kernel.org \
--cc=mchehab@s-opensource.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;
as well as URLs for NNTP newsgroup(s).