From patchwork Fri Sep 22 14:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 13395895 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 A4027E6FE3D for ; Fri, 22 Sep 2023 14:40:44 +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=S53VtZKehCX8S+Q416BnJQxYAGWcXiOb/QcfFnmyYlI=; b=XTo5nz0uNuFh4U nmyaPesSz5mQICJnemaw6Ibwo92MiXGQ9UUIQPfMfaaY66k6i/StfNx3iM0uPeQADZp6eaum1Md+I nHcd2pOPzV4VcDLz76fxG/DCuYBbD6J+O1rJ6AeLyRcUObF/TE2WJSkOPFUuzAdL1bAkMKMOKH0dY Q4+nG4T7O04Sv4BWMzKgcHtpw0xA8BscdJHC5eH/me1MwDMiEq5q2Px3QLJFATHtyckk0/lw3RUuX yOZjlLozreSkt69yoC8n6zy92wpmyH6MnNlVkcdYIiTPtFe06hwhFAICRBHSlQ4+D7dreJjAmIzov Pbrsscx+EZQhvUdz43ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjhKP-009DyL-0Y; Fri, 22 Sep 2023 14:40:21 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qjhK2-009DnD-1n for linux-arm-kernel@lists.infradead.org; Fri, 22 Sep 2023 14:40:03 +0000 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230922_074000_085102_EDC8F7BD X-CRM114-Status: GOOD ( 13.08 ) 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 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