Commit d98a5384 authored by Lee Jones's avatar Lee Jones Committed by Samuel Ortiz

mfd: db8500-prcmu: Support platform dependant device selection

The main aim for this cycle is to have the u8540 booting to a
console. However, the u8540 doesn't support all of the u8500
platform devices yet. After this stage is complete we can then
fill in the inadequacies, such as specific clock support at a
later date. To achieve this we're placing devices supported by
all platforms into a common device structure and the remaining
ones into a platform specific one.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent daba96d6
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/mfd/core.h> #include <linux/mfd/core.h>
...@@ -3067,6 +3068,15 @@ static struct db8500_thsens_platform_data db8500_thsens_data = { ...@@ -3067,6 +3068,15 @@ static struct db8500_thsens_platform_data db8500_thsens_data = {
.num_trips = 4, .num_trips = 4,
}; };
static struct mfd_cell common_prcmu_devs[] = {
{
.name = "ux500_wdt",
.platform_data = &db8500_wdt_pdata,
.pdata_size = sizeof(db8500_wdt_pdata),
.id = -1,
},
};
static struct mfd_cell db8500_prcmu_devs[] = { static struct mfd_cell db8500_prcmu_devs[] = {
{ {
.name = "db8500-prcmu-regulators", .name = "db8500-prcmu-regulators",
...@@ -3080,12 +3090,6 @@ static struct mfd_cell db8500_prcmu_devs[] = { ...@@ -3080,12 +3090,6 @@ static struct mfd_cell db8500_prcmu_devs[] = {
.platform_data = &db8500_cpufreq_table, .platform_data = &db8500_cpufreq_table,
.pdata_size = sizeof(db8500_cpufreq_table), .pdata_size = sizeof(db8500_cpufreq_table),
}, },
{
.name = "ux500_wdt",
.platform_data = &db8500_wdt_pdata,
.pdata_size = sizeof(db8500_wdt_pdata),
.id = -1,
},
{ {
.name = "db8500-thermal", .name = "db8500-thermal",
.num_resources = ARRAY_SIZE(db8500_thsens_resources), .num_resources = ARRAY_SIZE(db8500_thsens_resources),
...@@ -3175,13 +3179,25 @@ static int db8500_prcmu_probe(struct platform_device *pdev) ...@@ -3175,13 +3179,25 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
db8500_prcmu_update_cpufreq(); db8500_prcmu_update_cpufreq();
err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, err = mfd_add_devices(&pdev->dev, 0, common_prcmu_devs,
ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, db8500_irq_domain); ARRAY_SIZE(common_prcmu_devs), NULL, 0, db8500_irq_domain);
if (err) { if (err) {
pr_err("prcmu: Failed to add subdevices\n"); pr_err("prcmu: Failed to add subdevices\n");
return err; return err;
} }
/* TODO: Remove restriction when clk definitions are available. */
if (!of_machine_is_compatible("st-ericsson,u8540")) {
err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
ARRAY_SIZE(db8500_prcmu_devs), NULL, 0,
db8500_irq_domain);
if (err) {
mfd_remove_devices(&pdev->dev);
pr_err("prcmu: Failed to add subdevices\n");
goto no_irq_return;
}
}
err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata, err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata,
pdata->ab_irq); pdata->ab_irq);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment