Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1719486rwd; Tue, 16 May 2023 23:47:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7N8X2xjSRSbg5QJoPHhopJz+H/yn9OCkEPl0+JgAnfRj+KBThTQgLlryvBxHpJ6NNkjrLn X-Received: by 2002:a17:90b:148d:b0:23f:b609:e707 with SMTP id js13-20020a17090b148d00b0023fb609e707mr41409974pjb.2.1684306026475; Tue, 16 May 2023 23:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684306026; cv=none; d=google.com; s=arc-20160816; b=M2ZTUOzXBqBV2Zp0AnJsue6P5TqNhv7w9sRS7q4WXPqoqHdg6tKGJ4Mj4crD8dpRIU DbFiP2XMfvpbxXGyWOgbBFvJ2kMqZJZuT4ZgZwPjxbtNKqoWVZJTWHOwxqKNVDMKcR0z d1h8Ru4SjuvquWkYMSLA59LO2St4/nGU7ll3bB9jIbdjmjYv3Xiy/GE2Z9qRpVLSiHva vscPyKewjqL2VTyc7k7aZaSVKAB7QVIGoLzv+D/++cAIdB6BsA+vDrZ13eHvFoRyDHJh fCzyCz9O8ddyZdYRxfv1Vioao5ClxS/R5K/tJhLjGLBk5d0QIpoqgmr0DXHeDyBOSgt1 s7iw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rp0nqDvwrDzmrNRQFX9v3ZPPOVVJUXtkxKnXlM0WwKQ=; b=mtYPkirwEaI8ZSmXXrUyj4Zex8zih/VpTSTFQRLml394ozR3N8664naCvFbdgGaXh5 WvP0IrlvCC5uAeKeB7HBoU3BYiq66hXT/3Bw7oQIG8PAroaAKxjjVRE0E7yddkVKLwq4 drSbcfGaWYf0TGRzLCN0ZOO5JpXyMe9ZhwnGTIkowQTg3V9sgQVxcaBgrNrWcTFYazBV GTCbhwIRQybU1lAxPhyDPPzweAb6xWnf/RQ3h9bMaBAjHsURU0i5vF2hIAze7kV2Hdex yKxum0amX/558rPUeT6hEvCyW8LoTOEG0x5TQFgNaGh5HwXxHtZ16eHXYfFBCNfg16vB Q9/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a63af54000000b0052c76c18412si19702525pgo.26.2023.05.16.23.46.51; Tue, 16 May 2023 23:47:06 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232326AbjEQGdH (ORCPT + 99 others); Wed, 17 May 2023 02:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjEQGdG (ORCPT ); Wed, 17 May 2023 02:33:06 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED5363AAD; Tue, 16 May 2023 23:33:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 359608108; Wed, 17 May 2023 06:33:05 +0000 (UTC) Date: Wed, 17 May 2023 09:33:03 +0300 From: Tony Lindgren To: jerome Neanne Cc: Linus Walleij , Bartosz Golaszewski , Lee Jones , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Jonathan Cormier Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC Message-ID: <20230517063303.GO14287@atomide.com> References: <20230511-tps65219-add-gpio-support-v2-0-60feb64d649a@baylibre.com> <20230511-tps65219-add-gpio-support-v2-1-60feb64d649a@baylibre.com> <2e5cae40-7040-a92f-3d11-ce68f1307049@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2e5cae40-7040-a92f-3d11-ce68f1307049@baylibre.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 * jerome Neanne [230512 07:13]: > > > On 11/05/2023 22:57, Linus Walleij wrote: > > > + /* Documentation is stating that GPIO0 direction must not be changed in Linux: > > > + * Table 8-34. MFP_1_CONFIG(3): MULTI_DEVICE_ENABLE, > > > + * Should only be changed in INITIALIZE state (prior to ON Request). > > > + * Set statically by NVM, changing direction in application can cause a hang. > > > + * Below can be used for test purpose only: > > > + */ > > > + > > > +#if 0 > > > + int ret = regmap_update_bits(gpio->tps->regmap, TPS65219_REG_MFP_1_CONFIG, > > > + TPS65219_GPIO0_DIR_MASK, direction); > > > + if (ret) > > > + return ret; > > > +#endif > > > + dev_err(gpio->tps->dev, > > > + "GPIO%d direction set by NVM, change to %u failed, not allowed by specification\n", > > > + offset, direction); > > > + return -EOPNOTSUPP; > > > +} > > > > Normally people would complain about #if 0 code. > > > > But this is a special case! > > > > I definitely want the code to be in there somehow. > > > > What about: > > > > if (IS_ENABLED(DEBUG))? > > > > If someone enables debug with an explicit -DDEBUG to the compiler > > this could be allowed. > I'm fine with your proposal. Will wait few days just in case anyone wants to > add any comment then go for this. Just wondering.. Would it help for the driver probe to set gpio0 as a gpio hog after reading the configured value? Maybe the multi device enable just means the pin may be shared with no specific hardware reason to not change it during the runtime? Regards, Tony