X86 platform drivers
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Gross <markgross@kernel.org>,
	Andy Shevchenko <andy@kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Daniel Scally <djrscally@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Kate Hsuan <hpa@redhat.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 3/5] gpio: tps68470: Add support for the indicator LED outputs
Date: Tue, 29 Nov 2022 13:20:03 +0100	[thread overview]
Message-ID: <1940674f-84fc-e5c9-59c6-0e6389c9d285@redhat.com> (raw)
In-Reply-To: <CAHp75VdxRbFmqUzjmMbtmh1tDGMXre+A+2u-hz5H3HSLEBX+OQ@mail.gmail.com>

Hi,

On 11/29/22 12:59, Andy Shevchenko wrote:
> On Tue, Nov 29, 2022 at 1:32 PM Hans de Goede <hdegoede@redhat.com> wrote:
>> On 11/29/22 11:28, Andy Shevchenko wrote:
>>> On Mon, Nov 28, 2022 at 11:44 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>>>
>>>> The tps68470 has support for 2 indicator LED outputs called
>>>> ileda and iledb, at support for these as GPIO pins 10 + 11.
>>>
>>> add ?
>>
>> This models ileda and iledb outputs *as* GPIO pins 10 + 11
>> on the linux gpiochip.
>>
>> But yes it also adds gpio pins 10 + 11 to the gpiochip, so
>> either one works I guess :)
> 
> I had to be a bit more precise. 'at support'?! Perhaps it should be
> 'add support'?
> 
> ...
> 
>>>> +static void tps68470_gpio_get_reg_and_mask(bool get, unsigned int offset,
>>>> +                                          unsigned int *reg, int *mask)
>>>
>>> Hmm... Usual way is to put the get/set flag at the end of the list of
>>> parameters.
>>
>> For functions returning values by reference I always follow the
>> pattern of input parameters first, then output parameters.
>>
>>> Also why not naming it as 'dir' to avoid confusion with the _get in
>>> the function name?
>>
>> Because dir is meaningless without an enum to to define what a dir
>> of 0/false means. Where as get is clear without such an enum.
>> get is set to true when this function is called from
>> tps68470_gpio_get() and false when it is called from
>> tps68470_gpio_set(). It does not get more straight forward then that.
> 
> But it's about the buffer (in hw sense) to read value from. What about
> naming it out_or_in?

"out or in" still does not make clear what a value of true means
does true mean out or does it mean in ? 

I'm sorry, but just like with your comments on patch 1/3
I really don't see the problem here. Unlike "dir" or "out_or_in"
get is a perfectly fine parameter name which is actually clearly
defined by the parameter-name itself.

And the function + the callers are all in the same file, so
anyone reading the code can easily deduce the meaning from
the code.

Regards,

Hans




  reply	other threads:[~2022-11-29 12:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 21:44 [PATCH 0/5] gpio/media/int3472: Add support for tps68470 privacy-LED output Hans de Goede
2022-11-28 21:44 ` [PATCH 1/5] gpio: tps68470: Fix tps68470_gpio_get() reading from the wrong register Hans de Goede
2022-11-29 10:22   ` Andy Shevchenko
2022-11-29 11:27     ` Hans de Goede
2022-11-29 11:56       ` Andy Shevchenko
2022-11-29 12:19         ` Hans de Goede
2022-11-29 12:34           ` Andy Shevchenko
2022-11-29 12:59             ` Hans de Goede
2022-11-30 15:16   ` Dan Scally
2022-11-28 21:44 ` [PATCH 2/5] gpio: tps68470: Make tps68470_gpio_output() always set the initial value Hans de Goede
2022-11-29 10:24   ` Andy Shevchenko
2022-11-29 11:33     ` Hans de Goede
2022-11-30 16:04   ` Dan Scally
2022-11-28 21:44 ` [PATCH 3/5] gpio: tps68470: Add support for the indicator LED outputs Hans de Goede
2022-11-29 10:28   ` Andy Shevchenko
2022-11-29 11:32     ` Hans de Goede
2022-11-29 11:59       ` Andy Shevchenko
2022-11-29 12:20         ` Hans de Goede [this message]
2022-11-29 12:35           ` Andy Shevchenko
2022-11-28 21:44 ` [PATCH 4/5] media: ov8865: Add support for a privacy-led GPIO Hans de Goede
2022-11-28 21:44 ` [PATCH 5/5] platform/x86: int3472: Add support for the back privacy LED on Surface Go models Hans de Goede
2022-12-03  9:32 ` [PATCH 0/5] gpio/media/int3472: Add support for tps68470 privacy-LED output Linus Walleij
2022-12-03 12:28   ` Hans de Goede
2022-12-05 15:01     ` Hans de Goede
2022-12-05 21:26       ` Laurent Pinchart
2022-12-05 21:37         ` Hans de Goede
2022-12-07  0:25       ` Linus Walleij
2022-12-07 17:37         ` Hans de Goede
2022-12-05  9:18 ` Sakari Ailus

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=1940674f-84fc-e5c9-59c6-0e6389c9d285@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=djrscally@gmail.com \
    --cc=hpa@redhat.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.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