diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-04-09 15:52:58 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-09 16:54:36 -0400 |
commit | d98a5384d7dbe47b8673eb281aaf339173376245 (patch) | |
tree | 325b68a405672cc89010792841c11c6d117c4e39 /drivers/mfd | |
parent | daba96d6f38601552d08d52c15ef3c5660f1275f (diff) |
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: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 25dda8d7cb00..319b8abe742b 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/jiffies.h> | 24 | #include <linux/jiffies.h> |
25 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/of.h> | ||
27 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
28 | #include <linux/uaccess.h> | 29 | #include <linux/uaccess.h> |
29 | #include <linux/mfd/core.h> | 30 | #include <linux/mfd/core.h> |
@@ -3067,6 +3068,15 @@ static struct db8500_thsens_platform_data db8500_thsens_data = { | |||
3067 | .num_trips = 4, | 3068 | .num_trips = 4, |
3068 | }; | 3069 | }; |
3069 | 3070 | ||
3071 | static struct mfd_cell common_prcmu_devs[] = { | ||
3072 | { | ||
3073 | .name = "ux500_wdt", | ||
3074 | .platform_data = &db8500_wdt_pdata, | ||
3075 | .pdata_size = sizeof(db8500_wdt_pdata), | ||
3076 | .id = -1, | ||
3077 | }, | ||
3078 | }; | ||
3079 | |||
3070 | static struct mfd_cell db8500_prcmu_devs[] = { | 3080 | static struct mfd_cell db8500_prcmu_devs[] = { |
3071 | { | 3081 | { |
3072 | .name = "db8500-prcmu-regulators", | 3082 | .name = "db8500-prcmu-regulators", |
@@ -3081,12 +3091,6 @@ static struct mfd_cell db8500_prcmu_devs[] = { | |||
3081 | .pdata_size = sizeof(db8500_cpufreq_table), | 3091 | .pdata_size = sizeof(db8500_cpufreq_table), |
3082 | }, | 3092 | }, |
3083 | { | 3093 | { |
3084 | .name = "ux500_wdt", | ||
3085 | .platform_data = &db8500_wdt_pdata, | ||
3086 | .pdata_size = sizeof(db8500_wdt_pdata), | ||
3087 | .id = -1, | ||
3088 | }, | ||
3089 | { | ||
3090 | .name = "db8500-thermal", | 3094 | .name = "db8500-thermal", |
3091 | .num_resources = ARRAY_SIZE(db8500_thsens_resources), | 3095 | .num_resources = ARRAY_SIZE(db8500_thsens_resources), |
3092 | .resources = db8500_thsens_resources, | 3096 | .resources = db8500_thsens_resources, |
@@ -3175,13 +3179,25 @@ static int db8500_prcmu_probe(struct platform_device *pdev) | |||
3175 | 3179 | ||
3176 | db8500_prcmu_update_cpufreq(); | 3180 | db8500_prcmu_update_cpufreq(); |
3177 | 3181 | ||
3178 | err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, | 3182 | err = mfd_add_devices(&pdev->dev, 0, common_prcmu_devs, |
3179 | ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, db8500_irq_domain); | 3183 | ARRAY_SIZE(common_prcmu_devs), NULL, 0, db8500_irq_domain); |
3180 | if (err) { | 3184 | if (err) { |
3181 | pr_err("prcmu: Failed to add subdevices\n"); | 3185 | pr_err("prcmu: Failed to add subdevices\n"); |
3182 | return err; | 3186 | return err; |
3183 | } | 3187 | } |
3184 | 3188 | ||
3189 | /* TODO: Remove restriction when clk definitions are available. */ | ||
3190 | if (!of_machine_is_compatible("st-ericsson,u8540")) { | ||
3191 | err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, | ||
3192 | ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, | ||
3193 | db8500_irq_domain); | ||
3194 | if (err) { | ||
3195 | mfd_remove_devices(&pdev->dev); | ||
3196 | pr_err("prcmu: Failed to add subdevices\n"); | ||
3197 | goto no_irq_return; | ||
3198 | } | ||
3199 | } | ||
3200 | |||
3185 | err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata, | 3201 | err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata, |
3186 | pdata->ab_irq); | 3202 | pdata->ab_irq); |
3187 | if (err) { | 3203 | if (err) { |