Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11127832ybi; Thu, 25 Jul 2019 10:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9LMBES4EIBlFFL9SkdX0Y6sauSnqukBRQpuq1fQSWzjtR7IQwHregxhuvV8f9ZjGm19Sb X-Received: by 2002:a63:1d2:: with SMTP id 201mr52782606pgb.307.1564075611460; Thu, 25 Jul 2019 10:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564075611; cv=none; d=google.com; s=arc-20160816; b=srKQk9814j69rxFSRoSJoF5KSkKNbecfaLOAQfLLiJSJZ6tvJiveIGK7sHqNOqYqc3 kiFxCp8tkOAGWft6MKhnURVT3E5FjLDB0A8VHt/zAaOHwveZazU40NSL3DY8liNmDArV Wa7omYTc2Xuu/qHUx2MRnAVyQR9YFL5Ff5pE7bccyGHUitaOD1nviRRlBRiWYlhTj8Z9 HNuCys+JVb761ZnSjCUtInLpMkDiVeez1avSB2Av6d5t2Tky12o6dPVDzHc+uTtmW65s Dh5Yu/PLPiiraaNpmC6JQu//nPFYLb3p6wvbeO7hEilvQfY9vv0UNCZ5vbm+1FdOd/Sw xEFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=J/ML/61niP752oM19bE97gL7v9QOrp5SMkL6UiNcqYE=; b=deShaTMrUMGmOnLXFF116UWBwxm+5Q1K1S0QDc6vInBDGZ37ssb7jCEA8DuL8k9pvj 2krh6nxeaLF1cAsrld/StHlltRO6wMi95XwLnaZ9dwiByjCBq6xnaflWT0GkmHCjtd76 tiFE82NBLVvdh1JNCCqGQ7QlCzvvdWqkwndjf+WDtXjwRV828VY0Kb1aU0ZvCV0QKeJh eUqcfo9NbGCTTK5ToUWk4ifQ4Y1mWf0g7xKLRhZU4zUHgtj3KE3Ay/FQWkqU2xbgB8q2 Af8ZcafvjAYdACEGsLPbRaGlSIj9loz29VaoTHShOH+zsImzHeBBF45NwZBaNkfks9Rd qJCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PY7ogkWJ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b41si16844187pla.409.2019.07.25.10.26.36; Thu, 25 Jul 2019 10:26:51 -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=pass header.i=@gmail.com header.s=20161025 header.b=PY7ogkWJ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388650AbfGYMk6 (ORCPT + 99 others); Thu, 25 Jul 2019 08:40:58 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39330 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388147AbfGYMk5 (ORCPT ); Thu, 25 Jul 2019 08:40:57 -0400 Received: by mail-pf1-f195.google.com with SMTP id f17so18714567pfn.6; Thu, 25 Jul 2019 05:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=J/ML/61niP752oM19bE97gL7v9QOrp5SMkL6UiNcqYE=; b=PY7ogkWJSakBzZPZF4n2rjhfrfmSkjdugD/7CnQ2AqUGOsDzDMnWigVTfJnXOSd/nG OHvI4U1bWrzJc10q0ELDmuahZITR4TYwVJ3U2w7H6z7M1oLchLHnOOLYol3n/ELqfIHN +0MsLULuJdKSSZKIOOevgIyn+nmTJawaLgthP5bamahLF47jndtaNLyi+gIXTQobQVkL BIoSjO7QJEgIPzV6C2CyBOvtdA8yhr4972R5ZnEwIgmCPjEarOszKBCWPqWlaGYKnNaa yI1pmOeXcdlYxTV7oKBhiOVlLC7umlDnqTBUZOm4Z/uTcEkK6sKwX540uFSaK9HVZHFu OWvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=J/ML/61niP752oM19bE97gL7v9QOrp5SMkL6UiNcqYE=; b=YjYhDo3BE4SFpmr7ovwvKcdoCLIjldpREzmO76ZQUcZaR9HNPaTttkBl3rIKfYDAfA TMIGl6TInS+Tu5nrbJHO8kAOjAM5YwXgLDNLOk+MPdlolsn9y21m6KCYDlQCYTNgtXqr 5E0V6KI1Nx7cFSkGphjWjOQn7t0/afJFD9GmrRBL5JjupMHmV6f7NJUH8KChPRabVF0y x8F6GvlBb5AkKVxqR+HNbUW7tuqMiVTyKTfvOEyJRribVQJpTXJxTJnb59xDdZDAZ4sn d3f+ilsO81DCyXY8vQYMAfAl6zibI6LpqEul26zb0h3xpomttGazBApKLiCmKMGa47qZ EeuA== X-Gm-Message-State: APjAAAW2X71VreSNqLWvQGsb23pNn/zXDtCWk2c6DhpJ5wrtVYIGME9a N7ty6BdjW34ZljQwAxGeCSE= X-Received: by 2002:aa7:9786:: with SMTP id o6mr16119807pfp.222.1564058456426; Thu, 25 Jul 2019 05:40:56 -0700 (PDT) Received: from icarus ([2001:268:c144:ff3:774d:cc30:25fc:d4ac]) by smtp.gmail.com with ESMTPSA id n7sm57496320pff.59.2019.07.25.05.40.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jul 2019 05:40:55 -0700 (PDT) Date: Thu, 25 Jul 2019 21:40:37 +0900 From: William Breathitt Gray To: David Lechner Cc: linux-iio@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Mark Rutland , =?utf-8?Q?Beno=C3=AEt?= Cousson , Tony Lindgren , Thierry Reding , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Subject: Re: [PATCH 0/4] new driver for TI eQEP Message-ID: <20190725124037.GA4802@icarus> References: <20190722154538.5314-1-david@lechnology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190722154538.5314-1-david@lechnology.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 10:45:34AM -0500, David Lechner wrote: > 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. I believe exposing some sort of time data has merit. Quadrature counter devices in particular are commonly used for position tracking of automation systems, and such systems would benefit from velocity/speed information. So let's try to introduce that sort of functionality in this driver if possible. First, let's discuss your specific use case and requirements, and hopefully we can generalize it enough to be of use for future drivers. From your description, it sounds like you're attaching some sort of rotary encoder to the eQEP device. Is that correct? What sort of time data are you hoping to use; does the eQEP device provide a clock value, or would you be grabbing a timestamp from the system? I'm not sure yet if it would make sense to expose rotational speed directly as an attribute. If we were to expose just the count value and timestamp since the last read, that should be enough for a user to compute the delta and derive speed. I'll think more about this since some devices may simplify that case if the hardware is able to compute the speed for us. William Breathitt Gray