Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp558361lqi; Thu, 7 Mar 2024 05:34:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUR1K7AipZYeG4RS5fnPEVTeirUyFFaaLsE0EPH8m7mCMCunW3ZkSswJYE5jxono54bqUtFeEAdzjVY+5sIwmDKmlNUvTEaKv+pZ1Ag/Q== X-Google-Smtp-Source: AGHT+IFbrSYVJxcuGnbkd/9Sj3MfDPNJj4r1Y1iJlph+ALyO/jco9yeWEq0zmT1rCjXrFzhN6TUW X-Received: by 2002:ad4:536a:0:b0:690:8f11:f142 with SMTP id e10-20020ad4536a000000b006908f11f142mr6330426qvv.30.1709818488915; Thu, 07 Mar 2024 05:34:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709818488; cv=pass; d=google.com; s=arc-20160816; b=eOia+6RkyeRv1No/q45TA3+0CB/S3xf5D27NndzbpiYWL/tBSWp7rCVZLeAHjBUDQ1 hLGHnnqjUBMWAYbfymsOS0llOVdAmG5ZOpemvYA16+QmvqfoqMIU5fOtf+ifpQWRIsHx IKc5bTU3P+NmYoMdrIxHQt2/GQwEcib+qDbzok1bnWo8gpZiHinXwZY+hmxF+Zk/OldW QBESFkTOscRVuii8YfJ/XY7IcvutUTNwyK8NhQPSjvmKVO5YACWkEUMC0kGAyh99sVx9 e2ZWNDHkspWQKFLPA/0CNq7g0ZNlL0H3LI47Pc6ONM+dPzv3iGWTWs9C3uKQ1H+2Wxn/ xGfw== ARC-Message-Signature: i=2; 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=+7nWDb9ZWuayfFkASgiJUL4avZyU6WuY7zpZjhvk6Uc=; fh=ozwKRq0p8tj2zy4oAJzh3eawPsCHg5fP2FoTNn7f1y4=; b=ZoBT1466Gpb1nhj+FlZa92BLLjwx9/if+wqovLCq5N/T7DIF6u+rHF4pFIMqHks8/H ljBBZzL5FoR/Eo7EEu4CeYfHVvBIH0/LJzwt9ZsMFfGHklhgeVc/c1Ap+gt+6PSOww1X Po6PbhXh7F2z2HHzoLHZoBrY/6J9ElZtNbxBCYhauE5Y7a/CgG56zqLWj/JKwGIkyrVc H0a4q+lIfFjDGiwOn0K5SCsbxBS+OleiBzVFQxWGLUK1pMmToTONcrVqHBubohg6d38S n2XR4i0ZuQLMpC7S2lJs4PFh4DGPlfpb+cLzMNo4cZLXoVRTUFOxj++w57cxndp4Byk5 zz6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=7MbuGdCA; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-95603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95603-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 q5-20020ad45ca5000000b0068fe843bc61si17387932qvh.80.2024.03.07.05.34.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:34:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95603-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=7MbuGdCA; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-95603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95603-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 A32011C234FB for ; Thu, 7 Mar 2024 13:34:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E88B12DD8F; Thu, 7 Mar 2024 13:34:20 +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="7MbuGdCA" 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 B96D312D1E6; Thu, 7 Mar 2024 13:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.132.182.106 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709818459; cv=none; b=LJy12bPY0sC2uiVRCJLWDmxc6yTI2p60Jb9Sf/oeTHGzCq+odjz6KfSPlKN+v6AuAU7PlxwKCBKOjgAYUUd8ywH3f0nZZpNYewBW0c1HBF8Xie1JNqkQXL+P6fzRYqIqpkw8X4tejYJLS7wcVdlEFV4q8CgvOTq4mT3l8GsNeZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709818459; c=relaxed/simple; bh=LWsw026/asPNOxKB3DfQPCtN+8c7p5NHBaCKCQqDSWo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E62NSRbXEJF365CXapiig+1kBs/n+fcGfvpu+NvLJU/NMRDmzOgrPWL9oZ7y+U4oQemw8lYd+BcaF73qod0Q45/2q48uHadc23EgyBWFR7PhELH4PGZm8ReRg/3FQVvn4kC9ffn0+pkezIO7SXOzoHMGGXo5enlAMWn2BlGmG+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=7MbuGdCA; arc=none smtp.client-ip=185.132.182.106 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 (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4279x8Iq028743; Thu, 7 Mar 2024 14:33:58 +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=+7nWDb9ZWuayfFkASgiJUL4avZyU6WuY7zpZjhvk6Uc=; b=7M buGdCAh064QV5UxtSemkeKktdj715YEDnP34hOnWxuoPvR1bizyMPFs2c6Ah6Xxg 91un5/jB2VcXrWMHXUBo7hX9mQdGxfBj55AfIevjRG8PFNtS+Zwm80BUYWMwwKSv BCc1bDnu/Ssj4zLPBDUZkxHrxeWVQFiq5lviRxCY4N0yljtblgSD1lVTTr5B4Kqu weYNMKCptPNhsCQC+p3wxWJ2sycvb6IhLz3Bzz34XrnHHiM/IXfksq7AUh4WdcpH pmjCovExiSWh4Y6lytkcUsc9ntVKGxOQbYtQX3Fy6HhIU7WQA7+c2SN8hCNXkRQo PhX+XAIsLe5mGbDXlk5w== 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 3wn87tt1c7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Mar 2024 14:33:58 +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 241F24002D; Thu, 7 Mar 2024 14:33:55 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7FE0527A504; Thu, 7 Mar 2024 14:33:30 +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; Thu, 7 Mar 2024 14:33:27 +0100 From: Fabrice Gasnier To: CC: , , , , , , Subject: [PATCH v5 03/10] counter: stm32-timer-cnt: adopt signal definitions Date: Thu, 7 Mar 2024 14:32:59 +0100 Message-ID: <20240307133306.383045-4-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240307133306.383045-1-fabrice.gasnier@foss.st.com> References: <20240307133306.383045-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: 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-07_08,2024-03-06_01,2023-05-22_02 Adopt signals definitions to ease later signals additions. There are no intended functional changes here. Reviewed-by: William Breathitt Gray Signed-off-by: Fabrice Gasnier --- Changes in v4: - Add William's Reviewed-by tag 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