braille_console.c (9a64e8e0ace51b309fdcff4b4754b3649250382a) | braille_console.c (bbeddf52adc1b4207674ab88686cbbe58c24f721) |
---|---|
1/* 2 * Minimalistic braille device kernel support. 3 * 4 * By default, shows console messages on the braille device. 5 * Pressing Insert switches to VC browsing. 6 * 7 * Copyright (C) Samuel Thibault <samuel.thibault@ens-lyon.org> 8 * --- 345 unchanged lines hidden (view full) --- 354/* 355 * Called from printk.c when console=brl is given 356 */ 357 358int braille_register_console(struct console *console, int index, 359 char *console_options, char *braille_options) 360{ 361 int ret; | 1/* 2 * Minimalistic braille device kernel support. 3 * 4 * By default, shows console messages on the braille device. 5 * Pressing Insert switches to VC browsing. 6 * 7 * Copyright (C) Samuel Thibault <samuel.thibault@ens-lyon.org> 8 * --- 345 unchanged lines hidden (view full) --- 354/* 355 * Called from printk.c when console=brl is given 356 */ 357 358int braille_register_console(struct console *console, int index, 359 char *console_options, char *braille_options) 360{ 361 int ret; |
362 363 if (!(console->flags & CON_BRL)) 364 return 0; |
|
362 if (!console_options) 363 /* Only support VisioBraille for now */ 364 console_options = "57600o8"; 365 if (braille_co) 366 return -ENODEV; 367 if (console->setup) { 368 ret = console->setup(console, console_options); 369 if (ret != 0) 370 return ret; 371 } 372 console->flags |= CON_ENABLED; 373 console->index = index; 374 braille_co = console; 375 register_keyboard_notifier(&keyboard_notifier_block); 376 register_vt_notifier(&vt_notifier_block); | 365 if (!console_options) 366 /* Only support VisioBraille for now */ 367 console_options = "57600o8"; 368 if (braille_co) 369 return -ENODEV; 370 if (console->setup) { 371 ret = console->setup(console, console_options); 372 if (ret != 0) 373 return ret; 374 } 375 console->flags |= CON_ENABLED; 376 console->index = index; 377 braille_co = console; 378 register_keyboard_notifier(&keyboard_notifier_block); 379 register_vt_notifier(&vt_notifier_block); |
377 return 0; | 380 return 1; |
378} 379 380int braille_unregister_console(struct console *console) 381{ 382 if (braille_co != console) 383 return -EINVAL; | 381} 382 383int braille_unregister_console(struct console *console) 384{ 385 if (braille_co != console) 386 return -EINVAL; |
387 if (!(console->flags & CON_BRL)) 388 return 0; |
|
384 unregister_keyboard_notifier(&keyboard_notifier_block); 385 unregister_vt_notifier(&vt_notifier_block); 386 braille_co = NULL; | 389 unregister_keyboard_notifier(&keyboard_notifier_block); 390 unregister_vt_notifier(&vt_notifier_block); 391 braille_co = NULL; |
387 return 0; | 392 return 1; |
388} | 393} |