Skip to content

Commit 541b2ec

Browse files
iveceraNipaLocal
authored andcommitted
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 <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 3becbaa commit 541b2ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/mfd/zl3073x-core.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/device.h>
88
#include <linux/export.h>
99
#include <linux/math64.h>
10+
#include <linux/mfd/core.h>
1011
#include <linux/mfd/zl3073x.h>
1112
#include <linux/module.h>
1213
#include <linux/netlink.h>
@@ -752,6 +753,14 @@ static void zl3073x_devlink_unregister(void *ptr)
752753
devlink_unregister(ptr);
753754
}
754755

756+
static const struct mfd_cell zl3073x_dpll_cells[] = {
757+
MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 0),
758+
MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 1),
759+
MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 2),
760+
MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 3),
761+
MFD_CELL_BASIC("zl3073x-dpll", NULL, NULL, 0, 4),
762+
};
763+
755764
/**
756765
* zl3073x_dev_probe - initialize zl3073x device
757766
* @zldev: pointer to zl3073x device
@@ -823,6 +832,16 @@ int zl3073x_dev_probe(struct zl3073x_dev *zldev,
823832
if (rc)
824833
return rc;
825834

835+
/* Add DPLL sub-device cell for each DPLL channel */
836+
rc = devm_mfd_add_devices(zldev->dev, PLATFORM_DEVID_AUTO,
837+
zl3073x_dpll_cells, chip_info->num_channels,
838+
NULL, 0, NULL);
839+
if (rc) {
840+
dev_err_probe(zldev->dev, rc,
841+
"Failed to add DPLL sub-device\n");
842+
return rc;
843+
}
844+
826845
/* Register the device as devlink device */
827846
devlink = priv_to_devlink(zldev);
828847
devlink_register(devlink);

0 commit comments

Comments
 (0)