.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Minimalistic braille device kernel support. |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Pressing Insert switches to VC browsing. |
---|
6 | 7 | * |
---|
7 | 8 | * Copyright (C) Samuel Thibault <samuel.thibault@ens-lyon.org> |
---|
8 | | - * |
---|
9 | | - * This program is free software ; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License as published by |
---|
11 | | - * the Free Software Foundation ; either version 2 of the License, or |
---|
12 | | - * (at your option) any later version. |
---|
13 | | - * |
---|
14 | | - * This program is distributed in the hope that it will be useful, |
---|
15 | | - * but WITHOUT ANY WARRANTY ; without even the implied warranty of |
---|
16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | | - * GNU General Public License for more details. |
---|
18 | | - * |
---|
19 | | - * You should have received a copy of the GNU General Public License |
---|
20 | | - * along with the program ; if not, write to the Free Software |
---|
21 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
22 | 9 | */ |
---|
23 | 10 | |
---|
24 | 11 | #include <linux/kernel.h> |
---|
.. | .. |
---|
122 | 109 | /* Follow the VC cursor*/ |
---|
123 | 110 | static void vc_follow_cursor(struct vc_data *vc) |
---|
124 | 111 | { |
---|
125 | | - vc_x = vc->vc_x - (vc->vc_x % WIDTH); |
---|
126 | | - vc_y = vc->vc_y; |
---|
127 | | - lastvc_x = vc->vc_x; |
---|
128 | | - lastvc_y = vc->vc_y; |
---|
| 112 | + vc_x = vc->state.x - (vc->state.x % WIDTH); |
---|
| 113 | + vc_y = vc->state.y; |
---|
| 114 | + lastvc_x = vc->state.x; |
---|
| 115 | + lastvc_y = vc->state.y; |
---|
129 | 116 | } |
---|
130 | 117 | |
---|
131 | 118 | /* Maybe the VC cursor moved, if so follow it */ |
---|
132 | 119 | static void vc_maybe_cursor_moved(struct vc_data *vc) |
---|
133 | 120 | { |
---|
134 | | - if (vc->vc_x != lastvc_x || vc->vc_y != lastvc_y) |
---|
| 121 | + if (vc->state.x != lastvc_x || vc->state.y != lastvc_y) |
---|
135 | 122 | vc_follow_cursor(vc); |
---|
136 | 123 | } |
---|
137 | 124 | |
---|
.. | .. |
---|
303 | 290 | break; |
---|
304 | 291 | case '\t': |
---|
305 | 292 | c = ' '; |
---|
306 | | - /* Fallthrough */ |
---|
| 293 | + fallthrough; |
---|
307 | 294 | default: |
---|
308 | 295 | if (c < 32) |
---|
309 | 296 | /* Ignore other control sequences */ |
---|
.. | .. |
---|
360 | 347 | { |
---|
361 | 348 | int ret; |
---|
362 | 349 | |
---|
363 | | - if (!(console->flags & CON_BRL)) |
---|
364 | | - return 0; |
---|
365 | 350 | if (!console_options) |
---|
366 | 351 | /* Only support VisioBraille for now */ |
---|
367 | 352 | console_options = "57600o8"; |
---|
.. | .. |
---|
384 | 369 | { |
---|
385 | 370 | if (braille_co != console) |
---|
386 | 371 | return -EINVAL; |
---|
387 | | - if (!(console->flags & CON_BRL)) |
---|
388 | | - return 0; |
---|
389 | 372 | unregister_keyboard_notifier(&keyboard_notifier_block); |
---|
390 | 373 | unregister_vt_notifier(&vt_notifier_block); |
---|
391 | 374 | braille_co = NULL; |
---|