From patchwork Mon May 11 14:05:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel BOUHARA X-Patchwork-Id: 11540955 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DBD192A for ; Mon, 11 May 2020 14:05:41 +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 07D29206D3 for ; Mon, 11 May 2020 14:05:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rq5sgfwh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07D29206D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hdmBNo/DxejyMcGCWoS0khmWVjhsaVJPAZNoxOmh81o=; b=rq5sgfwhUxVcMV wGZG9U0voSz4rGd9WT7TdpbWoWTCa5lZoI7PZ7SiR8SYMGOTYCACRttM97rfBkG9le4szWZKcfx5R XGufsBxkhVfOpLUzA9+z3iQkR/JYvsS0/9ft2ACc1N+q1Ww1hhIS+1aN3UTbTO9kUFbnFHRpsRJfR kHqjr4O3w27yl0uGHrHexYOKu+F56WfScujfpfeDnJYirlbu7opT64jHaayIQ4lP4Xg7GQOn21gjU ubqhS9aI/BI9OLI7mZAXfjxzza6lpMDg0sWZr2ygKk9EUGnV29iH7JFMza6pC0lYKkFGMU36m+OQ4 UqXGThll3Fi6lKjd4erQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY93j-0001Hz-9A; Mon, 11 May 2020 14:05:31 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY93g-0001Ex-Az for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2020 14:05:29 +0000 X-Originating-IP: 78.193.40.249 Received: from localhost (unknown [78.193.40.249]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A0EDD20008; Mon, 11 May 2020 14:05:22 +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 Subject: [PATCH v4 0/5] Microchip TCB Capture driver Date: Mon, 11 May 2020 16:05:00 +0200 Message-Id: <20200511140505.1649111-1-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200511_070528_518110_64A66F02 X-CRM114-Status: GOOD ( 14.46 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.200 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Kamel Bouhara , Thomas Petazzoni , linux-input@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hello, Here is a new counter driver to support Microchip TCB capture devices. Each SoC has two TCB blocks, each one including three independent channels.The following series adds support for two counter modes: increase and quadrature decoder. As for the atmel clocksource and pwm, the counter driver needs to fill some tcb capabilities in order to operate with the right configuration. This is achieved in first patch of this series. Please feel free to comment. Cheers, Changes in v4: - Use existing binding to document capture mode of the Microchip TCBs. Changes in v3: - Updated the brand name: s/atmel/microchip/. - Added missing kernel doc for new elements introduced in structure atmel_tcb_config. - Removed useless blank line - Added an explicit clock removing path using devm_add_action_or_reset Changes in v2: - Fixed first patch not applying on mainline - Updated return code to -EINVAL when user is requesting qdec mode on a counter device not supporting it. - Added an error case returning -EINVAL when action edge is performed in qdec mode. - Removed no need to explicity setting ops to NULL from static struct as it is the default value. - Changed confusing code by using snprintf for the sake of clarity. - Changed code to use ARRAY_SIZE so that future reviewers will know that num_counts matches what's in the atmel_tc_count array without having to check so themselves. - Fixed errors reported by dt_binding_check Alexandre Belloni (2): dt-bindings: atmel-tcb: convert bindings to json-schema dt-bindings: microchip: atmel,at91rm9200-tcb: add sama5d2 compatible Kamel Bouhara (3): ARM: at91: add atmel tcb capabilities dt-bindings: counter: microchip-tcb-capture counter counter: Add microchip TCB capture counter .../devicetree/bindings/mfd/atmel-tcb.txt | 56 --- .../soc/microchip/atmel,at91rm9200-tcb.yaml | 172 ++++++++ drivers/counter/Kconfig | 11 + drivers/counter/Makefile | 1 + drivers/counter/microchip-tcb-capture.c | 397 ++++++++++++++++++ include/soc/at91/atmel_tcb.h | 5 + 6 files changed, 586 insertions(+), 56 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mfd/atmel-tcb.txt create mode 100644 Documentation/devicetree/bindings/soc/microchip/atmel,at91rm9200-tcb.yaml create mode 100644 drivers/counter/microchip-tcb-capture.c --- 2.25.0