Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3308728pxj; Tue, 1 Jun 2021 02:11:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHFy3S0xpIdpSk/geuY3b5o4L4cXsvfRXvfrsHh08mKqCQQOjM2dvWWByh/KNbE9JwImh9 X-Received: by 2002:a05:6638:287:: with SMTP id c7mr24245970jaq.137.1622538718761; Tue, 01 Jun 2021 02:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622538718; cv=none; d=google.com; s=arc-20160816; b=lCV4Gs6oyLWyv/DeDmAj78/ceUOtGyNrOHejD2+fAENZ0bVr3R/3MW0Bc7jM2NbnyX 2aDdLnzZ6EYFWwGGhJg2JYDV2ACzqadPGOHy+de0MmGpVCscaxTwMz3Pk8x1xJVY237P UB309eXpJIbtLK95DpnEH0dryQa5cJYsQGSztO9R3uQnsJuzOcsb70hwPQJD/dOjiGSB mppIwIzAsu9OAYQGxezJu7iLDo6DW09rqPkgCaJ9LsGXPRGN2ofhobNgQam1f9ZdlTGk qU/nHC/fuEay0iH5owzL9rJkYsPr7m4Gy1Vt19pYf0RGlkUxjvnX2OgE4Wto+bmw/iG1 B4AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=cm1zKdzH5luYSV4zfueSOrqr8qzCXCW4+Xq8BpmqA7Q=; b=IsPna49nELJTJSi5fenYuB67IPNvr50ojHko74ijyZuUT4GHB8TeGSWH9h/sDe0niZ U053R85SqFAgqahAUA0Uzf9dXwmMV5nvS7LGofqhaT92vqR/vP8MMrIsdAhg4Fu1BBpt J44ewzMrdaUVeXgPbP4LK1qqOTOR1StH+WXFSDUyRB5v3I3IEy4L3xTVAVOQJdsA43OM b1u806bt+0nghnaISavSUUrUlimJHXQP0sc9YfXimvweQUrfrwfoItbj98Bmlmq72rgR 4Cr4mR20oio6z2skj/7zEO48/G16JpoNsBFLUPNQW4ejpypbrcmmL5/+PTbsVysjT/yu Za1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sartura-hr.20150623.gappssmtp.com header.s=20150623 header.b=G1EOnFwz; 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 b26si17294720jap.85.2021.06.01.02.11.46; Tue, 01 Jun 2021 02:11:58 -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=@sartura-hr.20150623.gappssmtp.com header.s=20150623 header.b=G1EOnFwz; 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 S233614AbhFAJMV (ORCPT + 99 others); Tue, 1 Jun 2021 05:12:21 -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-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