[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250424154722.534284-9-ivecera@redhat.com>
Date: Thu, 24 Apr 2025 17:47:22 +0200
From: Ivan Vecera <ivecera@...hat.com>
To: netdev@...r.kernel.org
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
Jiri Pirko <jiri@...nulli.us>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Prathosh Satish <Prathosh.Satish@...rochip.com>,
Lee Jones <lee@...nel.org>,
Kees Cook <kees@...nel.org>,
Andy Shevchenko <andy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Schmidt <mschmidt@...hat.com>,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: [PATCH net-next v4 8/8] mfd: zl3073x: Register DPLL sub-device during init
Register DPLL sub-devices to expose the functionality provided
by ZL3073x chip family. Each sub-device represents one of
the available DPLL channels.
Signed-off-by: Ivan Vecera <ivecera@...hat.com>
---
v3->v4:
* use static mfd cells
---
drivers/mfd/zl3073x-core.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/mfd/zl3073x-core.c b/drivers/mfd/zl3073x-core.c
index d0022dfb0236c..a8971b86db121 100644
--- a/drivers/mfd/zl3073x-core.c
+++ b/drivers/mfd/zl3073x-core.c
@@ -7,6 +7,7 @@
#include <linux/device.h>
#include <linux/export.h>
#include <linux/math64.h>
+#include <linux/mfd/core.h>
#include <linux/mfd/zl3073x.h>
#include <linux/module.h>
#include <linux/netlink.h>
@@ -910,6 +911,14 @@ zl3073x_dev_state_fetch(struct zl3073x_dev *zldev)
return rc;
}
+static const struct mfd_cell zl3073x_dpll_cells[] = {
+ MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 0),
+ MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 1),
+ MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 2),
+ MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 3),
+ MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 4),
+};
+
/**
* zl3073x_dev_probe - initialize zl3073x device
* @zldev: pointer to zl3073x device
@@ -973,6 +982,16 @@ int zl3073x_dev_probe(struct zl3073x_dev *zldev,
if (rc)
return rc;
+ /* Add DPLL sub-device cell for each DPLL channel */
+ rc = devm_mfd_add_devices(zldev->dev, PLATFORM_DEVID_AUTO,
+ zl3073x_dpll_cells, chip_info->num_channels,
+ NULL, 0, NULL);
+ if (rc) {
+ dev_err_probe(zldev->dev, rc,
+ "Failed to add DPLL sub-device\n");
+ return rc;
+ }
+
/* Register the device as devlink device */
devlink = priv_to_devlink(zldev);
devlink_register(devlink);
--
2.49.0
Powered by blists - more mailing lists