@@ -11,12 +11,19 @@
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/platform_device.h>
+#include <linux/mfd/core.h>
#include <linux/mfd/samsung/exynos-regs-pmu.h>
#include <linux/mfd/samsung/exynos-pmu.h>
#define PMU_TABLE_END (-1U)
+enum pmu_mfd_list {
+ MFD_POWER_DOMAIN,
+ MFD_MAX,
+};
+
struct exynos_pmu_conf {
unsigned int offset;
unsigned int val[NUM_SYS_POWERDOWN];
@@ -33,6 +40,8 @@ struct exynos_pmu_data {
struct exynos_pmu_context {
struct device *dev;
const struct exynos_pmu_data *pmu_data;
+ struct mfd_cell cells[MFD_MAX];
+ struct pmu_dev_client_data mfd_data;
};
static void __iomem *pmu_base_addr;
@@ -482,6 +491,8 @@ static int exynos_pmu_probe(struct platform_device *pdev)
const struct of_device_id *match;
struct device *dev = &pdev->dev;
struct resource *res;
+ struct mfd_cell *cell;
+ int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pmu_base_addr = devm_ioremap_resource(dev, res);
@@ -506,6 +517,20 @@ static int exynos_pmu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pmu_context);
+ /* Initialize and invoke mfd clients */
+ cell = &pmu_context->cells[MFD_POWER_DOMAIN];
+ cell->name = "exynos-pmu-domain";
+ pmu_context->mfd_data.mem_base_addr = pmu_base_addr;
+ pmu_context->mfd_data.mem_size = resource_size(res);
+ cell->platform_data = &pmu_context->mfd_data;
+ cell->pdata_size = sizeof(pmu_context->mfd_data);
+ ret = mfd_add_devices(&pdev->dev, pdev->id, pmu_context->cells, MFD_MAX,
+ NULL, 0, NULL);
+ if (ret) {
+ dev_err(&pdev->dev, "fail to register client devices\n");
+ return ret;
+ }
+
dev_dbg(dev, "Exynos PMU Driver probe done\n");
return 0;
}
@@ -19,6 +19,11 @@ enum sys_powerdown {
NUM_SYS_POWERDOWN,
};
+struct pmu_dev_client_data {
+ void __iomem *mem_base_addr;
+ unsigned int mem_size;
+};
+
extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
#endif /* __EXYNOS_PMU_H */