Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11821940rwl; Tue, 3 Jan 2023 05:21:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxcnpN1kavGoP/kNbfnlQ7/0TjazIasVACP0bAAqJakzQNE9RUfFLBwbYfS3ywFm0b7Nwk X-Received: by 2002:a17:906:148a:b0:7cd:dbe8:e4f7 with SMTP id x10-20020a170906148a00b007cddbe8e4f7mr38107256ejc.77.1672752080318; Tue, 03 Jan 2023 05:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672752080; cv=none; d=google.com; s=arc-20160816; b=lOGsSnpHOG570PStb9MxRveowUZRWtVTmbbOLrQ1oG0/iKTEocFp6eqNWhKBEa8TI6 /3DAk3czYOV8rALmu1IJF8aZF7Rtg8PX/g0GmNTYR8IuKQFrUWVBju518mUKtHJIj3dl 0LR9imhZNGkT1HNL7x5MfbJBdJUmyrUkjhD8N3kTIbsdrHgOCEwPR+K/LYXCobiDYQN3 COoM70Q8wXYyqoBD6Hem3r6t93roe8GwwGlOeIf1kplKy3A9aT1iuD6ynerTJAf81TvC RhbdSpEkA5HI9jJ34ANDZ302OlTTghVs2Vu5VR3xbcKhVFXvd6X2gAgn9GH+C/p6l0T+ EelA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TqS3y3wqEw8VU6fuc3/0xI1BWUp368XvWGRuimZ7O1o=; b=chuFtqQXI+XwNUuLmU8YOmcB0ghij1j6AA814DS71b0f9IqgGLSizlBIGI3/E7c8Za P5OtPcrjeBx+pMcsMwdKMQa9Fvcgtd3LDDjj5j65ld4bgT29pMk5/rSas0Pvnm0khuc9 D7LGKp1PVes/K1W+dRyJcn4V3AqiEkNXCFHFWV89RjqxlDURmbH1d/16iri5dtbk+SU2 UUGNUYUof0XJCKdHx7YuHzqmRKxrHTwGTjr4nijOfA+e6X5KWKdhaTgKf4r5lGDkxV2G EGvbqil0idxo8v6/mQD5hlmJqwyElmAe66uOLoXsp7s7PeJGXZn1t9dHUSELdmdB1ORw Qi/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZVWeXS8n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xd3-20020a170907078300b0078e11cbb722si25471473ejb.92.2023.01.03.05.21.05; Tue, 03 Jan 2023 05:21:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZVWeXS8n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237693AbjACMw3 (ORCPT + 61 others); Tue, 3 Jan 2023 07:52:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237732AbjACMwX (ORCPT ); Tue, 3 Jan 2023 07:52:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FD3BCFC; Tue, 3 Jan 2023 04:52:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 500D5B80E12; Tue, 3 Jan 2023 12:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1488EC433D2; Tue, 3 Jan 2023 12:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672750339; bh=Wa6TU/u66JGcOO2l7KQC5SQzR8MRkoV+DozPJjJgvFc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZVWeXS8n9PHu8ZQP/yg3TdI1mkaBooz1jyzb/4734yf52pbUuAVqX5Rn3B08TxHWj kevH5vWcWONZc/vmhRS/xaZWV6EdttNGfgZj5dtmb2cVscXVQ1bLWbrV1A5W+zwHFV ksHh1iYvkF2stlaqHfcAg5kyC4zHvgwX+DW/GV73LFN8gjxhDwoWgrsoWuWJDlCKWM WjruZfe3XbujcvJbZ6ZCorgUxUMxFdvsasxEt0RHXSLDDE7XXOrX1qFYvJzuMM972g tWA6SVkz6FiIsRpTaJnTE7HY4CPlgBWfEventIbOxDzYpFuOLnSGqcQi4h4YmtAluJ JQBzHFZ8CV27w== Date: Tue, 3 Jan 2023 12:52:12 +0000 From: Lee Jones To: Fabrizio Castro Cc: Geert Uytterhoeven , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Sebastian Reichel , Geert Uytterhoeven , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , Chris Paterson , Biju Das , "linux-renesas-soc@vger.kernel.org" , Laurent Pinchart , Jacopo Mondi Subject: Re: [PATCH v2 2/4] mfd: Add RZ/V2M PWC core driver Message-ID: References: <20221221210917.458537-1-fabrizio.castro.jz@renesas.com> <20221221210917.458537-3-fabrizio.castro.jz@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 03 Jan 2023, Fabrizio Castro wrote: > Hi Geert, > > Thanks for your feedback! > > > -----Original Message----- > > From: Geert Uytterhoeven > > Sent: 03 January 2023 08:37 > > To: Fabrizio Castro > > Cc: Linus Walleij ; Bartosz Golaszewski > > ; Rob Herring ; Krzysztof Kozlowski > > ; Sebastian Reichel ; > > Geert Uytterhoeven ; Lee Jones ; > > linux-gpio@vger.kernel.org; devicetree@vger.kernel.org; linux- > > kernel@vger.kernel.org; linux-pm@vger.kernel.org; Chris Paterson > > ; Biju Das ; linux- > > renesas-soc@vger.kernel.org; Laurent Pinchart > > ; Jacopo Mondi > > Subject: Re: [PATCH v2 2/4] mfd: Add RZ/V2M PWC core driver > > > > Hi Fabrizio, > > > > On Wed, Dec 21, 2022 at 10:09 PM Fabrizio Castro > > wrote: > > > The External Power Sequence Controller (PWC) IP (found in the > > > RZ/V2M SoC) is a controller for external power supplies (regulators > > > and power switches), and it supports the following features: it > > > generates a power on/off sequence for external power supplies, > > > it generates an on/off sequence for the LPDDR4 core power supply > > > (LPVDD), it comes with General-Purpose Outputs, and it processes > > > key input signals. > > > > Thanks for your patch! > > > > > The PWC is basically a Multi-Function Device (MFD), its software > > > support comes with a core driver, and specialized drivers for > > > its specific features. > > > > I have to admit I'm not such a big fan of MFD. In this driver, > > you are not even sharing resources in the MFD cells, just the mapped > > register base. So I think you can easily save +100 LoC and reduce > > maintenance synchronization overhead across subsystems by just having > > a single non-MFD driver instead. > > > > Did you pick MFD because the PWC poweroff feature depends on board > > wiring, and thus is optional? > > I am not a big fan of MFD, either. Interesting. Could you both elaborate further please? > I picked MFD because we were not 100% sure of what the IP could do > when we started working on it. > I have received more information regarding the IP now (which I don't > have the liberty to discuss), I am still not 100% sure that's all > of it, but basically its support may require expansion later on. > > I liked the solution based on syscon and simple-mfd for several reasons, > but having dropped syscon and simple-mfd due to issues with the dt-bindings > I have moved on with a core driver to instantiate the required SW support. > We could of course move to a unified driver if that makes more sense? > If we were to move to unified driver, under which directory would you > suggest we put it? If you do not have any resources to share, you can simply register each of the devices via Device Tree. I do not see a valid reason to force a parent / child relationship for your use-case. Many people attempt to use MFD as a dumping ground / workaround for a bunch of reasons. Some valid, others not so much. -- Lee Jones [李琼斯]