Loading drivers/irqchip/qcom-pdc.c +25 −11 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ #define IRQ_ENABLE_BANK 0x10 #define IRQ_i_CFG 0x110 #define PDC_NO_PARENT_IRQ ~0UL struct pdc_pin_region { u32 pin_base; u32 parent_base; Loading Loading @@ -66,12 +68,18 @@ static void pdc_enable_intr(struct irq_data *d, bool on) static void qcom_pdc_gic_mask(struct irq_data *d) { if (d->hwirq == GPIO_NO_WAKE_IRQ) return; pdc_enable_intr(d, false); irq_chip_mask_parent(d); } static void qcom_pdc_gic_unmask(struct irq_data *d) { if (d->hwirq == GPIO_NO_WAKE_IRQ) return; pdc_enable_intr(d, true); irq_chip_unmask_parent(d); } Loading Loading @@ -115,6 +123,9 @@ static int qcom_pdc_gic_set_type(struct irq_data *d, unsigned int type) int pin_out = d->hwirq; enum pdc_irq_config_bits pdc_type; if (pin_out == GPIO_NO_WAKE_IRQ) return 0; switch (type) { case IRQ_TYPE_EDGE_RISING: pdc_type = PDC_EDGE_RISING; Loading Loading @@ -170,7 +181,7 @@ static irq_hw_number_t get_parent_hwirq(int pin) return (region->parent_base + pin - region->pin_base); } return ~0UL; return PDC_NO_PARENT_IRQ; } static int qcom_pdc_translate(struct irq_domain *d, struct irq_fwspec *fwspec, Loading Loading @@ -199,17 +210,17 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq, ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type); if (ret) return -EINVAL; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == ~0UL) return -EINVAL; return ret; ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq, &qcom_pdc_gic_chip, NULL); if (ret) return ret; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == PDC_NO_PARENT_IRQ) return 0; if (type & IRQ_TYPE_EDGE_BOTH) type = IRQ_TYPE_EDGE_RISING; Loading Loading @@ -244,17 +255,20 @@ static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int virq, ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type); if (ret) return -EINVAL; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == ~0UL) return -EINVAL; return ret; ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq, &qcom_pdc_gic_chip, NULL); if (ret) return ret; if (hwirq == GPIO_NO_WAKE_IRQ) return 0; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == PDC_NO_PARENT_IRQ) return 0; qcom_fwspec->mask = true; if (type & IRQ_TYPE_EDGE_BOTH) Loading include/linux/soc/qcom/irq.h +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ #include <linux/irqdomain.h> #define GPIO_NO_WAKE_IRQ ~0U /** * struct qcom_irq_fwspec - qcom specific irq fwspec wrapper * @fwspec: irq fwspec Loading Loading
drivers/irqchip/qcom-pdc.c +25 −11 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ #define IRQ_ENABLE_BANK 0x10 #define IRQ_i_CFG 0x110 #define PDC_NO_PARENT_IRQ ~0UL struct pdc_pin_region { u32 pin_base; u32 parent_base; Loading Loading @@ -66,12 +68,18 @@ static void pdc_enable_intr(struct irq_data *d, bool on) static void qcom_pdc_gic_mask(struct irq_data *d) { if (d->hwirq == GPIO_NO_WAKE_IRQ) return; pdc_enable_intr(d, false); irq_chip_mask_parent(d); } static void qcom_pdc_gic_unmask(struct irq_data *d) { if (d->hwirq == GPIO_NO_WAKE_IRQ) return; pdc_enable_intr(d, true); irq_chip_unmask_parent(d); } Loading Loading @@ -115,6 +123,9 @@ static int qcom_pdc_gic_set_type(struct irq_data *d, unsigned int type) int pin_out = d->hwirq; enum pdc_irq_config_bits pdc_type; if (pin_out == GPIO_NO_WAKE_IRQ) return 0; switch (type) { case IRQ_TYPE_EDGE_RISING: pdc_type = PDC_EDGE_RISING; Loading Loading @@ -170,7 +181,7 @@ static irq_hw_number_t get_parent_hwirq(int pin) return (region->parent_base + pin - region->pin_base); } return ~0UL; return PDC_NO_PARENT_IRQ; } static int qcom_pdc_translate(struct irq_domain *d, struct irq_fwspec *fwspec, Loading Loading @@ -199,17 +210,17 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq, ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type); if (ret) return -EINVAL; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == ~0UL) return -EINVAL; return ret; ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq, &qcom_pdc_gic_chip, NULL); if (ret) return ret; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == PDC_NO_PARENT_IRQ) return 0; if (type & IRQ_TYPE_EDGE_BOTH) type = IRQ_TYPE_EDGE_RISING; Loading Loading @@ -244,17 +255,20 @@ static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int virq, ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type); if (ret) return -EINVAL; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == ~0UL) return -EINVAL; return ret; ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq, &qcom_pdc_gic_chip, NULL); if (ret) return ret; if (hwirq == GPIO_NO_WAKE_IRQ) return 0; parent_hwirq = get_parent_hwirq(hwirq); if (parent_hwirq == PDC_NO_PARENT_IRQ) return 0; qcom_fwspec->mask = true; if (type & IRQ_TYPE_EDGE_BOTH) Loading
include/linux/soc/qcom/irq.h +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ #include <linux/irqdomain.h> #define GPIO_NO_WAKE_IRQ ~0U /** * struct qcom_irq_fwspec - qcom specific irq fwspec wrapper * @fwspec: irq fwspec Loading