Lines Matching refs:sisusb
94 sisusb_initialize(struct sisusb_usb_data *sisusb) in sisusb_initialize() argument
97 if (sisusb_setidxreg(sisusb, SISCR, 0x0c, 0x00)) in sisusb_initialize()
99 if (sisusb_setidxreg(sisusb, SISCR, 0x0d, 0x00)) in sisusb_initialize()
101 if (sisusb_setidxreg(sisusb, SISCR, 0x0e, 0x00)) in sisusb_initialize()
103 sisusb_setidxreg(sisusb, SISCR, 0x0f, 0x00); in sisusb_initialize()
107 sisusbcon_set_start_address(struct sisusb_usb_data *sisusb, struct vc_data *c) in sisusbcon_set_start_address() argument
109 sisusb->cur_start_addr = (c->vc_visible_origin - sisusb->scrbuf) / 2; in sisusbcon_set_start_address()
111 sisusb_setidxreg(sisusb, SISCR, 0x0c, (sisusb->cur_start_addr >> 8)); in sisusbcon_set_start_address()
112 sisusb_setidxreg(sisusb, SISCR, 0x0d, (sisusb->cur_start_addr & 0xff)); in sisusbcon_set_start_address()
116 sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location) in sisusb_set_cursor() argument
118 if (sisusb->sisusb_cursor_loc == location) in sisusb_set_cursor()
121 sisusb->sisusb_cursor_loc = location; in sisusb_set_cursor()
129 sisusb->bad_cursor_pos = 1; in sisusb_set_cursor()
131 if (sisusb_setidxregandor(sisusb, SISCR, 0x0b, 0x1f, 0x20)) in sisusb_set_cursor()
133 } else if (sisusb->bad_cursor_pos) { in sisusb_set_cursor()
134 if (sisusb_setidxregand(sisusb, SISCR, 0x0b, 0x1f)) in sisusb_set_cursor()
136 sisusb->bad_cursor_pos = 0; in sisusb_set_cursor()
139 if (sisusb_setidxreg(sisusb, SISCR, 0x0e, (location >> 8))) in sisusb_set_cursor()
141 sisusb_setidxreg(sisusb, SISCR, 0x0f, (location & 0xff)); in sisusb_set_cursor()
151 sisusb_sisusb_valid(struct sisusb_usb_data *sisusb) in sisusb_sisusb_valid() argument
153 if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) in sisusb_sisusb_valid()
162 struct sisusb_usb_data *sisusb; in sisusb_get_sisusb_lock_and_check() local
172 if (!(sisusb = sisusb_get_sisusb(console))) in sisusb_get_sisusb_lock_and_check()
175 mutex_lock(&sisusb->lock); in sisusb_get_sisusb_lock_and_check()
177 if (!sisusb_sisusb_valid(sisusb) || in sisusb_get_sisusb_lock_and_check()
178 !sisusb->havethisconsole[console]) { in sisusb_get_sisusb_lock_and_check()
179 mutex_unlock(&sisusb->lock); in sisusb_get_sisusb_lock_and_check()
183 return sisusb; in sisusb_get_sisusb_lock_and_check()
187 sisusb_is_inactive(struct vc_data *c, struct sisusb_usb_data *sisusb) in sisusb_is_inactive() argument
189 if (sisusb->is_gfx || in sisusb_is_inactive()
190 sisusb->textmodedestroyed || in sisusb_is_inactive()
208 struct sisusb_usb_data *sisusb; in sisusbcon_init() local
217 if (!(sisusb = sisusb_get_sisusb(c->vc_num))) in sisusbcon_init()
220 mutex_lock(&sisusb->lock); in sisusbcon_init()
222 if (!sisusb_sisusb_valid(sisusb)) { in sisusbcon_init()
223 mutex_unlock(&sisusb->lock); in sisusbcon_init()
231 c->vc_hi_font_mask = sisusb->current_font_512 ? 0x0800 : 0; in sisusbcon_init()
233 sisusb->haveconsole = 1; in sisusbcon_init()
235 sisusb->havethisconsole[c->vc_num] = 1; in sisusbcon_init()
240 c->vc_font.height = sisusb->current_font_height; in sisusbcon_init()
255 kref_get(&sisusb->kref); in sisusbcon_init()
260 mutex_unlock(&sisusb->lock); in sisusbcon_init()
273 struct sisusb_usb_data *sisusb; in sisusbcon_deinit() local
280 if (!(sisusb = sisusb_get_sisusb(c->vc_num))) in sisusbcon_deinit()
283 mutex_lock(&sisusb->lock); in sisusbcon_deinit()
288 sisusb->havethisconsole[c->vc_num] = 0; in sisusbcon_deinit()
291 if (sisusb->font_backup) { in sisusbcon_deinit()
293 if (sisusb->havethisconsole[c->vc_num]) in sisusbcon_deinit()
297 vfree(sisusb->font_backup); in sisusbcon_deinit()
298 sisusb->font_backup = NULL; in sisusbcon_deinit()
302 mutex_unlock(&sisusb->lock); in sisusbcon_deinit()
305 kref_put(&sisusb->kref, sisusb_delete); in sisusbcon_deinit()
357 (y) * sisusb->sisusb_num_columns + \
361 ((u16 *)(sisusb->vrambase + (c->vc_origin - sisusb->scrbuf)) + \
362 (y) * sisusb->sisusb_num_columns + \
369 struct sisusb_usb_data *sisusb; in sisusbcon_putc() local
372 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_putc()
376 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_putc()
377 mutex_unlock(&sisusb->lock); in sisusbcon_putc()
382 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(x, y), in sisusbcon_putc()
385 mutex_unlock(&sisusb->lock); in sisusbcon_putc()
393 struct sisusb_usb_data *sisusb; in sisusbcon_putcs() local
398 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_putcs()
412 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_putcs()
413 mutex_unlock(&sisusb->lock); in sisusbcon_putcs()
417 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(x, y), in sisusbcon_putcs()
420 mutex_unlock(&sisusb->lock); in sisusbcon_putcs()
427 struct sisusb_usb_data *sisusb; in sisusbcon_clear() local
436 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_clear()
447 cols = sisusb->sisusb_num_columns; in sisusbcon_clear()
463 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_clear()
464 mutex_unlock(&sisusb->lock); in sisusbcon_clear()
471 sisusb_copy_memory(sisusb, (unsigned char *)SISUSB_VADDR(x, y), in sisusbcon_clear()
474 mutex_unlock(&sisusb->lock); in sisusbcon_clear()
482 struct sisusb_usb_data *sisusb; in sisusbcon_bmove() local
489 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_bmove()
494 cols = sisusb->sisusb_num_columns; in sisusbcon_bmove()
496 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_bmove()
497 mutex_unlock(&sisusb->lock); in sisusbcon_bmove()
504 sisusb_copy_memory(sisusb, (unsigned char *)SISUSB_VADDR(dx, dy), in sisusbcon_bmove()
507 mutex_unlock(&sisusb->lock); in sisusbcon_bmove()
514 struct sisusb_usb_data *sisusb; in sisusbcon_switch() local
523 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_switch()
529 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_switch()
530 mutex_unlock(&sisusb->lock); in sisusbcon_switch()
539 mutex_unlock(&sisusb->lock); in sisusbcon_switch()
540 dev_dbg(&sisusb->sisusb_dev->dev, "ASSERT ORIGIN != SCREENBUF!\n"); in sisusbcon_switch()
546 (int)(sisusb->scrbuf + sisusb->scrbuf_size - c->vc_origin)); in sisusbcon_switch()
552 sisusb_copy_memory(sisusb, (unsigned char *)c->vc_origin, in sisusbcon_switch()
556 mutex_unlock(&sisusb->lock); in sisusbcon_switch()
565 struct sisusb_usb_data *sisusb; in sisusbcon_save_screen() local
572 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_save_screen()
577 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_save_screen()
578 mutex_unlock(&sisusb->lock); in sisusbcon_save_screen()
584 (int)(sisusb->scrbuf + sisusb->scrbuf_size - c->vc_origin)); in sisusbcon_save_screen()
590 mutex_unlock(&sisusb->lock); in sisusbcon_save_screen()
597 struct sisusb_usb_data *sisusb; in sisusbcon_set_palette() local
605 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_set_palette()
610 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_set_palette()
611 mutex_unlock(&sisusb->lock); in sisusbcon_set_palette()
616 if (sisusb_setreg(sisusb, SISCOLIDX, table[i])) in sisusbcon_set_palette()
618 if (sisusb_setreg(sisusb, SISCOLDATA, c->vc_palette[j++] >> 2)) in sisusbcon_set_palette()
620 if (sisusb_setreg(sisusb, SISCOLDATA, c->vc_palette[j++] >> 2)) in sisusbcon_set_palette()
622 if (sisusb_setreg(sisusb, SISCOLDATA, c->vc_palette[j++] >> 2)) in sisusbcon_set_palette()
626 mutex_unlock(&sisusb->lock); in sisusbcon_set_palette()
635 struct sisusb_usb_data *sisusb; in sisusbcon_blank() local
640 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_blank()
646 sisusb->is_gfx = blank ? 1 : 0; in sisusbcon_blank()
648 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_blank()
649 mutex_unlock(&sisusb->lock); in sisusbcon_blank()
660 sisusb_copy_memory(sisusb, in sisusbcon_blank()
662 (u32)(sisusb->vrambase + in sisusbcon_blank()
663 (c->vc_origin - sisusb->scrbuf)), in sisusbcon_blank()
665 sisusb->con_blanked = 1; in sisusbcon_blank()
677 sisusb->con_blanked = 0; in sisusbcon_blank()
698 mutex_unlock(&sisusb->lock); in sisusbcon_blank()
702 sisusb_setidxregandor(sisusb, SISSR, 0x01, ~0x20, sr1); in sisusbcon_blank()
703 sisusb_setidxregandor(sisusb, SISCR, 0x17, 0x7f, cr17); in sisusbcon_blank()
704 sisusb_setidxregandor(sisusb, SISSR, 0x1f, 0x3f, pmreg); in sisusbcon_blank()
705 sisusb_setidxregandor(sisusb, SISCR, 0x63, 0xbf, cr63); in sisusbcon_blank()
709 mutex_unlock(&sisusb->lock); in sisusbcon_blank()
718 struct sisusb_usb_data *sisusb; in sisusbcon_scrolldelta() local
724 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_scrolldelta()
729 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_scrolldelta()
730 mutex_unlock(&sisusb->lock); in sisusbcon_scrolldelta()
738 if (sisusb->con_rolled_over > in sisusbcon_scrolldelta()
739 (c->vc_scr_end - sisusb->scrbuf) + margin) { in sisusbcon_scrolldelta()
741 ul = c->vc_scr_end - sisusb->scrbuf; in sisusbcon_scrolldelta()
742 we = sisusb->con_rolled_over + c->vc_size_row; in sisusbcon_scrolldelta()
747 we = sisusb->scrbuf_size; in sisusbcon_scrolldelta()
751 p = (c->vc_visible_origin - sisusb->scrbuf - ul + we) % we + in sisusbcon_scrolldelta()
754 st = (c->vc_origin - sisusb->scrbuf - ul + we) % we; in sisusbcon_scrolldelta()
765 c->vc_visible_origin = sisusb->scrbuf + (p + ul) % we; in sisusbcon_scrolldelta()
768 sisusbcon_set_start_address(sisusb, c); in sisusbcon_scrolldelta()
770 mutex_unlock(&sisusb->lock); in sisusbcon_scrolldelta()
779 struct sisusb_usb_data *sisusb; in sisusbcon_cursor() local
782 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_cursor()
787 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_cursor()
788 mutex_unlock(&sisusb->lock); in sisusbcon_cursor()
794 sisusbcon_set_start_address(sisusb, c); in sisusbcon_cursor()
798 sisusb_setidxregor(sisusb, SISCR, 0x0a, 0x20); in sisusbcon_cursor()
799 sisusb->sisusb_cursor_size_to = -1; in sisusbcon_cursor()
800 mutex_unlock(&sisusb->lock); in sisusbcon_cursor()
804 sisusb_set_cursor(sisusb, (c->vc_pos - sisusb->scrbuf) / 2); in sisusbcon_cursor()
830 if (sisusb->sisusb_cursor_size_from != from || in sisusbcon_cursor()
831 sisusb->sisusb_cursor_size_to != to) { in sisusbcon_cursor()
833 sisusb_setidxreg(sisusb, SISCR, 0x0a, from); in sisusbcon_cursor()
834 sisusb_setidxregandor(sisusb, SISCR, 0x0b, 0xe0, to); in sisusbcon_cursor()
836 sisusb->sisusb_cursor_size_from = from; in sisusbcon_cursor()
837 sisusb->sisusb_cursor_size_to = to; in sisusbcon_cursor()
840 mutex_unlock(&sisusb->lock); in sisusbcon_cursor()
844 sisusbcon_scroll_area(struct vc_data *c, struct sisusb_usb_data *sisusb, in sisusbcon_scroll_area() argument
847 int cols = sisusb->sisusb_num_columns; in sisusbcon_scroll_area()
879 sisusb_copy_memory(sisusb, (char *)SISUSB_VADDR(0, t), in sisusbcon_scroll_area()
882 mutex_unlock(&sisusb->lock); in sisusbcon_scroll_area()
891 struct sisusb_usb_data *sisusb; in sisusbcon_scroll() local
909 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_scroll()
914 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_scroll()
915 mutex_unlock(&sisusb->lock); in sisusbcon_scroll()
921 return sisusbcon_scroll_area(c, sisusb, t, b, dir, lines); in sisusbcon_scroll()
925 sisusbcon_set_start_address(sisusb, c); in sisusbcon_scroll()
939 sisusb->scrbuf + sisusb->scrbuf_size) { in sisusbcon_scroll()
940 sisusbcon_memcpyw((u16 *)sisusb->scrbuf, in sisusbcon_scroll()
943 c->vc_origin = sisusb->scrbuf; in sisusbcon_scroll()
944 sisusb->con_rolled_over = oldorigin - sisusb->scrbuf; in sisusbcon_scroll()
957 if (oldorigin - delta < sisusb->scrbuf) { in sisusbcon_scroll()
958 sisusbcon_memmovew((u16 *)(sisusb->scrbuf + in sisusbcon_scroll()
959 sisusb->scrbuf_size - in sisusbcon_scroll()
964 c->vc_origin = sisusb->scrbuf + in sisusbcon_scroll()
965 sisusb->scrbuf_size - in sisusbcon_scroll()
967 sisusb->con_rolled_over = 0; in sisusbcon_scroll()
979 originoffset = (u32)(c->vc_origin - sisusb->scrbuf); in sisusbcon_scroll()
982 sisusb_copy_memory(sisusb, in sisusbcon_scroll()
984 (u32)(sisusb->vrambase + originoffset), in sisusbcon_scroll()
987 sisusb_copy_memory(sisusb, in sisusbcon_scroll()
989 (u32)sisusb->vrambase + originoffset + in sisusbcon_scroll()
993 sisusb_copy_memory(sisusb, in sisusbcon_scroll()
995 (u32)(sisusb->vrambase + originoffset), in sisusbcon_scroll()
1001 sisusbcon_set_start_address(sisusb, c); in sisusbcon_scroll()
1005 mutex_unlock(&sisusb->lock); in sisusbcon_scroll()
1014 struct sisusb_usb_data *sisusb; in sisusbcon_set_origin() local
1021 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_set_origin()
1026 if (sisusb_is_inactive(c, sisusb) || sisusb->con_blanked) { in sisusbcon_set_origin()
1027 mutex_unlock(&sisusb->lock); in sisusbcon_set_origin()
1031 c->vc_origin = c->vc_visible_origin = sisusb->scrbuf; in sisusbcon_set_origin()
1033 sisusbcon_set_start_address(sisusb, c); in sisusbcon_set_origin()
1035 sisusb->con_rolled_over = 0; in sisusbcon_set_origin()
1037 mutex_unlock(&sisusb->lock); in sisusbcon_set_origin()
1047 struct sisusb_usb_data *sisusb; in sisusbcon_resize() local
1050 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_resize()
1053 fh = sisusb->current_font_height; in sisusbcon_resize()
1055 mutex_unlock(&sisusb->lock); in sisusbcon_resize()
1071 sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, in sisusbcon_do_font_op() argument
1089 mutex_unlock(&sisusb->lock); in sisusbcon_do_font_op()
1094 sisusb->font_slot = slot; in sisusbcon_do_font_op()
1104 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x01); /* Reset */ in sisusbcon_do_font_op()
1105 err |= sisusb_setidxreg(sisusb, SISSR, 0x02, 0x04); /* Write to plane 2 */ in sisusbcon_do_font_op()
1106 err |= sisusb_setidxreg(sisusb, SISSR, 0x04, 0x07); /* Memory mode a0-bf */ in sisusbcon_do_font_op()
1107 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x03); /* Reset */ in sisusbcon_do_font_op()
1112 err |= sisusb_setidxreg(sisusb, SISGR, 0x04, 0x03); /* Select plane read 2 */ in sisusbcon_do_font_op()
1113 err |= sisusb_setidxreg(sisusb, SISGR, 0x05, 0x00); /* Disable odd/even */ in sisusbcon_do_font_op()
1114 err |= sisusb_setidxreg(sisusb, SISGR, 0x06, 0x00); /* Address range a0-bf */ in sisusbcon_do_font_op()
1122 err |= sisusb_writeb(sisusb, in sisusbcon_do_font_op()
1123 sisusb->vrambase + offset + i, in sisusbcon_do_font_op()
1130 err |= sisusb_readb(sisusb, in sisusbcon_do_font_op()
1131 sisusb->vrambase + offset + i, in sisusbcon_do_font_op()
1145 err |= sisusb_writeb(sisusb, in sisusbcon_do_font_op()
1146 sisusb->vrambase + offset + in sisusbcon_do_font_op()
1154 err |= sisusb_readb(sisusb, in sisusbcon_do_font_op()
1155 sisusb->vrambase + offset + in sisusbcon_do_font_op()
1167 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x01); /* Reset */ in sisusbcon_do_font_op()
1168 err |= sisusb_setidxreg(sisusb, SISSR, 0x02, 0x03); /* Write to planes 0+1 */ in sisusbcon_do_font_op()
1169 err |= sisusb_setidxreg(sisusb, SISSR, 0x04, 0x03); /* Memory mode a0-bf */ in sisusbcon_do_font_op()
1171 sisusb_setidxreg(sisusb, SISSR, 0x03, font_select); in sisusbcon_do_font_op()
1172 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x03); /* Reset end */ in sisusbcon_do_font_op()
1177 err |= sisusb_setidxreg(sisusb, SISGR, 0x04, 0x00); /* Select plane read 0 */ in sisusbcon_do_font_op()
1178 err |= sisusb_setidxreg(sisusb, SISGR, 0x05, 0x10); /* Enable odd/even */ in sisusbcon_do_font_op()
1179 err |= sisusb_setidxreg(sisusb, SISGR, 0x06, 0x06); /* Address range b8-bf */ in sisusbcon_do_font_op()
1184 if ((set) && (ch512 != sisusb->current_font_512)) { in sisusbcon_do_font_op()
1195 sisusb->current_font_512 = ch512; in sisusbcon_do_font_op()
1200 sisusb_getreg(sisusb, SISINPSTAT, &dummy); in sisusbcon_do_font_op()
1201 sisusb_setreg(sisusb, SISAR, 0x12); in sisusbcon_do_font_op()
1202 sisusb_setreg(sisusb, SISAR, ch512 ? 0x07 : 0x0f); in sisusbcon_do_font_op()
1204 sisusb_getreg(sisusb, SISINPSTAT, &dummy); in sisusbcon_do_font_op()
1205 sisusb_setreg(sisusb, SISAR, 0x20); in sisusbcon_do_font_op()
1206 sisusb_getreg(sisusb, SISINPSTAT, &dummy); in sisusbcon_do_font_op()
1228 sisusb_getidxreg(sisusb, SISCR, 0x07, &ovr); in sisusbcon_do_font_op()
1233 sisusb_setidxreg(sisusb, SISCR, 0x07, ovr); in sisusbcon_do_font_op()
1234 sisusb_setidxreg(sisusb, SISCR, 0x12, vde); in sisusbcon_do_font_op()
1238 sisusb_getidxreg(sisusb, SISCR, 0x09, &fsr); in sisusbcon_do_font_op()
1240 sisusb_setidxreg(sisusb, SISCR, 0x09, fsr); in sisusbcon_do_font_op()
1241 sisusb->current_font_height = fh; in sisusbcon_do_font_op()
1243 sisusb->sisusb_cursor_size_from = -1; in sisusbcon_do_font_op()
1244 sisusb->sisusb_cursor_size_to = -1; in sisusbcon_do_font_op()
1249 mutex_unlock(&sisusb->lock); in sisusbcon_do_font_op()
1273 mutex_unlock(&sisusb->lock); in sisusbcon_do_font_op()
1283 struct sisusb_usb_data *sisusb; in sisusbcon_font_set() local
1289 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_font_set()
1298 if (sisusb->font_backup) { in sisusbcon_font_set()
1299 if (sisusb->font_backup_size < charcount) { in sisusbcon_font_set()
1300 vfree(sisusb->font_backup); in sisusbcon_font_set()
1301 sisusb->font_backup = NULL; in sisusbcon_font_set()
1305 if (!sisusb->font_backup) in sisusbcon_font_set()
1306 sisusb->font_backup = vmalloc(charcount * 32); in sisusbcon_font_set()
1308 if (sisusb->font_backup) { in sisusbcon_font_set()
1309 memcpy(sisusb->font_backup, font->data, charcount * 32); in sisusbcon_font_set()
1310 sisusb->font_backup_size = charcount; in sisusbcon_font_set()
1311 sisusb->font_backup_height = font->height; in sisusbcon_font_set()
1312 sisusb->font_backup_512 = (charcount == 512) ? 1 : 0; in sisusbcon_font_set()
1317 return sisusbcon_do_font_op(sisusb, 1, 2, font->data, in sisusbcon_font_set()
1327 struct sisusb_usb_data *sisusb; in sisusbcon_font_get() local
1329 if (!(sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num))) in sisusbcon_font_get()
1339 mutex_unlock(&sisusb->lock); in sisusbcon_font_get()
1343 if (!sisusb->font_backup) { in sisusbcon_font_get()
1344 mutex_unlock(&sisusb->lock); in sisusbcon_font_get()
1349 memcpy(font->data, sisusb->font_backup, 256 * 32); in sisusbcon_font_get()
1351 mutex_unlock(&sisusb->lock); in sisusbcon_font_get()
1430 sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last) in sisusb_console_init() argument
1434 mutex_lock(&sisusb->lock); in sisusb_console_init()
1437 if (sisusb->haveconsole || !sisusb->SiS_Pr) { in sisusb_console_init()
1438 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1442 sisusb->con_first = first; in sisusb_console_init()
1443 sisusb->con_last = last; in sisusb_console_init()
1448 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1453 if (!sisusb->gfxinit || first < 1 || last < 1) { in sisusb_console_init()
1454 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1458 sisusb->sisusb_cursor_loc = -1; in sisusb_console_init()
1459 sisusb->sisusb_cursor_size_from = -1; in sisusb_console_init()
1460 sisusb->sisusb_cursor_size_to = -1; in sisusb_console_init()
1463 if (sisusb_reset_text_mode(sisusb, 1)) { in sisusb_console_init()
1464 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1465 dev_err(&sisusb->sisusb_dev->dev, "Failed to set up text mode\n"); in sisusb_console_init()
1470 sisusb_initialize(sisusb); in sisusb_console_init()
1474 mysisusbs[i] = sisusb; in sisusb_console_init()
1478 sisusb->sisusb_num_columns = 80; in sisusb_console_init()
1481 sisusb->scrbuf_size = 32 * 1024; in sisusb_console_init()
1484 if (!(sisusb->scrbuf = (unsigned long)vmalloc(sisusb->scrbuf_size))) { in sisusb_console_init()
1485 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1486 dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate screen buffer\n"); in sisusb_console_init()
1490 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1496 sisusb->haveconsole = 1; in sisusb_console_init()
1506 sisusb_console_exit(struct sisusb_usb_data *sisusb) in sisusb_console_exit() argument
1536 if (sisusb->haveconsole) { in sisusb_console_exit()
1538 if (sisusb->havethisconsole[i]) in sisusb_console_exit()
1543 sisusb->haveconsole = 0; in sisusb_console_exit()
1546 vfree((void *)sisusb->scrbuf); in sisusb_console_exit()
1547 sisusb->scrbuf = 0; in sisusb_console_exit()
1549 vfree(sisusb->font_backup); in sisusb_console_exit()
1550 sisusb->font_backup = NULL; in sisusb_console_exit()