aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/db8500-prcmu.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-05-09 11:19:25 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-09 11:19:25 -0400
commitca7edd16ae488fe0eff5d4f8eb17c5caa8dcc5fa (patch)
tree969f7466567a7147f25289018aa80cc1a16cdbc1 /drivers/mfd/db8500-prcmu.c
parent9fc63f670f53cf9dcdca5e523289dda35da47e63 (diff)
mfd: Enable Device Tree support for the db8500-prcmu
This patch will enable probing to occur during a Device Tree enabled boot. The IRQ base is expected to be located in and will be fetched from the DT itself. We also prevent any of the db8500 regulators from being registered here, as they will be enabled via DT instead. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/db8500-prcmu.c')
-rw-r--r--drivers/mfd/db8500-prcmu.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 79a79ae6fc25..e6f8d261eeba 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2960,7 +2960,8 @@ static struct mfd_cell db8500_prcmu_devs[] = {
2960 */ 2960 */
2961static int __devinit db8500_prcmu_probe(struct platform_device *pdev) 2961static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
2962{ 2962{
2963 int err = 0; 2963 struct device_node *np = pdev->dev.of_node;
2964 int irq = 0, err = 0;
2964 2965
2965 if (ux500_is_svp()) 2966 if (ux500_is_svp())
2966 return -ENODEV; 2967 return -ENODEV;
@@ -2970,8 +2971,14 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
2970 /* Clean up the mailbox interrupts after pre-kernel code. */ 2971 /* Clean up the mailbox interrupts after pre-kernel code. */
2971 writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR); 2972 writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);
2972 2973
2973 err = request_threaded_irq(IRQ_DB8500_PRCMU1, prcmu_irq_handler, 2974 if (np)
2974 prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL); 2975 irq = platform_get_irq(pdev, 0);
2976
2977 if (!np || irq <= 0)
2978 irq = IRQ_DB8500_PRCMU1;
2979
2980 err = request_threaded_irq(irq, prcmu_irq_handler,
2981 prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
2975 if (err < 0) { 2982 if (err < 0) {
2976 pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n"); 2983 pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n");
2977 err = -EBUSY; 2984 err = -EBUSY;
@@ -2981,14 +2988,16 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
2981 if (cpu_is_u8500v20_or_later()) 2988 if (cpu_is_u8500v20_or_later())
2982 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); 2989 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET);
2983 2990
2984 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 2991 if (!np) {
2985 ARRAY_SIZE(db8500_prcmu_devs), NULL, 2992 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
2986 0); 2993 ARRAY_SIZE(db8500_prcmu_devs), NULL, 0);
2994 if (err) {
2995 pr_err("prcmu: Failed to add subdevices\n");
2996 return err;
2997 }
2998 }
2987 2999
2988 if (err) 3000 pr_info("DB8500 PRCMU initialized\n");
2989 pr_err("prcmu: Failed to add subdevices\n");
2990 else
2991 pr_info("DB8500 PRCMU initialized\n");
2992 3001
2993no_irq_return: 3002no_irq_return:
2994 return err; 3003 return err;