Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2649338pxv; Sun, 27 Jun 2021 04:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGyF0PuspjelfESUMDXGM20gC0bGIeYKHVUhtBOch7qXx0rQyu8OqwkzC1fROTSKA2YedP X-Received: by 2002:aa7:db94:: with SMTP id u20mr26676398edt.381.1624794198187; Sun, 27 Jun 2021 04:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624794198; cv=none; d=google.com; s=arc-20160816; b=ZC33oTsomc/HQlZvet89/QokSUd8GUkGVF+MQUim7cZ7/jsBsRrD9sL8NGXrL/wAYp Z6jOBYwvBo2f2RtN1uiDnfaoccxspDJjXi6NJ3jLlpYcNWNHqCwZDgRq8ZQZ5E1PRBwv TMqEC3P+9m/bnG31DOjd53EgwqcZXwR6szZh/rq8wa1nc+KNWwbJDj9fb4MF/DaIjlAU Exv7z7ajmqh19ewas7YkI1mCcYh+b+LJ86TU4S83/Y9b3DCKPXi9UK27cflREDn4i37z LffqXeeG9RfCNug4ZQHiJiwHdtwmMoIQP3l9eNnccbw51/cxAdbzPG92X3b1yoxOS71R 24sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7nCcZa51W677BE+Hel0O/2f8nMv5K3UCI0TqVVzGVFE=; b=olCE86Zz6wH/PrxVrfIBrOD0Wrt0PYip4ZL38KMKQ/AdRUEpTxhnMqd7MaVBVRCbTg +2peLgZDp8YP1AKINJpxJ0Wkp5i8Ff33Xnq1SjKt/2Mpn3VXKDqVwvvMAhl2BOuzUsAn z7dxr3C9DXR4jadZ/dKvCU1UMePFm/dTQAUo1gR2JyoJ6qAC/5FXCGTwW2b55l6RmRth wtv0It5dDLmAI9UI7CtZLoU0OTbeuDnoCepNNve5o1p6UHCD0hEd4sbU3jGawGB/ZtVD NM3ODFvb4Mby/vIPCBPjuMdZp80OFnk7GRGOuOzzahm4lTLCe6viQrKDdD1Aujz4V7h0 jGzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tCpyfKk6; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si11739871edc.353.2021.06.27.04.42.54; Sun, 27 Jun 2021 04:43:18 -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=@linaro.org header.s=google header.b=tCpyfKk6; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbhF0LoU (ORCPT + 99 others); Sun, 27 Jun 2021 07:44:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbhF0LoT (ORCPT ); Sun, 27 Jun 2021 07:44:19 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05CADC061787 for ; Sun, 27 Jun 2021 04:41:54 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id u13so26196817lfk.2 for ; Sun, 27 Jun 2021 04:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7nCcZa51W677BE+Hel0O/2f8nMv5K3UCI0TqVVzGVFE=; b=tCpyfKk6mjwf5hKPeYWKLVMLc3+tab8zSmjQyuDhkNWsOLgj+9g24nsoJW7QJhLS10 BiL3k1UPE9CrxlKVByXTovHluLJn5rNHH3AWiWQBDRR9uHIGAotgaN1VwvK96gbSU1yx b3Ev0DDKaY3HXR2KxsgNPpj7aoHjnmq0B04i7yq9ogCbqgJ0nYx2ATwuaztFuZhiSJdP 6WMuvUOMh128wnXcNZ27iO9Cwozg/WAB8+XEkgl06PdhkzT8FtiYrd0mQPd6hWsTAvc7 0wrkNGt4fdFTRnAkWOpQ0tHza14D7SyHpNEIaBLQQWX05CCVrn5eVDC9NZcbBejtDUVD E2Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7nCcZa51W677BE+Hel0O/2f8nMv5K3UCI0TqVVzGVFE=; b=KPJTw2CCq6P9U9y3hyfESj5sDozW/+Tf+YNoVCYm+rS+KBWPDdudhj1K+0VQd+aJyR vQBjU3nGUn0B5XcgMlQUfz4mWmfirdedcP4qgrLOW4mEQT4kdDonaW3ZaqSHtL7ACt43 A9QojnRt6O8Q8hmbcGcYyGCjAbexlVdaYhq5/9qdUd0HPCYin1DXh6L3xmhmFJGIQ6RT Mgms/38hpnwKf7wPU7u0WNtDuYvXsPDxleMSDMCy12FV+vCrWWKna8Mv+X89VO8tdx3I xEvGFzhWR5MnKJTDX8H8vdefN3qkKrg+rgv8laqVjmcHH659pEDZkTrSJ4wuJiTS+kOQ 5rew== X-Gm-Message-State: AOAM532GDsbr454F3jbJMS/UVByg+O7ZPegFQSM7Q6VR9izP9MCjixO7 R+kdLsdV95Fq7xYtKxiyp9ozT6B/ug6IB+3Utn7Ozg== X-Received: by 2002:a05:6512:1508:: with SMTP id bq8mr15370726lfb.529.1624794113085; Sun, 27 Jun 2021 04:41:53 -0700 (PDT) MIME-Version: 1.0 References: <20210625235532.19575-1-dipenp@nvidia.com> <20210625235532.19575-7-dipenp@nvidia.com> In-Reply-To: <20210625235532.19575-7-dipenp@nvidia.com> From: Linus Walleij Date: Sun, 27 Jun 2021 13:41:42 +0200 Message-ID: Subject: Re: [RFC 06/11] gpiolib: Add HTE support To: Dipen Patel Cc: "thierry.reding@gmail.com" , Jon Hunter , linux-kernel , linux-tegra , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Kent Gibson , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Doc Mailing List , Rob Herring Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 26, 2021 at 1:48 AM Dipen Patel wrote: > Some GPIO chip can provide hardware timestamp support on its GPIO lines > , in order to support that additional functions needs to be added which > can talk to both GPIO chip and HTE (hardware timestamping engine) > subsystem. This patch introduces functions which gpio consumer can use > to request hardware assisted timestamping. Below is the list of the APIs > that are added in gpiolib subsystem. > > - gpiod_hw_timestamp_control - to enable/disable HTE on specified GPIO > line. This API will return HTE specific descriptor for the specified > GPIO line during the enable call, it will be stored as pointer in the > gpio_desc structure as hw_ts_data. > - gpiod_is_hw_timestamp_enabled - to query if HTE is enabled on > specified GPIO line. > - gpiod_get_hw_timestamp - to retrieve hardware timestamps. > > Signed-off-by: Dipen Patel This looks good to me. The chip driver can look up and provide a timestamp provider for a certain line, which is proper since the GPIO hardware will be tightly coupled with the timestamp hardware so we need to ask the hardware about this directly and delegate it to the GPIO driver. Yours, Linus Walleij