From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no 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 D63A6C2BA2B for ; Thu, 9 Apr 2020 14:14:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8DCD20857 for ; Thu, 9 Apr 2020 14:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbgDIOOF (ORCPT ); Thu, 9 Apr 2020 10:14:05 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:35475 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727235AbgDIOOF (ORCPT ); Thu, 9 Apr 2020 10:14:05 -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 DA6E3FF808; Thu, 9 Apr 2020 14:14:02 +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 v2 0/3] Atmel TCB capture driver Date: Thu, 9 Apr 2020 16:13:58 +0200 Message-Id: <20200409141401.321222-1-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Hello, Here is a new counter driver to support Atmel 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 from 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. Kamel Bouhara (3): ARM: at91: add atmel tcb capabilities dt-bindings: counter: atmel-tcb-capture counter counter: Add atmel TCB capture counter .../bindings/counter/atmel-tcb-capture.yaml | 35 ++ drivers/counter/Kconfig | 11 + drivers/counter/Makefile | 1 + drivers/counter/atmel-tcb-capture.c | 394 ++++++++++++++++++ include/soc/at91/atmel_tcb.h | 2 + 5 files changed, 443 insertions(+) create mode 100644 Documentation/devicetree/bindings/counter/atmel-tcb-capture.yaml create mode 100644 drivers/counter/atmel-tcb-capture.c -- 2.25.0