Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp83526rdb; Wed, 20 Dec 2023 06:58:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyFX+UupUSOY8aaslTkUfoUDzguOl/KG/0TsX3urqg+oHPvwzzoJ9zaTUk+BisEscwrTli X-Received: by 2002:a05:620a:13f8:b0:77e:fba3:759c with SMTP id h24-20020a05620a13f800b0077efba3759cmr21268207qkl.148.1703084325318; Wed, 20 Dec 2023 06:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703084325; cv=none; d=google.com; s=arc-20160816; b=CzIKIJq1s/AQEprSfO9XtUZJXMW328gD7t/iHpolrRTcAx4Bu8ezQzZuJCjeqVpk4+ uE8vfbLTzoI2/nvr2FAIEBFD7s8MowSV/Xde3vV+NG0FMufJuIS+aPvDqUmBAn9NbfMe PlJsGDtcGaGPz3vYY0AGLVDwH3BS2dw/w9TTaphpKzTzu8qW7/kNfrBfPGQTr6fUZAnt +z4vj7LNh3Q0936MOOxm6blken87ZjOhrT3CC62XMs9UnRoC7SMUpqo7YkYCU+CAIzpI pF10bOWpEyv5KRVyFFt/RD2Dea/9KtewGiFi5VIKv/hK8Fqo7oCb7BPzkbpB4doz8x5O 07bg== 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=V9ljivPttp2rz/EBN+xGrc8EnIawGBMvk5JANbG9TY8=; fh=ozwKRq0p8tj2zy4oAJzh3eawPsCHg5fP2FoTNn7f1y4=; b=gv5mwGURnuwam6bZ17kOpqp0aT0flq9TBcjlNeIT/J48g4DKH6Jw4wHxN3QvzzZm6r fFa684p4HYr3aBrzjtBAyCdcIzJlUrXWokSAj56Cs3ZyKtLCuT7gu9X7ppOR6Mghd+nj 5WWic9yL21AcxYIJevR1R/ddBXOn9aQuzmyI/NshMN8Td/IWvFnPP+/4hfYdVoapXJpg 8dEw5fQDqvD1N7yVZ27ei48sK2AP87jpiqTU5b+0EFZNRplgF5Iz84pZJZCYKcyKdn+M 8fvBsZIlZEPKDEibtN367fJI0vJOlBoc4GQ+Glhryc9eEfSeG63nHF+AMbjNQM6qkMnx pHhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=GVG0yZJo; spf=pass (google.com: domain of linux-kernel+bounces-7098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7098-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. [147.75.199.223]) by mx.google.com with ESMTPS id dt33-20020a05620a47a100b0077eff4d54b3si3153476qkb.261.2023.12.20.06.58.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:58:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=GVG0yZJo; spf=pass (google.com: domain of linux-kernel+bounces-7098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7098-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 11FE51C24085 for ; Wed, 20 Dec 2023 14:58:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49D273FB39; Wed, 20 Dec 2023 14:58:17 +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="GVG0yZJo" 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 CF2FA3E474; Wed, 20 Dec 2023 14:58:14 +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 3BKASCsi015122; Wed, 20 Dec 2023 15:57:57 +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=V9ljivPttp2rz/EBN+xGrc8EnIawGBMvk5JANbG9TY8=; b=GV G0yZJo2HpQWxVho3iuC+MCaByn5qEXgfMzSfchradW6/gJeQS6N6SZQtvdfAQqRX T0eUUE+ZSTUNmZ52dMQ1WziMFfyf7p/JjN7GJ0KghqZisDz+5xy77NcIhnIYA3/y v9iSpHtMfc7Zqrg4JFAHixG3/JexhW/euoOnGhIj5G1zusC8Bb+zT06CFNdAJfpr Tx171HjiZ5/BG8l6LoNQoTJQzV4r2HbQiYa/PwBF5OeOmiHPyTUZBjXWg8EqnKEv 9LluO9cBBIZoVrg3Tg183Gse7vodT9Z5hRqJ+rF8rBiJr/34oJuRnR1uGPCYIQOC A6Hrrmt4iv29ie29u6Dw== 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 3v1pb4qwkn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 15:57:57 +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 01E7A100057; Wed, 20 Dec 2023 15:57:57 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EBA3221B512; Wed, 20 Dec 2023 15:57:56 +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:57:56 +0100 From: Fabrice Gasnier To: CC: , , , , , , Subject: [PATCH v3 03/10] counter: stm32-timer-cnt: adopt signal definitions Date: Wed, 20 Dec 2023 15:57:19 +0100 Message-ID: <20231220145726.640627-4-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_08,2023-12-20_01,2023-05-22_02 Adopt signals definitions to ease later signals additions. There are no intended functional changes here. Signed-off-by: Fabrice Gasnier --- Changes in v3: New patch split from "counter: stm32-timer-cnt: introduce clock signal" --- drivers/counter/stm32-timer-cnt.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c index 668e9d1061d3..c34747d7857e 100644 --- a/drivers/counter/stm32-timer-cnt.c +++ b/drivers/counter/stm32-timer-cnt.c @@ -21,6 +21,9 @@ #define TIM_CCER_MASK (TIM_CCER_CC1P | TIM_CCER_CC1NP | \ TIM_CCER_CC2P | TIM_CCER_CC2NP) +#define STM32_CH1_SIG 0 +#define STM32_CH2_SIG 1 + struct stm32_timer_regs { u32 cr1; u32 cnt; @@ -247,14 +250,14 @@ static int stm32_action_read(struct counter_device *counter, return 0; case COUNTER_FUNCTION_QUADRATURE_X2_A: /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ - if (synapse->signal->id == count->synapses[0].signal->id) + if (synapse->signal->id == STM32_CH1_SIG) *action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES; else *action = COUNTER_SYNAPSE_ACTION_NONE; return 0; case COUNTER_FUNCTION_QUADRATURE_X2_B: /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ - if (synapse->signal->id == count->synapses[1].signal->id) + if (synapse->signal->id == STM32_CH2_SIG) *action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES; else *action = COUNTER_SYNAPSE_ACTION_NONE; @@ -278,11 +281,11 @@ static const struct counter_ops stm32_timer_cnt_ops = { static struct counter_signal stm32_signals[] = { { - .id = 0, + .id = STM32_CH1_SIG, .name = "Channel 1" }, { - .id = 1, + .id = STM32_CH2_SIG, .name = "Channel 2" } }; @@ -291,12 +294,12 @@ static struct counter_synapse stm32_count_synapses[] = { { .actions_list = stm32_synapse_actions, .num_actions = ARRAY_SIZE(stm32_synapse_actions), - .signal = &stm32_signals[0] + .signal = &stm32_signals[STM32_CH1_SIG] }, { .actions_list = stm32_synapse_actions, .num_actions = ARRAY_SIZE(stm32_synapse_actions), - .signal = &stm32_signals[1] + .signal = &stm32_signals[STM32_CH2_SIG] } }; -- 2.25.1