hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/tty/serial/sh-sci.c
....@@ -31,6 +31,7 @@
3131 #include <linux/ioport.h>
3232 #include <linux/ktime.h>
3333 #include <linux/major.h>
34
+#include <linux/minmax.h>
3435 #include <linux/module.h>
3536 #include <linux/mm.h>
3637 #include <linux/of.h>
....@@ -2923,6 +2924,13 @@
29232924 sci_port->irqs[i] = platform_get_irq(dev, i);
29242925 }
29252926
2927
+ /*
2928
+ * The fourth interrupt on SCI port is transmit end interrupt, so
2929
+ * shuffle the interrupts.
2930
+ */
2931
+ if (p->type == PORT_SCI)
2932
+ swap(sci_port->irqs[SCIx_BRI_IRQ], sci_port->irqs[SCIx_TEI_IRQ]);
2933
+
29262934 /* The SCI generates several interrupts. They can be muxed together or
29272935 * connected to different interrupt lines. In the muxed case only one
29282936 * interrupt resource is specified as there is only one interrupt ID.
....@@ -2988,7 +2996,7 @@
29882996 port->flags = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags;
29892997 port->fifosize = sci_port->params->fifosize;
29902998
2991
- if (port->type == PORT_SCI) {
2999
+ if (port->type == PORT_SCI && !dev->dev.of_node) {
29923000 if (sci_port->reg_size >= 0x20)
29933001 port->regshift = 2;
29943002 else