Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2894418pxb; Fri, 12 Feb 2021 04:20:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAEdG9GlKgAu/WHihTb+ZqeSTT1FG16TWV30oFxeywu5iVKXPX68hnP60xMNCnDHSLhX00 X-Received: by 2002:a05:6402:22b0:: with SMTP id cx16mr2980118edb.255.1613132443804; Fri, 12 Feb 2021 04:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613132443; cv=none; d=google.com; s=arc-20160816; b=id+TlMQ3aGpf5gfpOnb8qYnQOGh1y7x7W6UCipYhjcL874Nnu6h3axN+uvZ1lAub4x /S2UjzBJuO03e700LzBR+E+uASCpSdBZMBXAsOaogzpS+ATtmPolW25n7Mr5IogrTrU1 ahTjg+BoPr68PGyOX7JL4iip9mnfy6pNGae97QG4XYHjkBc5Sixyyjthe2wqttA+d+/w iyDuRlDtR8hKURdjhcStiCGHU7FXRdbL365OFJsglC1DeQSEbwS3j+x/3XSQBrVrhhWh Z9+2L5s8+xVJEQ508GbAE1Bd4RjcrIZsBqPlXzXVwgUpTBQBPlY3YVp46YtXdO5ctffy 4lNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qq/erQhvqOiEgwwaSkLxw6EUe9nNWYVASAMK97kmd2w=; b=MoWDCPtHSLz9D+R8JBbTOoAWZe2g57H6X9h50qoN98G7FW9icyX/uI59aWnvnjcc/f rkOYgOw7oPlKZkNIzRnMpkqRdJqYi76QwDkLnwXX8biRBmaUOvf5SJ69bCgNg6YbLpy4 SntzwZZ5Dxo/V4w0g+UFnHsqazX3C7CM5De/usx989++JGdEldTGi2ZP/8GC1582tjG1 rH0FhJLAAfl0o+fykfrj/vJNzBtplMGrNBuWzBq7mOrz6iGhxw8qsk/o6JnH0PawOTc7 ShqPmEzlUruEjXsKnwriyq1/VXraphv8XaV51cbrPmiatDhJBBclwgAgzxBBSza/qZMT yuEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mXtfdw1/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch12si5619677edb.463.2021.02.12.04.20.20; Fri, 12 Feb 2021 04:20:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mXtfdw1/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbhBLMTr (ORCPT + 99 others); Fri, 12 Feb 2021 07:19:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbhBLMQP (ORCPT ); Fri, 12 Feb 2021 07:16:15 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891ABC061574; Fri, 12 Feb 2021 04:15:35 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id v206so8426594qkb.3; Fri, 12 Feb 2021 04:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qq/erQhvqOiEgwwaSkLxw6EUe9nNWYVASAMK97kmd2w=; b=mXtfdw1/myZbxJuR8Bhj/IwbFFXOssX4yjc6D6RyYyPRjfN9SnXG+ODg4sNtwPJchk 37fdk7XhATrlBwsxM4QP593RhyRHdxfrlcxNKTRHXYOm75bsfGYKchn6IxIFWJnSNE09 9WQrTq3RGiroiqpmVE8b3sy4xwckR48UmYUbwaMPkvaIwGpqhSPG0gX4n+db28a1y9KB Q0kb1vIdWJOQgTGoRjudNX6W5yqhqB1MkPdlp1WNoEr4NMARsb0Uqixo5muiEvfg+zHg zPbgib5TF+g7+amDgp45vTYllfHx5dZuoqu3qtluurJ2Frl7ie2OTps+e481QyuzgmDH SV0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qq/erQhvqOiEgwwaSkLxw6EUe9nNWYVASAMK97kmd2w=; b=Bl4Qw+W7Ok/Ou1XJqeBaRStq82vIuPNzS91+bUoBSj1AMElQ2Owc9VYIgEX8hyuvWG B+X2vuepvXXwYgTdyC/X9qcJxqVwiCFMWtkeyVg7OOvwpIKhNOyFBZ7Qs3+4DGb76BXQ 8YjtvkDQNpG3ppgpBIlVZYi00IISHZm9cwf1oNxUQX0t1vKdq00YhPbMyigoLOkWdn1H 4dzQIO1H+QVCH3qm2tOunWCM66VEIuwzbFCfyYyxSdfq5+azweFKhlAUXIPHwYu5u128 A8fbwgBBCRuWek7FZn4bnyu2DtuNG7yoHkKHqzKHfjjoGYfbvIbpd4eYOPbjCecNMj53 d81g== X-Gm-Message-State: AOAM533m8yGxsWKm7ZYc1p5iwHi0LwlV4L1d/2ezFcgq8sf0y7ESvUow BpH7b6ERkUWEGt5B4awLiac= X-Received: by 2002:a37:6cc6:: with SMTP id h189mr1330584qkc.195.1613132134837; Fri, 12 Feb 2021 04:15:34 -0800 (PST) Received: from localhost.localdomain ([193.27.12.132]) by smtp.gmail.com with ESMTPSA id y135sm6278534qkb.14.2021.02.12.04.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 04:15:34 -0800 (PST) From: William Breathitt Gray To: jic23@kernel.org Cc: kernel@pengutronix.de, linux-stm32@st-md-mailman.stormreply.com, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, William Breathitt Gray Subject: [PATCH v8 16/22] counter: Move counter enums to uapi header Date: Fri, 12 Feb 2021 21:13:40 +0900 Message-Id: X-Mailer: git-send-email 2.30.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is in preparation for a subsequent patch implementing a character device interface for the Counter subsystem. Signed-off-by: William Breathitt Gray --- MAINTAINERS | 1 + include/linux/counter.h | 42 +-------------------------- include/uapi/linux/counter.h | 56 ++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 41 deletions(-) create mode 100644 include/uapi/linux/counter.h diff --git a/MAINTAINERS b/MAINTAINERS index 94a19606d947..5392112b3f19 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4543,6 +4543,7 @@ F: Documentation/ABI/testing/sysfs-bus-counter F: Documentation/driver-api/generic-counter.rst F: drivers/counter/ F: include/linux/counter.h +F: include/uapi/linux/counter.h CPMAC ETHERNET DRIVER M: Florian Fainelli diff --git a/include/linux/counter.h b/include/linux/counter.h index 2f01e1fec857..2d544f58a79c 100644 --- a/include/linux/counter.h +++ b/include/linux/counter.h @@ -9,6 +9,7 @@ #include #include #include +#include struct counter_device; struct counter_count; @@ -27,47 +28,6 @@ enum counter_comp_type { COUNTER_COMP_COUNT_MODE, }; -enum counter_scope { - COUNTER_SCOPE_DEVICE, - COUNTER_SCOPE_SIGNAL, - COUNTER_SCOPE_COUNT, -}; - -enum counter_count_direction { - COUNTER_COUNT_DIRECTION_FORWARD, - COUNTER_COUNT_DIRECTION_BACKWARD, -}; - -enum counter_count_mode { - COUNTER_COUNT_MODE_NORMAL, - COUNTER_COUNT_MODE_RANGE_LIMIT, - COUNTER_COUNT_MODE_NON_RECYCLE, - COUNTER_COUNT_MODE_MODULO_N, -}; - -enum counter_function { - COUNTER_FUNCTION_INCREASE, - COUNTER_FUNCTION_DECREASE, - COUNTER_FUNCTION_PULSE_DIRECTION, - COUNTER_FUNCTION_QUADRATURE_X1_A, - COUNTER_FUNCTION_QUADRATURE_X1_B, - COUNTER_FUNCTION_QUADRATURE_X2_A, - COUNTER_FUNCTION_QUADRATURE_X2_B, - COUNTER_FUNCTION_QUADRATURE_X4, -}; - -enum counter_signal_level { - COUNTER_SIGNAL_LEVEL_LOW, - COUNTER_SIGNAL_LEVEL_HIGH, -}; - -enum counter_synapse_action { - COUNTER_SYNAPSE_ACTION_NONE, - COUNTER_SYNAPSE_ACTION_RISING_EDGE, - COUNTER_SYNAPSE_ACTION_FALLING_EDGE, - COUNTER_SYNAPSE_ACTION_BOTH_EDGES, -}; - /** * struct counter_comp - Counter component node * @type: Counter component data type diff --git a/include/uapi/linux/counter.h b/include/uapi/linux/counter.h new file mode 100644 index 000000000000..6113938a6044 --- /dev/null +++ b/include/uapi/linux/counter.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * Userspace ABI for Counter character devices + * Copyright (C) 2020 William Breathitt Gray + */ +#ifndef _UAPI_COUNTER_H_ +#define _UAPI_COUNTER_H_ + +/* Component scope definitions */ +enum counter_scope { + COUNTER_SCOPE_DEVICE, + COUNTER_SCOPE_SIGNAL, + COUNTER_SCOPE_COUNT, +}; + +/* Count direction values */ +enum counter_count_direction { + COUNTER_COUNT_DIRECTION_FORWARD, + COUNTER_COUNT_DIRECTION_BACKWARD, +}; + +/* Count mode values */ +enum counter_count_mode { + COUNTER_COUNT_MODE_NORMAL, + COUNTER_COUNT_MODE_RANGE_LIMIT, + COUNTER_COUNT_MODE_NON_RECYCLE, + COUNTER_COUNT_MODE_MODULO_N, +}; + +/* Count function values */ +enum counter_function { + COUNTER_FUNCTION_INCREASE, + COUNTER_FUNCTION_DECREASE, + COUNTER_FUNCTION_PULSE_DIRECTION, + COUNTER_FUNCTION_QUADRATURE_X1_A, + COUNTER_FUNCTION_QUADRATURE_X1_B, + COUNTER_FUNCTION_QUADRATURE_X2_A, + COUNTER_FUNCTION_QUADRATURE_X2_B, + COUNTER_FUNCTION_QUADRATURE_X4, +}; + +/* Signal values */ +enum counter_signal_level { + COUNTER_SIGNAL_LEVEL_LOW, + COUNTER_SIGNAL_LEVEL_HIGH, +}; + +/* Action mode values */ +enum counter_synapse_action { + COUNTER_SYNAPSE_ACTION_NONE, + COUNTER_SYNAPSE_ACTION_RISING_EDGE, + COUNTER_SYNAPSE_ACTION_FALLING_EDGE, + COUNTER_SYNAPSE_ACTION_BOTH_EDGES, +}; + +#endif /* _UAPI_COUNTER_H_ */ -- 2.30.0