Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1002501ybb; Wed, 8 Apr 2020 14:21:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJOLVqjNEFDn/RK7JFtVh4J+geUtC9MlajtVK03GfkN6chDl6vJyW2fnHkGdxaUsSkel62D X-Received: by 2002:aca:3255:: with SMTP id y82mr4173330oiy.44.1586380890998; Wed, 08 Apr 2020 14:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586380890; cv=none; d=google.com; s=arc-20160816; b=VRG5Dy+tZF4kNCdGLRMcvnZYhZkLewPSl8UwzNNqQP5ngBSkOeu/4fX7KVTPxGhXrP DsknIQHBFdGMqgDJH81z1XAM9lixAXyjv8cieAwT4omxafUwVlBoygT3Tw3knJv2fF3v /cK2Vm5AXnra7iWcizsYmcYqtyfRnCDEvyQiQSVqf6gQJMXErKB+uR8PPQD4G7PxycGn vwX3DaS9GmExOaJl9973K/tolLPzJxL6GuKP5zBMUF3twc2DV8Y416GCku9UCgaEyCHJ 0kdrXHH3UECnb0vennh9J7qnEcbxE9xDwek5SvR+jODQfe20UcqGJP+Z65sASNeANt9B Jkow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EVMc1OHJHB8VvA0TWlbmWmPavYiZYAI6v/n+zzq1Wf0=; b=ZAMQl3jvIWhXorJfySSA/JfrEL6XvWQDgoOvsu8kBUaU0VDInk4vyjevxlF1xJkkYU 89BS+9vTClJi0njMpj8NRZQYJle9DeZGVfJKxbjK5wUR+LSinz9N9de/t4PMLk+oVk3V CPeBxaOhdwNkXTPEIvAdYazZ3OFzVNak2Fxz3x4xJQgHx2Rc6wjq0WfGtg0K6l/QQVBK eFxEzCC2phy8hMx4k2BhbHqsFWKNnOR4zMkYMwX8rTvVj+VZKf9pchU3LzeFPps9wTGs SxeOhtlOFZ5Ll9epTeaw/9zvT85r8efGztOsEViIqoG+UwNqcXnhu3z70t20y0bLRPf9 J3Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="JlEGM/DO"; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l65si2433270oig.156.2020.04.08.14.21.18; Wed, 08 Apr 2020 14:21:30 -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=@chromium.org header.s=google header.b="JlEGM/DO"; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730523AbgDHRKn (ORCPT + 99 others); Wed, 8 Apr 2020 13:10:43 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:41785 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbgDHRKn (ORCPT ); Wed, 8 Apr 2020 13:10:43 -0400 Received: by mail-io1-f65.google.com with SMTP id b12so842701ion.8 for ; Wed, 08 Apr 2020 10:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EVMc1OHJHB8VvA0TWlbmWmPavYiZYAI6v/n+zzq1Wf0=; b=JlEGM/DOa4q8siqwVYUAftU8gmZWjOLtOYJEE+Bp5LCO4tlR1jInMjHa136elkQI5X fM45YgN4JD3Wm3RtLmMIac1umB86TBoz7VTMsdvJzqdYMKwkFn6ta31nyfuRuxYniSow reddZXCDRqSsCYkcqfJA8aQ7XAHdHC0hXldCo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EVMc1OHJHB8VvA0TWlbmWmPavYiZYAI6v/n+zzq1Wf0=; b=pZj7tWEOzhE06PbfyB7EGP3Dk5C9eBNvE+cnbK45ie1ZqlMgzTK3cruX01O+dpGuEx lnTPh7RnB55ekAQsexnax4ZgTavjlbdUv13EqjjLG496TNM6yVab6OuCvg5vVbwq/KpW ItjsqiEy9doOeN+DryI6yr6vTtEq6jc/Yxr5IC7Pug6sWnyDUO33SZAQvye90aDze/j6 9snrpTLjRWz+a5Lhp37mCi/BFD4wx9lUoW5I19U096I2DL7HAV6DHwytsESBvtt0dOVJ B90vKAYbstBt6AvI2gqpcYak0sLdR4M2mFW8tAxsstCXQ60Fy5UojJZ+Dw8+ZonnW5Cl q0Hg== X-Gm-Message-State: AGi0PuZ2mtC0J4I1JhmsLiJgt4A7Od5jBh4BCVGtu2ObkU/IKDptzHnA WbxL5wwP3kAEKr4zKEJBlR7c5UJ5AMQhII4JoKXaYQ== X-Received: by 2002:a02:cac4:: with SMTP id f4mr7518997jap.51.1586365841562; Wed, 08 Apr 2020 10:10:41 -0700 (PDT) MIME-Version: 1.0 References: <20190826095612.7455cb05@archlinux> <8abbe9360938ab851d16c2c1494ba56034775823.camel@collabora.com> <6b50bdff184e6af664b7a61e0a8a2cddc5718f0a.camel@collabora.com> <20191110151408.GB3984@icarus> <20191111114955.00001031@huawei.com> <20191112011618.GA62259@icarus> In-Reply-To: <20191112011618.GA62259@icarus> From: Gwendal Grignou Date: Wed, 8 Apr 2020 10:10:28 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] counter: cros_ec: Add synchronization sensor To: William Breathitt Gray Cc: Jonathan Cameron , Jonathan Cameron , Fabien Lahoudere , Enrico Granata , Collabora kernel ML , Jonathan Corbet , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Lee Jones , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Nicolas Ferre , Nick Vaccaro , linux-iio , linux-doc@vger.kernel.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I resend a counter driver for the EC at https://patchwork.kernel.org/patch/11479437/ I tried a timestamp only IIO sensor, but this is not allowed, as the timestamp channel is very specific: no extended parameters can be added. I did not add a COUNTER_COUNT_TALLY type, as a newer function COUNTER_COUNT_FUNCTION_INCREASE, fits the counter better. I am still using IIO_COUNT (inspired by the st counter driver) to gather the event in real time on the iio side. Gwendal. On Mon, Nov 11, 2019 at 5:16 PM William Breathitt Gray wrote: > > On Mon, Nov 11, 2019 at 11:49:55AM +0000, Jonathan Cameron wrote: > > On Sun, 10 Nov 2019 10:14:08 -0500 > > William Breathitt Gray wrote: > > > > > On Tue, Sep 24, 2019 at 04:20:51PM +0200, Fabien Lahoudere wrote: > > > > Hi all, > > > > > > > > After some discussions and investigation, the timestamp is very > > > > important for that sync driver. > > > > Google team uses that timestamp to compare with gyroscope timestamp. > > > > > > > > So the important data is timestamp and counter value is useless. > > > > Just the event of counter increment is important to get a timestamp. > > > > > > > > In that case, my idea was to just use an IIO driver with a single > > > > channel with IIO_TIMESTAMP. We discuss this here and it seems > > > > controversial. > > > > > > > > So my question to Jonathan is if we have a timestamp coming from the EC > > > > itself, can we consider this timestamp as a good IIO driver? > > > > > > > > Any other idea is welcome, however Google team would like to manage > > > > only IIO drivers if possible. > > > > > > > > Thanks > > > > > > Jonathan, > > > > > > Should the the timestamp from the EC be introduced as an IIO driver > > > using IIO_TIMESTAMP? > > > > It is is a rather odd driver but I suppose it would be fine with lots > > of clear docs on why it is how it is... > > > > > > > > Since there is no corresponding EC Counter driver in the baseline right > > > now we don't have a conflict yet. If the EC timestamp is introduced as > > > an IIO driver then we should make any future EC Counter driver mutually > > > exclusive with the IIO driver in order to prevent any memory space > > > conflict. At that point we may deprecate the IIO driver and move the > > > timestamp functionality to the corresponding Counter driver. > > > > That route does become somewhat of a mess so I suspect we'd have to have > > a single driver supporting both userspace interfaces. If you are happy > > that we'd be adding a bit of legacy to support for ever then we can go > > that way. > > Generally I'd prefer all components of a device to be supported, but > if this is as Fabien suggests that due to the nature of this particular > device the counter value is of no interest, then a Counter driver is of > little practical use here. In this particular case, it seems better to > restrict the driver support to just the timestamp functionality that > will be used, rather than introduce extra code to expose values that > will likely be ignored and risk adding code to the kernel that becomes > unmaintained due to lack of exposure or interest. > > William Breathitt Gray > > > > > > > > > That's assuming someone is interested in the Count component enough to > > > implement an EC Counter driver; otherwise, the IIO driver will serve > > > just fine if timestamp is the only data desired from this device. > > > > > > William Breathitt Gray > > > >