aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/Kconfig17
-rw-r--r--drivers/char/keyboard.c2
-rw-r--r--drivers/char/sysrq.c4
-rw-r--r--drivers/char/vt.c6
-rw-r--r--drivers/char/vt_ioctl.c2
5 files changed, 26 insertions, 5 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index f6f8c03047fa..1232ace097e1 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -36,6 +36,23 @@ config VT
36 If unsure, say Y, or else you won't be able to do much with your new 36 If unsure, say Y, or else you won't be able to do much with your new
37 shiny Linux system :-) 37 shiny Linux system :-)
38 38
39config VT_UNICODE
40 bool "Virtual console is Unicode by default"
41 depends on VT
42 default n
43 ---help---
44 If you say Y here, the virtual terminal will be in UTF-8 by default,
45 and the keyboard will run in unicode mode.
46
47 If you say N here, the virtual terminal will not be in UTF-8 by
48 default, and the keyboard will run in XLATE mode.
49
50 This can also be changed by passing 'default_utf8=<0|1>' on the
51 kernel command line.
52
53 Historically, the kernel has defaulted to non-UTF8 and XLATE mode.
54 If unsure, say N here.
55
39config VT_CONSOLE 56config VT_CONSOLE
40 bool "Support for console on virtual terminal" if EMBEDDED 57 bool "Support for console on virtual terminal" if EMBEDDED
41 depends on VT 58 depends on VT
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 5ae2a3250c50..212276affa1f 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1381,7 +1381,7 @@ int __init kbd_init(void)
1381 kbd_table[i].lockstate = KBD_DEFLOCK; 1381 kbd_table[i].lockstate = KBD_DEFLOCK;
1382 kbd_table[i].slockstate = 0; 1382 kbd_table[i].slockstate = 0;
1383 kbd_table[i].modeflags = KBD_DEFMODE; 1383 kbd_table[i].modeflags = KBD_DEFMODE;
1384 kbd_table[i].kbdmode = VC_XLATE; 1384 kbd_table[i].kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;
1385 } 1385 }
1386 1386
1387 error = input_register_handler(&kbd_handler); 1387 error = input_register_handler(&kbd_handler);
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 179fa36ce485..78d14935f2b8 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -108,12 +108,12 @@ static void sysrq_handle_unraw(int key, struct tty_struct *tty)
108 struct kbd_struct *kbd = &kbd_table[fg_console]; 108 struct kbd_struct *kbd = &kbd_table[fg_console];
109 109
110 if (kbd) 110 if (kbd)
111 kbd->kbdmode = VC_XLATE; 111 kbd->kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;
112} 112}
113static struct sysrq_key_op sysrq_unraw_op = { 113static struct sysrq_key_op sysrq_unraw_op = {
114 .handler = sysrq_handle_unraw, 114 .handler = sysrq_handle_unraw,
115 .help_msg = "unRaw", 115 .help_msg = "unRaw",
116 .action_msg = "Keyboard mode set to XLATE", 116 .action_msg = "Keyboard mode set to system default",
117 .enable_mask = SYSRQ_ENABLE_KEYBOARD, 117 .enable_mask = SYSRQ_ENABLE_KEYBOARD,
118}; 118};
119#else 119#else
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 0d56f8fc105c..645ad9808982 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -158,7 +158,11 @@ static void blank_screen_t(unsigned long dummy);
158static void set_palette(struct vc_data *vc); 158static void set_palette(struct vc_data *vc);
159 159
160static int printable; /* Is console ready for printing? */ 160static int printable; /* Is console ready for printing? */
161static int default_utf8; 161#ifdef CONFIG_VT_UNICODE
162int default_utf8 = 1;
163#else
164int default_utf8;
165#endif
162module_param(default_utf8, int, S_IRUGO | S_IWUSR); 166module_param(default_utf8, int, S_IRUGO | S_IWUSR);
163 167
164/* 168/*
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 6c7384afff13..e6f89e8b9258 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -1125,7 +1125,7 @@ int vt_waitactive(int vt)
1125void reset_vc(struct vc_data *vc) 1125void reset_vc(struct vc_data *vc)
1126{ 1126{
1127 vc->vc_mode = KD_TEXT; 1127 vc->vc_mode = KD_TEXT;
1128 kbd_table[vc->vc_num].kbdmode = VC_XLATE; 1128 kbd_table[vc->vc_num].kbdmode = default_utf8 ? VC_UNICODE : VC_XLATE;
1129 vc->vt_mode.mode = VT_AUTO; 1129 vc->vt_mode.mode = VT_AUTO;
1130 vc->vt_mode.waitv = 0; 1130 vc->vt_mode.waitv = 0;
1131 vc->vt_mode.relsig = 0; 1131 vc->vt_mode.relsig = 0;