Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3098385rdb; Fri, 22 Sep 2023 19:35:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFb+5qxtHk0Ivhh8CGPyGHbdRjSlf6kjSkxhmVpQncVQTyW8MKnxpTjnV6f67rRpODu8ewc X-Received: by 2002:a05:6a00:134b:b0:68a:3b39:a486 with SMTP id k11-20020a056a00134b00b0068a3b39a486mr1307767pfu.24.1695436558888; Fri, 22 Sep 2023 19:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695436558; cv=none; d=google.com; s=arc-20160816; b=osH3jgLlClk1onxkdp6g7cnLGyhAh5Hxfn0e2VbmhaaYbpRpsiw0SPB5r73siuABLb QuVRIQ0OcGkDCuKZv8LWCx/o1rNw8ytCGFgGDC8ycmUpM5mSQrp/mHUcD7zNktDkrMZx LlAe8cPK+IwqBUR5wrklXXYixYfyMJBQcshvXAllHA9L00f8J+a+Ov8K8Q5RGD5Q72sW m5DqLWKP2Gedo/LcmjTmqbGr6NldxaW+xWlVVOCIE955fNDK2g5EUrdGR5NvxyLV+OJT tgHC1JcWzkhOcDOgZALrtuzQszYI4RkMctFZa49RUFc4iuUE0eINm+3R4hn2MxsGY4O/ bbiQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Mr6LkXEw8sIJ8BcE3bjActArsfoXf80+QAQbdeESybU=; fh=ozwKRq0p8tj2zy4oAJzh3eawPsCHg5fP2FoTNn7f1y4=; b=JNTYU6sZkenFwCNBkUd/eioi7iZ+cpJmYFr235Tp8eT/owzBuz7l7MgQaXxN7FvKwL MpUXyXKcvCmVF8citpi6LBcRI/REl7LfrWTqkU1rE6bJ8fZLPfL1WJLlDP+9kelHmMlK 7NS8eaRBTsGVqfpDmjCHJGDZ3XSzEkMhBJrEZebAuTcPZLOegMo35UVE0JGZICV/0TTC SQleZw5ZRaWQllVfTGSE6jZWB1gX1YVptb39ttz+OiQe6+x1PB9m5rLTobF6ezynEP9E ut+iheAIi/fDV298RRMzy4RgO1nnDT8/l1/1B/J/eiwIneetyXiACJUsJ48eK7wwbqQG KpmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=UdzA6JPV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id t41-20020a056a0013a900b0068fbf6ba315si5385668pfg.233.2023.09.22.19.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 19:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=UdzA6JPV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7E1AA8096FC9; Fri, 22 Sep 2023 07:41:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231486AbjIVOkW (ORCPT + 99 others); Fri, 22 Sep 2023 10:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231192AbjIVOkM (ORCPT ); Fri, 22 Sep 2023 10:40:12 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0113100; Fri, 22 Sep 2023 07:40:06 -0700 (PDT) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38M9t6lk014993; Fri, 22 Sep 2023 16:39:44 +0200 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=Mr6LkXE w8sIJ8BcE3bjActArsfoXf80+QAQbdeESybU=; b=UdzA6JPVKFv5JkdXhOrdWLF b0A6m1IF3zizMZZFoM9heTrmMIITnirPvb+T7AjR5AJQqSOBTiuol5D2Q+Ep63dM EywqJxhoepRolz7SBouwpn9PCZPG8WlIzn6pw8jTgvZlecRFkIiebeMJtS6z+1zR BA/L+94mvVblJd6J+reReRR+ptI14BBn6l8AZ4eR1RCC1OdFRxb0QEq2wB+fmHxJ IRpRxAwDVwesf417MThgqP2BIKGDPD1/d9yhhgWelqDLZpOqfzYemSDIS0cUEgf8 Pk5qxurSbFb9RpkW3gmcP7TiefJeJ+Qb+McEbWNGOheXSxgyrP5utK7INg5vuNg= = Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3t8tt03wg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 16:39:44 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E7B91100051; Fri, 22 Sep 2023 16:39:43 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C81AF235F24; Fri, 22 Sep 2023 16:39:43 +0200 (CEST) Received: from localhost (10.252.14.82) 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, 22 Sep 2023 16:39:43 +0200 From: Fabrice Gasnier To: CC: , , , , , , Subject: [PATCH v2 0/6] counter: fix, improvements and stm32 timer events support Date: Fri, 22 Sep 2023 16:39:14 +0200 Message-ID: <20230922143920.3144249-1-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.252.14.82] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-22_13,2023-09-21_01,2023-05-22_02 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 22 Sep 2023 07:41:01 -0700 (PDT) This series combines some fix and improvements to the counter interface, found while stm32 timer counter driver developements. It also introduces a new tool that can be used for testing. Then, it improves the stm32 timer counter driver by introducing new signals, e.g. counting frequency, and missing channels. It also adds support for interrupt based events using the chrdev interface. Two event types are added in this series: overflows and capture. Up to now, stm32 timer counter driver focused mainly on quadrature encoder feature. With this series, all timer instances can be enabled for simple counting (with overflow and capture events). Changes in v2: - counter fix and improvement patch applied, hence dropped in v2 series - mfd patch applied, hence dropped in v2 series - revisit watch events tool (mainly command line interface) - add one patch to rename STM32 Timer counter - various review comments from v1 Fabrice Gasnier (6): tools/counter: add a flexible watch events tool counter: stm32-timer-cnt: rename quadrature signal counter: stm32-timer-cnt: rename counter counter: stm32-timer-cnt: introduce clock signal counter: stm32-timer-cnt: populate capture channels and check encoder counter: stm32-timer-cnt: add support for events drivers/counter/stm32-timer-cnt.c | 558 ++++++++++++++++++++++++++- include/linux/mfd/stm32-timers.h | 15 + tools/counter/Build | 1 + tools/counter/Makefile | 12 +- tools/counter/counter_watch_events.c | 368 ++++++++++++++++++ 5 files changed, 934 insertions(+), 20 deletions(-) create mode 100644 tools/counter/counter_watch_events.c -- 2.25.1