All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
Cc: Gwendal Grignou <gwendal@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2] drivers: counter: Add Cros EC Sync counter
Date: Sat, 25 Apr 2020 16:21:01 +0100	[thread overview]
Message-ID: <20200425162101.21f7960e@archlinux> (raw)
In-Reply-To: <20200420190810.GA16124@icarus>

On Mon, 20 Apr 2020 15:08:10 -0400
William Breathitt Gray <vilhelm.gray@gmail.com> wrote:

> 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
> > <vilhelm.gray@gmail.com> 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 timestamp,
> > > > 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 subsystems.
> > I will wait for counter to offer a way to gather timestamp'ed counts.
> > Do you have a plan/proposed ABI you can share?
> > 
> > Thanks,
> > 
> > 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.
> 

Don't copy our crazy clock choosing stuff. That's legacy rubbish for
compatibility with a silly choice I made a long time ago.  Pick
a sensible clock type and stick to it.

Jonathan

> William Breathitt Gray


      reply	other threads:[~2020-04-25 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 19:55 [PATCH v2] drivers: counter: Add Cros EC Sync counter Gwendal Grignou
2020-04-14 13:21 ` Enric Balletbo i Serra
2020-04-14 20:48 ` William Breathitt Gray
2020-04-20 18:54   ` Gwendal Grignou
2020-04-20 19:08     ` William Breathitt Gray
2020-04-25 15:21       ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200425162101.21f7960e@archlinux \
    --to=jic23@kernel.org \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vilhelm.gray@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.