@@ -126,7 +126,6 @@ struct pm8xxx_mpp {
126126 struct regmap * regmap ;
127127 struct pinctrl_dev * pctrl ;
128128 struct gpio_chip chip ;
129- struct irq_chip irq ;
130129
131130 struct pinctrl_desc desc ;
132131 unsigned npins ;
@@ -778,6 +777,32 @@ static int pm8xxx_mpp_child_to_parent_hwirq(struct gpio_chip *chip,
778777 return 0 ;
779778}
780779
780+ static void pm8xxx_mpp_irq_disable (struct irq_data * d )
781+ {
782+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
783+
784+ gpiochip_disable_irq (gc , irqd_to_hwirq (d ));
785+ }
786+
787+ static void pm8xxx_mpp_irq_enable (struct irq_data * d )
788+ {
789+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
790+
791+ gpiochip_enable_irq (gc , irqd_to_hwirq (d ));
792+ }
793+
794+ static const struct irq_chip pm8xxx_mpp_irq_chip = {
795+ .name = "ssbi-mpp" ,
796+ .irq_mask_ack = irq_chip_mask_ack_parent ,
797+ .irq_unmask = irq_chip_unmask_parent ,
798+ .irq_disable = pm8xxx_mpp_irq_disable ,
799+ .irq_enable = pm8xxx_mpp_irq_enable ,
800+ .irq_set_type = irq_chip_set_type_parent ,
801+ .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE |
802+ IRQCHIP_IMMUTABLE ,
803+ GPIOCHIP_IRQ_RESOURCE_HELPERS ,
804+ };
805+
781806static const struct of_device_id pm8xxx_mpp_of_match [] = {
782807 { .compatible = "qcom,pm8018-mpp" , .data = (void * ) 6 },
783808 { .compatible = "qcom,pm8038-mpp" , .data = (void * ) 6 },
@@ -871,14 +896,8 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
871896 if (!parent_domain )
872897 return - ENXIO ;
873898
874- pctrl -> irq .name = "ssbi-mpp" ;
875- pctrl -> irq .irq_mask_ack = irq_chip_mask_ack_parent ;
876- pctrl -> irq .irq_unmask = irq_chip_unmask_parent ;
877- pctrl -> irq .irq_set_type = irq_chip_set_type_parent ;
878- pctrl -> irq .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE ;
879-
880899 girq = & pctrl -> chip .irq ;
881- girq -> chip = & pctrl -> irq ;
900+ gpio_irq_chip_set_chip ( girq , & pm8xxx_mpp_irq_chip ) ;
882901 girq -> default_type = IRQ_TYPE_NONE ;
883902 girq -> handler = handle_level_irq ;
884903 girq -> fwnode = dev_fwnode (pctrl -> dev );
0 commit comments