Commit 8db8acee authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

docs: console.txt: convert docs to ReST and rename to *.rst

Convert this small file to ReST in preparation for adding it to
the driver-api book.

While this is not part of the driver-api book, mark it as
:orphan:, in order to avoid build warnings.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 01c0aa79
:orphan:
===============
Console Drivers Console Drivers
=============== ===============
...@@ -17,25 +20,26 @@ of driver occupying the consoles.) They can only take over the console that is ...@@ -17,25 +20,26 @@ of driver occupying the consoles.) They can only take over the console that is
occupied by the system driver. In the same token, if the modular driver is occupied by the system driver. In the same token, if the modular driver is
released by the console, the system driver will take over. released by the console, the system driver will take over.
Modular drivers, from the programmer's point of view, have to call: Modular drivers, from the programmer's point of view, have to call::
do_take_over_console() - load and bind driver to console layer do_take_over_console() - load and bind driver to console layer
give_up_console() - unload driver; it will only work if driver give_up_console() - unload driver; it will only work if driver
is fully unbound is fully unbound
In newer kernels, the following are also available: In newer kernels, the following are also available::
do_register_con_driver() do_register_con_driver()
do_unregister_con_driver() do_unregister_con_driver()
If sysfs is enabled, the contents of /sys/class/vtconsole can be If sysfs is enabled, the contents of /sys/class/vtconsole can be
examined. This shows the console backends currently registered by the examined. This shows the console backends currently registered by the
system which are named vtcon<n> where <n> is an integer from 0 to 15. Thus: system which are named vtcon<n> where <n> is an integer from 0 to 15.
Thus::
ls /sys/class/vtconsole ls /sys/class/vtconsole
. .. vtcon0 vtcon1 . .. vtcon0 vtcon1
Each directory in /sys/class/vtconsole has 3 files: Each directory in /sys/class/vtconsole has 3 files::
ls /sys/class/vtconsole/vtcon0 ls /sys/class/vtconsole/vtcon0
. .. bind name uevent . .. bind name uevent
...@@ -46,27 +50,29 @@ What do these files signify? ...@@ -46,27 +50,29 @@ What do these files signify?
read, or acts to bind or unbind the driver to the virtual consoles read, or acts to bind or unbind the driver to the virtual consoles
when written to. The possible values are: when written to. The possible values are:
0 - means the driver is not bound and if echo'ed, commands the driver 0
- means the driver is not bound and if echo'ed, commands the driver
to unbind to unbind
1 - means the driver is bound and if echo'ed, commands the driver to 1
- means the driver is bound and if echo'ed, commands the driver to
bind bind
2. name - read-only file. Shows the name of the driver in this format: 2. name - read-only file. Shows the name of the driver in this format::
cat /sys/class/vtconsole/vtcon0/name cat /sys/class/vtconsole/vtcon0/name
(S) VGA+ (S) VGA+
'(S)' stands for a (S)ystem driver, i.e., it cannot be directly '(S)' stands for a (S)ystem driver, i.e., it cannot be directly
commanded to bind or unbind commanded to bind or unbind
'VGA+' is the name of the driver 'VGA+' is the name of the driver
cat /sys/class/vtconsole/vtcon1/name cat /sys/class/vtconsole/vtcon1/name
(M) frame buffer device (M) frame buffer device
In this case, '(M)' stands for a (M)odular driver, one that can be In this case, '(M)' stands for a (M)odular driver, one that can be
directly commanded to bind or unbind. directly commanded to bind or unbind.
3. uevent - ignore this file 3. uevent - ignore this file
...@@ -75,14 +81,17 @@ driver takes over the consoles vacated by the driver. Binding, on the other ...@@ -75,14 +81,17 @@ driver takes over the consoles vacated by the driver. Binding, on the other
hand, will bind the driver to the consoles that are currently occupied by a hand, will bind the driver to the consoles that are currently occupied by a
system driver. system driver.
NOTE1: Binding and unbinding must be selected in Kconfig. It's under: NOTE1:
Binding and unbinding must be selected in Kconfig. It's under::
Device Drivers -> Character devices -> Support for binding and unbinding Device Drivers ->
console drivers Character devices ->
Support for binding and unbinding console drivers
NOTE2: If any of the virtual consoles are in KD_GRAPHICS mode, then binding or NOTE2:
unbinding will not succeed. An example of an application that sets the console If any of the virtual consoles are in KD_GRAPHICS mode, then binding or
to KD_GRAPHICS is X. unbinding will not succeed. An example of an application that sets the
console to KD_GRAPHICS is X.
How useful is this feature? This is very useful for console driver How useful is this feature? This is very useful for console driver
developers. By unbinding the driver from the console layer, one can unload the developers. By unbinding the driver from the console layer, one can unload the
...@@ -92,10 +101,10 @@ framebuffer console to VGA console and vice versa, this feature also makes ...@@ -92,10 +101,10 @@ framebuffer console to VGA console and vice versa, this feature also makes
this possible. (NOTE NOTE NOTE: Please read fbcon.txt under Documentation/fb this possible. (NOTE NOTE NOTE: Please read fbcon.txt under Documentation/fb
for more details.) for more details.)
Notes for developers: Notes for developers
===================== ====================
do_take_over_console() is now broken up into: do_take_over_console() is now broken up into::
do_register_con_driver() do_register_con_driver()
do_bind_con_driver() - private function do_bind_con_driver() - private function
...@@ -104,7 +113,7 @@ give_up_console() is a wrapper to do_unregister_con_driver(), and a driver must ...@@ -104,7 +113,7 @@ give_up_console() is a wrapper to do_unregister_con_driver(), and a driver must
be fully unbound for this call to succeed. con_is_bound() will check if the be fully unbound for this call to succeed. con_is_bound() will check if the
driver is bound or not. driver is bound or not.
Guidelines for console driver writers: Guidelines for console driver writers
===================================== =====================================
In order for binding to and unbinding from the console to properly work, In order for binding to and unbinding from the console to properly work,
...@@ -140,6 +149,4 @@ The current crop of console drivers should still work correctly, but binding ...@@ -140,6 +149,4 @@ The current crop of console drivers should still work correctly, but binding
and unbinding them may cause problems. With minimal fixes, these drivers can and unbinding them may cause problems. With minimal fixes, these drivers can
be made to work correctly. be made to work correctly.
==========================
Antonino Daplas <adaplas@pol.net> Antonino Daplas <adaplas@pol.net>
...@@ -187,7 +187,7 @@ the hardware. Thus, in a VGA console:: ...@@ -187,7 +187,7 @@ the hardware. Thus, in a VGA console::
Assuming the VGA driver can be unloaded, one must first unbind the VGA driver Assuming the VGA driver can be unloaded, one must first unbind the VGA driver
from the console layer before unloading the driver. The VGA driver cannot be from the console layer before unloading the driver. The VGA driver cannot be
unloaded if it is still bound to the console layer. (See unloaded if it is still bound to the console layer. (See
Documentation/console/console.txt for more information). Documentation/console/console.rst for more information).
This is more complicated in the case of the framebuffer console (fbcon), This is more complicated in the case of the framebuffer console (fbcon),
because fbcon is an intermediate layer between the console and the drivers:: because fbcon is an intermediate layer between the console and the drivers::
...@@ -204,7 +204,7 @@ fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from ...@@ -204,7 +204,7 @@ fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from
fbcon. fbcon.
So, how do we unbind fbcon from the console? Part of the answer is in So, how do we unbind fbcon from the console? Part of the answer is in
Documentation/console/console.txt. To summarize: Documentation/console/console.rst. To summarize:
Echo a value to the bind file that represents the framebuffer console Echo a value to the bind file that represents the framebuffer console
driver. So assuming vtcon1 represents fbcon, then:: driver. So assuming vtcon1 represents fbcon, then::
......
...@@ -93,7 +93,7 @@ config VT_HW_CONSOLE_BINDING ...@@ -93,7 +93,7 @@ config VT_HW_CONSOLE_BINDING
select the console driver that will serve as the backend for the select the console driver that will serve as the backend for the
virtual terminals. virtual terminals.
See <file:Documentation/console/console.txt> for more See <file:Documentation/console/console.rst> for more
information. For framebuffer console users, please refer to information. For framebuffer console users, please refer to
<file:Documentation/fb/fbcon.rst>. <file:Documentation/fb/fbcon.rst>.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment