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

Commit 4874c377 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

msm: mpm: cleanup the calls to of_mpm_init



The of_mpm_init function expects the board file to find its node.
This can be done in a function within the mpm driver. Cleanup
the code.

Change-Id: Ic1449da203aabdf5e8b87a0141cfec6345b00798
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent c4127fbe
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -50,22 +50,10 @@ static struct of_device_id irq_match[] __initdata = {
	{}
};

static struct of_device_id mpm_match[] __initdata = {
	{.compatible = "qcom,mpm-v2", },
	{}
};

void __init msm_dt_init_irq(void)
{
	struct device_node *node;

	of_irq_init(irq_match);
	node = of_find_matching_node(NULL, mpm_match);

	WARN_ON(!node);

	if (node)
		of_mpm_init(node);
	of_mpm_init();
}

void __init msm_dt_init_irq_nompm(void)
+9 −11
Original line number Diff line number Diff line
@@ -130,17 +130,15 @@ void msm_mpm_exit_sleep(bool from_idle);
/**
 * of_mpm_init() - Device tree initialization function
 *
 * @node: MPM device tree node.
 *
 * The initialization function is called from the machine irq function after
 * GPIO/GIC device initialization routines are called. MPM driver keeps track
 * of all enabled/wakeup interrupts in the system to be able to configure MPM
 * when entering a system wide low power mode. The MPM is a alway-on low power
 * hardware block that monitors 64 wakeup interrupts when the system is in a
 * low power mode. The initialization function constructs the MPM mapping
 * between the IRQs and the MPM pin based on data in the device tree.
 * The initialization function is called after * GPIO/GIC device initialization
 * routines are called and before any device irqs are requested. MPM driver
 * keeps track of all enabled/wakeup interrupts in the system to be able to
 * configure MPM when entering a system wide low power mode. The MPM is a
 * alway-on low power hardware block that monitors 64 wakeup interrupts when the
 * system is in a low power mode. The initialization function constructs the MPM
 * mapping between the IRQs and the MPM pin based on data in the device tree.
 */
void __init of_mpm_init(struct device_node *node);
void __init of_mpm_init(void);
#else
static inline int msm_mpm_enable_irq(unsigned int irq, unsigned int enable)
{ return -ENODEV; }
@@ -161,7 +159,7 @@ static inline bool msm_mpm_gpio_irqs_detectable(bool from_idle)
{ return false; }
static inline void msm_mpm_enter_sleep(uint32_t sclk_count, bool from_idle) {}
static inline void msm_mpm_exit_sleep(bool from_idle) {}
static inline void __init of_mpm_init(struct device_node *node) {}
static inline void __init of_mpm_init(void) {}
#endif
#ifdef CONFIG_MSM_MPM_OF
/** msm_mpm_suspend_prepare() - Called at prepare_late() op during suspend
+11 −1
Original line number Diff line number Diff line
@@ -739,7 +739,7 @@ static inline int __init mpm_irq_domain_legacy_size(struct irq_domain *d)
	return d->revmap_data.legacy.size;
}

void __init of_mpm_init(struct device_node *node)
static void __init __of_mpm_init(struct device_node *node)
{
	const __be32 *list;

@@ -908,3 +908,13 @@ int __init msm_mpm_device_init(void)
	return platform_driver_register(&msm_mpm_dev_driver);
}
arch_initcall(msm_mpm_device_init);

void __init of_mpm_init(void)
{
	struct device_node *node;

	node = of_find_matching_node(NULL, msm_mpm_match_table);
	WARN_ON(!node);
	if (node)
		__of_mpm_init(node);
}