diff options
| author | Abhimanyu Kapur <abhimany@codeaurora.org> | 2015-03-30 11:55:03 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:07:16 -0700 |
| commit | c191d46b7233459f5e33cf75779ed3c732c87618 (patch) | |
| tree | ba7ecef6627af65699c526abd4d5da20ba81e365 | |
| parent | 879ffd4f078f29ce902a7500604ea2f221b6e4c0 (diff) | |
irqchip: msm: Add snaphot of msm irq driver
Snapshot the msm irq driver as of msm-3.14 commit:
3bc54cf86bdc7affa7cd4bf7faa3c57fe8f8819d (Merge "msm:
camera: Add dummy sub module in sensor pipeline")
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Conflicts:
drivers/irqchip/Kconfig
drivers/irqchip/Makefile
Change-Id: Idf5284906af960fe03dcf881df1b57149c8e6ad8
| -rw-r--r-- | drivers/irqchip/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/irqchip/Makefile | 2 | ||||
| -rw-r--r-- | drivers/irqchip/irq-msm.c | 56 | ||||
| -rw-r--r-- | include/linux/irqchip/msm-gpio-irq.h | 51 |
4 files changed, 113 insertions, 0 deletions
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 4d7294e5d982..463dbf3dbf6d 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -193,3 +193,7 @@ config IRQ_MXS def_bool y if MACH_ASM9260 || ARCH_MXS select IRQ_DOMAIN select STMP_DEVICE + +config MSM_IRQ + bool + select IRQ_DOMAIN diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 177f78f6e6d6..305f110447a3 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -55,3 +55,5 @@ obj-$(CONFIG_RENESAS_H8S_INTC) += irq-renesas-h8s.o obj-$(CONFIG_ARCH_SA1100) += irq-sa11x0.o obj-$(CONFIG_INGENIC_IRQ) += irq-ingenic.o obj-$(CONFIG_IMX_GPCV2) += irq-imx-gpcv2.o +obj-$(CONFIG_MSM_IRQ) += irq-msm.o +obj-$(CONFIG_MSM_SHOW_RESUME_IRQ) += msm_show_resume_irq.o diff --git a/drivers/irqchip/irq-msm.c b/drivers/irqchip/irq-msm.c new file mode 100644 index 000000000000..420a86796d35 --- /dev/null +++ b/drivers/irqchip/irq-msm.c @@ -0,0 +1,56 @@ +/* Copyright (c) 2014-2015, 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_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; +} + +static int __init pinctrl_irq_dummy(struct device_node *node, + struct device_node *parent) +{ + return 0; +} +#ifdef CONFIG_USE_PINCTRL_IRQ +IRQCHIP_DECLARE(tlmmv3_irq, "qcom,msm-tlmm-gp", irq_msm_gpio_init); +#else +IRQCHIP_DECLARE(tlmm_irq, "qcom,msm-gpio", irq_msm_gpio_init); +#endif +IRQCHIP_DECLARE(8996_pinctrl, "qcom,msm8996-pinctrl", pinctrl_irq_dummy); +IRQCHIP_DECLARE(qpnp_irq, "qcom,spmi-pmic-arb", qpnpint_of_init); +IRQCHIP_DECLARE(wcd9xxx_irq, "qcom,wcd9xxx-irq", wcd9xxx_irq_of_init); diff --git a/include/linux/irqchip/msm-gpio-irq.h b/include/linux/irqchip/msm-gpio-irq.h new file mode 100644 index 000000000000..f57279424038 --- /dev/null +++ b/include/linux/irqchip/msm-gpio-irq.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2013-2015, 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. + */ + +#ifndef MSM_GPIO_IRQ_H +#define MSM_GPIO_IRQ_H + +#include <linux/irq.h> + +#if (defined(CONFIG_GPIO_MSM_V1) || defined(CONFIG_GPIO_MSM_V2) \ + || defined(CONFIG_GPIO_MSM_V3) && !defined(CONFIG_USE_PINCTRL_IRQ)) +int __init msm_gpio_of_init(struct device_node *node, + struct device_node *parent); +extern struct irq_chip msm_gpio_irq_extn; +static inline int __init msm_tlmm_of_irq_init(struct device_node *node, + struct device_node *parent) +{ + return 0; +} +#elif defined(CONFIG_PINCTRL_MSM_TLMM) +int __init msm_tlmm_of_irq_init(struct device_node *node, + struct device_node *parent); +extern struct irq_chip mpm_tlmm_irq_extn; +static inline int __init msm_gpio_of_init(struct device_node *node, + struct device_node *parent) +{ + return 0; +} +#else +extern struct irq_chip mpm_pinctrl_extn; +static inline int __init msm_tlmm_of_irq_init(struct device_node *node, + struct device_node *parent) +{ + return 0; +} + +static inline int __init msm_gpio_of_init(struct device_node *node, + struct device_node *parent) +{ + return 0; +} +#endif +#endif |
