@@ -1002,6 +1002,7 @@ static bool msm_gpio_needs_valid_mask(struct msm_pinctrl *pctrl)
1002
1002
static int msm_gpio_init (struct msm_pinctrl * pctrl )
1003
1003
{
1004
1004
struct gpio_chip * chip ;
1005
+ struct gpio_irq_chip * girq ;
1005
1006
int ret ;
1006
1007
unsigned ngpio = pctrl -> soc -> ngpios ;
1007
1008
@@ -1027,6 +1028,18 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
1027
1028
pctrl -> irq_chip .irq_request_resources = msm_gpio_irq_reqres ;
1028
1029
pctrl -> irq_chip .irq_release_resources = msm_gpio_irq_relres ;
1029
1030
1031
+ girq = & chip -> irq ;
1032
+ girq -> chip = & pctrl -> irq_chip ;
1033
+ girq -> parent_handler = msm_gpio_irq_handler ;
1034
+ girq -> num_parents = 1 ;
1035
+ girq -> parents = devm_kcalloc (pctrl -> dev , 1 , sizeof (* girq -> parents ),
1036
+ GFP_KERNEL );
1037
+ if (!girq -> parents )
1038
+ return - ENOMEM ;
1039
+ girq -> default_type = IRQ_TYPE_NONE ;
1040
+ girq -> handler = handle_bad_irq ;
1041
+ girq -> parents [0 ] = pctrl -> irq ;
1042
+
1030
1043
ret = gpiochip_add_data (& pctrl -> chip , pctrl );
1031
1044
if (ret ) {
1032
1045
dev_err (pctrl -> dev , "Failed register gpiochip\n" );
@@ -1053,20 +1066,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
1053
1066
}
1054
1067
}
1055
1068
1056
- ret = gpiochip_irqchip_add (chip ,
1057
- & pctrl -> irq_chip ,
1058
- 0 ,
1059
- handle_edge_irq ,
1060
- IRQ_TYPE_NONE );
1061
- if (ret ) {
1062
- dev_err (pctrl -> dev , "Failed to add irqchip to gpiochip\n" );
1063
- gpiochip_remove (& pctrl -> chip );
1064
- return - ENOSYS ;
1065
- }
1066
-
1067
- gpiochip_set_chained_irqchip (chip , & pctrl -> irq_chip , pctrl -> irq ,
1068
- msm_gpio_irq_handler );
1069
-
1070
1069
return 0 ;
1071
1070
}
1072
1071
0 commit comments