Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2544565pxb; Tue, 9 Mar 2021 05:24:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyU4C8BEP0r78uEQxj/yk5e1TZllPpO+JviHV/r5jImgsu2YvuuYLLdZNFFAzlyCyN6n6sp X-Received: by 2002:a05:6402:510b:: with SMTP id m11mr4109571edd.103.1615296263089; Tue, 09 Mar 2021 05:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615296263; cv=none; d=google.com; s=arc-20160816; b=LOpC+M1MRVlNMwGkJC2eoVFE0ljTiKRC2E9ER2y1vILufvT+ZTOTuqj3aZ0Li7qtyA VqZTQHuNGgUEqElrYJIJryOWrBFd3bcsjHGCroNk6GGPw0FKm6bufkfNg5hSOuiYNWC8 ftP+aBY1AuNonPyqt9b+lqbaXN76kzKOyV2xTL6HE5JU2ACTqcfq8ozNJzv37UyoN+FZ nK6iwpYr5uxDqiPfuZqPZDwjYXL/QtDMsAQHv32AJqgy92ofgYBk77yVnxm2BL+gkI0L 0JI0/B5SQ0jieD0Ya3K6v4Z7yX7UPlPLDcMMVRk/5IuhMKWaYchBYd55P1EDxUq1+HOx m1ng== 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=jtnafmPIEm/uciDz91Y90561rS0hqXgRCMM9b1KyMxI=; b=mGubymYc681Aq7/dsOkm0AutuyK6yn855ycZGH0czQHKmpwO/aD1O4jTPoSbCgcMYM uw+l1LA0oFBC2QD5UxOov3mZRTVAhAJ4DJdvYx3SYkfT5yZe9JZMUaZ+RkUaH3qonutw XI/9CUPbZ+GpzPVm4S3GTVYo66TDlG9spGI4WtEy7FdEnqpONuoKte00xMYhNow2emi2 y6abroNYEJ2jU/RSX44sZjeLvwRv1snReGmTXZ5EMZcYlMRnGhaSsAIIol6lSLBpB39W z4nWJYMOa2it+9VlnSSoqevSNJrCuQrBf7pJ4OTygI7kVsz0E3uofelZmfVD1BNJsBbH Xtpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hm1K7gbe; 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 u6si9012516ejx.73.2021.03.09.05.24.00; Tue, 09 Mar 2021 05:24:23 -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=hm1K7gbe; 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 S231828AbhCINWl (ORCPT + 99 others); Tue, 9 Mar 2021 08:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbhCINWX (ORCPT ); Tue, 9 Mar 2021 08:22:23 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD92C06174A; Tue, 9 Mar 2021 05:22:23 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id q204so9362525pfq.10; Tue, 09 Mar 2021 05:22:23 -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=jtnafmPIEm/uciDz91Y90561rS0hqXgRCMM9b1KyMxI=; b=hm1K7gbeZ4zkZ3VpuaV5XXFT1+qMm+LLu2X2wNAQNYhVlW4p/KCUkFQogQc9yYsLmg D2iCzYeoQHJAmHgUAtWsr+jIBKsL8LTFWXRgDmroQeInG1PRLKKlTTxIT1Tzd2kaTuw/ X/ugI1Erldi4aOrE2Z10M11hlQcTfVaCffGHhSwFxTY+aizrMGq2xHi/jdl7vgeDBsiV leYifI2NoDdzHkF6mcOKRcMPnm+9hZUodm0Uw3RT+wYwZfAzrBS8JGEEb4PjcaxajG7n 1OAhZPECwgw8lcWEhVPwjoCKfmY/E6DoZWiNbnGODyTjF3QDVRUELzAAStMhYyRXhmQN 0h/A== 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=jtnafmPIEm/uciDz91Y90561rS0hqXgRCMM9b1KyMxI=; b=MfAlD/flTGyDIpm0pNaIuGpSlKAlLwZffpW6k72IcaRYU+GaP0+7nccygkLT9841QZ FtM9d0xLHHde3UxnZtd0BC5Y+1wHfNfK01YmEJLlLn3ZpKDDvyvS5tKH34W4TpiLjvB4 QVl9DaS2uNkQy9z111YjdvSdRRandhc5Jto7JMX+O5UozteRwyB23+7hBT9LuCkCmpXh Npnw4QRXnUMdB0uH9v9pNcOpY5ed8ezcRvOMmZqH9+pSYm6Nbia3wDVOBLpg+izTaevx zB+oh/p0DKbQK9gnUJM4vco2/8gBXqZKKBPFuchLBY0W4ZW9v2kq8GBpHHLcAQar0x1f LNyQ== X-Gm-Message-State: AOAM53108Dsx21/SlJUxGfU9hPmiH6RqOCziiqz3zSAzGk/lVnOFg0Fy oOmZMftYA1Bsp2W9a0LTHsg= X-Received: by 2002:a63:fb18:: with SMTP id o24mr24474588pgh.55.1615296142824; Tue, 09 Mar 2021 05:22:22 -0800 (PST) Received: from localhost.localdomain ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id y9sm7647421pfl.201.2021.03.09.05.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 05:22:22 -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 v9 25/33] counter: Move counter enums to uapi header Date: Tue, 9 Mar 2021 22:19:38 +0900 Message-Id: X-Mailer: git-send-email 2.30.1 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. 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 1508db256784..93233a07f5aa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4581,6 +4581,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 e7fd6d81a929..eee85db8e332 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.1