From: Linus Walleij <linus.walleij@linaro.org>
To: Thomas Richard <thomas.richard@bootlin.com>
Cc: Lee Jones <lee@kernel.org>, Bartosz Golaszewski <brgl@bgdev.pl>,
Andi Shyti <andi.shyti@kernel.org>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-i2c@vger.kernel.org, linux-watchdog@vger.kernel.org,
thomas.petazzoni@bootlin.com, blake.vermeer@keysight.com
Subject: Re: [PATCH v2 2/5] gpio: Congatec Board Controller gpio driver
Date: Tue, 17 Sep 2024 21:25:56 +0200 [thread overview]
Message-ID: <CACRpkdbtwF-k3fHFvpXD+m8KN2XCt56X=iOXbideds0v+LWqWw@mail.gmail.com> (raw)
In-Reply-To: <20240503-congatec-board-controller-v2-2-681511a01c8f@bootlin.com>
Hi Thomas,
thanks for your patch!
Some comments:
On Tue, Sep 17, 2024 at 7:00 PM Thomas Richard
<thomas.richard@bootlin.com> wrote:
> Add gpio support for the Congatec Board Controller.
>
> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
That's a bit terse commit message. At least mention that it sits under
the MFD.
> @@ -233,6 +233,16 @@ config GPIO_CADENCE
> help
> Say yes here to enable support for Cadence GPIO controller.
>
> +config GPIO_CGBC
> + tristate "Congatec Board Controller GPIO support"
> + depends on MFD_CGBC
> + help
> + Select this option to enable GPIO support for the Congatec Board
> + Controller.
> +
> + This driver can also be built as a module. If so, the module will be
> + called gpio-cgbc.
> +
> config GPIO_CLPS711X
This is in the middle of the memory-mapped GPIO drivers.
This is not a memory-mapped driver.
Move it down in the menu to the submenu for MFD GPIO
drivers please.
> +static void __cgbc_gpio_set(struct gpio_chip *chip,
> + unsigned int offset, int value)
> +{
> + struct cgbc_gpio_data *gpio = gpiochip_get_data(chip);
> + struct cgbc_device_data *cgbc = gpio->cgbc;
> + u8 val;
> + int ret;
> +
> + ret = cgbc_gpio_cmd(cgbc, CGBC_GPIO_CMD_GET, (offset > 7) ? 1 : 0, 0, &val);
> + if (ret)
> + return;
> +
> + if (value)
> + val |= BIT(offset % 8);
> + else
> + val &= ~((u8)BIT(offset % 8));
Is that cast really needed? (If you tried without and it
cause compilation problems, I believe you, if someone
smarter than me said it should be there, ignore me.)
> + if (direction == GPIO_LINE_DIRECTION_IN)
> + val &= ~((u8)BIT(offset % 8));
Dito.
Apart from this it looks very nice, so with the above
addressed:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
next prev parent reply other threads:[~2024-09-17 19:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 17:00 [PATCH v2 0/5] Congatec Board Controller drivers Thomas Richard
2024-09-17 17:00 ` [PATCH v2 1/5] mfd: add Congatec Board Controller mfd driver Thomas Richard
2024-09-17 17:00 ` [PATCH v2 2/5] gpio: Congatec Board Controller gpio driver Thomas Richard
2024-09-17 19:25 ` Linus Walleij [this message]
2024-09-17 17:00 ` [PATCH v2 3/5] i2c: Congatec Board Controller i2c bus driver Thomas Richard
2024-10-01 10:00 ` Andi Shyti
2024-11-19 22:41 ` Andi Shyti
2024-11-20 7:02 ` Andi Shyti
2024-09-17 17:00 ` [PATCH v2 4/5] watchdog: Congatec Board Controller watchdog timer driver Thomas Richard
2024-09-20 14:55 ` Guenter Roeck
2024-09-17 17:00 ` [PATCH v2 5/5] MAINTAINERS: Add entry for Congatec Board Controller Thomas Richard
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='CACRpkdbtwF-k3fHFvpXD+m8KN2XCt56X=iOXbideds0v+LWqWw@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=andi.shyti@kernel.org \
--cc=blake.vermeer@keysight.com \
--cc=brgl@bgdev.pl \
--cc=lee@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=thomas.petazzoni@bootlin.com \
--cc=thomas.richard@bootlin.com \
--cc=wim@linux-watchdog.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).