From: Lee Jones <lee@kernel.org>
To: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-rtc@vger.kernel.org, Inochi Amaoto <inochiama@gmail.com>,
dlan@gentoo.org, linux-kernel@vger.kernel.org,
Jingbao Qiu <qiujingbao.dlmu@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Chen Wang <unicorn_wang@outlook.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
sophgo@lists.linux.dev
Subject: Re: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
Date: Wed, 5 Mar 2025 16:32:11 -0800 [thread overview]
Message-ID: <20250306003211.GA8350@google.com> (raw)
In-Reply-To: <20250302195205.3183174-3-alexander.sverdlin@gmail.com>
On Sun, 02 Mar 2025, Alexander Sverdlin wrote:
> Add driver for Sophgo CV1800 series SoC RTC MFD. The RTC module comprises
> a 32kHz oscillator, Power-on-Reset (PoR) sub-module, HW state machine to
> control chip power-on, power-off and reset. Furthermore, the 8051 subsystem
> is located within RTCSYS including associated SRAM block.
>
> This patch only populates RTC sub-device.
>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> ---
> Changelog:
> v12:
> - new patch
>
> MAINTAINERS | 1 +
> drivers/mfd/Kconfig | 14 ++++++++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/cv1800-rtcsys.c | 66 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 82 insertions(+)
> create mode 100644 drivers/mfd/cv1800-rtcsys.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 92fc0eca7061..446156998380 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -22185,6 +22185,7 @@ M: Chen Wang <unicorn_wang@outlook.com>
> M: Inochi Amaoto <inochiama@outlook.com>
> T: git https://github.com/sophgo/linux.git
> S: Maintained
> +F: drivers/mfd/cv1800-rtcsys.c
> N: sophgo
> K: sophgo
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 6b0682af6e32..842cc4d95c4b 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -285,6 +285,20 @@ config MFD_CS42L43_SDW
> Select this to support the Cirrus Logic CS42L43 PC CODEC with
> headphone and class D speaker drivers over SoundWire.
>
> +config MFD_CV1800_RTCSYS
> + tristate "Sophgo CV1800 RTC MFD"
> + depends on ARCH_SOPHGO || COMPILE_TEST
> + select MFD_CORE
> + help
> + If you say yes here you get support the RTC MFD driver for Sophgo
> + CV1800 series SoC. The RTC module comprises a 32kHz oscillator,
> + Power-on-Reset (PoR) sub-module, HW state machine to control chip
> + power-on, power-off and reset. Furthermore, the 8051 subsystem is
> + located within RTCSYS including associated SRAM block.
> +
> + This driver can also be built as a module. If so, the module will be
> + called cv1800-rtcsys.
> +
> config MFD_MADERA
> tristate "Cirrus Logic Madera codecs"
> select MFD_CORE
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 9220eaf7cf12..3cf03ffeedbb 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -18,6 +18,7 @@ obj-$(CONFIG_MFD_CROS_EC_DEV) += cros_ec_dev.o
> obj-$(CONFIG_MFD_CS42L43) += cs42l43.o
> obj-$(CONFIG_MFD_CS42L43_I2C) += cs42l43-i2c.o
> obj-$(CONFIG_MFD_CS42L43_SDW) += cs42l43-sdw.o
> +obj-$(CONFIG_MFD_CV1800_RTCSYS) += cv1800-rtcsys.o
> obj-$(CONFIG_MFD_ENE_KB3930) += ene-kb3930.o
> obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o
> obj-$(CONFIG_MFD_GATEWORKS_GSC) += gateworks-gsc.o
> diff --git a/drivers/mfd/cv1800-rtcsys.c b/drivers/mfd/cv1800-rtcsys.c
> new file mode 100644
> index 000000000000..72d11284f1de
> --- /dev/null
> +++ b/drivers/mfd/cv1800-rtcsys.c
> @@ -0,0 +1,66 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for Sophgo CV1800 series SoC RTC MFD
> + *
> + * The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module,
> + * HW state machine to control chip power-on, power-off and reset. Furthermore,
> + * the 8051 subsystem is located within RTCSYS including associated SRAM block.
> + *
> + * Copyright (C) 2025 Alexander Sverdlin <alexander.sverdlin@gmail.com>
> + *
> + */
> +
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/property.h>
> +
> +static struct resource cv1800_rtcsys_irq_resources[] = {
> + DEFINE_RES_IRQ_NAMED(0, "alarm"),
> +};
> +
> +static const struct mfd_cell cv1800_rtcsys_subdev[] = {
> + {
> + .name = "cv1800-rtc",
> + .num_resources = 1,
> + .resources = &cv1800_rtcsys_irq_resources[0],
> + },
> +};
> +
> +static const struct mfd_cell cv1800_rtcsys_rtc_subdev =
> + MFD_CELL_NAME("cv1800-rtc");
How is this different from the one above?
Adding a single device does not constitute an MFD.
> +static int cv1800_rtcsys_probe(struct platform_device *pdev)
> +{
> + int irq;
> +
> + irq = platform_get_irq_byname(pdev, "alarm");
> + if (irq < 0)
> + return irq;
> + cv1800_rtcsys_irq_resources[0].start = irq;
> + cv1800_rtcsys_irq_resources[0].end = irq;
> +
> + return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
> + cv1800_rtcsys_subdev,
> + ARRAY_SIZE(cv1800_rtcsys_subdev),
> + NULL, 0, NULL);
> +}
> +
> +static const struct of_device_id cv1800_rtcsys_of_match[] = {
> + { .compatible = "sophgo,cv1800b-rtc" },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, cv1800_rtcsys_of_match);
> +
> +static struct platform_driver cv1800_rtcsys_mfd = {
> + .probe = cv1800_rtcsys_probe,
> + .driver = {
> + .name = "cv1800_rtcsys",
> + .of_match_table = cv1800_rtcsys_of_match,
> + },
> +};
> +module_platform_driver(cv1800_rtcsys_mfd);
> +
> +MODULE_AUTHOR("Alexander Sverdlin <alexander.sverdlin@gmail.com>");
> +MODULE_DESCRIPTION("Sophgo CV1800 series SoC RTC MFD driver");
> +MODULE_LICENSE("GPL");
> --
> 2.48.1
>
--
Lee Jones [李琼斯]
WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee@kernel.org>
To: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-rtc@vger.kernel.org, Inochi Amaoto <inochiama@gmail.com>,
dlan@gentoo.org, linux-kernel@vger.kernel.org,
Jingbao Qiu <qiujingbao.dlmu@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Chen Wang <unicorn_wang@outlook.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
sophgo@lists.linux.dev
Subject: Re: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
Date: Wed, 5 Mar 2025 16:32:11 -0800 [thread overview]
Message-ID: <20250306003211.GA8350@google.com> (raw)
In-Reply-To: <20250302195205.3183174-3-alexander.sverdlin@gmail.com>
On Sun, 02 Mar 2025, Alexander Sverdlin wrote:
> Add driver for Sophgo CV1800 series SoC RTC MFD. The RTC module comprises
> a 32kHz oscillator, Power-on-Reset (PoR) sub-module, HW state machine to
> control chip power-on, power-off and reset. Furthermore, the 8051 subsystem
> is located within RTCSYS including associated SRAM block.
>
> This patch only populates RTC sub-device.
>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> ---
> Changelog:
> v12:
> - new patch
>
> MAINTAINERS | 1 +
> drivers/mfd/Kconfig | 14 ++++++++
> drivers/mfd/Makefile | 1 +
> drivers/mfd/cv1800-rtcsys.c | 66 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 82 insertions(+)
> create mode 100644 drivers/mfd/cv1800-rtcsys.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 92fc0eca7061..446156998380 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -22185,6 +22185,7 @@ M: Chen Wang <unicorn_wang@outlook.com>
> M: Inochi Amaoto <inochiama@outlook.com>
> T: git https://github.com/sophgo/linux.git
> S: Maintained
> +F: drivers/mfd/cv1800-rtcsys.c
> N: sophgo
> K: sophgo
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 6b0682af6e32..842cc4d95c4b 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -285,6 +285,20 @@ config MFD_CS42L43_SDW
> Select this to support the Cirrus Logic CS42L43 PC CODEC with
> headphone and class D speaker drivers over SoundWire.
>
> +config MFD_CV1800_RTCSYS
> + tristate "Sophgo CV1800 RTC MFD"
> + depends on ARCH_SOPHGO || COMPILE_TEST
> + select MFD_CORE
> + help
> + If you say yes here you get support the RTC MFD driver for Sophgo
> + CV1800 series SoC. The RTC module comprises a 32kHz oscillator,
> + Power-on-Reset (PoR) sub-module, HW state machine to control chip
> + power-on, power-off and reset. Furthermore, the 8051 subsystem is
> + located within RTCSYS including associated SRAM block.
> +
> + This driver can also be built as a module. If so, the module will be
> + called cv1800-rtcsys.
> +
> config MFD_MADERA
> tristate "Cirrus Logic Madera codecs"
> select MFD_CORE
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 9220eaf7cf12..3cf03ffeedbb 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -18,6 +18,7 @@ obj-$(CONFIG_MFD_CROS_EC_DEV) += cros_ec_dev.o
> obj-$(CONFIG_MFD_CS42L43) += cs42l43.o
> obj-$(CONFIG_MFD_CS42L43_I2C) += cs42l43-i2c.o
> obj-$(CONFIG_MFD_CS42L43_SDW) += cs42l43-sdw.o
> +obj-$(CONFIG_MFD_CV1800_RTCSYS) += cv1800-rtcsys.o
> obj-$(CONFIG_MFD_ENE_KB3930) += ene-kb3930.o
> obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o
> obj-$(CONFIG_MFD_GATEWORKS_GSC) += gateworks-gsc.o
> diff --git a/drivers/mfd/cv1800-rtcsys.c b/drivers/mfd/cv1800-rtcsys.c
> new file mode 100644
> index 000000000000..72d11284f1de
> --- /dev/null
> +++ b/drivers/mfd/cv1800-rtcsys.c
> @@ -0,0 +1,66 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Driver for Sophgo CV1800 series SoC RTC MFD
> + *
> + * The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module,
> + * HW state machine to control chip power-on, power-off and reset. Furthermore,
> + * the 8051 subsystem is located within RTCSYS including associated SRAM block.
> + *
> + * Copyright (C) 2025 Alexander Sverdlin <alexander.sverdlin@gmail.com>
> + *
> + */
> +
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/property.h>
> +
> +static struct resource cv1800_rtcsys_irq_resources[] = {
> + DEFINE_RES_IRQ_NAMED(0, "alarm"),
> +};
> +
> +static const struct mfd_cell cv1800_rtcsys_subdev[] = {
> + {
> + .name = "cv1800-rtc",
> + .num_resources = 1,
> + .resources = &cv1800_rtcsys_irq_resources[0],
> + },
> +};
> +
> +static const struct mfd_cell cv1800_rtcsys_rtc_subdev =
> + MFD_CELL_NAME("cv1800-rtc");
How is this different from the one above?
Adding a single device does not constitute an MFD.
> +static int cv1800_rtcsys_probe(struct platform_device *pdev)
> +{
> + int irq;
> +
> + irq = platform_get_irq_byname(pdev, "alarm");
> + if (irq < 0)
> + return irq;
> + cv1800_rtcsys_irq_resources[0].start = irq;
> + cv1800_rtcsys_irq_resources[0].end = irq;
> +
> + return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
> + cv1800_rtcsys_subdev,
> + ARRAY_SIZE(cv1800_rtcsys_subdev),
> + NULL, 0, NULL);
> +}
> +
> +static const struct of_device_id cv1800_rtcsys_of_match[] = {
> + { .compatible = "sophgo,cv1800b-rtc" },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, cv1800_rtcsys_of_match);
> +
> +static struct platform_driver cv1800_rtcsys_mfd = {
> + .probe = cv1800_rtcsys_probe,
> + .driver = {
> + .name = "cv1800_rtcsys",
> + .of_match_table = cv1800_rtcsys_of_match,
> + },
> +};
> +module_platform_driver(cv1800_rtcsys_mfd);
> +
> +MODULE_AUTHOR("Alexander Sverdlin <alexander.sverdlin@gmail.com>");
> +MODULE_DESCRIPTION("Sophgo CV1800 series SoC RTC MFD driver");
> +MODULE_LICENSE("GPL");
> --
> 2.48.1
>
--
Lee Jones [李琼斯]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-03-06 0:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 19:51 [PATCH v12 0/3] riscv: rtc: sophgo: add rtc support for CV1800 Alexander Sverdlin
2025-03-02 19:51 ` Alexander Sverdlin
2025-03-02 19:51 ` [PATCH v12 1/3] dt-bindings: mfd: sophgo: add RTC support for Sophgo CV1800 series SoC Alexander Sverdlin
2025-03-02 19:51 ` Alexander Sverdlin
2025-03-03 8:39 ` Krzysztof Kozlowski
2025-03-03 8:39 ` Krzysztof Kozlowski
2025-03-02 19:51 ` [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only) Alexander Sverdlin
2025-03-02 19:51 ` Alexander Sverdlin
2025-03-05 20:33 ` kernel test robot
2025-03-05 20:33 ` kernel test robot
2025-03-06 0:32 ` Lee Jones [this message]
2025-03-06 0:32 ` Lee Jones
2025-03-06 5:29 ` kernel test robot
2025-03-06 5:29 ` kernel test robot
2025-03-02 19:51 ` [PATCH v12 3/3] rtc: sophgo: add rtc support for Sophgo CV1800 SoC Alexander Sverdlin
2025-03-02 19:51 ` Alexander Sverdlin
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=20250306003211.GA8350@google.com \
--to=lee@kernel.org \
--cc=alexander.sverdlin@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=inochiama@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rtc@vger.kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=qiujingbao.dlmu@gmail.com \
--cc=robh@kernel.org \
--cc=sophgo@lists.linux.dev \
--cc=unicorn_wang@outlook.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.