From patchwork Fri Aug 27 03:47:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12461187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55772C432BE for ; Fri, 27 Aug 2021 03:52:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2537160F42 for ; Fri, 27 Aug 2021 03:52:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2537160F42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=diOnFgnCV6a1fQFcvLgZiYfr8OZeVM4VNf3IweGGuEY=; b=tzg1qdKunqT+Hb NXOtpPpnniGQt6XGDxyn8+Xi5E153Dw7w3HXZ9qKyQNyEAhDHpFeM6pUrHhXv8EcHf0W+ISKnoxjp RibTAjwGMbkO/m9AQtkIKck4fOBJvGUE7pDnZkHLlZfAJKS+wcs7WVnKKOqRji1DkBW+Hwyxvmhv8 5Av6XrsIZseYyYh2MFfT3EM6WipQL7pGWWs+GEqhZV8e+qiS29jZ6KUaoAoWy8WrOeMP1eGp41Kfw E56TWepXlCVMLjwKCqywYuV3PIyfkwEms0a1hs0LPdAFclPt3MC4+HubF4ccVyIKuhY3DWVd9URfn 3g0UrjMCarURrOCNKcjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJSr1-00BRrW-SG; Fri, 27 Aug 2021 03:48:32 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJSqo-00BRpD-A8 for linux-arm-kernel@lists.infradead.org; Fri, 27 Aug 2021 03:48:19 +0000 Received: by mail-pj1-x1036.google.com with SMTP id z24-20020a17090acb1800b0018e87a24300so3927801pjt.0 for ; Thu, 26 Aug 2021 20:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ailO7mWThdrVL8blMHbd6DHGx3BHyfc6JT8C/AVCxTw=; b=hGJNel52AB4HPlmab7Q3dYqidGZHRqIPtSwUqem6ds0ejfoHDhxaaR6BoLtvxjoh93 9DKRxXcivLvrT8A676B8xOo7YSnxaI/+H9euY8Zd/SCci9enXb9uPvo/ivUeb6rsraiu awqubFC1VqYB9lHNkjjidBkt3HOnilq4N2lYJo5U58KbGvohFMaqqm2MmbgOo6G4/gAe RhEzBuiXHAr7i6sVmYtzkc0KJTZa3TDgWhxKUJPudU3PCmdl1Oq9VCtQp0rJbfuzQexY HzokXmhQ6qCAPU+CjT2pAOUWshUlxxdCdi5tmIkZW6pAQMeew+3NJ/25Uhm+4hrASQUK JpoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ailO7mWThdrVL8blMHbd6DHGx3BHyfc6JT8C/AVCxTw=; b=tQAfcjhS7s0D76rWV6NxInB7sd1Cu2OrxI4NjxcZTPyovBX2BqhSwVhXSMCBYYCKeT 7at6Exf1qvXIhKwswvAwoOEf+kJl5T7XOYtmlWZ32GtNCv0ME8YF1lhvCyf2R8AxB08X /1eCNwAXcPvjMHL45FF2lyl0MXSAL1rcPzaleA6YNEIgqeNfgfojxXYpU38aBGlooEXM ysWxFA3vgynK/kc2QWtmefZTACKxlK+nd+6zn9+oFJ4MEL4NUlpRcoxdXmFUaBpdACP4 7ODzBJubWiPjbb5YreDLf4MyleZ1GKz3T29CrwpVitjwtYB9ZAdBlCLW5oYLSi5cHTLr nJjQ== X-Gm-Message-State: AOAM53146wpsRv03VOcv/f7l7X+Gd06jIF4915D1rZRJm7M2RyrrCBDG MtJ+Q+shwq8whJkQLg4reyQ= X-Google-Smtp-Source: ABdhPJz6HSG/IOmN4K3PSxmGRWXA6Onvhl/sDmrN61R87mNnnixTGMgF40yfuAJdfhNNRbLMD8iNXQ== X-Received: by 2002:a17:90a:49cb:: with SMTP id l11mr1353505pjm.142.1630036097608; Thu, 26 Aug 2021 20:48:17 -0700 (PDT) Received: from localhost.localdomain ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id o6sm4364693pjk.4.2021.08.26.20.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 20:48:17 -0700 (PDT) From: William Breathitt Gray To: jic23@kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, jarkko.nikula@linux.intel.com, William Breathitt Gray , Fabrice Gasnier Subject: [PATCH v16 01/14] counter: stm32-lptimer-cnt: Provide defines for clock polarities Date: Fri, 27 Aug 2021 12:47:45 +0900 Message-Id: X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_204818_371546_5BAD70DE X-CRM114-Status: GOOD ( 12.90 ) 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 The STM32 low-power timer permits configuration of the clock polarity via the LPTIMX_CFGR register CKPOL bits. This patch provides preprocessor defines for the supported clock polarities. Cc: Fabrice Gasnier Signed-off-by: William Breathitt Gray Reviewed-by: Fabrice Gasnier --- drivers/counter/stm32-lptimer-cnt.c | 6 +++--- include/linux/mfd/stm32-lptimer.h | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c index 13656957c45f..7367f46c6f91 100644 --- a/drivers/counter/stm32-lptimer-cnt.c +++ b/drivers/counter/stm32-lptimer-cnt.c @@ -140,9 +140,9 @@ static const enum counter_function stm32_lptim_cnt_functions[] = { }; enum stm32_lptim_synapse_action { - STM32_LPTIM_SYNAPSE_ACTION_RISING_EDGE, - STM32_LPTIM_SYNAPSE_ACTION_FALLING_EDGE, - STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES, + STM32_LPTIM_SYNAPSE_ACTION_RISING_EDGE = STM32_LPTIM_CKPOL_RISING_EDGE, + STM32_LPTIM_SYNAPSE_ACTION_FALLING_EDGE = STM32_LPTIM_CKPOL_FALLING_EDGE, + STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES = STM32_LPTIM_CKPOL_BOTH_EDGES, STM32_LPTIM_SYNAPSE_ACTION_NONE, }; diff --git a/include/linux/mfd/stm32-lptimer.h b/include/linux/mfd/stm32-lptimer.h index 90b20550c1c8..06d3f11dc3c9 100644 --- a/include/linux/mfd/stm32-lptimer.h +++ b/include/linux/mfd/stm32-lptimer.h @@ -45,6 +45,11 @@ #define STM32_LPTIM_PRESC GENMASK(11, 9) #define STM32_LPTIM_CKPOL GENMASK(2, 1) +/* STM32_LPTIM_CKPOL */ +#define STM32_LPTIM_CKPOL_RISING_EDGE 0 +#define STM32_LPTIM_CKPOL_FALLING_EDGE 1 +#define STM32_LPTIM_CKPOL_BOTH_EDGES 2 + /* STM32_LPTIM_ARR */ #define STM32_LPTIM_MAX_ARR 0xFFFF