Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp688782pxf; Thu, 1 Apr 2021 10:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyb2XfrLw+dTYl29/sPvwgUplbDY8NA9lg448hHyBO4iTEsHgramKeM+bYlbJsMue2AsRD X-Received: by 2002:a05:6e02:1d01:: with SMTP id i1mr7505411ila.171.1617299895323; Thu, 01 Apr 2021 10:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617299895; cv=none; d=google.com; s=arc-20160816; b=uvptOg28MRyOrN/OqR0aiMAn1LPqYTTzWGhZIz6ql0WMujZ3USXGTcIsEVArukrIFm pgVXFDBfGKZfKImWsz9xOc/1AZlP3aSkJLp3Iu4D/3KBPXqinvAHyVvr+tuKI0aWQTGt kwB9FRJS1wUYPIp/T4EHz82vlTCdhqO3zdgVxFEm1WpGUAkwQsAOQhEHXmGr4PXJbuzQ 2RIwGGGQY556qsQ2z9D3tjfkAgRzEeoI3ercpdYtDalBFIEwYF7vNjSZEKrld697Mi1r jXtJbQkzskwKZ/EHmx8fT4xyinJxkHZPZMJe5z2NTf4QtPk2BzJ071n5aNFWLx73SG0M 4wxw== 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=WH+kAbagll9akxuUHqMFh3rNKMar4o3v6gTYdJcUIiE=; b=GG6noiRyJ+5xn3vePhMK91mcTqxRdweV0PjlO/yDENFJPU4JUIvszo/ZDUq2VKaE4Q rlgjJpVhgXja2n6kPTBVZ1zjKBMDfqMMT5AhAu0ZVSgo7GzuCAn5GDwzGcFvopahXap0 fvMHMcdZWlOy2xZELexzim/5b369dtuGapKxj69ZYbmOYGr0FqPnugrv9n7DB8dxmLip g1D4bNlv5PtOV8tovbeST9t1cV+X2bi7ZZDOjqT3uAXd8oel+gpp32QTX78JccGO0UTT fvLWgui7qMIzmPfedqg3SUa7C8IO19VMesq9FVkX+OY+hSQIUSPazx1QFBKJAOhnWVvY zzcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=1ypL8Wa8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si5707622ilu.82.2021.04.01.10.58.02; Thu, 01 Apr 2021 10:58:15 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=1ypL8Wa8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236313AbhDAR5o (ORCPT + 99 others); Thu, 1 Apr 2021 13:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234900AbhDARmK (ORCPT ); Thu, 1 Apr 2021 13:42:10 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F28C0045D9 for ; Thu, 1 Apr 2021 07:25:49 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id o66so1958841ybg.10 for ; Thu, 01 Apr 2021 07:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WH+kAbagll9akxuUHqMFh3rNKMar4o3v6gTYdJcUIiE=; b=1ypL8Wa8sUdG73EO99/NVS2TpkfsaRCNg8yduWkR4ElYHj8J8Veicor1vdONTuA43n OJ2XHHopXV7W098Eo3dJsRU0SXAv2NMUywQSpWHPKw2RDZDGKUe707+8boGVlO8R4hTE OcSGw7v8oQOoyhB+GQcoRumTPvBLcJRAIHWcBlY8JN/AXaFjjGShd+3NBaSJ4/CQ2CmH HJoIl5WCTiDE7TglOXNvw5dmdGLa7oystpeEqIum56FPlPSwTVOkSAi59pE32FHVSc60 IZu4xxJOo6ZEXUup1WASLcIybVdw4j8naIvtiX3dmlVW+mrFVeCQCevrRyou8PKwWnYn ynUw== 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=WH+kAbagll9akxuUHqMFh3rNKMar4o3v6gTYdJcUIiE=; b=P/rijLlDE91p079uOtOvbKSC9Li5BVW2qPkYNqGcOrR3R8949XfvLexIhLu6LUQO/5 7MxPyVhIGTftxFpVdW4siWUT3gLsiTE6dSRDTJmCMCbev0igl5PaVjHdKNRdCYb/tkaD 86d0Y5VhmrY3RlI9qNW0cRscv3+/7xKC3n1sSIysOnVsNaXSbys3qP0lOQmRYwCfjyXL 4xyULnlLLSeCPEhU3RA84ZlB9zJCOUA+I2QwVGoo2X3Iz/zAbXPp+D26vXLRtcoBK+bs pRksWmEryJIBFwqULvdnGClWaLsgOBcYG5TR5/Y9xriM+VEGQOeqrtfjgGOFTK707hF8 udlg== X-Gm-Message-State: AOAM530ZiiT9cYcYa2RTzkrXGYY8Vq9kOk+WHu7KUb9pH2iQNQQzducQ C7wDCjam2NhYRUTpFc7xhAkv945fUn4q1e+zMgCcKw== X-Received: by 2002:a25:c588:: with SMTP id v130mr12117757ybe.312.1617287149038; Thu, 01 Apr 2021 07:25:49 -0700 (PDT) MIME-Version: 1.0 References: <20210330085655.12615-1-wsa+renesas@sang-engineering.com> <20210330085655.12615-2-wsa+renesas@sang-engineering.com> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 1 Apr 2021 16:25:38 +0200 Message-ID: Subject: Re: [PATCH RFC/RFT 1/1] misc: add simple logic analyzer using polling To: Linus Walleij Cc: Wolfram Sang , linux-kernel , Linux-Renesas , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 1, 2021 at 3:08 PM Linus Walleij wrote: > > On Tue, Mar 30, 2021 at 10:58 AM Wolfram Sang > wrote: > > > This is a simple logic analyzer using GPIO polling. It comes with a > > script to isolate a CPU for polling. While this is definately not a > > production level analyzer, it can be a helpful first view when remote > > debugging. Read the documentation for details. > > > > Signed-off-by: Wolfram Sang > > I am a great supporter of this idea. > > When we created gpiod_get_array_value() and friends, the idea > was exactly to be able to do things like this. It's a good way to > utilize the fact that several GPIO lines can often be read from a single > register read. > > > + i2c-analyzer { > > + compatible = "gpio-logic-analyzer"; > > + probe-gpios = <&gpio6 21 GPIO_OPEN_DRAIN>, <&gpio6 4 GPIO_OPEN_DRAIN>; > > + probe-names = "SCL", "SDA"; > > + }; > > + > > +The binding documentation is in the ``misc`` folder of the Kernel binding > > +documentation. > (...) > > +++ b/Documentation/devicetree/bindings/misc/gpio-logic-analyzer.yaml > > When other debugging tools for GPIO got DT bindings it was concluded that > it is possible to create bindings like this for debugging without even > specifying > any formal bindings. They are just for debugging after all. > > Personally I like the bindings anyway. > > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > > I would consider housing this tool under drivers/gpio actually. > We have other funky things like gpio-sim and gpio-aggregator > so why not. > We have actually created a sub-menu for "Virtual GPIO drivers". > I would create a Kconfig menu with "GPIO hardware hacking tools". > > But Bartosz would need to agree on that idea. > It's perfect! If we ever get something like a generic bitbanging driver or something, it could go in there too. Bart > > +config GPIO_LOGIC_ANALYZER > > + tristate "Simple GPIO logic analyzer" > > + depends on GPIOLIB || COMPILE_TEST > > + help > > depends on EXPERT > > I would say. Definitely not something for the average user. > > Yours, > Linus Walleij