Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca7edd16 authored by Lee Jones's avatar Lee Jones Committed by Samuel Ortiz
Browse files

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: default avatarLee Jones <lee.jones@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 9fc63f67
Loading
Loading
Loading
Loading
+19 −10
Original line number Diff line number Diff line
@@ -2960,7 +2960,8 @@ static struct mfd_cell db8500_prcmu_devs[] = {
 */
static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
{
	int err = 0;
	struct device_node *np = pdev->dev.of_node;
	int irq = 0, err = 0;

	if (ux500_is_svp())
		return -ENODEV;
@@ -2970,7 +2971,13 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
	/* Clean up the mailbox interrupts after pre-kernel code. */
	writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);

	err = request_threaded_irq(IRQ_DB8500_PRCMU1, prcmu_irq_handler,
	if (np)
		irq = platform_get_irq(pdev, 0);

	if (!np || irq <= 0)
		irq = IRQ_DB8500_PRCMU1;

	err = request_threaded_irq(irq, prcmu_irq_handler,
	        prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
	if (err < 0) {
		pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n");
@@ -2981,13 +2988,15 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
	if (cpu_is_u8500v20_or_later())
		prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET);

	if (!np) {
		err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
			      ARRAY_SIZE(db8500_prcmu_devs), NULL,
			      0);

	if (err)
				ARRAY_SIZE(db8500_prcmu_devs), NULL, 0);
		if (err) {
			pr_err("prcmu: Failed to add subdevices\n");
	else
			return err;
		}
	}

	pr_info("DB8500 PRCMU initialized\n");

no_irq_return: