Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3934479ybz; Mon, 20 Apr 2020 12:10:19 -0700 (PDT) X-Google-Smtp-Source: APiQypLSceuDIDu8WPec5MC17RW74l3POABA5iFWK5e/8UmITiYllM0q49GwJJ4+zcQ5TLk3vcbd X-Received: by 2002:a05:6402:b2e:: with SMTP id bo14mr3583686edb.90.1587409819273; Mon, 20 Apr 2020 12:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587409819; cv=none; d=google.com; s=arc-20160816; b=OFQhOOqrzBmmdanbbpH/3/DXxF8ysDIubwLKYRS6QMSVP/GinutrqyOstEkGykgjzc PnBBM9ykvq8S5Qo/VMjKQMXI9no6aNP3cksdnhVIe6ez0P1OQfB/TY1pllKSEZjgOtHB VdEYE9v6fnubpe8/UcUzFFvca/MXylUnYT9htUoZ44QQe72tz67Nk/ylFI6MRIopWYCZ RtAcMoLN3u7X64R3gCtVMH4w9A5SYrXbH8FhEz+5CBUnWC8Fp3zsOzbY4mxpc/0mWVsB s6GxBGOYWVCzYslQT0H9UDflFrVsmTQF73IcKnNOzMRAOjSRu+bdzHplQuoLnfARfHqB tmfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=H3Jg3tG9mOP7tMGOLglwmln0MBz8ObmXMf+JASaNH08=; b=CIBK7k/BQ+JzPEDrva/9XFwl2AU4gYFWBDD0s4vU0NryFjitHr14nCA0XtPYqZF/N1 cmXUN+kKkkNiy/IhhTYRt7ehmE46Gu/SIL907uYcLK6cld4gIPXbC+G8vQafSD3SdZgA pBOTf2k26De4aBhK6rsZR53dWQde+flTi+591FgiGNG+84lIA/heW9pQE3RJTJmWsEMc 6rsIVaJkJCjBFvcuLCStLqsljJElOEZG4t/sNq5K7or9rHGzHPSKcrJ4PSoSkGULm/3c rqQQarXXmb160RG3tINADzPCp4W2Y5/DzuUpEVe1OQ99PD8/VEgVKJMfG0az2A9v0xNR 7fBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sJ0Pqwkj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id a19si100926ejs.131.2020.04.20.12.09.55; Mon, 20 Apr 2020 12:10:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sJ0Pqwkj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726692AbgDTTIw (ORCPT + 99 others); Mon, 20 Apr 2020 15:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725896AbgDTTIw (ORCPT ); Mon, 20 Apr 2020 15:08:52 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AF85C061A0C; Mon, 20 Apr 2020 12:08:51 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id j4so11899017qkc.11; Mon, 20 Apr 2020 12:08:51 -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; bh=H3Jg3tG9mOP7tMGOLglwmln0MBz8ObmXMf+JASaNH08=; b=sJ0PqwkjLvBvuf2g+GVKZUikKq4EiCL6XVrnPp6yMjFoiogoqIwOMSj4ydUKKkfoQc QA0Muf96g9gTXkat2x24I/kORZ2Aw3euk0noHRJrbZ0RzYZOGPqD4X6tc4bhw1IUX37w jOiGfRgX6I88dne3WkL9vNRudoxD9dWfpFYcZwkysTKplFm67VJThkLQdSdWU0lPlbHu uh7R7T1cLmH6c1MFrE5Z+sxUqTjPjaH8DV7Ucv6y3gTdeTzjGkCr+Bvzr9ceWvxnOrqr VPB+PKOmQdrZtj8/3GRH0Ih38xgeSl/VgV658w6lcu8w4XC9AQjCueUAUJbzOmcH5gkw TvtA== 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; bh=H3Jg3tG9mOP7tMGOLglwmln0MBz8ObmXMf+JASaNH08=; b=Ehe46LLG+tcaH55Z6cf1si5hirD6hNSZDhrE/Mfpm6bvII19okii+ncdc1GYRcI4EP eOhfOmhZHSGhCbHYmn+RfFjzKegem2ht0d/x5J2LJKCKXNxcMgRdac6xLJ7Wg14p+uTg +0sC2Sf6iX45m+/bST9fccglGyXnHqvztcFP4ZR4phZx6BSLq/L6imOk5FiLcJFqP2Y9 UavqkQlOqhg5SmFcSyKDmcunf4zBsu/w8uN9nItkinVb5mzJJoSWR8EZCYATFBpBwZlK 52JaV0oq7StwOTmY0xmlJ5QQBh0KrouddmTKeorlSeQmHCzWietKVABhO3KqTWAGWFXs fkqg== X-Gm-Message-State: AGi0PubwOwSrAWa19Lyt5AZVzo7DCT4K//ND/VUSjsAe7SggvGZrYCNO XnN6Zm+KYhdez16MXs6mbbU= X-Received: by 2002:a37:e112:: with SMTP id c18mr17010881qkm.467.1587409730812; Mon, 20 Apr 2020 12:08:50 -0700 (PDT) Received: from icarus (072-189-064-225.res.spectrum.com. [72.189.64.225]) by smtp.gmail.com with ESMTPSA id u190sm274784qkb.102.2020.04.20.12.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 12:08:49 -0700 (PDT) Date: Mon, 20 Apr 2020 15:08:10 -0400 From: William Breathitt Gray To: Gwendal Grignou Cc: Enric Balletbo i Serra , Jonathan Cameron , Benson Leung , Guenter Roeck , linux-kernel , linux-iio Subject: Re: [PATCH v2] drivers: counter: Add Cros EC Sync counter Message-ID: <20200420190810.GA16124@icarus> References: <20200413195514.192868-1-gwendal@chromium.org> <20200414204814.GH7347@icarus> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --DocE+STaALJfprDB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 20, 2020 at 11:54:16AM -0700, Gwendal Grignou wrote: > On Tue, Apr 14, 2020 at 1:48 PM William Breathitt Gray > wrote: > > > > On Mon, Apr 13, 2020 at 12:55:14PM -0700, Gwendal Grignou wrote: > > > When the camera vsync pin is connected to the embedded controller (EC= ) of > > > a chromebook, the EC reports a sensor with a counter that increases > > > at each GPIO rising edge. > > > > > > The sensor is presented using the counter subsystem. > > > In addition, it is also presented via the IIO subsystem with a timest= amp, > > > allowing synchronisation with sensors connected to the same EC, for > > > image stabilisation or augmented reality applications. > > > > Hi Gwendal, > > > > Sorry for the delay. I have some changes requested below. > > > > > To enable the counter: > > > via counter ABI: > > > echo "rising edge" > counterX/count0/signal_action > > > via iio ABI > > > echo 1 > iio:deviceY/en > > > > > > To disable the counter: > > > via counter ABI: > > > echo "none" > counterX/count0/signal_action > > > via iio ABI > > > echo 0 > iio:deviceY/en > > > > Although in theory a user could manually disable the actions for a > > Signal, this is a very roundabout way of actually disabling the Count. > > It's better to expose an "enable" attribute to allow the users to > > perform this functionality; for example: > > > > echo 0 > counterX/count0/enable > > echo 1 > counterX/count0/enable > > > > > > > > To read the current counter value: > > > via counter ABI: > > > cat counterX/count0/count > > > via iio ABI > > > cat iio:deviceY/in_count_raw > > > > I know we discussed this in the last review but it's still the same as > > before: IIO_COUNT interface is deprecated so new drivers won't be > > allowed to use it. You'll have to remove the IIO_COUNT code in this > > driver and replace it with Counter subsystem equivalents. > I understand the need of a clean separation between counter and IIO subsy= stems. > I will wait for counter to offer a way to gather timestamp'ed counts. > Do you have a plan/proposed ABI you can share? >=20 > Thanks, >=20 > Gwendal. Hi Gwendal, I'm working on a reimplementation of the internals of the Counter subsystem: https://gitlab.com/vilhelmgray/iio/-/tree/counter_chardev I'm hoping to submit it to the mailing list later this week if I don't hit any delays; it'll include support as well for a character device interface for userspace application. Once those changes are merged into IIO, I'll submit a patch to add timestamp support -- hopefully within a week or two after. Right now I haven't yet chosen any specific format for timestamps, but I will likely match the format IIO subsystem currently has for its timestamp support so that migration is easier for these drivers. William Breathitt Gray --DocE+STaALJfprDB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAl6d8xoACgkQhvpINdm7 VJLvUBAAvbUJPNJWuqxWg5+I1tHr2pK+fwO7yuy65gwXG7V8n0kaZ5XqnZfwoO5+ 1sdDtGnCs1qmhaY/ge2epuE9ylRW5RBkKbwAL8vB42Q2bbs7BgIaVg7LOvhcGNPV 7T0erY7XPf2/cxcuipQYhztISb9wMTYaLOCFdSNo+tUCJeRy0MPynOrdvI3Fsvzu /SnvLFfhMeU3w9u2XXG/P7LY0bGIrrEfOu8b/MObIMYnRXi/squkNJAqojCXGFHZ 1c9rRtc9kWWxwM7cSzxSZKMJIiIpqdZFutDQW64uIIHmlnYzaRhz0Ti4OkedrzHY AHWhQBbkA+1vLjX4Nt8Q521m1JlYg9T9oS3MPGhFdz7HO1XUZPJh0Fg18LCBEk4O R0MpB/x6HGW3Ky+gIaXY5y9nY8BWozgBfEdPL5WYAqqiVs/yaV2KCcV14o+cHHSv xZGfLObMPGmawTfFk2EsCyWca3G2ioPyG3ZkOcFXNOpuZUaqec5AfQhYkms1CE4I Oj38LE3MShV5qYjBUE1zNd6MGI6+nFnIytm1gMq0nC5wP6HKsVm6BuTrmkfH5V1M n2QaI96FUF+NZRpFp3BXktMi2S5BePtTogr5IkLZ5nuLmGPCfrKGyd8dxiv4/qmM luSTSLtF/PN/bmVTs9VkMUTSuHyRqidCVvAMjwxM0zW5TvjPaSQ= =Ale4 -----END PGP SIGNATURE----- --DocE+STaALJfprDB--