Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2646028pxt; Mon, 9 Aug 2021 05:46:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvVGB7p4/S4MxVSOQ7LYi879dphJ3PLg73a8JHRV8GnfN2Y2vxnMRMoPYAsU+AQ3Jw2tI/ X-Received: by 2002:a17:906:1615:: with SMTP id m21mr22966792ejd.279.1628513189011; Mon, 09 Aug 2021 05:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628513189; cv=none; d=google.com; s=arc-20160816; b=o9BV+PKZziNfBTMUzTq7IOIcHocg8XhtGDF+tkuZVWPJHq7UWvCxKB7jumyzQucx2s gFTwb6N8IPQLag3pmlFVNvC94apHlcEHN38dgKJLEsxKG4oXHLaIg8Alig01HSVx+Fwn TihW6+DprG/aIFsb0EPm5kTxILXOV95V53IbtfTqlMy7n0z/1aSgNbi5KwUPqVkntJHv ItryhdaDrywuttWbB7+DxkjgnEfkMtVx3DbNBJerl/2cU2o+xTlO5RvCHscZ5IOvI5to rsgsaYIatUTZBTKgxWCpu+njk24MvRQcT/Q0s/NTRwNS9DwAf4eeiAzLprBJ27hqUw6N Gfwg== 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=MNgjMBZKV5tnzvtwezKeXdHG8qj2KXtYg4Y6svSHKRg=; b=d1jkQyjPamMoR4RSAVmKQlJCwpgb9Lcc/zLXEfZ3BS/gmCl9XpjmKZ02BvENQ0QhSh T2vI6o6wwBcJGyXgmg3Q+jgT13uX8Ftnlrb02njcimOKbAZ4/C8meGmeOdQ6JZ5Z5xVA kIMEbXLa7Ezvj1mH4Nl43CU/Fdu9uHR5r0XR5Il21eiMgTAs1wEeD28DJs3sqcGguWXy 7714aqZgIZ59FGxDUQ4wBHuF5xoJ6eN84bCkeA/sQCRZAIMVnBEuobWmgKvtrxPXM44t sAhEGL82F9Eaj5nvLwZL+jmQ+RR0Fq7NNdgI5ul/0FDeNFkgtHvri6mdCSy/J8whDmSX XK3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FAn+EuFW; 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 gg8si17003510ejb.531.2021.08.09.05.46.05; Mon, 09 Aug 2021 05:46:28 -0700 (PDT) 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=FAn+EuFW; 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 S235453AbhHIMit (ORCPT + 99 others); Mon, 9 Aug 2021 08:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235435AbhHIMik (ORCPT ); Mon, 9 Aug 2021 08:38:40 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BAF3C06179C; Mon, 9 Aug 2021 05:38:19 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id s22-20020a17090a1c16b0290177caeba067so34368640pjs.0; Mon, 09 Aug 2021 05:38:19 -0700 (PDT) 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=MNgjMBZKV5tnzvtwezKeXdHG8qj2KXtYg4Y6svSHKRg=; b=FAn+EuFWDYvhXecaX8ERhVLy3qQW3dkq+mgrD9XJONPNx0KAFDj9LdOoIYaQq9YXxA KYUXgTLIx0QT0w4uWzT4mkWsez6r/dXvoYvguOYZV5LR8ge7hUjlLa6V/P9EfvC0uaw8 6XVh2sc1ERDPh1xwvnhD7QJwG9awRINffw07CT7BFHtwAzqtVYk8REwLciEaLW7JGudN Y2kXOsTu0DsnkfojiIJBv41Y7R2gT1yU5EFOQVePwe1LAwwvIQlvlZzaj5ncQ+6KGpYi /VctckIH6iFymggT73pmDPBJwdZ8iSYcLxJd3NSLasZ2oZnLYjwEfGx1obus1BpHPUab kUtA== 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=MNgjMBZKV5tnzvtwezKeXdHG8qj2KXtYg4Y6svSHKRg=; b=rQrFo2k5vzD40kjXLFAUN8A+z00QVLh4n6ND/mB/jZv/FuzluBpEYBxzhd8NI6EyJC Du1uKH6f+cRsSu730ewRfNsZ4bhKd8h1Tudyyirb2hAjqDwWQRbeMawXZh8UYsC4/b3C rH14KgK77YcUrCU+E58YFrFFYSTWoXwn9zVXXcOZe/ShsUJGwHRzpErfaOlCvBMq4fRh Fq0S0XckkNTQGCQ15or8cSGdbQ27iqiINXFy5KVUdWE4UrG4lul3p7iVzVhUGsb8DT4w t6IRCc6+nvgJY8NarWStlLX+UuXopxmtKhxgAdvP41n0LYkshsqqQpZYmuIqkNXJ2VWA Gf0A== X-Gm-Message-State: AOAM531SZZDGPKETUYK71FepJvtab0k9iwc7r8Gz/IQaWdp3xWEoTd+3 lZsmnKc4lFAbAP9ApEtlWRU= X-Received: by 2002:a62:e405:0:b029:3c8:e5ab:ca94 with SMTP id r5-20020a62e4050000b02903c8e5abca94mr13461618pfh.5.1628512698978; Mon, 09 Aug 2021 05:38:18 -0700 (PDT) Received: from localhost.localdomain ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id e35sm22382177pjk.28.2021.08.09.05.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 05:38:18 -0700 (PDT) From: William Breathitt Gray To: jic23@kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, 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, jarkko.nikula@linux.intel.com, William Breathitt Gray Subject: [PATCH v15 05/13] counter: Move counter enums to uapi header Date: Mon, 9 Aug 2021 21:37:30 +0900 Message-Id: <4dfa52b09cd7b8034b679d2b4af7c9f7fd0d027c.1628511445.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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. Reviewed-by: David Lechner 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 5d3f7e05a588..cef0f840e142 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4764,6 +4764,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 CP2615 I2C DRIVER M: Bence Csókás diff --git a/include/linux/counter.h b/include/linux/counter.h index 445f22d8bfe2..7c9f7e23953a 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.32.0