From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EDD0C433DF for ; Fri, 29 May 2020 13:26:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FEAC20C09 for ; Fri, 29 May 2020 13:26:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DcdnZCZy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FEAC20C09 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v0bCDkj9vL0RjRsfv7Ne93EfcooXX3zisYvDOJM+Lkk=; b=DcdnZCZyzfc/DD GusGQwdehejXieD87ABq8XrbbojuvflaACfHe0y+v152KrsggqOgQj3KyuXvLq7zGCn9acGpW+LKs ZbgZIvt8nh2QFSZAEEmlKuZiJGC2/LzuawaYoNrdam4a9ssRgO4Zf7UOwsVZdt77IQWmzkBOAFkc+ FjU0gNF45kENsgHB/O2Q+97Y5KhqdU02OCoiKtI5/lwcNqh9WlxQANOV6skO6i75TOc51opUW6LtQ adAsap/uhSUpbXvurlFrFHd3EppVjTRxifmK+Aj3fU4xsb4QjlidTUncMb7HgoT9MVEcQWCvaFqoC vKKl6jOboZvALsdCHwjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jef1v-0002EP-U0; Fri, 29 May 2020 13:26:35 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jef1r-00029M-Lf for linux-arm-kernel@lists.infradead.org; Fri, 29 May 2020 13:26:33 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 904CF1C0389; Fri, 29 May 2020 15:26:14 +0200 (CEST) Date: Fri, 29 May 2020 15:26:04 +0200 From: Pavel Machek To: William Breathitt Gray Subject: Re: [PATCH v2 4/4] docs: counter: Document character device interface Message-ID: <20200529132604.GB1339@bug> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200529_062631_860217_6DD031EC X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kamel.bouhara@bootlin.com, gwendal@chromium.org, david@lechnology.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mcoquelin.stm32@gmail.com, fabrice.gasnier@st.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org, alexandre.torgue@st.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat 2020-05-16 15:20:02, William Breathitt Gray wrote: > This patch adds high-level documentation about the Counter subsystem > character device interface. > > Signed-off-by: William Breathitt Gray > --- > Documentation/driver-api/generic-counter.rst | 112 +++++++++++++------ > 1 file changed, 76 insertions(+), 36 deletions(-) > > diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst > index 8f85c30dea0b..58045b33b576 100644 > --- a/Documentation/driver-api/generic-counter.rst > +++ b/Documentation/driver-api/generic-counter.rst > + > +Counter chrdev > +-------------- > +Translates counter data to the standard Counter character device; data > +is transferred via standard character device read/write calls. > + > +Sysfs Interface > +=============== > + > +Several sysfs attributes are generated by the Generic Counter interface, > +and reside under the `/sys/bus/counter/devices/counterX` directory, > +where `X` is to the respective counter device id. Please see > +Documentation/ABI/testing/sysfs-bus-counter for detailed information on > +each Generic Counter interface sysfs attribute. > + > +Through these sysfs attributes, programs and scripts may interact with > +the Generic Counter paradigm Counts, Signals, and Synapses of respective > +counter devices. > + > +Counter Character Device > +======================== > + > +Counter character device nodes are created under the `/dev` directory as > +`counterX`, where `X` is the respective counter device id. Defines for > +the standard Counter data types are exposed via the userspace > +`include/uapi/linux/counter-types.h` file. > + > +The first 196095 bytes of the character device serve as a control > +selection area where control exposure of desired Counter components and > +extensions may be selected. Each byte serves as a boolean selection > +indicator for a respective Counter component or extension. The format of > +this area is as follows: > + > +* For each device extension, a byte is required. > +* For each Signal, a byte is reserved for the Signal component, and a > + byte is reserved for each Signal extension. > +* For each Count, a byte is reserved for the Count component, a byte is > + reserved for the count function, a byte is reserved for each Synapse > + action, and byte is reserved for each Count extension. > + > +The selected Counter components and extensions may then be interfaced > +after the first 196095 bytes via standard character device read/write > +operations. The number of bytes available for each component or > +extension is dependent on their respective data type: u8 will have 1 > +byte available, u64 will have 8 bytes available, strings will have 64 > +bytes available, etc. This looks like very, very strange interface, and not described in detail required to understand it. Could you take a look at input subsystem, /dev/input/event0? Perhaps it is directly usable, and if not something similar should probably be acceptable. Best regards, Pavel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel