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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9F1AFC47093 for ; Tue, 1 Jun 2021 09:10:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A63661364 for ; Tue, 1 Jun 2021 09:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233439AbhFAJMW (ORCPT ); Tue, 1 Jun 2021 05:12:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232869AbhFAJMM (ORCPT ); Tue, 1 Jun 2021 05:12:12 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4729C06174A for ; Tue, 1 Jun 2021 02:10:30 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id r6so4838699ilj.1 for ; Tue, 01 Jun 2021 02:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=cm1zKdzH5luYSV4zfueSOrqr8qzCXCW4+Xq8BpmqA7Q=; b=G1EOnFwzlUcOj+mQ2hVnmDrnG4jV6IaWiG/hy1cVgvwY8heUh+zr4yQb1GnsUe04e3 Yd8Es1UscpvrVh9kjJNxCyFcjYubC1q36c4AyxYNOSfMSDhBQXl2hAf+lfLWueLJagxP Z+sxRrWtwqeXmuPc/d2weCwfIZ3MMzZ08Jva6zMZQFkMPW616M75TwdW4U43+z+S6AY5 rcMlBzjafz6zHA1YfpJoF3zfEuYUAxrG4sEbPF5xCjSwNO2v/PewrNSXfSj2pzBiCVi7 VBPyPGpNCOmwG3O4cw2BbXl/aEVC1M1VPuraUdmXOK+RTW9RmGcpCI505QKihdxCje60 k7LA== 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:content-transfer-encoding; bh=cm1zKdzH5luYSV4zfueSOrqr8qzCXCW4+Xq8BpmqA7Q=; b=S5qfx/+6YaqAzgcy4HN98epq3nfDmhW48CvQDKUERQ7aNnVyQTdCLDIfE3YBcqOFTg XnO1P6cGvEAXFqylSMPfep1TgvtQ0s5Io1Y2Z9lGXUC0jvl4o6q5eAtmViAZKKLW3lkT OlAit2L0UEYIQcXdBOt8iAY/XW2k5IFhtYdjg+XUnUr4WVoXdIBIZDDbo/GOme5Hn6p4 pJjOsxpE5rmFI1FczzHfE3HAhS4UbIz/vTDI0NqVnTiZrcnAtkpQuqjxncvgR7qQrL1A AQsZNXZJAjfiCItMqJ5h2OsBVA7CrRWDyV44VeIAv2VBdyCwMpBD7sDvbWWrZ/K0rmD6 d8fA== X-Gm-Message-State: AOAM533LrK152gNTNr4DMGxPqD8EOqQ3sj3rXMvRP/gZh296xqgCRUph 7WyJWejpAjyWPeFP8DIvE4imPBNmiXENwkrxNu7dSw== X-Google-Smtp-Source: ABdhPJx4Nd1+PVFLw0K7RiEnDfXvuR5hb0Eor8DBxwJ9aKS6tRpKO5WzBcuIXJE63Zw4MQi4lvk0qhEH/abkgwD+WBY= X-Received: by 2002:a05:6e02:1393:: with SMTP id d19mr20354035ilo.90.1622538630053; Tue, 01 Jun 2021 02:10:30 -0700 (PDT) MIME-Version: 1.0 References: <20210524120539.3267145-1-robert.marko@sartura.hr> <20210524120539.3267145-3-robert.marko@sartura.hr> <20210524230940.GA1350504@robh.at.kernel.org> <20210525074649.GC4005783@dell> <20210526075255.GG4005783@dell> <20210601081933.GU543307@dell> <20210601082226.GV543307@dell> In-Reply-To: <20210601082226.GV543307@dell> From: Robert Marko Date: Tue, 1 Jun 2021 11:10:19 +0200 Message-ID: Subject: Re: [PATCH v2 3/4] dt-bindings: mfd: Add Delta TN48M CPLD drivers bindings To: Lee Jones Cc: Rob Herring , Linus Walleij , Bartosz Golaszewski , "open list:GPIO SUBSYSTEM" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luka Perkov , jmp@epiphyte.org, Paul Menzel , Donald Buczek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 1, 2021 at 10:22 AM Lee Jones wrote: > > On Tue, 01 Jun 2021, Lee Jones wrote: > > > On Mon, 31 May 2021, Robert Marko wrote: > > > > > On Wed, May 26, 2021 at 9:52 AM Lee Jones wrot= e: > > > > > > > > On Tue, 25 May 2021, Robert Marko wrote: > > > > > > > > > On Tue, May 25, 2021 at 9:46 AM Lee Jones = wrote: > > > > > > > > > > > > On Mon, 24 May 2021, Rob Herring wrote: > > > > > > > > > > > > > On Mon, May 24, 2021 at 02:05:38PM +0200, Robert Marko wrote: > > > > > > > > Add binding documents for the Delta TN48M CPLD drivers. > > > > > > > > > > > > > > > > Signed-off-by: Robert Marko > > > > > > > > --- > > > > > > > > Changes in v2: > > > > > > > > * Implement MFD as a simple I2C MFD > > > > > > > > * Add GPIO bindings as separate > > > > > > > > > > > > > > I don't understand why this changed. This doesn't look like a= n MFD to > > > > > > > me. Make your binding complete if there are missing functions= . > > > > > > > Otherwise, stick with what I already ok'ed. > > > > > > > > > > > > Right. What else, besides GPIO, does this do? > > > > > > > > > > It currently does not do anything else as hwmon driver was essent= ially > > > > > NACK-ed for not exposing standard attributes. > > > > > > > > Once this provides more than GPIO capabilities i.e. becomes a prope= r > > > > Multi-Function Device, then it can use the MFD framework. Until th= en, > > > > it's a GPIO device I'm afraid. > > > > > > > > Are you going to re-author the HWMON driver to conform? > > > hwmon cannot be reathored as it has no standard hwmon attributes. > > > > > > > > > > > > The CPLD itself has PSU status-related information, bootstrap rel= ated > > > > > information, > > > > > various resets for the CPU-s, OOB ethernet PHY, information on th= e exact board > > > > > model it's running etc. > > > > > > > > > > PSU and model-related info stuff is gonna be exposed via a misc d= river > > > > > in debugfs as > > > > > we have user-space SW depending on that. > > > > > I thought we agreed on that as v1 MFD driver was exposing those d= irectly and > > > > > not doing anything else. > > > > > > > > Yes, we agreed that creating an MFD driver just to expose chip > > > > attributes was not an acceptable solution. > > > > > > > > > So I moved to use the simple I2C MFD driver, this is all modeled = on the sl28cpld > > > > > which currently uses the same driver and then GPIO regmap as I do= . > > > > > > > > > > Other stuff like the resets is probably gonna get exposed later w= hen > > > > > it's required > > > > > to control it directly. > > > > > > > > In order for this driver to tick the MFD box, it's going to need mo= re > > > > than one function. > > > > > > Understood, would a debug driver count or I can expose the resets via > > > a reset driver > > > as we have a future use for them? > > > > CPLDs and FPGAs are funny ones and are often difficult to support in > > Linux. Especially if they can change their behaviour. > > > > It's hard to make a solid suggestion as to how your device is handled > > without knowing the intricacies of the device. > > > > Why do you require one single Regmap anyway? Are they register banks > > not neatly separated on a per-function basis? > > Also, if this is really just a GPIO expander, can't the GPIO driver > output something to /sysfs that identifies it to userspace instead? I replied to your previous reply instead of this one directly. It's not just a GPIO expander, it also provides resets to all of the HW and a lot of debugging information. Note that other switches use the same CPLD but with more features so I want to just extend these drivers and add for example hwmon. It's not just about it identifying itself, it offers a lot of various debug info, quite literally down to what CPU has access to the serial console on the front and their bootstrap pins. So, I want to expose the CPLD version, code version, switch model, PSU status pins and a lot more using a separate driver as they don't really belong to any other subsystem than misc using debugfs. I hope this clears things up, Robert > > -- > Lee Jones [=E6=9D=8E=E7=90=BC=E6=96=AF] > Senior Technical Lead - Developer Services > Linaro.org =E2=94=82 Open source software for Arm SoCs > Follow Linaro: Facebook | Twitter | Blog --=20 Robert Marko Staff Embedded Linux Engineer Sartura Ltd. Lendavska ulica 16a 10000 Zagreb, Croatia Email: robert.marko@sartura.hr Web: www.sartura.hr