Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1500122pxb; Wed, 30 Mar 2022 05:07:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPQjg8rszp9+EVWTxUP15k07Y1k91wMzc6GXE9MrYWqjO8NahS7YD3pttyWxXSTNUd+ftw X-Received: by 2002:a05:6602:1491:b0:648:cd01:9ba9 with SMTP id a17-20020a056602149100b00648cd019ba9mr11438283iow.195.1648642028293; Wed, 30 Mar 2022 05:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648642028; cv=none; d=google.com; s=arc-20160816; b=NKg9fPh4IeR81HzpRukdNJj0AvLUrefrU4rxkWAVF6cmTfxGKf4s+Bjt0w2fuoXHR5 nvYVYrP2WD/tN7tjqVGyhA0ZEZIlR3uCZgcARMt57ENRMMNKR4y2egXMISwTkcSA6RmE hV8rnaAEjCxu0YCorv8wDdiVjzUsLgCQJaW1UKW6E+aSloz/+GQXTjA4Qf9790PIKwPN 3aAG0ptianPIuLTG5urk2t/Xw3VmEyPo/dJGNUr5Nm0yw3crQ88U9KSP5NMb4L9X69kj 5fJ0yrfCTGpnApZK7E84a4WUDpDIkFjq87P7OY3MKEPE2CBPBSqfhwBCCzUJG0GBHCbm D0YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=w3815+MGXaDijvWMYtqcYwozP7wYjHgBU5ZGj2ffCo4=; b=sBC00rDXndVbGIjng2gAxJcGClmuW1uWyof/9V8LBcV6DrnCiij/Nj54C30wg1juUx F7IBzVHANEF2EPgMhBCMgdQeAD5AF/2Hm9WAEehVEx3CS2YDqO4+1eGfq98FAs3QfFTe oXcjaIC7wOXO69NAo9LGdTV9WBibCD838FUr33OIf4p+egQdcU6NzXkV4qrwacQKi0CJ UcNseHX3lokf+VaYgCy0iz6grEdaTgC2/OEuAJGWR2vpVtieiAPXllwLgY0bySaWnoen pr9i/lEqDqY+kXCPrU2Vbt9vhoJojj7gKRKxEsB7kN8alfgnsGk65vE4xsVb1rlcScIu D3jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fCJ6lzlV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a5e9741000000b00649580844ecsi18404121ioq.9.2022.03.30.05.06.55; Wed, 30 Mar 2022 05:07:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fCJ6lzlV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237175AbiC2NSe (ORCPT + 99 others); Tue, 29 Mar 2022 09:18:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234581AbiC2NSd (ORCPT ); Tue, 29 Mar 2022 09:18:33 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C588A639B; Tue, 29 Mar 2022 06:16:47 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id z128so14781290pgz.2; Tue, 29 Mar 2022 06:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=w3815+MGXaDijvWMYtqcYwozP7wYjHgBU5ZGj2ffCo4=; b=fCJ6lzlVxTfVgqckkBqb1S/nzl583ie/5M/JHaHBfoHc7by/n3+u6k/2uLuhJLX9kz LoYV8tw4CbW3gC0Mtsb8bSIqTaVWZ2lmdR91CGnXpYlysrL7q5o+W+kCLKV7hVIQxfSN 4u45i720kDEBKzlXLZJ68/DJGmNfR9cYax+DosToVi7LFXoeW+otnOZ7lOul7yUgC/El DN56g8OmHth+8F6zsnpr+a0+GE5msp7tQiw6r2HaFCn3WA4Jq/NxiL5M7AXP8DfHgtIT oMLZpUOd6JUoBNj858rV7JFL5xcuLF4oaUhW1rXbl4BpjHGZ1V3+Gq35LgxMDpe2x4di Ei3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=w3815+MGXaDijvWMYtqcYwozP7wYjHgBU5ZGj2ffCo4=; b=LiyMGyFokLzHc/sAMSqEyzJ+q04K2ezByfTQuIfbwxLc+j0qM3ByeFHTl04tYoQigG 7mZMe9OKIjt0F4F/g/818e1gTMmGfaktTg/Hs9cR7oj29RD0/cTii6stAEeEHoidXmy3 3Ad0nBes7FJ3tMNDbOEAiaDaq0TR4f6Bxxr1siQJqNnJAJpCSguTLQTL9ezlr4ryUsfz zAd3HFERMddZ6fzr1ivKq+XTy+IAUYELTsE/TVzg8Buu7y6TSgtfbM4m/UOK32RcX7lP aAXj18wmjsxlw+LZkEsMbDgG59+tN6KNWnD4FJjKZWDUK986O1V8GvVsazPqrT6H0xHr itAQ== X-Gm-Message-State: AOAM532HVkcqYRRWH4VvzWZn0ij5wHGzgFYYXmCIuvVtM/fJEmRzomZk MJnoY9T3wHLQZJ/pNSHArzo= X-Received: by 2002:a05:6a00:2408:b0:4f7:a8cb:9b63 with SMTP id z8-20020a056a00240800b004f7a8cb9b63mr27846870pfh.33.1648559807221; Tue, 29 Mar 2022 06:16:47 -0700 (PDT) Received: from [192.168.43.80] (subs02-180-214-232-29.three.co.id. [180.214.232.29]) by smtp.gmail.com with ESMTPSA id j16-20020a63e750000000b00373598b8cbfsm15932192pgk.74.2022.03.29.06.16.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Mar 2022 06:16:46 -0700 (PDT) Message-ID: Date: Tue, 29 Mar 2022 20:16:42 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v5 01/11] Documentation: Add HTE subsystem guide Content-Language: en-US To: Dipen Patel , thierry.reding@gmail.com, jonathanh@nvidia.com, smangipudi@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, warthog618@gmail.com, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, robh+dt@kernel.org References: <20220329054521.14420-1-dipenp@nvidia.com> <20220329054521.14420-2-dipenp@nvidia.com> From: Bagas Sanjaya In-Reply-To: <20220329054521.14420-2-dipenp@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/03/22 12.45, Dipen Patel wrote: > +============================================ > +The Linux Hardware Timestamping Engine (HTE) > +============================================ > + > +:Author: Dipen Patel > + Please learn how to convey semantics with rst format, see further comments below. > +This document describes the API that can be used by hardware timestamping > +engine provider and consumer drivers that want to use the hardware timestamping > +engine (HTE) framework. Both consumers and providers must include > +#include . > + Maybe it's better to write as `... providers must ``#include ```. > +The HTE framework APIs for the providers > +---------------------------------------- > + > +.. kernel-doc:: drivers/hte/hte.c > + :functions: devm_hte_register_chip hte_push_ts_ns > + > +The HTE framework APIs for the consumers > +---------------------------------------- > + > +.. kernel-doc:: drivers/hte/hte.c > + :functions: devm_of_hte_request_ts_ns hte_req_ts_by_linedata_ns hte_release_ts hte_enable_ts hte_disable_ts hte_get_clk_src_info > + > +The HTE framework public structures > +----------------------------------- > +.. kernel-doc:: include/linux/hte.h > + > +More on the HTE timestamp data > +------------------------------ > +The struct hte_ts_data is used to pass timestamp details between the consumers > +and the providers. It expresses timestamp data in nanoseconds in u64 data > +type. For now all the HTE APIs using struct hte_ts_data require tsc to be in > +nanoseconds. An example of the typical hte_ts_data data life cycle, for the > +GPIO line is as follows:: > + When we talk about name terms found in actual code (like keywords or variable names), it is customary to enclose them inside inline code (for example, ``struct what`` or ``u64 what``). > + - Monitors GPIO line change. > + - Detects the state change on GPIO line. > + - Converts timestamps in nanoseconds and stores it in tsc. > + - Stores GPIO raw level in raw_level variable if the provider has that > + hardware capability. > + - Pushes this hte_ts_data object to HTE subsystem. > + - HTE subsystem increments seq counter and invokes consumer provided callback. > + Based on callback return value, the HTE core invokes secondary callback in > + the thread context. > + > +HTE subsystem debugfs attributes > +-------------------------------- > +HTE subsystem creates debugfs attributes at ``/sys/kernel/debug/hte/``. > +It also creates line/signal-related debugfs attributes at > +``/sys/kernel/debug/hte//