aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/serial/driver66
1 files changed, 57 insertions, 9 deletions
diff --git a/Documentation/serial/driver b/Documentation/serial/driver
index 87856d3cfb67..42ef9970bc86 100644
--- a/Documentation/serial/driver
+++ b/Documentation/serial/driver
@@ -116,12 +116,15 @@ hardware.
116 line becoming inactive or the tty layer indicating we want 116 line becoming inactive or the tty layer indicating we want
117 to stop transmission due to an XOFF character. 117 to stop transmission due to an XOFF character.
118 118
119 The driver should stop transmitting characters as soon as
120 possible.
121
119 Locking: port->lock taken. 122 Locking: port->lock taken.
120 Interrupts: locally disabled. 123 Interrupts: locally disabled.
121 This call must not sleep 124 This call must not sleep
122 125
123 start_tx(port) 126 start_tx(port)
124 start transmitting characters. 127 Start transmitting characters.
125 128
126 Locking: port->lock taken. 129 Locking: port->lock taken.
127 Interrupts: locally disabled. 130 Interrupts: locally disabled.
@@ -281,26 +284,31 @@ hardware.
281Other functions 284Other functions
282--------------- 285---------------
283 286
284uart_update_timeout(port,cflag,quot) 287uart_update_timeout(port,cflag,baud)
285 Update the FIFO drain timeout, port->timeout, according to the 288 Update the FIFO drain timeout, port->timeout, according to the
286 number of bits, parity, stop bits and quotient. 289 number of bits, parity, stop bits and baud rate.
287 290
288 Locking: caller is expected to take port->lock 291 Locking: caller is expected to take port->lock
289 Interrupts: n/a 292 Interrupts: n/a
290 293
291uart_get_baud_rate(port,termios) 294uart_get_baud_rate(port,termios,old,min,max)
292 Return the numeric baud rate for the specified termios, taking 295 Return the numeric baud rate for the specified termios, taking
293 account of the special 38400 baud "kludge". The B0 baud rate 296 account of the special 38400 baud "kludge". The B0 baud rate
294 is mapped to 9600 baud. 297 is mapped to 9600 baud.
295 298
299 If the baud rate is not within min..max, then if old is non-NULL,
300 the original baud rate will be tried. If that exceeds the
301 min..max constraint, 9600 baud will be returned. termios will
302 be updated to the baud rate in use.
303
304 Note: min..max must always allow 9600 baud to be selected.
305
296 Locking: caller dependent. 306 Locking: caller dependent.
297 Interrupts: n/a 307 Interrupts: n/a
298 308
299uart_get_divisor(port,termios,oldtermios) 309uart_get_divisor(port,baud)
300 Return the divsor (baud_base / baud) for the selected baud rate 310 Return the divsor (baud_base / baud) for the specified baud
301 specified by termios. If the baud rate is out of range, try 311 rate, appropriately rounded.
302 the original baud rate specified by oldtermios (if non-NULL).
303 If that fails, try 9600 baud.
304 312
305 If 38400 baud and custom divisor is selected, return the 313 If 38400 baud and custom divisor is selected, return the
306 custom divisor instead. 314 custom divisor instead.
@@ -308,6 +316,46 @@ uart_get_divisor(port,termios,oldtermios)
308 Locking: caller dependent. 316 Locking: caller dependent.
309 Interrupts: n/a 317 Interrupts: n/a
310 318
319uart_match_port(port1,port2)
320 This utility function can be used to determine whether two
321 uart_port structures describe the same port.
322
323 Locking: n/a
324 Interrupts: n/a
325
326uart_write_wakeup(port)
327 A driver is expected to call this function when the number of
328 characters in the transmit buffer have dropped below a threshold.
329
330 Locking: port->lock should be held.
331 Interrupts: n/a
332
333uart_register_driver(drv)
334 Register a uart driver with the core driver. We in turn register
335 with the tty layer, and initialise the core driver per-port state.
336
337 drv->port should be NULL, and the per-port structures should be
338 registered using uart_add_one_port after this call has succeeded.
339
340 Locking: none
341 Interrupts: enabled
342
343uart_unregister_driver()
344 Remove all references to a driver from the core driver. The low
345 level driver must have removed all its ports via the
346 uart_remove_one_port() if it registered them with uart_add_one_port().
347
348 Locking: none
349 Interrupts: enabled
350
351uart_suspend_port()
352
353uart_resume_port()
354
355uart_add_one_port()
356
357uart_remove_one_port()
358
311Other notes 359Other notes
312----------- 360-----------
313 361