Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3752557pxv; Tue, 13 Jul 2021 02:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMTsW9BUKmE28M+K0xlDTauNwzKqXaJku2+KK9nbX/dfrJoP3sOuJCY82VnfKm2fqdw7f9 X-Received: by 2002:a17:906:849a:: with SMTP id m26mr4582594ejx.457.1626170305698; Tue, 13 Jul 2021 02:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626170305; cv=none; d=google.com; s=arc-20160816; b=nX3nL80Gna+bVjtn4oVdQr0cHdhhVAS/5dxA4XUGvFFR88NMO5XMoYh38yHW/l+lEk cAxfSDnkfBaUo2wgpcolhDZv86t/x9VSGEJTPzmm+5tzgmOxPUPtkPWKniC6VcJFmI9d jXJSdXPoeE8x9bUT9+qEmr5iJyGYg7d0LFnHtgfJs4VQbMIcoeOjRnLFcKzlsrMM/a02 qnhW/QRUL/GkrcLbwaNAmLYX/O/TUrBa9vg12/QHCx0MWWEjFcxTI0vqCnoQtDkGFbvI 4ZeXtWrvZqOtDTfA7bYejO0/B3eeOyFMTmNFzLdm857dMX8+F1pyYKniGQTCnOEvlC/O 7LgQ== 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=b5JE74fK4deUY8yHQ1YylVaYz4OFe3N6orpodgl7zhE=; b=wED98zpiVtCtU4UtnPcMJALHxY68AlJwIpkPbd6QKf0XcnaJPe1R9plNgynIZllGaX eBEMBvM/EZq70rrGYJ09USXjlklwdBoKtjeSDHRqtw5vVdUEICSuELnzxGzr5cr1HFsK ELCPBeHVNfmtSSQyyj2EjyeJIond0PMf6pyz3S3E1Vl6zpBxB1lZlhUCHczmVJwgIVm/ ApUVBkIOp3GzdmNop9twatwOEIIEzLXxdiprsDK0D9/GMfNonSQiGHO0il74GZg6Y2/z sp4RBxeaH1XDg3b+CDe/TUccwopRfBesgBVpVEW/XFWbiSrJXvS3wi50cjpBWin+YLo1 42iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MUh6h5UA; 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 t15si13201170ejd.275.2021.07.13.02.58.03; Tue, 13 Jul 2021 02:58:25 -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=MUh6h5UA; 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 S235513AbhGMJ5X (ORCPT + 99 others); Tue, 13 Jul 2021 05:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235488AbhGMJ5U (ORCPT ); Tue, 13 Jul 2021 05:57:20 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A460EC0613EE; Tue, 13 Jul 2021 02:54:29 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id b8-20020a17090a4888b02901725eedd346so1752134pjh.4; Tue, 13 Jul 2021 02:54:29 -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=b5JE74fK4deUY8yHQ1YylVaYz4OFe3N6orpodgl7zhE=; b=MUh6h5UAv02BHwD0QIhzDyG1hF5LzDO+nC9S2cxko+ysMc7YewNooKacOGkIyU8Nav l4JECG03ws4wWqkrTnJoGk/MEqB183HlhSJJ+uqF2t8ImehF8KaS8f1qeqiCTkEKtxIt Ps+7MbjerJ5jwMfjcGQBgs5aQa6ecJH9A2q6GuNOaIcZKCHf+YeouPhMZKVwREx4y9aq UX8G7a+eq90IF4l/aeW4h4RuUJeWdRGeJVp0yqvlBPl8z753rTdiK5ToOY3YXqwDxeF1 hrB4jytiPk3us1OjSa8YhHWU+J/vbBLFvUkFScmIE+YKck+x0z9yy22GAV2kVoDBo3g0 Yw5A== 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=b5JE74fK4deUY8yHQ1YylVaYz4OFe3N6orpodgl7zhE=; b=gu0SmQwbU1erJwHJLzp9ZpksNBBv+TPvCxPQNVX48e9zAOryzA9KmVdANRMnHBUBzY hm1khRVdjhrCAe68UchzKmDlwkQy7/04NPxAGAAtSxmZBMAFIrTlba+dVvFa975fAR2+ 9X2lZYL3EaQcL6sT/UtnF6/hzTDJelm5lEkOT4r0W6XZLP/JKgFcB2iEhKBsQV5pvWXd g7/SsfLl1JIN9e85wcS8Q95e8wwkexWy+RfxrdvORe0v+RdKJhL0ivOLAC55GCLFQXDg ScaENxC0pO6w0nEdG2+zD1C3KFfmnJ/IQwrgrPjlFaSdStqVQ214GlEgwTJ3j11Gxf1O 9hbw== X-Gm-Message-State: AOAM530cluzpdzz4bhXkOEIoXltbD7dGe5IypikUgKM2/Vo738R4Q9lC /jIUvT0jaASpQo9JKyvUXkw= X-Received: by 2002:a17:90a:8a94:: with SMTP id x20mr15105617pjn.130.1626170069248; Tue, 13 Jul 2021 02:54:29 -0700 (PDT) Received: from localhost.localdomain ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id f6sm18153854pfj.28.2021.07.13.02.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 02:54:28 -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 v13 09/17] counter: Move counter enums to uapi header Date: Tue, 13 Jul 2021 18:53:13 +0900 Message-Id: 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 372b6966e93c..96bcdde8165b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4748,6 +4748,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