linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: jerome Neanne <jneanne@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>, 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: Wed, 17 May 2023 09:33:03 +0300	[thread overview]
Message-ID: <20230517063303.GO14287@atomide.com> (raw)
In-Reply-To: <2e5cae40-7040-a92f-3d11-ce68f1307049@baylibre.com>

* jerome Neanne <jneanne@baylibre.com> [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


  reply	other threads:[~2023-05-17  6:33 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
2023-05-17  6:33       ` Tony Lindgren [this message]
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=20230517063303.GO14287@atomide.com \
    --to=tony@atomide.com \
    --cc=brgl@bgdev.pl \
    --cc=jcormier@criticallink.com \
    --cc=jneanne@baylibre.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 \
    /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;
as well as URLs for NNTP newsgroup(s).