From patchwork Sat May 12 11:24:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10395883 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BEFEB60236 for ; Sat, 12 May 2018 11:24:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC95228CA1 for ; Sat, 12 May 2018 11:24:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A111128F4E; Sat, 12 May 2018 11:24:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA37A28CA1 for ; Sat, 12 May 2018 11:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751642AbeELLYl (ORCPT ); Sat, 12 May 2018 07:24:41 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:46439 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751003AbeELLYi (ORCPT ); Sat, 12 May 2018 07:24:38 -0400 Received: by mail-wr0-f195.google.com with SMTP id a12-v6so7659129wrn.13 for ; Sat, 12 May 2018 04:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=I1O/Vi9qyRLOvryXuWgp/CUZ2mqK3dEpVMZAL8TkDNM=; b=DCfOAcQYHsmH5/47NHXAhQLOs/1p5T/7UzczGnCDOGIJGL2qHFrfSvxJ9h3VKuP9au 6ghih8ENh7sFRI3xxNvatVRX9bj5gJWPf/G1KEoU+6gqJXIFSSgGPM1PnJXQPR/wDk83 8W++5Xhf3MJZeaNC6GmURfgWCppJorQgTaa21H7Np1MXvDPJ+R8i+LoZzevZgzp7/3CP a6Znz7G9NftP6jJazKrpNX3+z2BCeWYeYHkOFv6Uvo0UjRMe1p/FPLqGZ9RaXaIGRueg 6c7Rq9/ONCcGKNWKyqUW5flLN6RMm3YK+Uva6TIHbOozZWAlp3HCQ0JoZlOT98kx3tA0 y9jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=I1O/Vi9qyRLOvryXuWgp/CUZ2mqK3dEpVMZAL8TkDNM=; b=cAk4UnHKSBMJbdtjkoudD3OYpZU1x7pSTDahAE+TYf+CavEGCB3Uoofqy2gj9f+oAk hApcA8R62ejp6fmNwyz/kFtaCJ/I0Cf/LNBf8K6N/jHOfTHH/UrVx41ySErXHLBEYlg6 nmEL4E8lidaHgPzvfBYYXRSqrEccEigl5HV4xN6coCbljqm6Z4e/+CXTe62FTpvzEnip FIeY1s4uTYPydHVxToWB4awygqsbO6j5OaDQu6rDAmACgso9qiWDhLLCMflYblj+ZQ56 JQXNVTCZMi0t2nHNpbyHU9IxGyXMV4sVYk2bGSUzN05ffbcUekyAzFvBCMV6PzUnVGMd /bBg== X-Gm-Message-State: ALKqPwdTTwoSy3MtMQdSvX60DrX/zQT6W7r/wQjXjDXmKJ9ucS6jOACz FDLTXPs9aDernrHojPpo1qqD6w== X-Google-Smtp-Source: AB8JxZpjWlxmzON4Gx86ssK82FEEu6EpnBUxzk11VZPF/OC5X0d5fJpv7sIzNtX7b/P4fTHqMVAW/g== X-Received: by 2002:adf:e4cc:: with SMTP id v12-v6mr1936034wrm.243.1526124277115; Sat, 12 May 2018 04:24:37 -0700 (PDT) Received: from dvbdev.wuest.de (ip-176-199-71-134.hsi06.unitymediagroup.de. [176.199.71.134]) by smtp.gmail.com with ESMTPSA id 141-v6sm3845434wmf.35.2018.05.12.04.24.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 May 2018 04:24:36 -0700 (PDT) From: Daniel Scheller 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 Message-Id: <20180512112432.30887-3-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180512112432.30887-1-d.scheller.oss@gmail.com> References: <20180512112432.30887-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller 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 --- 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 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 + * Marcus Metzler + * + * 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 +#include + +/******************************************************************************/ + +#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__ */