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

Commit c831d048 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

irqchip: irq-msm: Introduce irq-msm driver



Prepare for irqchip_init() to initialize irq controllers. The
IRQCHIP_DECLARE macro inserts a function pointer in __irqchip_of_table
section and the kernel runs through it calling each irq controllers
initialization function - the kernel respects the parent irq controller
ordering and ensures that a parent irq controller's init function is
called prior to its child irq controllers.

This driver serves the purpose of being able to declare various irq
controllers in MSM/APQ/FSM platforms using IRQCHIP_DECLARE macro.

MPM hardware monitors certain interrupt lines on GIC and GPIO while
apps is power collapsed. It needs to be initialized right after GPIO
is initialized.

Change-Id: I3ab333dbb428932df060a682c0930f1e61ffe45b
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent d2056c0d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -46,3 +46,7 @@ config VERSATILE_FPGA_IRQ_NR
       int
       default 4
       depends on VERSATILE_FPGA_IRQ

config MSM_IRQ
	bool
	select IRQ_DOMAIN
+1 −0
Original line number Diff line number Diff line
@@ -16,3 +16,4 @@ obj-$(CONFIG_RENESAS_INTC_IRQPIN) += irq-renesas-intc-irqpin.o
obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
obj-$(CONFIG_VERSATILE_FPGA_IRQ)	+= irq-versatile-fpga.o
obj-$(CONFIG_ARCH_VT8500)		+= irq-vt8500.o
obj-$(CONFIG_MSM_IRQ)			+= irq-msm.o
+50 −0
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <linux/irqchip/qpnp-int.h>
#include <linux/irqchip/msm-gpio-irq.h>
#include <linux/irqchip/msm-mpm-irq.h>
#include <linux/mfd/wcd9xxx/core.h>
#include "irqchip.h"

static int __init irq_msm_gpio_init(struct device_node *node,
			struct device_node *parent)
{
	int rc;

#ifdef CONFIG_USE_PINCTRL_IRQ
	rc = msm_tlmm_v3_of_irq_init(node, parent);
#else
	rc = msm_gpio_of_init(node, parent);
#endif
	if (rc) {
		pr_err("Couldn't initlialize gpio irq rc = %d\n", rc);
		return rc;
	}

	/*
	 * Initialize the mpm after gpio (and gic) are initialized. Note that
	 * gpio irq controller is the child of gic irq controller, hence gic's
	 * init function will be called prior to gpio.
	 */
	of_mpm_init();

	return 0;
}

#ifdef CONFIG_USE_PINCTRL_IRQ
IRQCHIP_DECLARE(tlmm_irq, "qcom,msm-tlmmv3-gp-intc", irq_msm_gpio_init);
#else
IRQCHIP_DECLARE(tlmm_irq, "qcom,msm-gpio", irq_msm_gpio_init);
#endif
IRQCHIP_DECLARE(qpnp_irq, "qcom,spmi-pmic-arb", qpnpint_of_init);
IRQCHIP_DECLARE(wcd9xxx_irq, "qcom,wcd9xxx-irq", wcd9xxx_irq_of_init);