1 // SPDX-License-Identifier: GPL-2.0+
3 * Core driver for Renesas Synchronization Management Unit (SMU) devices.
5 * Copyright (C) 2021 Integrated Device Technology, Inc., a Renesas Company.
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/mfd/core.h>
11 #include <linux/mfd/rsmu.h>
12 #include <linux/module.h>
14 #include <linux/regmap.h>
15 #include <linux/slab.h>
25 static struct mfd_cell rsmu_cm_devs
[] = {
27 .name
= "8a3400x-phc",
30 .name
= "8a3400x-cdev",
34 static struct mfd_cell rsmu_sabre_devs
[] = {
36 .name
= "82p33x1x-phc",
39 .name
= "82p33x1x-cdev",
43 static struct mfd_cell rsmu_sl_devs
[] = {
45 .name
= "8v19n85x-phc",
48 .name
= "8v19n85x-cdev",
52 int rsmu_core_init(struct rsmu_ddata
*rsmu
)
54 struct mfd_cell
*cells
;
62 cells
= rsmu_sabre_devs
;
68 dev_err(rsmu
->dev
, "Unsupported RSMU device type: %d\n", rsmu
->type
);
72 mutex_init(&rsmu
->lock
);
74 ret
= devm_mfd_add_devices(rsmu
->dev
, PLATFORM_DEVID_AUTO
, cells
,
75 RSMU_N_DEVS
, NULL
, 0, NULL
);
77 dev_err(rsmu
->dev
, "Failed to register sub-devices: %d\n", ret
);
81 EXPORT_SYMBOL_GPL(rsmu_core_init
);
83 void rsmu_core_exit(struct rsmu_ddata
*rsmu
)
85 mutex_destroy(&rsmu
->lock
);
87 EXPORT_SYMBOL_GPL(rsmu_core_exit
);
89 MODULE_DESCRIPTION("Renesas SMU core driver");
90 MODULE_LICENSE("GPL");