Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7416402ybi; Mon, 22 Jul 2019 12:47:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM16grQcBgermww97UhKevp8JtnBcKEGX/DEkbo+pXJkI8AOMBqpjY1S+o0zDS2R0pGGIs X-Received: by 2002:a62:e417:: with SMTP id r23mr1785746pfh.160.1563824878572; Mon, 22 Jul 2019 12:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563824878; cv=none; d=google.com; s=arc-20160816; b=wP4DSW+uaV/zpvUvxmdugKG2OiK3aABjinOISZ9a34vm77X97od6g9SeeME9ji6Kpe 9RDZlye10oqGb/OJMuv4xPs/KZnxT+FErBICkMuCkQZrfpLWCjgJRgVnZ1EeczIN2V65 Hg3CIKfB5r6Qz0L9zzktKxlkAwDiEgHwmrk/1tuY8S1g47i1UlRvWyFIwaMFZ14Igmf9 3AxFX/l+RYTckzx5BHAXGP4sHn3Ky9NEfdYVY97iwLQsl13ne0bKkCl0LuiOfK/8sRQh cVB/x/rkNNd9ulVCc0WT1xfV04QvVbMHUTEnKf3hBXukbEvb7s2yGNjMyNKUoyyAbiFv Ftng== 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=1innLmemI1YK9z1CEeqUt59/OsFQDgFrRWTZveqQDFo=; b=g+GX5lTIH266P3JSx+T/4lqs7jQWVSnBJprZDFtVhqSnX7FC7NIuE+xJY+S4/FR8Uu 0y7YCGiB77JJdzbbHFqE0IfBtMyMKOhx9SjxePwkOJ7sJuoJ8rA1h3QcB/pDhADoZt8J u6Ve/iIdr473OH+qjMXeo9tMwV0HSPKua9MYLu7XcjHQz9Ggl0zw9POyPlJzrdjGN8W5 6cCA5uR0ONHrguNBJWpRcPBK6TbiAyKYzoxKncQD3JTo2koAdZIKZyXhzVXJPoKvvZ4l c1c/dAjkfbYK20e5HNbKwypKaMk/SnOAQOzQVGyEQ8w+6KyAcMWy9QDbexi84k4rZ6yl cX6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=et8rX0i0; 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 co12si9128882plb.197.2019.07.22.12.47.42; Mon, 22 Jul 2019 12:47:58 -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=et8rX0i0; 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 S1729143AbfGVPqU (ORCPT + 99 others); Mon, 22 Jul 2019 11:46:20 -0400 Received: from vern.gendns.com ([98.142.107.122]:44082 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbfGVPqU (ORCPT ); Mon, 22 Jul 2019 11:46:20 -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=1innLmemI1YK9z1CEeqUt59/OsFQDgFrRWTZveqQDFo=; b=et8rX0i0bdlwCoihML2rE8CE+n WJlLtDVFMTum0shQ6D8BN1OfsfGGA/hRMaI+G0RP5LhKxJppFjFfSHj9OA57O+cbWy71lYBShYBO0 p0lEpgEGkLFZETJw6lwqJ3Oe5UF9Z9RJHiilz4oN0ZWwBnhHUHLaOgBj+c2M0ASps2h2ymfgNsu8d /gyna72Cyg9n5ldNIAg3DIOJZ838RwxBiZQiC3sqBFTHQ+98Gfod4Axeum0HDsUGZV7Q3uWgTba/j f38J10it5JtaduHPEn2eqWoX061t+RFBZbCHkgXp2nxLj1yDC4QvFT+aEMYnVwADJtNg0B9P4CBHJ HLlDiGzA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:44690 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1hpaW1-006p1O-CJ; Mon, 22 Jul 2019 11:46:17 -0400 From: David Lechner To: linux-iio@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org Cc: David Lechner , Rob Herring , Mark Rutland , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , William Breathitt Gray , Thierry Reding , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Subject: [PATCH 0/4] new driver for TI eQEP Date: Mon, 22 Jul 2019 10:45:34 -0500 Message-Id: <20190722154538.5314-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 on an as-needed basis. The only other feature I am interested in is adding is getting time data in order to calculate the rotational speed of a motor. However, there probably needs to be a higher level discussion of how this can fit into the counter subsystem in general first. 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' CEILING = 'ceiling' FLOOR = 'floor' ENABLE = 'enable' cnts = [] for c in COUNTERS: enable_path = path.join(COUNTER_PATH, c, COUNT0, ENABLE) with open(enable_path, 'w') as f: f.write('1') ceiling_path = path.join(COUNTER_PATH, c, COUNT0, CEILING) with open(ceiling_path, 'w') as f: f.write(str(0xffffffff)) 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 (4): 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 .../devicetree/bindings/counter/ti-eqep.txt | 18 + MAINTAINERS | 6 + arch/arm/boot/dts/am335x-boneblue.dts | 54 +++ arch/arm/boot/dts/am33xx-l4.dtsi | 27 ++ drivers/counter/Kconfig | 12 + drivers/counter/Makefile | 1 + drivers/counter/ti-eqep.c | 381 ++++++++++++++++++ drivers/pwm/Kconfig | 2 +- 8 files changed, 500 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/counter/ti-eqep.txt create mode 100644 drivers/counter/ti-eqep.c -- 2.17.1