From: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Michael Walle <michael@walle.cc>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] gpio: regmap: Support combined GPIO and pin control drivers
Date: Mon, 04 Jul 2022 16:31:57 +0100 [thread overview]
Message-ID: <yG5ebSToQJ6Oj2Oe8C7JimXFFcPT8LJ8@localhost> (raw)
In-Reply-To: <CAHp75VcshqBNtd7HFMR39Fh3mR=Uv0m4rznpFPDhix3hB0or7g@mail.gmail.com>
Andy Shevchenko <andy.shevchenko@gmail.com> writes:
> On Sun, Jul 3, 2022 at 1:11 PM Aidan MacDonald
> <aidanmacdonald.0x0@gmail.com> wrote:
>>
>> Allow gpio-regmap to be used for the GPIO portion of a combined
>> pin control and GPIO driver by setting the has_pinctrl flag. This
>> flag will cause GPIO direction set ops to be implemented as calls
>> to pinctrl_gpio_direction_input/output() instead of updating the
>> direction set registers directly.
>>
>> Note that reg_dir_out/in_base is still required for implementing
>> the GPIO chip's ->get_direction() callback.
>
> ...
>
>> + /*
>> + * we need a direction register for implementing ->get_direction
>> + * even if ->direction_input/output is handled by pin control
>> + */
>
> /*
> * Multi-line comments go with this format
> * or style. Pay attention to the capitalization
> * and English grammar, e.g. period at the end of sentence(s).
> */
>
I used this "style" to match the surrounding code, but I suppose
I might as well fix the other comments while I'm here.
>> + if (config->has_pinctrl && !(config->reg_dir_in_base ||
>> + config->reg_dir_out_base))
>
> Can you re-indent this either to be one line or put the second part of
> the conditional onto the second line?
Yep.
>
> And why not use && everywhere?
>
No reason to be honest, but maybe it's easier to understand?
"has pin control and doesn't set reg_dir_in_base or reg_dir_out_base".
Using && is more like this:
"has pin control, doesn't set reg_dir_in_base, and doesn't
set reg_dir_out_base".
next prev parent reply other threads:[~2022-07-04 15:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-03 11:10 [PATCH 0/3] gpio-regmap support for register fields and other hooks Aidan MacDonald
2022-07-03 11:10 ` [PATCH 1/3] gpio: regmap: Support registers with more than one bit per GPIO Aidan MacDonald
2022-07-03 14:09 ` Andy Shevchenko
2022-07-04 16:03 ` Aidan MacDonald
2022-07-04 12:28 ` Michael Walle
2022-07-04 16:01 ` Aidan MacDonald
2022-07-04 19:46 ` Michael Walle
2022-07-06 20:46 ` Aidan MacDonald
2022-07-07 7:44 ` Michael Walle
2022-07-07 14:58 ` Aidan MacDonald
2022-07-03 11:10 ` [PATCH 2/3] gpio: regmap: Support combined GPIO and pin control drivers Aidan MacDonald
2022-07-03 14:14 ` Andy Shevchenko
2022-07-04 15:31 ` Aidan MacDonald [this message]
2022-07-03 11:10 ` [PATCH 3/3] gpio: regmap: Support a custom ->to_irq() hook Aidan MacDonald
2022-07-03 14:24 ` Andy Shevchenko
2022-07-04 16:38 ` Aidan MacDonald
2022-07-04 23:05 ` Linus Walleij
2022-07-05 11:09 ` Aidan MacDonald
2022-07-06 11:45 ` Andy Shevchenko
2022-07-06 20:53 ` Aidan MacDonald
2022-07-06 12:02 ` Linus Walleij
2022-07-06 13:50 ` Aidan MacDonald
2022-07-11 11:48 ` 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=yG5ebSToQJ6Oj2Oe8C7JimXFFcPT8LJ8@localhost \
--to=aidanmacdonald.0x0@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
/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).