All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use callbacks to access UART_DLL/UART_DLM
@ 2015-12-17 15:45 Sebastian Frias
  2015-12-17 16:02 ` Måns Rullgård
  0 siblings, 1 reply; 12+ messages in thread
From: Sebastian Frias @ 2015-12-17 15:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Magnus Damm
  Cc: linux-serial, LKML, Mason, Måns Rullgård

---
resending as plain-text
---
  drivers/tty/serial/8250/8250_core.c |   17 +++++++----------
  1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c 
b/drivers/tty/serial/8250/8250_core.c
index 2c46a21..9ca863c 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -791,22 +791,19 @@ static int size_fifo(struct uart_8250_port *up)
   */
  static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
  {
-    unsigned char old_dll, old_dlm, old_lcr;
+    unsigned char old_lcr;
      unsigned int id;
+    unsigned int old_dl;

      old_lcr = serial_in(p, UART_LCR);
-    serial_out(p, UART_LCR, UART_LCR_CONF_MODE_A);
-
-    old_dll = serial_in(p, UART_DLL);
-    old_dlm = serial_in(p, UART_DLM);

-    serial_out(p, UART_DLL, 0);
-    serial_out(p, UART_DLM, 0);
+    serial_out(p, UART_LCR, UART_LCR_CONF_MODE_A);

-    id = serial_in(p, UART_DLL) | serial_in(p, UART_DLM) << 8;
+    old_dl = serial_dl_read(p);
+    serial_dl_write(p, 0);
+    id = serial_dl_read(p);
+    serial_dl_write(p, old_dl);

-    serial_out(p, UART_DLL, old_dll);
-    serial_out(p, UART_DLM, old_dlm);
      serial_out(p, UART_LCR, old_lcr);

      return id;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-12-18 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 15:45 [PATCH] use callbacks to access UART_DLL/UART_DLM Sebastian Frias
2015-12-17 16:02 ` Måns Rullgård
2015-12-17 18:07   ` Sebastian Frias
2015-12-17 18:09     ` Måns Rullgård
2015-12-17 19:14       ` Mason
2015-12-18 10:46     ` [PATCH v2] " Sebastian Frias
2015-12-18 16:06       ` Peter Hurley
2015-12-18 16:27         ` Sebastian Frias
2015-12-18 16:34           ` Peter Hurley
2015-12-18 16:35             ` Sebastian Frias
2015-12-18 16:40         ` [PATCH v3] " Sebastian Frias
2015-12-18 16:42           ` Peter Hurley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.