Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5539263ybl; Tue, 10 Dec 2019 07:38:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwBEIDFwUQmjJ9gjxlyotGjotfJvL8arQYxR9kiE2149T/hbTyRM5vqJLgJTrdq7VE0qYGF X-Received: by 2002:aca:ecd0:: with SMTP id k199mr4555391oih.158.1575992327778; Tue, 10 Dec 2019 07:38:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575992327; cv=none; d=google.com; s=arc-20160816; b=Cv7LIuX5QN/dRZf9e1uPwxj/oBph6WF0/lFOCJGAN3E5aR5xT80IFf8VKF/mIMB+sf T80AgU9lnZNKBECky3fH3d53PxlCtNT/srPzdZP1JDRmhKP6Lkb7F0Pdb9K/Es7DjrWh rhR8fOO+VVfDzGxH1qKMLInwNeDxoVBVDe8gE0eZUXCzb0wiCNOQ0x7EibZyzR4WWNIa xQx1g9ps8GgNW0fcCEp/thlCwyfIZn5yGVNx0F1AnObMY8fNY2btca169zKipRidp65w Z4vLHOozE7Q0MKtIininTGEe2zygvec3/FbEXTk4NUiwnue9RS59Wo6NsAI6ApCI0OK9 YhWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=pbkSBpgJUvXSPC5VhPDjF7lUA1vOSO+ZjaOSmjDX7ds=; b=uv+I+ZVWRpTNibfYIPkpfJNV7rESAd1cgr6iU6fwssO/ofwZhFCGMTewGYjD8WWPAe J3zEoOlDFmheiiZubZJUtriRKXnjYJGGGv0/1/C9zLwqEwBaLzwM6JuRe9OvYpqANQu1 f61XreyAHATVt15dKd7klqgeoqM6NaGWT/2hnKwGurliBR2rmb2NQx17jBVe3tWkcuv4 y5TVo1tb/P+EocFVKitkAE9uLzIgW1NTR5QmgoR9uI6Hiuj4UpFL9R4CeW6OCNzdqs2+ LGrpC9hEi/QHEj5vhRZGjF9st5XwJgOmWjxu6aqCC0OsfAZVQipljhjUFwG1RRlMv0CS rA8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=DF9bQBza; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r126si2111176oig.36.2019.12.10.07.38.35; Tue, 10 Dec 2019 07:38:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=DF9bQBza; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727667AbfLJPhp (ORCPT + 99 others); Tue, 10 Dec 2019 10:37:45 -0500 Received: from sv2-smtprelay2.synopsys.com ([149.117.73.133]:53776 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727647AbfLJPho (ORCPT ); Tue, 10 Dec 2019 10:37:44 -0500 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id DDBC5405D3; Tue, 10 Dec 2019 15:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1575992263; bh=VbA5BxszGxxpBvjX7QPw0ZeM5aDPv05lVfXsQi2i6zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=DF9bQBzakzmR59p2IBRadN2EejZw/ho/g0KcA9oykCFDBiZmKAv0X0ZaonD17NAj8 zgMxq4cAwrNLIUk/0N69+D9sadtdO4vPjmfkg95UZbvOQ9r6RUwbcBIihjSPnYSa35 k62rUCRXIvIlOgFqrbhhDYPMx+RF0lhHOzxk3mtnv3AUAAf41Tq3E0OJ/5QZssC5or G3PRKd0M7ijrHXLDXYENXP6NlGb2+r9rb/we67RPWnGoIXZ3Yea6ek7BQgfGx8RCV3 Z3JOkQCm667xqgPpwCeKYenjkHvAG+yuphC3yRl5GSVl+K+Nr8F9L55+xLdMtJlvMl p/DNNFA/6M/VA== Received: from de02.synopsys.com (de02.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id A2D27A0087; Tue, 10 Dec 2019 15:37:36 +0000 (UTC) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id 8B6FB3E2D6; Tue, 10 Dec 2019 16:37:36 +0100 (CET) From: Vitor Soares To: linux-kernel@vger.kernel.org, linux-i3c@lists.infradead.org Cc: Joao.Pinto@synopsys.com, bbrezillon@kernel.org, gregkh@linuxfoundation.org, wsa@the-dreams.de, arnd@arndb.de, broonie@kernel.org, Vitor Soares Subject: [RFC 3/5] i3c: device: expose transfer strutures to uapi Date: Tue, 10 Dec 2019 16:37:31 +0100 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move i3c transfer related structures to uapi, so they can be access by userspace. Signed-off-by: Vitor Soares --- include/linux/i3c/device.h | 54 +-------------------------------- include/uapi/linux/i3c/device.h | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 53 deletions(-) create mode 100644 include/uapi/linux/i3c/device.h diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h index de102e4..1df05c2 100644 --- a/include/linux/i3c/device.h +++ b/include/linux/i3c/device.h @@ -14,59 +14,7 @@ #include #include #include - -/** - * enum i3c_error_code - I3C error codes - * - * These are the standard error codes as defined by the I3C specification. - * When -EIO is returned by the i3c_device_do_priv_xfers() or - * i3c_device_send_hdr_cmds() one can check the error code in - * &struct_i3c_priv_xfer.err or &struct i3c_hdr_cmd.err to get a better idea of - * what went wrong. - * - * @I3C_ERROR_UNKNOWN: unknown error, usually means the error is not I3C - * related - * @I3C_ERROR_M0: M0 error - * @I3C_ERROR_M1: M1 error - * @I3C_ERROR_M2: M2 error - */ -enum i3c_error_code { - I3C_ERROR_UNKNOWN = 0, - I3C_ERROR_M0 = 1, - I3C_ERROR_M1, - I3C_ERROR_M2, -}; - -/** - * enum i3c_hdr_mode - HDR mode ids - * @I3C_HDR_DDR: DDR mode - * @I3C_HDR_TSP: TSP mode - * @I3C_HDR_TSL: TSL mode - */ -enum i3c_hdr_mode { - I3C_HDR_DDR, - I3C_HDR_TSP, - I3C_HDR_TSL, -}; - -/** - * struct i3c_priv_xfer - I3C SDR private transfer - * @rnw: encodes the transfer direction. true for a read, false for a write - * @len: transfer length in bytes of the transfer - * @data: input/output buffer - * @data.in: input buffer. Must point to a DMA-able buffer - * @data.out: output buffer. Must point to a DMA-able buffer - * @err: I3C error code - */ -struct i3c_priv_xfer { - u8 rnw; - u16 len; - union { - void *in; - const void *out; - } data; - enum i3c_error_code err; -}; +#include /** * enum i3c_dcr - I3C DCR values diff --git a/include/uapi/linux/i3c/device.h b/include/uapi/linux/i3c/device.h new file mode 100644 index 0000000..edbb14d --- /dev/null +++ b/include/uapi/linux/i3c/device.h @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2019 Synopsys, Inc. and/or its affiliates. + * + * Author: Vitor Soares + */ + +#ifndef _UAPI_LINUX_I3C_DEVICE_H +#define _UAPI_LINUX_I3C_DEVICE_H + +#include + +/** + * enum i3c_error_code - I3C error codes + * + * These are the standard error codes as defined by the I3C specification. + * When -EIO is returned by the i3c_device_do_priv_xfers() or + * i3c_device_send_hdr_cmds() one can check the error code in + * &struct_i3c_priv_xfer.err or &struct i3c_hdr_cmd.err to get a better idea of + * what went wrong. + * + * @I3C_ERROR_UNKNOWN: unknown error, usually means the error is not I3C + * related + * @I3C_ERROR_M0: M0 error + * @I3C_ERROR_M1: M1 error + * @I3C_ERROR_M2: M2 error + */ +enum i3c_error_code { + I3C_ERROR_UNKNOWN = 0, + I3C_ERROR_M0 = 1, + I3C_ERROR_M1, + I3C_ERROR_M2, +}; + +/** + * enum i3c_hdr_mode - HDR mode ids + * @I3C_HDR_DDR: DDR mode + * @I3C_HDR_TSP: TSP mode + * @I3C_HDR_TSL: TSL mode + */ +enum i3c_hdr_mode { + I3C_HDR_DDR, + I3C_HDR_TSP, + I3C_HDR_TSL, +}; + +/** + * struct i3c_priv_xfer - I3C SDR private transfer + * @rnw: encodes the transfer direction. true for a read, false for a write + * @len: transfer length in bytes of the transfer + * @data: input/output buffer + * @data.in: input buffer. Must point to a DMA-able buffer + * @data.out: output buffer. Must point to a DMA-able buffer + * @err: I3C error code + */ +struct i3c_priv_xfer { + u8 rnw; + u16 len; + union { + void *in; + const void *out; + } data; + enum i3c_error_code err; +}; + +#endif /* _UAPI_LINUX_I3C_DEVICE_H */ -- 2.7.4