Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp84053rdb; Wed, 20 Dec 2023 06:59:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGY1SRhBLijU9OZ+ivBsmAbuAT0y8uaAqnSp4+yZ1U4Fl/9rQ0bKyyoLf6mJxt2LmuhSynp X-Received: by 2002:a05:6512:b94:b0:50e:546b:53bb with SMTP id b20-20020a0565120b9400b0050e546b53bbmr517330lfv.136.1703084387799; Wed, 20 Dec 2023 06:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703084387; cv=none; d=google.com; s=arc-20160816; b=Mur91sgCZCbur35lqfRyek34cDnTz9G/Nk9hJ6qG+UeEG1teRI4oci4eAwHqeF5kqo DnatVhWb5bL4V1uFKviyDLo8tzcE5jZWiGAcZkJrj1r1HJTcEoEJ4KI4Vz4aJT13xxIz yL1uEV42iu9mjefKctZnhrIGO+gaKl7Yk94N+ejJCit6i0qJlxd4fi5tw4h43mk1tPTj mfasXiP4bjWj5g5GA4N9Br/aoc946KZSYOS4XlTcvBz7tGr56lA6E9KiNLSh0INxsdeq H12O1iW/a0GsT3tD2dvCRuWxFithI0hxqdjBD/j9ehE8ZRh0qqGD/BfJBN7v2Lg7SryE prOg== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IlOpFy1jN9ZOWAsrgsbza2MKAqlVofANmjpRVKJzMP8=; fh=ozwKRq0p8tj2zy4oAJzh3eawPsCHg5fP2FoTNn7f1y4=; b=EwocmZMWdsYWTtp3ofcl1N29IUnXrqkThP6mtEBKYGo+zBD88Bror/bTXzdvneGq/J 2rFN3PPzGHe6Zmkt2kuAuntvGpjWtaKC4QIRSPxZU+BvfmEh7CPfMHx/6fCDr82bTOvZ 7iHoI34g1+csmpBMIlh6Wk5LOSjfS6NnSPIR2DSNj5xfmhVYpjHxdF0vP64tOR6Dgdvr CGPYuiAGt8WatrSe/u3uJwxBbLAgVH/OPblbvX36o/OwDsI7R5e5myfHO/nQrl1Bmmgg dKcMfuAHbavGiP1BREeFadbgwaVJE48KooiuVDl5wcoqjsaZ3vOFClugY5EKBuNPFdp/ GyLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=WqoSYPmr; spf=pass (google.com: domain of linux-kernel+bounces-7102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7102-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 am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lj20-20020a170906f9d400b00a234a3b6a22si3097476ejb.615.2023.12.20.06.59.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:59:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=WqoSYPmr; spf=pass (google.com: domain of linux-kernel+bounces-7102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7102-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 86BD01F231DB for ; Wed, 20 Dec 2023 14:59:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB1303FB39; Wed, 20 Dec 2023 14:59:24 +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="WqoSYPmr" X-Original-To: linux-kernel@vger.kernel.org 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 7CFFA3E47C; Wed, 20 Dec 2023 14:59:22 +0000 (UTC) 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 (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3BKADF1f016334; Wed, 20 Dec 2023 15:59:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=IlOpFy1jN9ZOWAsrgsbza2MKAqlVofANmjpRVKJzMP8=; b=Wq oSYPmrnqOtKR8MZEK2h2F+3x+wSaUYH2qM3baqje0C+T323T5RZ+G/umGjc8nVQg YopDDJBbxbrp/jj2KZ7qLN0KDOoJiC18Yb7dAOmGT2UbJ4uAm0J6wWmCjuA10hqq 03/3NYkzPE9AdLrg0btnBNszF/kWH//miD9DONHlNjduvNvXCfMRn6KRvS6tl/4c AnOZil/MA/tR+LtGm9ksaQS+bWqO4ZXvDQD9fdQL1XoD4snux/0NY6zadcrChrSB WWzBuoGFoaB4azi5JUpISivlRsScFNwgdLOSebfKcZtRiFCmVfJ3m51jdmWOhBFs mMGGCEyBlm2yqYcoA/Rw== 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 3v1pb4qwry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 15:59:12 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4F0AB100068; Wed, 20 Dec 2023 15:59:12 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 440A821B51F; Wed, 20 Dec 2023 15:59:12 +0100 (CET) Received: from localhost (10.201.20.59) 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, 20 Dec 2023 15:59:09 +0100 From: Fabrice Gasnier To: CC: , , , , , , Subject: [PATCH v3 07/10] counter: stm32-timer-cnt: introduce channels Date: Wed, 20 Dec 2023 15:57:23 +0100 Message-ID: <20231220145726.640627-8-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220145726.640627-1-fabrice.gasnier@foss.st.com> References: <20231220145726.640627-1-fabrice.gasnier@foss.st.com> 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: 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.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-20_09,2023-12-20_01,2023-05-22_02 Simply add channels 3 and 4 that can be used for capture. Statically add them, despite some timers doesn't have them. Rather rely on stm32_action_read that will report "none" action for these currently. Signed-off-by: Fabrice Gasnier --- Changes in v3: - New patch split from: "counter: stm32-timer-cnt: populate capture channels and check encoder" --- drivers/counter/stm32-timer-cnt.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c index 6933d42b16bf..55eb6af34750 100644 --- a/drivers/counter/stm32-timer-cnt.c +++ b/drivers/counter/stm32-timer-cnt.c @@ -25,6 +25,8 @@ #define STM32_CH1_SIG 0 #define STM32_CH2_SIG 1 #define STM32_CLOCK_SIG 2 +#define STM32_CH3_SIG 3 +#define STM32_CH4_SIG 4 struct stm32_timer_regs { u32 cr1; @@ -366,6 +368,14 @@ static struct counter_signal stm32_signals[] = { .ext = stm32_count_clock_ext, .num_ext = ARRAY_SIZE(stm32_count_clock_ext), }, + { + .id = STM32_CH3_SIG, + .name = "Channel 3" + }, + { + .id = STM32_CH4_SIG, + .name = "Channel 4" + }, }; static struct counter_synapse stm32_count_synapses[] = { @@ -384,6 +394,16 @@ static struct counter_synapse stm32_count_synapses[] = { .num_actions = ARRAY_SIZE(stm32_clock_synapse_actions), .signal = &stm32_signals[STM32_CLOCK_SIG] }, + { + .actions_list = stm32_synapse_actions, + .num_actions = ARRAY_SIZE(stm32_synapse_actions), + .signal = &stm32_signals[STM32_CH3_SIG] + }, + { + .actions_list = stm32_synapse_actions, + .num_actions = ARRAY_SIZE(stm32_synapse_actions), + .signal = &stm32_signals[STM32_CH4_SIG] + }, }; static struct counter_count stm32_counts = { -- 2.25.1