From: Rob Herring <robh@kernel.org>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>,
Lizhi Hou <lizhi.hou@amd.com>
Cc: Lee Jones <lee@kernel.org>,
devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@axis.com
Subject: Re: [PATCH] mfd: Add Simple PCI MFD driver
Date: Mon, 23 Jan 2023 10:13:06 -0600 [thread overview]
Message-ID: <CAL_JsqKKJn3iuHu-Q5XTknCbAW1gt1BmF0w4Gzfcq2S5mv0gZw@mail.gmail.com> (raw)
In-Reply-To: <20230120-simple-mfd-pci-v1-1-c46b3d6601ef@axis.com>
On Mon, Jan 23, 2023 at 8:32 AM Vincent Whitchurch
<vincent.whitchurch@axis.com> wrote:
>
> Add a PCI driver which registers all child nodes specified in the
> devicetree. It will allow platform devices to be used on virtual
> systems which already support PCI and devicetree, such as UML with
> virt-pci.
There's similar work underway for Xilinx/AMD PCIe FPGAs[1]. It's the
same thing really. Non-discoverable things downstream of a PCI device.
There's also a desire for that to work on non-DT (ACPI) based hosts.
While UML supports DT, that's currently only for the unittest AFAIK.
So it's more like a non-DT host. How does the DT get populated for UML
for this to work?
Can you provide details on the actual h/w you want to use. What
problem are you trying to solve?
Really, what I want to see here is everyone interested in this feature
to work together on it. Not just creating a one-off solution for their
1 use case that's a subset of a bigger solution.
> The driver has no id_table by default; user space needs to provide one
> using the new_id mechanism in sysfs.
But your DT will have the id in it already. Wouldn't you rather
everything work without userspace intervention? I can't imagine the
list here would be too long.
>
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
> ---
> drivers/mfd/Kconfig | 11 +++++++++++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/simple-mfd-pci.c | 21 +++++++++++++++++++++
> 3 files changed, 33 insertions(+)
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 30db49f31866..1e325334e9ae 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1277,6 +1277,17 @@ config MFD_SIMPLE_MFD_I2C
> sub-devices represented by child nodes in Device Tree will be
> subsequently registered.
>
> +config MFD_SIMPLE_MFD_PCI
> + tristate "Simple Multi-Functional Device support (PCI)"
> + depends on PCI
> + depends on OF || COMPILE_TEST
> + help
> + This enables support for a PCI driver for which any sub-devices
> + represented by child nodes in the devicetree will be registered.
> +
> + The driver does not bind to any devices by default; that should
> + be done via sysfs using new_id.
> +
> config MFD_SL28CPLD
> tristate "Kontron sl28cpld Board Management Controller"
> depends on I2C
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 457471478a93..7ae329039a13 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -268,6 +268,7 @@ obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o
>
> obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o
> obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o
> +obj-$(CONFIG_MFD_SIMPLE_MFD_PCI) += simple-mfd-pci.o
> obj-$(CONFIG_MFD_SMPRO) += smpro-core.o
> obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o
>
> diff --git a/drivers/mfd/simple-mfd-pci.c b/drivers/mfd/simple-mfd-pci.c
> new file mode 100644
> index 000000000000..c5b2540e924a
> --- /dev/null
> +++ b/drivers/mfd/simple-mfd-pci.c
> @@ -0,0 +1,21 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> +#include <linux/pci.h>
> +
> +static int simple_mfd_pci_probe(struct pci_dev *pdev,
> + const struct pci_device_id *id)
> +{
> + return devm_of_platform_populate(&pdev->dev);
Really, this could be anything in the child DT. Not just what Linux
classifies as an MFD. So maybe drivers/mfd is not the right place.
Rob
[1] https://lore.kernel.org/all/1674183732-5157-1-git-send-email-lizhi.hou@amd.com/
next prev parent reply other threads:[~2023-01-23 16:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 14:32 [PATCH] mfd: Add Simple PCI MFD driver Vincent Whitchurch
2023-01-23 15:32 ` Lee Jones
2023-01-23 16:02 ` Vincent Whitchurch
2023-01-23 16:36 ` Rob Herring
2023-01-24 2:30 ` Lizhi Hou
2023-01-24 13:15 ` Vincent Whitchurch
2023-01-23 16:31 ` Greg Kroah-Hartman
2023-01-25 10:15 ` Vincent Whitchurch
2023-01-25 12:29 ` Greg Kroah-Hartman
2023-01-25 13:06 ` Vincent Whitchurch
2023-01-25 13:34 ` Greg Kroah-Hartman
2023-01-25 14:54 ` Rob Herring
2023-01-25 15:00 ` Greg Kroah-Hartman
2023-01-25 15:34 ` Rob Herring
2023-01-31 15:07 ` Greg Kroah-Hartman
2023-01-23 16:13 ` Rob Herring [this message]
2023-01-24 12:54 ` Vincent Whitchurch
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=CAL_JsqKKJn3iuHu-Q5XTknCbAW1gt1BmF0w4Gzfcq2S5mv0gZw@mail.gmail.com \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@axis.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=vincent.whitchurch@axis.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;
as well as URLs for NNTP newsgroup(s).