Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9902083rwr; Fri, 12 May 2023 00:29:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ725fcPtjyoGNQW4BsyyYIZBq5hpZhp0xdzmrBnjc2PL8csonB+wKJzhMMxJAh+5kt0WwTe X-Received: by 2002:a05:6a00:15ca:b0:63b:19e5:a9ec with SMTP id o10-20020a056a0015ca00b0063b19e5a9ecmr31986606pfu.33.1683876581329; Fri, 12 May 2023 00:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683876581; cv=none; d=google.com; s=arc-20160816; b=DoTv+BEQCPLvvUt+TJD5aSKxNptwQWyd3OOZiD/jdncoPamBNXKUM9ac4ZDkR6rOUB cKVwpAt3AFqKMAF6nxb9ZU1MFXkfhUvWt1k6+6XWLCI8uKN3nYnu62MkwVnu+07NewCi 88vWkP+FSpg7/HdMrKZgQYhb21FxtTcMbiKG0TJhyKuL9JUD3sS1MiPT93AbK2UJF5dN tCw3GTG4u5rQr+JWboJ1kL20oD4AOcna+NmmQma+s5GsEi6KJYRET7PhAe3nL/ArZL/I crps0Ca9UcrA6LJGuXxfqQ30/AOvHbh0ls9UoLUV9DPx3sw2GGsdA9wpjg3EDodANGe3 uPjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PPhQRy4HPP9Hjp11lzPQ3zP0xKs4X8HPNb5FmQafXzg=; b=nZ5Z0wKZJEe9Jv6J/a2h/WzS4x2yq0eR73/qrqe6Y5YCWRF+ZJFDXWzFO4pjuIXFJn xrpMHCDnqXbLBW0HICxgdjaAQ9Nv1PRk+zwudAOa8iSajIi4bpHAPwXSj9MgecRm0Ss5 E8rWHH2kI9EyYhqbZeNZN8FGqyp3rYXrmxPye/DKyvRUFmc6YNF7dBb7/TgV6TZGxSJj jikr23udLMJd+7SX7v9auqtYzMQ3ksm2565CDaNguP8W7wXOVHgVxl14tT9jJdmAx6Mg 9K/ppX9sw1hdZAQKSvulGP1K/v716bvXV18EVvXAJfFBwi1NecsY2QCEMCTU8+irNtEy xw8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b="4YJ/nGQc"; 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 n6-20020aa79846000000b0064355e25c7esi9828920pfq.188.2023.05.12.00.29.29; Fri, 12 May 2023 00:29:41 -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; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b="4YJ/nGQc"; 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 S240272AbjELHQI (ORCPT + 99 others); Fri, 12 May 2023 03:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240140AbjELHPh (ORCPT ); Fri, 12 May 2023 03:15:37 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29E9B106C8 for ; Fri, 12 May 2023 00:13:26 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f42b984405so28924135e9.3 for ; Fri, 12 May 2023 00:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1683875604; x=1686467604; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PPhQRy4HPP9Hjp11lzPQ3zP0xKs4X8HPNb5FmQafXzg=; b=4YJ/nGQcwmjEJyXetQTMv6vZEtXXnXCtVTEj6ZJdD2ZvjIzR3cQx7mlmlJ7h9/a8aM +I9WYuDl63SaxIOwA1i37KQb6r3G4Oz7rZEkXbkjRMnXWyghHJ0b13VY9NMQMFdRGoKm Z9VJG4TBTIMsIKdUPuahjsx7g2cc9PXUjdjS4hw3wCfMXEYoFfQXUv7LWHEGUV+uxFP9 sriHw/fEKQAUcFDV1AkZcmUhz5Jcu1RByKC4NPxtiiIqicFgJSKZfEuXb1XX8YFegQdL rw+/2sB5eYUhznaLEfvUl3n9pgk2OOhczWSWdlYQpxPS70IfRd2V6+bsaltJgtdDJV7I tjqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683875604; x=1686467604; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PPhQRy4HPP9Hjp11lzPQ3zP0xKs4X8HPNb5FmQafXzg=; b=cSBXxyIO3pgsnv4ZFYIA9k8cucuBVgoQeT1o1z0rH4EGZxMcoV6LceEyhswbD+kl38 iuxFbYE4PcmNLUwlN+qVIz7EBX/laerTk2ccv6TfVDElCNfRAbPcoWq/x7DDOhcDSXbG i7DdT4H+txH/fPXAuRJwdhOBA0rIbtMnu8ziGt5DWvdt6oB6pIAUcqKpqtyFZEDUI1MO UA3zMSAt5hIHD1D6yC5bulohLIeGerNfj/ijg6EZKT3J+19XssR89w2Cez+yBZ3keLGI D0PRkHtl+VFJ3v193yqZPls4a8bv+cQN5rv/2Zxovv2WgrzyebbPwtdWZiqYO8nTRlRl EXUA== X-Gm-Message-State: AC+VfDxk6YzXWmuZvPQmkyfCwsMN7a+V2I222M0Gqob5yOJQ7JXXSrgR QStiIBUkTAFa6ve9dyMg0oqSTw== X-Received: by 2002:a7b:c3cf:0:b0:3f4:220a:bbf8 with SMTP id t15-20020a7bc3cf000000b003f4220abbf8mr13053335wmj.34.1683875604597; Fri, 12 May 2023 00:13:24 -0700 (PDT) Received: from [192.168.1.91] (192.201.68.85.rev.sfr.net. [85.68.201.192]) by smtp.gmail.com with ESMTPSA id y12-20020adffa4c000000b00306281cfa59sm22474955wrr.47.2023.05.12.00.13.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 May 2023 00:13:24 -0700 (PDT) Message-ID: <2e5cae40-7040-a92f-3d11-ce68f1307049@baylibre.com> Date: Fri, 12 May 2023 09:13:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC Content-Language: en-US To: Linus Walleij Cc: Bartosz Golaszewski , Tony Lindgren , Lee Jones , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Jonathan Cormier References: <20230511-tps65219-add-gpio-support-v2-0-60feb64d649a@baylibre.com> <20230511-tps65219-add-gpio-support-v2-1-60feb64d649a@baylibre.com> From: jerome Neanne In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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.