Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3548459ybl; Sun, 1 Sep 2019 15:59:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZewe5kpXl3k87KUem2YnOOHJeCfj0c7ZKgsQY48Ni482yqdzaTZT6uBMYpoopEDAGIA8K X-Received: by 2002:a17:902:a714:: with SMTP id w20mr26531579plq.135.1567378795730; Sun, 01 Sep 2019 15:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567378795; cv=none; d=google.com; s=arc-20160816; b=GUv1m53ZGt7GoQC/y/kpOKaVOOosqG4Kp/3KOHdkLmttiehSB7GFTSvnyKXWOEMOTY W04/65wphiSvCiAg/Ngckfy96i6y7ZA3O0V35x7RsPT9ys+nmJw1Pm7oHVdKnfi2QMzF 0muJBsp3CcHshwNNjFeben8AvwuSPQH29tIKDF1nJY4ovNWuPUphXPp2KwzRkBWChCg+ kHMtp+4L2zy8fXUPfpKIYSOwP04gJ2ozMAEiO2Kelsl4zZSFr6/Q+sw5ttrOGV5Ki8r3 phaLOLtc4gzXvS/3faZAnoADyHTN9JDDh/ZdFLPEvD9uzEj7jBg1BdVIWc+Dw47OU7p9 FHiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=q5I8hNXYUTOVr6qJJGD6VgyFndq2TJGOuDuT4GVouDk=; b=kJcz0+DxTA5d5DGkhRvytRHX6BOjteHYsVQwSpIjwNNE0UkR7ChANVJ7GOWaoGxisU bmK80zlkRr+0NA6E2Un2Zo7B1CFOVbzBomiLCgPf7xfBN4R2YACOU7BWyckrdQApiXN9 oqJOKN1LgTcEl8k75UtCfBXl8IE5UZyCDBztDtJGy6Se8bbHc/nGy5eUfW7P8UyY/3lz /iPZYW4JTmYD2JbrBDkhv96Z7cD/XX/ri2aVSa/23K4cz12EnpuUG1EseRzCDDuG5VTJ BfK95hplgzXw32cNxcx6DmAbb4FUFoyB3fSTB77a8wPUoU7NO5mFgZTG+l95eo3NPJua M15Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=mAzKb4qB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si10247879plt.283.2019.09.01.15.59.39; Sun, 01 Sep 2019 15:59:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=mAzKb4qB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729184AbfIAW6s (ORCPT + 99 others); Sun, 1 Sep 2019 18:58:48 -0400 Received: from vern.gendns.com ([98.142.107.122]:37370 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729048AbfIAW6r (ORCPT ); Sun, 1 Sep 2019 18:58:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=q5I8hNXYUTOVr6qJJGD6VgyFndq2TJGOuDuT4GVouDk=; b=mAzKb4qBMqscx40J8SieYVnJ4w CDyosjONCebl6PiNzSRwIofpGAlYPNofqndaEpMvvk8lvwe1w7fsvH83Tujs96moLqifpQyJnux87 wkDWpRnJlKNZKRAlU8KfmigT6KsWTrRXB191TcLia30td2qHcwWP7Kx7ukmkiz0M15VlJFNVc0ULE 0i33kJnUTMUabzPKXh/lStK2yp9qJZzXMgkqG5NbNR7IRdZ7K76ic7jvivuq8pxkNa2OBX6iHRWrE 8ExsjK/beLyVM8HARyLDpaSa9bEjk8e82W+tGip6D4fkuhu5c2yyjRBihjeei/PfeAmTvYXu6CACe o0IHTW0w==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:58390 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1i4Ynz-000351-RK; Sun, 01 Sep 2019 18:58:43 -0400 From: David Lechner To: linux-iio@vger.kernel.org, linux-omap@vger.kernel.org Cc: David Lechner , Rob Herring , Mark Rutland , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , William Breathitt Gray , Thierry Reding , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Subject: [PATCH v3 0/6] counter: new TI eQEP driver Date: Sun, 1 Sep 2019 17:58:21 -0500 Message-Id: <20190901225827.12301-1-david@lechnology.com> X-Mailer: git-send-email 2.17.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds device tree bindings and a new counter driver for the Texas Instruments Enhanced Quadrature Encoder Pulse (eQEP). As mentioned in one of the commit messages, to start with, the driver only supports reading the current counter value and setting the min/max values. Other features can be added as the counter subsystem gains support for them. v3 changes: - Minor changes to device tree bindings (style and generic node name) - Drop action in initializer - Fix ordering of pm runtime disable v2 changes: - New patch to move TI PWMSS driver from drivers/pwm/ to drivers/bus/ - Device tree bindings converted to .yaml format - Device tree clock renamed from "fck" to "sysclkout" - Dropped unused index and strobe signals from counter driver - Added synapses and actions to counter driver - Fixed base in of kstrtouint() - Clarifications in commit messages This series has been tested on a BeagleBone Blue with the following script: #!/usr/bin/env python3 from os import path from time import sleep COUNTER_PATH = '/sys/bus/counter/devices' COUNTERS = ['counter0', 'counter1', 'counter2'] COUNT0 = 'count0' COUNT = 'count' FUNCTION = 'function' CEILING = 'ceiling' FLOOR = 'floor' ENABLE = 'enable' cnts = [] for c in COUNTERS: function_path = path.join(COUNTER_PATH, c, COUNT0, FUNCTION) with open(function_path, 'w') as f: f.write('quadrature x4') floor_path = path.join(COUNTER_PATH, c, COUNT0, FLOOR) with open(floor_path, 'w') as f: f.write(str(0)) ceiling_path = path.join(COUNTER_PATH, c, COUNT0, CEILING) with open(ceiling_path, 'w') as f: f.write(str(0xffffffff)) enable_path = path.join(COUNTER_PATH, c, COUNT0, ENABLE) with open(enable_path, 'w') as f: f.write('1') cnt_path = path.join(COUNTER_PATH, c, COUNT0, COUNT) cnts.append(open(cnt_path, 'r')) while True: for c in cnts: c.seek(0) val = int(c.read()) if val >= 0x80000000: val -= 0x100000000 print(val, end=' ') print() sleep(1) David Lechner (6): bus/ti-pwmss: move TI PWMSS driver from PWM to bus subsystem dt-bindings: counter: new bindings for TI eQEP counter: new TI eQEP driver ARM: dts: am33xx: Add nodes for eQEP ARM: dts: am335x-boneblue: Enable eQEP ARM: dts: am335x-boneblue: Use of am335x-osd335x-common.dtsi .../devicetree/bindings/counter/ti-eqep.yaml | 50 ++ MAINTAINERS | 6 + arch/arm/boot/dts/am335x-boneblue.dts | 146 +++--- arch/arm/boot/dts/am33xx-l4.dtsi | 27 + drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 1 + drivers/{pwm/pwm-tipwmss.c => bus/ti-pwmss.c} | 0 drivers/counter/Kconfig | 11 + drivers/counter/Makefile | 1 + drivers/counter/ti-eqep.c | 473 ++++++++++++++++++ drivers/pwm/Kconfig | 9 - drivers/pwm/Makefile | 1 - 12 files changed, 634 insertions(+), 100 deletions(-) create mode 100644 Documentation/devicetree/bindings/counter/ti-eqep.yaml rename drivers/{pwm/pwm-tipwmss.c => bus/ti-pwmss.c} (100%) create mode 100644 drivers/counter/ti-eqep.c -- 2.17.1