mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jerome Neanne <jneanne@baylibre.com>
To: andy.shevchenko@gmail.com
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Tony Lindgren <tony@atomide.com>, Lee Jones <lee@kernel.org>,
	khilman@baylibre.com, msp@baylibre.com, francesco@dolcini.it,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-omap@vger.kernel.org,
	Jonathan Cormier <jcormier@criticallink.com>
Subject: Re: [PATCH v4 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC
Date: Tue, 6 Jun 2023 14:45:51 +0200	[thread overview]
Message-ID: <e487f966-aafb-7d21-935d-b1d0ac7c21ac@baylibre.com> (raw)
In-Reply-To: <ZHXZBCwk6tTu8gjY@surfacebook>



On 30/05/2023 13:07, andy.shevchenko@gmail.com wrote:
> Tue, May 30, 2023 at 09:59:59AM +0200, Jerome Neanne kirjoitti:
> 
> First of all, I have a bit of déjà vu that I have given already some comments
> that left neither answered nor addressed.
Sorry for that. I did not realized that some comments on the cover 
letter also apply to commit message.
> 
>> Add support for TPS65219 PMICs GPIO interface.
>>
>> 3 GPIO pins:
>> - GPIO0 only is IO but input mode reserved for MULTI_DEVICE_ENABLE usage
>> - GPIO1 and GPIO2 are Output only and referred as GPO1 and GPO2 in spec
>>
>> GPIO0 is statically configured as input or output prior to Linux boot.
>> it is used for MULTI_DEVICE_ENABLE function.
>> This setting is statically configured by NVM.
>> GPIO0 can't be used as a generic GPIO (specification Table 8-34).
>> It's either a GPO when MULTI_DEVICE_EN=0 or a GPI when MULTI_DEVICE_EN=1.
>>
>> Datasheet describes specific usage for non standard GPIO.
>> Link: https://www.ti.com/lit/ds/symlink/tps65219.pdf
> 
> Can you convert this to be a Datasheet tag? Currently even Link is *not* a tag
> because there must be no blank lines in the tag block.
> 
>> Co-developed-by: Jonathan Cormier <jcormier@criticallink.com>
>> Signed-off-by: Jonathan Cormier <jcormier@criticallink.com>
>> Signed-off-by: Jerome Neanne <jneanne@baylibre.com>
> 
I misinterpreted this comment. I looked at wrong examples but I think I 
understand now that the right usage is to have all the tags grouped 
together into one block which is delimited by blank lines before and 
after the whole block.
I'll then do this and put all the Datasheet/Link into the tag block. 
Stop putting Links inside the commit message right after I refer to it.
https://www.kernel.org/doc/html/latest/process/5.Posting.html#patch-formatting-and-changelogs

> ...
> 
>> +	help
>> +	  Select this option to enable GPIO driver for the TPS65219 chip family.
>> +	  GPIO0 is statically configured as input or output prior to Linux boot.
>> +	  It is used for MULTI_DEVICE_ENABLE function.
>> +	  This setting is statically configured by NVM.
>> +	  GPIO0 can't be used as a generic GPIO.
>> +	  It's either a GPO when MULTI_DEVICE_EN=0 or a GPI when MULTI_DEVICE_EN=1.
>> +
>> +	  This driver can also be built as a module.
>> +	  If so, the module will be called gpio_tps65219.
> 
> Random indentation. Can you use as much room as available on each line, please?
Sure for next iteration, I choosed 80 columns here to stay consistent 
with other configs. I kept a carriage return after the first sentence 
like it is done for other descriptions.
This driver can also be built as a module... is separated with a blank 
line as it is done in all other configs.
For all the other lines, I now keep the same line until last word 
strictly exceed column 80.

> 
>> @@ -0,0 +1,181 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * GPIO driver for TI TPS65219 PMICs
>> + *
>> + * Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/
>> + */
>> +
>> +#include <linux/bits.h>
>> +#include <linux/gpio/driver.h>
>> +#include <linux/mfd/tps65219.h>
>> +#include <linux/module.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/regmap.h>
> 
> ...
> 
>> +static int tps65219_gpio_get(struct gpio_chip *gc, unsigned int offset)
>> +{
>> +	struct tps65219_gpio *gpio = gpiochip_get_data(gc);
>> +	struct device *dev = gpio->tps->dev;
>> +	int ret, val;
>> +
>> +	if (offset != TPS65219_GPIO0_IDX) {
>> +		dev_err(dev, "GPIO%d is output only, cannot get\n", offset);
> 
>> +		return -EOPNOTSUPP;
> 
> This seems blind following the checkpatch false warning. The checkpatch does
> not know about subsystem details, i.e. GPIOLIB uses ENOTSUPP in the callbacks.
> The userspace won't see that as GPIOLIB takes care of translating it when
> needed.
> 
Thanks for explaining, I'm often in trouble for choosing the error code. 
I'll replace here and all other places where it's used with EOPNOTSUPP.

Regards,
Jerome

  reply	other threads:[~2023-06-06 12:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30  7:59 [PATCH v4 0/2] Add support for TI TPS65219 PMIC GPIO interface Jerome Neanne
2023-05-30  7:59 ` [PATCH v4 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC Jerome Neanne
2023-05-30 11:07   ` andy.shevchenko
2023-06-06 12:45     ` jerome Neanne [this message]
2023-06-06 14:36       ` Andy Shevchenko
2023-05-30 11:36   ` Linus Walleij
2023-05-30  8:00 ` [PATCH v4 2/2] mfd: tps65219: Add gpio cell instance Jerome Neanne

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=e487f966-aafb-7d21-935d-b1d0ac7c21ac@baylibre.com \
    --to=jneanne@baylibre.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=francesco@dolcini.it \
    --cc=jcormier@criticallink.com \
    --cc=khilman@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 \
    --cc=msp@baylibre.com \
    --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®