From patchwork Wed Mar 6 15:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 13584232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5962CC5475B for ; Wed, 6 Mar 2024 15:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=204rqnESaRi29lfeocU7wm5EEFqiKDXI04JGxZHQ35E=; b=Aa4qiK+M9i50YZ WU1Cz4HLxW5peORz5kjD5CwtLrtqc/pFujayTI6aAJ4qh1wrQGEhMWIh9Vdz5rAW7obxCLXtu5zF7 YCuC2lQ0boKY7a/4pIgHaaX1x8owNl5AogIv3ztBdxNGd9doKZQimB89l2dQGT6TlZ2D5DwPvbeYe rMvJ//La3WMnxThjSkI4ZOc+WenLDaGRZGoOqQVIMApGN8gxFu2w3TtSGuKEfjAR0ah0DAbc9KMfO NRhjoFNsh5+y9vCphi/E9NTnKftHenj1fcJgR9TIzbu2PwK32KwFCXA5X5eJ2KV0cdZN/hwEZyhM5 AD/Ao8iPXXdz4zZrE5mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhtL8-00000000o77-0wRE; Wed, 06 Mar 2024 15:37:54 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhtL4-00000000o4Z-2rXV for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2024 15:37:52 +0000 Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426A3Hk7012206; Wed, 6 Mar 2024 16:37:44 +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=qstRAve 03QX2RDPXI2xiohBwHTDAxLnNYs7VMSqsGpg=; b=242AI4QFoBfN8HA2pkk9Z0b IldQn41koXHItj8gVHkAMUJXvKjaCVZSZtjpm2FMvrKJ7gfUJtr8tvt9vK2Qibf5 FFMMtUcxR4yliuC3Cmss4+0m0+B1AZTHEbKfKH6/6uDcp7gzsmx1kcCb/0ADOWIH zikStUZq07Z+/bXj53Y2kTOj9iYwt+5qht1FSji08CbsIUOeW0IykM3C9f6hB8i6 Q0fs36qfoTEqze2x/nr3N1Ax65B6zeZKY80H4RX40FjVZXUQFYyJE3fFGH/LQGwx cQhqxlu8QbJATdW4NNR1xxEDSwtO6+a30wXt84i57IQWHtl7zzu1BSU5bQAeuJA= = 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 3wmej58r3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Mar 2024 16:37:44 +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 C1DDA4002D; Wed, 6 Mar 2024 16:37:37 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 42AF0283682; Wed, 6 Mar 2024 16:37:03 +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; Wed, 6 Mar 2024 16:37:00 +0100 From: Fabrice Gasnier To: CC: , , , , , , , , Subject: [PATCH v6] counter: Introduce the COUNTER_COMP_FREQUENCY() macro Date: Wed, 6 Mar 2024 16:36:31 +0100 Message-ID: <20240306153631.4051115-1-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.201.22.191] 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-06_10,2024-03-05_01,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_073751_440808_BCF1F663 X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 v6 - use COUNTER_COMP_SIGNAL_U64() helper macro. 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/counter.h b/include/linux/counter.h index 702e9108bbb4..ac36f6e799f6 100644 --- a/include/linux/counter.h +++ b/include/linux/counter.h @@ -602,6 +602,9 @@ struct counter_array { #define COUNTER_COMP_FLOOR(_read, _write) \ COUNTER_COMP_COUNT_U64("floor", _read, _write) +#define COUNTER_COMP_FREQUENCY(_read) \ + COUNTER_COMP_SIGNAL_U64("frequency", _read, NULL) + #define COUNTER_COMP_POLARITY(_read, _write, _available) \ { \ .type = COUNTER_COMP_SIGNAL_POLARITY, \