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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 0F33CC433B4 for ; Thu, 1 Apr 2021 17:57:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7F1960FF3 for ; Thu, 1 Apr 2021 17:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234737AbhDAR5q (ORCPT ); Thu, 1 Apr 2021 13:57:46 -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-Google-Smtp-Source: ABdhPJxupg8K9QOvfQqfplXb9385y7HzeRg1j4Fbtc/ryhIPKrlK5XiQrBgMkwdJ6XBrJHjAp/YvxoFroo98g+XW918= 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