Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp197776lqg; Fri, 1 Mar 2024 02:26:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlfi5TW32XCehoYRfl7F1WXE5le5IATqZkFtiL9BwHEf3Q+aD7HozLi/2LxfHguhf5/YL4x0DrFIeV2zuo+y6QqnwG0+4PhyS6SptpFA== X-Google-Smtp-Source: AGHT+IGXJoqgF7pKuo9HAdPGIjrtBkj0XiF0s7/ZYAHi0ypLY7wn7dquwxihfVjyPBNYBQfsndUL X-Received: by 2002:a05:6122:17a7:b0:4c8:e834:6cf2 with SMTP id o39-20020a05612217a700b004c8e8346cf2mr970950vkf.3.1709288803967; Fri, 01 Mar 2024 02:26:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709288803; cv=pass; d=google.com; s=arc-20160816; b=bduemFt6EGnUbPLoSrN6PxmBNMcnyTXJjQ1cdC77UUDkJE1HG1SHUZzKIC1D0CDl2u 8LP+5G1i2BBPFhwsoow4jEv9BHpNoJ/PS27eKYYGFPsfUpS8wvHD8iMy8Ro7dGTHpRhj h3b4fOM++GfusbhnFLrpSS0vQSns8jqq2hFucysjnMYVabIuwNihy9CyZDY8X7CHVDKp Jj98NP6FSkb8Ig4WrgPGqbSa4PmCMdBmhTr5NY9QVSJnJa7Efa6yMRqD2pu2uxhSfrES L6A8ek14P25r0+FsBcN5HS2Z04ZCubVBOvbSYaUeKvvD7ZcGMm5cSg5y05dbkCZFBzwg GESw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=vp6qVxJ487N75yXFKor9ARqDlZLKEE+aQ/uMZChldUI=; fh=2Srb/HojV92fyGSX5JixQ50f0JC8E/4Fm+p3ee7pvDg=; b=r1p1bj3QBf4Ibod4xZxsjuiNvQFpEwfMhvsY78G4tS64X/tlJN7W3FO3YM+Zfbg0/W XkgCEy3wAzFC99CnZe+J0Fdu/MF39+gut2jlDF97oCV+O3lazUx+Jv2lMKR/E6EyoKNc +YEwXUiVPBg5FM1SljFSOEFyF3XE16pHmccfxAR/CzBqVVdAAvo2Ff2PBqbz07zYmYia bTI7gW0FkOUKU6yihZcFZZdbhUUqNrROas0YqBM4T+1IIQ5Np7ooudP9psepVfvlND2R ItvptzEbY7J2+4gre5N0XOCmuj56c8mVvtvuGJItwJJb4XBv3n3cQ2Aj/7bwaArNxUXv tPWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=zZNq4TqU; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-88249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w24-20020ae9e518000000b00787b0fe26cbsi2492591qkf.479.2024.03.01.02.26.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 02:26:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=zZNq4TqU; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-88249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AF6D61C20F3B for ; Fri, 1 Mar 2024 10:26:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A91806BB2B; Fri, 1 Mar 2024 10:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="zZNq4TqU" Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD71723BD; Fri, 1 Mar 2024 10:26:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.132.182.106 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709288796; cv=none; b=FgnZogja+q0Or+mf6iXAjpvwahHEKF1ixxlGZER75OBsf1J+dO9nOpxDmZRBWEO/9SxmpUdWNsFkBiv3oq9ffhiEhURA3n1Vr90F6fQ7A0wdrJu7FAyR3cZ1aWd29umzO4FtglB0/840KmsiFZSvbfgFv+8GyqS1GtP3PYBYrOk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709288796; c=relaxed/simple; bh=jokYsqyurEXFxDPkRxZFI7C9kQPmyFxJWzMmRh4UsNU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Z6V7dVUPuhIlmhK2WDbuML8ydxfUUFg7B+LMFdRZAFBFAN637JHeRn2vWX5Rj1WYWRScNHKIhZaDh9JkHwErw+DnkB3McNXOcXkub5R6EQZjp2dHktIDPOGEkbBAXco+2UHL5156t34xaEokvJF4awnUxCe0TZZRn4qdGcuwbNY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=zZNq4TqU; arc=none smtp.client-ip=185.132.182.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4219345a021497; Fri, 1 Mar 2024 11:26:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=selector1; bh=vp6qVxJ 487N75yXFKor9ARqDlZLKEE+aQ/uMZChldUI=; b=zZNq4TqUD3suEztwQFse5rO dyMvyXT4S5CPRCUwHnw3aAybLz3LdveJbu0AKfZWtLnXGWmga6A5CVXjExA7zFZ7 IIa9bLZahnWkwoFABBsEwmAH3Nm88Z1+b4tq4OABLc+M+fjSjwEmF4xYX6s/gCqj hm9BP/vOs7/xAADaRPBdfOqa6IzguLHLgptQbqg6Vqr8PmgJg/hd3Ho/P1g4suMm lMJQvy1n3troKACRd2vGqEuFspPnICLiSskCJpzmYuz8PbXEt+vmSwjheFST9CXU LmRsOutuRpxsa6Xlbe0W0LQ9/z4do0NQW35d9R1gHnkN55MiPmeqMPQIWg61/rw= = Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3whf4bqdtx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Mar 2024 11:26:10 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 80BE640046; Fri, 1 Mar 2024 11:26:06 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A80AA244B60; Fri, 1 Mar 2024 11:25:31 +0100 (CET) Received: from localhost (10.201.22.191) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 1 Mar 2024 11:25:30 +0100 From: Fabrice Gasnier To: CC: , , , , , , , , Subject: [PATCH v5] counter: Introduce the COUNTER_COMP_FREQUENCY() macro Date: Fri, 1 Mar 2024 11:25:05 +0100 Message-ID: <20240301102505.591918-1-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_08,2024-03-01_01,2023-05-22_02 Now that there are two users for the "frequency" extension, introduce a new COUNTER_COMP_FREQUENCY() macro. This extension is intended to be a read-only signal attribute. Suggested-by: William Breathitt Gray Signed-off-by: Fabrice Gasnier --- Changes in v5 - "frequency" extension is read-only, so there's no need to provide a write parameter. - patch sent separately from "counter: Add stm32 timer events support" [1] [1] https://lore.kernel.org/lkml/20240227173803.53906-2-fabrice.gasnier@foss.st.com/ --- include/linux/counter.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/counter.h b/include/linux/counter.h index 702e9108bbb4..0ac36f815b7d 100644 --- a/include/linux/counter.h +++ b/include/linux/counter.h @@ -602,6 +602,13 @@ struct counter_array { #define COUNTER_COMP_FLOOR(_read, _write) \ COUNTER_COMP_COUNT_U64("floor", _read, _write) +#define COUNTER_COMP_FREQUENCY(_read) \ +{ \ + .type = COUNTER_COMP_U64, \ + .name = "frequency", \ + .signal_u64_read = (_read), \ +} + #define COUNTER_COMP_POLARITY(_read, _write, _available) \ { \ .type = COUNTER_COMP_SIGNAL_POLARITY, \ -- 2.25.1