From: jerome Neanne <jneanne@baylibre.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Tony Lindgren <tony@atomide.com>, Lee Jones <lee@kernel.org>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-omap@vger.kernel.org,
Jonathan Cormier <jcormier@criticallink.com>
Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC
Date: Fri, 12 May 2023 09:13:23 +0200 [thread overview]
Message-ID: <2e5cae40-7040-a92f-3d11-ce68f1307049@baylibre.com> (raw)
In-Reply-To: <CACRpkdbjjoOoGeaqv9yQ4fTKqxt5eLDBjZCnNAYQnng3L+n8TQ@mail.gmail.com>
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.
next prev parent reply other threads:[~2023-05-12 7:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 14:09 [PATCH v2 0/2] Add support for TI TPS65219 PMIC GPIO interface Jerome Neanne
2023-05-11 14:09 ` [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC Jerome Neanne
2023-05-11 20:57 ` Linus Walleij
2023-05-12 7:13 ` jerome Neanne [this message]
2023-05-17 6:33 ` Tony Lindgren
2023-05-22 12:26 ` jerome Neanne
2023-05-15 15:36 ` Bartosz Golaszewski
2023-05-16 13:49 ` jerome Neanne
2023-05-20 9:44 ` andy.shevchenko
2023-05-22 7:47 ` jerome Neanne
2023-05-22 11:18 ` Andy Shevchenko
2023-05-23 9:09 ` jerome Neanne
2023-05-26 13:31 ` Bartosz Golaszewski
2023-05-11 14:09 ` [PATCH v2 2/2] mfd: tps65219: Add gpio cell instance Jerome Neanne
2023-05-11 20:59 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e5cae40-7040-a92f-3d11-ce68f1307049@baylibre.com \
--to=jneanne@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=jcormier@criticallink.com \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®