Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1101615pxy; Sun, 15 Aug 2021 09:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEz/t1/JjLxk9OHwBt/TFzKAs0SP0jrMtw84Yq4okKTvZVb7GDYRRsUpf5Xw7BktCsosMI X-Received: by 2002:a17:907:2097:: with SMTP id pv23mr11964038ejb.262.1629046334626; Sun, 15 Aug 2021 09:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629046334; cv=none; d=google.com; s=arc-20160816; b=duiCrGb8TiOZvURacAax0+0YmBqsmYie1wTdj2kA1sNkwke5uEoEpgNl+u2BPxsCgP DmqacyXQtjxpCIronyu1jO0e8JrTh707mGRmK9AMtWZrATcmzvbmapI8R/ySZZa2nC7T WjgGTvInhOKSByCyPVgn3cN0bhNN4xMynqTcNkHYeL9yaRb5ZSreQ5xdhhKnUwKoedH1 hYPTWJYxOsv7CNqVgc0RotFxXNzEPW4P6Ahr/gFV6tAAkE+yJDMkC3YIVc6itKvInUuV U8Tzt38qNHJHY3iC8DKeMhl/CbCOOFqDrDKJ8/v061Abi2BHLC5KM2oLWyq5q/nFu4BM a/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=tMf4qcdeYljr/4++yO3v2J4zvHWD8oxv+lNaOjWGENw=; b=HEQe3cd3L2Gmy6fmJ7/xMO0gvaOyGaHnNV4nVXTrchsiWUjODpe48wDzd9PXSoW+3I ZytseJu9pLQQzQi/lkXw1WidX7NHbxTHaFlXewA9j8S0MyAc4U1VIvFZfnpuVNd5bNo2 GnrZeNyWItgbvumsIDXDOZ/VDNFhNS7YzjrPQk7Urd4WYykffsRaMfRIj/ZZhwcEar0z /3dPK9oA5rBSU8s25WTQmq5i/qz9sIvss+X2xG0NR8s5Oz3HtKNUyICehrHynIfYfkoo MgqePOQYba4Xrpc3wY5C4AKZDvpiEbfyFmcUIltkC2i/G3gskk7AJ2I2knB0RV4M/i/4 sMbA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt16si7873036ejc.735.2021.08.15.09.51.51; Sun, 15 Aug 2021 09:52:14 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231322AbhHOQsj (ORCPT + 99 others); Sun, 15 Aug 2021 12:48:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:35408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbhHOQsi (ORCPT ); Sun, 15 Aug 2021 12:48:38 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47395604AC; Sun, 15 Aug 2021 16:48:04 +0000 (UTC) Date: Sun, 15 Aug 2021 17:51:02 +0100 From: Jonathan Cameron To: William Breathitt Gray Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, jarkko.nikula@linux.intel.com Subject: Re: [PATCH v15 07/13] docs: counter: Document character device interface Message-ID: <20210815175102.4a10a28f@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Aug 2021 21:37:32 +0900 William Breathitt Gray wrote: > This patch adds high-level documentation about the Counter subsystem > character device interface. > > Signed-off-by: William Breathitt Gray Hi William, Trivial probable typo inline. I'm struggling somewhat with these interfaces because I simply don't know enough about how people use counters to know whether they provide everything people will want. They feel similar to the event handling type functions you can set up in motor drives, so they may well make sense, but ideally we need review from someone (other than yourself!) who actually uses this stuff on a regular basis. If we don't get any additional review I guess we go ahead anyway next cycle. Jonathan > --- > + > +Counter events can be configured by users to report various Counter > +data of interest. This can be conceptualized as a list of Counter > +component read calls to perform. For example: > + > + +-------------------------------------------------+ > + | COUNTER_EVENT_OVERFLOW | COUNTER_EVENT_INDEX | > + +========================+========================+ > + | Channel 0 | Channel 0 | > + +------------------------+------------------------+ > + | * Count 0 | * Signal 0 | > + | * Count 1 | * Signal 0 Extension 0 | > + | * Signal 3 | * Extension 4 | > + | * Count 4 Extension 2 +------------------------+ > + | * Signal 5 Extension 0 | Channel 1 | > + | +------------------------+ > + | | * Signal 4 | > + | | * Signal 4 Extension 0 | > + | | * Count 7 | > + +------------------------+------------------------+ > + > +When ``counter_push_event(counter, COUNTER_EVENT_INDEX, 1)`` is called > +for example, it will go down the list for the ``COUNTER_EVENT_INDEX`` > +event channel 1 and execute the read callbacks for Signal 4, Signal 4 > +Extension 0, and Count 4 -- the data returned for each is pushed to a Count 7? > +kfifo as a ``struct counter_event``, which userspace can retrieve via a > +standard read operation on the respective character device node. > + > Block for the entire subsystem