From patchwork Wed Apr 15 13:04:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel Bouhara X-Patchwork-Id: 202006 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=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 357C7C3815B for ; Wed, 15 Apr 2020 13:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13FC020737 for ; Wed, 15 Apr 2020 13:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505915AbgDONFe (ORCPT ); Wed, 15 Apr 2020 09:05:34 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:33033 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505892AbgDONFL (ORCPT ); Wed, 15 Apr 2020 09:05:11 -0400 Received: from localhost (unknown [78.193.40.249]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 6D846240006; Wed, 15 Apr 2020 13:05:00 +0000 (UTC) From: Kamel Bouhara To: William Breathitt Gray , Rob Herring , Mark Rutland , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Cc: Thomas Petazzoni , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Kamel Bouhara Subject: [PATCH v3 1/3] ARM: at91: add atmel tcb capabilities Date: Wed, 15 Apr 2020 15:04:53 +0200 Message-Id: <20200415130455.2222019-2-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200415130455.2222019-1-kamel.bouhara@bootlin.com> References: <20200415130455.2222019-1-kamel.bouhara@bootlin.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some atmel socs have extra tcb capabilities that allow using a generic clock source or enabling a quadrature decoder. Signed-off-by: Kamel Bouhara --- Changes from v3: - Added missing kernel doc for new elements introduced in structure atmel_tcb_config. Changes from v2: - Fixed first patch not applying on mainline include/soc/at91/atmel_tcb.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/soc/at91/atmel_tcb.h b/include/soc/at91/atmel_tcb.h index c3c7200ce151..1d7071dc0bca 100644 --- a/include/soc/at91/atmel_tcb.h +++ b/include/soc/at91/atmel_tcb.h @@ -36,9 +36,14 @@ struct clk; /** * struct atmel_tcb_config - SoC data for a Timer/Counter Block * @counter_width: size in bits of a timer counter register + * @has_gclk: boolean indicating if a timer counter has a generic clock + * @has_qdec: boolean indicating if a timer counter has a quadrature + * decoder. */ struct atmel_tcb_config { size_t counter_width; + bool has_gclk; + bool has_qdec; }; /** From patchwork Wed Apr 15 13:04:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel Bouhara X-Patchwork-Id: 202005 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=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 93832C38A2E for ; Wed, 15 Apr 2020 13:05:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71D9020737 for ; Wed, 15 Apr 2020 13:05:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505908AbgDONFx (ORCPT ); Wed, 15 Apr 2020 09:05:53 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:47305 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505896AbgDONFL (ORCPT ); Wed, 15 Apr 2020 09:05:11 -0400 X-Originating-IP: 78.193.40.249 Received: from localhost (unknown [78.193.40.249]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 9671DFF80A; Wed, 15 Apr 2020 13:05:08 +0000 (UTC) From: Kamel Bouhara To: William Breathitt Gray , Rob Herring , Mark Rutland , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Cc: Thomas Petazzoni , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Kamel Bouhara Subject: [PATCH v3 2/3] dt-bindings: counter: microchip-tcb-capture counter Date: Wed, 15 Apr 2020 15:04:54 +0200 Message-Id: <20200415130455.2222019-3-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200415130455.2222019-1-kamel.bouhara@bootlin.com> References: <20200415130455.2222019-1-kamel.bouhara@bootlin.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Describe the devicetree binding for the Microchip TCB module. Each counter blocks exposes three independent counters. However, when configured in quadrature decoder, both channel <0> and <1> are required for speed/position and rotation capture (yet only the position is captured). Signed-off-by: Kamel Bouhara --- Changes from v3: - Updated the brand name: s/atmel/microchip/. Changes from v2: - Fixed errors reported by dt_binding_check .../counter/microchip-tcb-capture.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/counter/microchip-tcb-capture.yaml diff --git a/Documentation/devicetree/bindings/counter/microchip-tcb-capture.yaml b/Documentation/devicetree/bindings/counter/microchip-tcb-capture.yaml new file mode 100644 index 000000000000..183e9ee4c049 --- /dev/null +++ b/Documentation/devicetree/bindings/counter/microchip-tcb-capture.yaml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/counter/microchip-tcb-capture.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip TCB Counter + +maintainers: + - Kamel Bouhara + +properties: + compatible: + const: "microchip,tcb-capture" + + reg: + description: TCB capture channel to register as counter device. + Each channel is independent therefore only one channel is + registered by default execpt for the QDEC mode where both TCB0's + channels <0> and <1> are required. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + tcb0: timer@f800c000 { + compatible = "microchip,tcb-capture"; + reg = <0>, <1>; + };