All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Liu Ying <victor.liu@nxp.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de,
	festevam@gmail.com, linux-imx@nxp.com
Subject: Re: [PATCH RESEND] mfd: Add Freescale i.MX8qxp Control and Status Registers (CSR) module driver
Date: Mon, 31 Oct 2022 15:40:01 +0000	[thread overview]
Message-ID: <Y1/sUfeVy1a6EKZQ@google.com> (raw)
In-Reply-To: <20221017075702.4182846-1-victor.liu@nxp.com>

On Mon, 17 Oct 2022, Liu Ying wrote:

> Freescale i.MX8qxp Control and Status Registers (CSR) module is a system
> controller. It represents a set of miscellaneous registers of a specific
> subsystem. It may provide control and/or status report interfaces to a
> mix of standalone hardware devices within that subsystem.
> 
> The CSR module in i.MX8qm/qxp SoCs is a child node of a simple power-managed
> bus(i.MX8qxp pixel link MSI bus). To propagate power management operations
> of the CSR module's child devices to that simple power-managed bus, add a
> dedicated driver for the CSR module. Also, the driver would populate the CSR
> module's child devices.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
> The Freescale i.MX8qxp CSR DT bindings is at
> Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml.
> 
> Resend the patch based on v6.1-rc1.
> 
>  drivers/mfd/Kconfig           | 10 +++++++
>  drivers/mfd/Makefile          |  1 +
>  drivers/mfd/fsl-imx8qxp-csr.c | 53 +++++++++++++++++++++++++++++++++++
>  3 files changed, 64 insertions(+)
>  create mode 100644 drivers/mfd/fsl-imx8qxp-csr.c
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 8b93856de432..966a250d7910 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -499,6 +499,16 @@ config MFD_MX25_TSADC
>  	  i.MX25 processors. They consist of a conversion queue for general
>  	  purpose ADC and a queue for Touchscreens.
>  
> +config MFD_MX8QXP_CSR
> +	tristate "Freescale i.MX8qxp Control and Status Registers (CSR) Module"
> +	depends on (ARCH_MXC && OF) || COMPILE_TEST
> +	help
> +	  Enable support for Freescale i.MX8qm/qxp Control and Status Registers
> +	  (CSR) Module. As a system controller, CSR represents a set of
> +	  miscellaneous registers of a specific subsystem. It may provide
> +	  control and/or status report interfaces to a mix of standalone
> +	  hardware devices within that subsystem.
> +
>  config MFD_HI6421_PMIC
>  	tristate "HiSilicon Hi6421 PMU/Codec IC"
>  	depends on OF
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 7ed3ef4a698c..5c3c13d7ce85 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -113,6 +113,7 @@ obj-$(CONFIG_MFD_TWL4030_AUDIO)	+= twl4030-audio.o
>  obj-$(CONFIG_TWL6040_CORE)	+= twl6040.o
>  
>  obj-$(CONFIG_MFD_MX25_TSADC)	+= fsl-imx25-tsadc.o
> +obj-$(CONFIG_MFD_MX8QXP_CSR)	+= fsl-imx8qxp-csr.o
>  
>  obj-$(CONFIG_MFD_MC13XXX)	+= mc13xxx-core.o
>  obj-$(CONFIG_MFD_MC13XXX_SPI)	+= mc13xxx-spi.o
> diff --git a/drivers/mfd/fsl-imx8qxp-csr.c b/drivers/mfd/fsl-imx8qxp-csr.c
> new file mode 100644
> index 000000000000..3915d3d6ca65
> --- /dev/null
> +++ b/drivers/mfd/fsl-imx8qxp-csr.c
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +/*
> + * Copyright 2022 NXP
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
> +
> +static int imx8qxp_csr_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +
> +	pm_runtime_enable(&pdev->dev);
> +
> +	ret = devm_of_platform_populate(&pdev->dev);

The use of this API does not constitute a MFD.

Please use "simple-mfd" instead.

> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "failed to populate sub-devices: %d\n", ret);
> +		pm_runtime_disable(&pdev->dev);
> +	}
> +
> +	return ret;
> +}
> +
> +static int imx8qxp_csr_remove(struct platform_device *pdev)
> +{
> +	pm_runtime_disable(&pdev->dev);
> +	return 0;
> +}
> +
> +static const struct of_device_id imx8qxp_csr_of_match[] = {
> +	{ .compatible = "fsl,imx8qxp-mipi-lvds-csr", },
> +	{ .compatible = "fsl,imx8qm-lvds-csr", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, imx8qxp_csr_of_match);
> +
> +static struct platform_driver imx8qxp_csr_driver = {
> +	.probe = imx8qxp_csr_probe,
> +	.remove = imx8qxp_csr_remove,
> +	.driver = {
> +		.name = "imx8qxp-csr",
> +		.of_match_table = imx8qxp_csr_of_match,
> +	},
> +};
> +
> +module_platform_driver(imx8qxp_csr_driver);
> +
> +MODULE_DESCRIPTION("Freescale i.MX8qm/qxp Control and Status Registers Module Driver");
> +MODULE_AUTHOR("Liu Ying <victor.liu@nxp.com>");
> +MODULE_LICENSE("GPL v2");

-- 
Lee Jones [李琼斯]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee@kernel.org>
To: Liu Ying <victor.liu@nxp.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de,
	festevam@gmail.com, linux-imx@nxp.com
Subject: Re: [PATCH RESEND] mfd: Add Freescale i.MX8qxp Control and Status Registers (CSR) module driver
Date: Mon, 31 Oct 2022 15:40:01 +0000	[thread overview]
Message-ID: <Y1/sUfeVy1a6EKZQ@google.com> (raw)
In-Reply-To: <20221017075702.4182846-1-victor.liu@nxp.com>

On Mon, 17 Oct 2022, Liu Ying wrote:

> Freescale i.MX8qxp Control and Status Registers (CSR) module is a system
> controller. It represents a set of miscellaneous registers of a specific
> subsystem. It may provide control and/or status report interfaces to a
> mix of standalone hardware devices within that subsystem.
> 
> The CSR module in i.MX8qm/qxp SoCs is a child node of a simple power-managed
> bus(i.MX8qxp pixel link MSI bus). To propagate power management operations
> of the CSR module's child devices to that simple power-managed bus, add a
> dedicated driver for the CSR module. Also, the driver would populate the CSR
> module's child devices.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
> The Freescale i.MX8qxp CSR DT bindings is at
> Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml.
> 
> Resend the patch based on v6.1-rc1.
> 
>  drivers/mfd/Kconfig           | 10 +++++++
>  drivers/mfd/Makefile          |  1 +
>  drivers/mfd/fsl-imx8qxp-csr.c | 53 +++++++++++++++++++++++++++++++++++
>  3 files changed, 64 insertions(+)
>  create mode 100644 drivers/mfd/fsl-imx8qxp-csr.c
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 8b93856de432..966a250d7910 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -499,6 +499,16 @@ config MFD_MX25_TSADC
>  	  i.MX25 processors. They consist of a conversion queue for general
>  	  purpose ADC and a queue for Touchscreens.
>  
> +config MFD_MX8QXP_CSR
> +	tristate "Freescale i.MX8qxp Control and Status Registers (CSR) Module"
> +	depends on (ARCH_MXC && OF) || COMPILE_TEST
> +	help
> +	  Enable support for Freescale i.MX8qm/qxp Control and Status Registers
> +	  (CSR) Module. As a system controller, CSR represents a set of
> +	  miscellaneous registers of a specific subsystem. It may provide
> +	  control and/or status report interfaces to a mix of standalone
> +	  hardware devices within that subsystem.
> +
>  config MFD_HI6421_PMIC
>  	tristate "HiSilicon Hi6421 PMU/Codec IC"
>  	depends on OF
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 7ed3ef4a698c..5c3c13d7ce85 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -113,6 +113,7 @@ obj-$(CONFIG_MFD_TWL4030_AUDIO)	+= twl4030-audio.o
>  obj-$(CONFIG_TWL6040_CORE)	+= twl6040.o
>  
>  obj-$(CONFIG_MFD_MX25_TSADC)	+= fsl-imx25-tsadc.o
> +obj-$(CONFIG_MFD_MX8QXP_CSR)	+= fsl-imx8qxp-csr.o
>  
>  obj-$(CONFIG_MFD_MC13XXX)	+= mc13xxx-core.o
>  obj-$(CONFIG_MFD_MC13XXX_SPI)	+= mc13xxx-spi.o
> diff --git a/drivers/mfd/fsl-imx8qxp-csr.c b/drivers/mfd/fsl-imx8qxp-csr.c
> new file mode 100644
> index 000000000000..3915d3d6ca65
> --- /dev/null
> +++ b/drivers/mfd/fsl-imx8qxp-csr.c
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +/*
> + * Copyright 2022 NXP
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
> +
> +static int imx8qxp_csr_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +
> +	pm_runtime_enable(&pdev->dev);
> +
> +	ret = devm_of_platform_populate(&pdev->dev);

The use of this API does not constitute a MFD.

Please use "simple-mfd" instead.

> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "failed to populate sub-devices: %d\n", ret);
> +		pm_runtime_disable(&pdev->dev);
> +	}
> +
> +	return ret;
> +}
> +
> +static int imx8qxp_csr_remove(struct platform_device *pdev)
> +{
> +	pm_runtime_disable(&pdev->dev);
> +	return 0;
> +}
> +
> +static const struct of_device_id imx8qxp_csr_of_match[] = {
> +	{ .compatible = "fsl,imx8qxp-mipi-lvds-csr", },
> +	{ .compatible = "fsl,imx8qm-lvds-csr", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, imx8qxp_csr_of_match);
> +
> +static struct platform_driver imx8qxp_csr_driver = {
> +	.probe = imx8qxp_csr_probe,
> +	.remove = imx8qxp_csr_remove,
> +	.driver = {
> +		.name = "imx8qxp-csr",
> +		.of_match_table = imx8qxp_csr_of_match,
> +	},
> +};
> +
> +module_platform_driver(imx8qxp_csr_driver);
> +
> +MODULE_DESCRIPTION("Freescale i.MX8qm/qxp Control and Status Registers Module Driver");
> +MODULE_AUTHOR("Liu Ying <victor.liu@nxp.com>");
> +MODULE_LICENSE("GPL v2");

-- 
Lee Jones [李琼斯]

  parent reply	other threads:[~2022-10-31 15:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  7:57 [PATCH RESEND] mfd: Add Freescale i.MX8qxp Control and Status Registers (CSR) module driver Liu Ying
2022-10-17  7:57 ` Liu Ying
2022-10-31  8:44 ` Liu Ying
2022-10-31  8:44   ` Liu Ying
2022-10-31  9:30   ` Lee Jones
2022-10-31  9:30     ` Lee Jones
2022-10-31 15:40 ` Lee Jones [this message]
2022-10-31 15:40   ` Lee Jones
2022-11-01  5:53   ` Liu Ying
2022-11-01  5:53     ` Liu Ying
2022-11-02  3:49     ` Liu Ying
2022-11-02  3:49       ` Liu Ying
2022-11-07  9:05       ` Lee Jones
2022-11-07  9:05         ` Lee Jones
2022-11-08  3:56         ` Liu Ying
2022-11-08  3:56           ` Liu Ying
2022-11-09 12:50           ` Ying Liu
2022-11-09 12:50             ` Ying Liu
2022-11-14 10:03             ` Lee Jones
2022-11-14 10:03               ` Lee Jones
2022-11-14 10:01           ` Lee Jones
2022-11-14 10:01             ` Lee Jones
2022-11-14 20:54           ` Rob Herring
2022-11-14 20:54             ` Rob Herring
2022-11-15  5:21             ` Liu Ying
2022-11-15  5:21               ` Liu Ying
2022-11-15 13:33               ` Rob Herring
2022-11-15 13:33                 ` Rob Herring
2022-11-16  3:12                 ` Liu Ying
2022-11-16  3:12                   ` Liu Ying
2022-11-16 13:57                   ` Lee Jones
2022-11-16 13:57                     ` Lee Jones

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=Y1/sUfeVy1a6EKZQ@google.com \
    --to=lee@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=victor.liu@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.