From: Lee Jones <lee@kernel.org>
To: Thomas Richard <thomas.richard@bootlin.com>
Cc: Linus Walleij <linus.walleij@linaro.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 1/5] mfd: add Congatec Board Controller mfd driver
Date: Thu, 12 Sep 2024 15:13:09 +0100 [thread overview]
Message-ID: <20240912141309.GC24460@google.com> (raw)
In-Reply-To: <9f29d904-e7ba-40fb-b5d8-1efeddf6f148@bootlin.com>
On Tue, 10 Sep 2024, Thomas Richard wrote:
> On 8/22/24 12:38, Lee Jones wrote:
> > On Fri, 09 Aug 2024, Thomas Richard wrote:
> >
> >> Add core MFD driver for the Board Controller found on some Congatec SMARC
> >> module. This Board Controller provides functions like watchdog, GPIO, and
> >> I2C busses.
> >>
> >> This commit add support only for the conga-SA7 module.
> >>
> >> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
> >> ---
> >> drivers/mfd/Kconfig | 12 ++
> >> drivers/mfd/Makefile | 1 +
> >> drivers/mfd/cgbc-core.c | 453 +++++++++++++++++++++++++++++++++++++++++++++++
> >> include/linux/mfd/cgbc.h | 44 +++++
> >> 4 files changed, 510 insertions(+)
> >>
> >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> >> index bc8be2e593b6..3e0530f30267 100644
> >> --- a/drivers/mfd/Kconfig
> >> +++ b/drivers/mfd/Kconfig
> >> @@ -224,6 +224,18 @@ config MFD_AXP20X_RSB
> >> components like regulators or the PEK (Power Enable Key) under the
> >> corresponding menus.
> >>
> >> +config MFD_CGBC
> >> + tristate "Congatec Board Controller"
> >> + select MFD_CORE
> >> + depends on X86
> >> + help
> >> + This is the core driver of the Board Controller found on some Congatec
> >> + SMARC modules. The Board Controller provides functions like watchdog,
> >> + I2C busses, and GPIO controller.
> >> +
> >> + To compile this driver as a module, choose M here: the module will be
> >> + called cgbc-core.
> >> +
> >> config MFD_CROS_EC_DEV
> >> tristate "ChromeOS Embedded Controller multifunction device"
> >> select MFD_CORE
> >> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> >> index 02b651cd7535..d5da3fcd691c 100644
> >> --- a/drivers/mfd/Makefile
> >> +++ b/drivers/mfd/Makefile
> >> @@ -13,6 +13,7 @@ obj-$(CONFIG_MFD_SM501) += sm501.o
> >> obj-$(CONFIG_ARCH_BCM2835) += bcm2835-pm.o
> >> obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o
> >> obj-$(CONFIG_MFD_BD9571MWV) += bd9571mwv.o
> >> +obj-$(CONFIG_MFD_CGBC) += cgbc-core.o
> >> obj-$(CONFIG_MFD_CROS_EC_DEV) += cros_ec_dev.o
> >> obj-$(CONFIG_MFD_CS42L43) += cs42l43.o
> >> obj-$(CONFIG_MFD_CS42L43_I2C) += cs42l43-i2c.o
> >> diff --git a/drivers/mfd/cgbc-core.c b/drivers/mfd/cgbc-core.c
> >> new file mode 100644
> >> index 000000000000..cca9b1170cc9
> >> --- /dev/null
> >> +++ b/drivers/mfd/cgbc-core.c
> >> @@ -0,0 +1,453 @@
> >> +// SPDX-License-Identifier: GPL-2.0-or-later
> >> +/*
> >> + * Congatec Board Controller MFD core driver.
> >
> > No such thing as an MFD.
>
> What should it be if it's not an MFD ?
You should be telling me this. :)
"Board Controller" according to the Kconfig entry.
> >> +static struct platform_device *cgbc_pdev;
> >
> > No avoidable globals.
>
> I don't see how can I have cgbc_pdev not global.
Because of the incestuous, "I am my own parent", thing? Okay.
> >> +static void cgbc_session_release(struct cgbc_device_data *cgbc)
> >> +{
> >> + if (cgbc_session_command(cgbc, cgbc->session) != cgbc->session)
> >
> > What does this do?
> >
> > Are we checking or doing something? If the latter, then we shouldn't be
> > doing that in an if() statement. If the former, then what's the point
> > of the function?
>
> We try to close the session we opened with the device.
> We check that the session is closed correctly.
Please remove it from the if statement and store the result in variable
with suitable nomenclature please.
[...]
In future, please snip everything you do not wish to discuss.
> Thanks for the review !!
No problem.
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2024-09-12 14:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 14:52 [PATCH 0/5] Congatec Board Controller drivers Thomas Richard
2024-08-09 14:52 ` [PATCH 1/5] mfd: add Congatec Board Controller mfd driver Thomas Richard
2024-08-22 10:38 ` Lee Jones
2024-09-10 15:41 ` Thomas Richard
2024-09-12 14:13 ` Lee Jones [this message]
2024-09-13 8:30 ` Thomas Richard
2024-09-17 8:09 ` Lee Jones
2024-08-09 14:52 ` [PATCH 2/5] gpio: Congatec Board Controller gpio driver Thomas Richard
2024-08-14 9:16 ` Bartosz Golaszewski
2024-08-19 16:11 ` Thomas Richard
2024-08-09 14:52 ` [PATCH 3/5] i2c: Congatec Board Controller i2c bus driver Thomas Richard
2024-08-13 23:24 ` Andi Shyti
2024-09-06 13:29 ` Thomas Richard
2024-09-09 19:29 ` Andi Shyti
2024-08-09 14:52 ` [PATCH 4/5] watchdog: Congatec Board Controller watchdog timer driver Thomas Richard
2024-08-09 16:27 ` Guenter Roeck
2024-09-02 13:38 ` Thomas Richard
2024-08-09 14:52 ` [PATCH 5/5] MAINTAINERS: Add entry for Congatec Board Controller Thomas Richard
2024-08-13 23:26 ` Andi Shyti
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=20240912141309.GC24460@google.com \
--to=lee@kernel.org \
--cc=andi.shyti@kernel.org \
--cc=blake.vermeer@keysight.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.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).