hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-mxs.c
....@@ -84,7 +84,7 @@
8484 port->both_edges &= ~pin_mask;
8585 switch (type) {
8686 case IRQ_TYPE_EDGE_BOTH:
87
- val = port->gc.get(&port->gc, d->hwirq);
87
+ val = readl(port->base + PINCTRL_DIN(port)) & pin_mask;
8888 if (val)
8989 edge = GPIO_INT_FALL_EDGE;
9090 else
....@@ -248,7 +248,10 @@
248248 u32 dir;
249249
250250 dir = readl(port->base + PINCTRL_DOE(port));
251
- return !(dir & mask);
251
+ if (dir & mask)
252
+ return GPIO_LINE_DIRECTION_OUT;
253
+
254
+ return GPIO_LINE_DIRECTION_IN;
252255 }
253256
254257 static const struct platform_device_id mxs_gpio_ids[] = {