Lines Matching refs:sisusb

86 sisusb_initialize(struct sisusb_usb_data *sisusb)  in sisusb_initialize()  argument
89 if (sisusb_setidxreg(sisusb, SISCR, 0x0c, 0x00)) in sisusb_initialize()
91 if (sisusb_setidxreg(sisusb, SISCR, 0x0d, 0x00)) in sisusb_initialize()
93 if (sisusb_setidxreg(sisusb, SISCR, 0x0e, 0x00)) in sisusb_initialize()
95 sisusb_setidxreg(sisusb, SISCR, 0x0f, 0x00); in sisusb_initialize()
99 sisusbcon_set_start_address(struct sisusb_usb_data *sisusb, struct vc_data *c) in sisusbcon_set_start_address() argument
101 sisusb->cur_start_addr = (c->vc_visible_origin - sisusb->scrbuf) / 2; in sisusbcon_set_start_address()
103 sisusb_setidxreg(sisusb, SISCR, 0x0c, (sisusb->cur_start_addr >> 8)); in sisusbcon_set_start_address()
104 sisusb_setidxreg(sisusb, SISCR, 0x0d, (sisusb->cur_start_addr & 0xff)); in sisusbcon_set_start_address()
108 sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location) in sisusb_set_cursor() argument
110 if (sisusb->sisusb_cursor_loc == location) in sisusb_set_cursor()
113 sisusb->sisusb_cursor_loc = location; in sisusb_set_cursor()
121 sisusb->bad_cursor_pos = 1; in sisusb_set_cursor()
123 if (sisusb_setidxregandor(sisusb, SISCR, 0x0b, 0x1f, 0x20)) in sisusb_set_cursor()
125 } else if (sisusb->bad_cursor_pos) { in sisusb_set_cursor()
126 if (sisusb_setidxregand(sisusb, SISCR, 0x0b, 0x1f)) in sisusb_set_cursor()
128 sisusb->bad_cursor_pos = 0; in sisusb_set_cursor()
131 if (sisusb_setidxreg(sisusb, SISCR, 0x0e, (location >> 8))) in sisusb_set_cursor()
133 sisusb_setidxreg(sisusb, SISCR, 0x0f, (location & 0xff)); in sisusb_set_cursor()
143 sisusb_sisusb_valid(struct sisusb_usb_data *sisusb) in sisusb_sisusb_valid() argument
145 if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) in sisusb_sisusb_valid()
154 struct sisusb_usb_data *sisusb; in sisusb_get_sisusb_lock_and_check() local
164 sisusb = sisusb_get_sisusb(console); in sisusb_get_sisusb_lock_and_check()
165 if (!sisusb) in sisusb_get_sisusb_lock_and_check()
168 mutex_lock(&sisusb->lock); in sisusb_get_sisusb_lock_and_check()
170 if (!sisusb_sisusb_valid(sisusb) || in sisusb_get_sisusb_lock_and_check()
171 !sisusb->havethisconsole[console]) { in sisusb_get_sisusb_lock_and_check()
172 mutex_unlock(&sisusb->lock); in sisusb_get_sisusb_lock_and_check()
176 return sisusb; in sisusb_get_sisusb_lock_and_check()
180 sisusb_is_inactive(struct vc_data *c, struct sisusb_usb_data *sisusb) in sisusb_is_inactive() argument
182 if (sisusb->is_gfx || in sisusb_is_inactive()
183 sisusb->textmodedestroyed || in sisusb_is_inactive()
201 struct sisusb_usb_data *sisusb; in sisusbcon_init() local
210 sisusb = sisusb_get_sisusb(c->vc_num); in sisusbcon_init()
211 if (!sisusb) in sisusbcon_init()
214 mutex_lock(&sisusb->lock); in sisusbcon_init()
216 if (!sisusb_sisusb_valid(sisusb)) { in sisusbcon_init()
217 mutex_unlock(&sisusb->lock); in sisusbcon_init()
225 c->vc_hi_font_mask = sisusb->current_font_512 ? 0x0800 : 0; in sisusbcon_init()
227 sisusb->haveconsole = 1; in sisusbcon_init()
229 sisusb->havethisconsole[c->vc_num] = 1; in sisusbcon_init()
234 c->vc_font.height = sisusb->current_font_height; in sisusbcon_init()
249 kref_get(&sisusb->kref); in sisusbcon_init()
254 mutex_unlock(&sisusb->lock); in sisusbcon_init()
267 struct sisusb_usb_data *sisusb; in sisusbcon_deinit() local
274 sisusb = sisusb_get_sisusb(c->vc_num); in sisusbcon_deinit()
275 if (!sisusb) in sisusbcon_deinit()
278 mutex_lock(&sisusb->lock); in sisusbcon_deinit()
283 sisusb->havethisconsole[c->vc_num] = 0; in sisusbcon_deinit()
286 if (sisusb->font_backup) { in sisusbcon_deinit()
288 if (sisusb->havethisconsole[c->vc_num]) in sisusbcon_deinit()
292 vfree(sisusb->font_backup); in sisusbcon_deinit()
293 sisusb->font_backup = NULL; in sisusbcon_deinit()
297 mutex_unlock(&sisusb->lock); in sisusbcon_deinit()
300 kref_put(&sisusb->kref, sisusb_delete); in sisusbcon_deinit()
349 static inline void *sisusb_vaddr(const struct sisusb_usb_data *sisusb, in sisusb_vaddr() argument
352 return (u16 *)c->vc_origin + y * sisusb->sisusb_num_columns + x; in sisusb_vaddr()
355 static inline unsigned long sisusb_haddr(const struct sisusb_usb_data *sisusb, in sisusb_haddr() argument
358 unsigned long offset = c->vc_origin - sisusb->scrbuf; in sisusb_haddr()
361 offset += 2 * (y * sisusb->sisusb_num_columns + x); in sisusb_haddr()
363 return sisusb->vrambase + offset; in sisusb_haddr()
370 struct sisusb_usb_data *sisusb; in sisusbcon_putc() local
372 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_putc()
373 if (!sisusb) in sisusbcon_putc()
377 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_putc()
378 mutex_unlock(&sisusb->lock); in sisusbcon_putc()
382 sisusb_copy_memory(sisusb, sisusb_vaddr(sisusb, c, x, y), in sisusbcon_putc()
383 sisusb_haddr(sisusb, c, x, y), 2); in sisusbcon_putc()
385 mutex_unlock(&sisusb->lock); in sisusbcon_putc()
393 struct sisusb_usb_data *sisusb; in sisusbcon_putcs() local
395 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_putcs()
396 if (!sisusb) in sisusbcon_putcs()
405 memcpy(sisusb_vaddr(sisusb, c, x, y), s, count * 2); in sisusbcon_putcs()
407 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_putcs()
408 mutex_unlock(&sisusb->lock); in sisusbcon_putcs()
412 sisusb_copy_memory(sisusb, sisusb_vaddr(sisusb, c, x, y), in sisusbcon_putcs()
413 sisusb_haddr(sisusb, c, x, y), count * 2); in sisusbcon_putcs()
415 mutex_unlock(&sisusb->lock); in sisusbcon_putcs()
422 struct sisusb_usb_data *sisusb; in sisusbcon_clear() local
430 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_clear()
431 if (!sisusb) in sisusbcon_clear()
440 dest = sisusb_vaddr(sisusb, c, x, y); in sisusbcon_clear()
442 cols = sisusb->sisusb_num_columns; in sisusbcon_clear()
458 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_clear()
459 mutex_unlock(&sisusb->lock); in sisusbcon_clear()
466 sisusb_copy_memory(sisusb, sisusb_vaddr(sisusb, c, x, y), in sisusbcon_clear()
467 sisusb_haddr(sisusb, c, x, y), length); in sisusbcon_clear()
469 mutex_unlock(&sisusb->lock); in sisusbcon_clear()
476 struct sisusb_usb_data *sisusb; in sisusbcon_switch() local
484 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_switch()
485 if (!sisusb) in sisusbcon_switch()
491 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_switch()
492 mutex_unlock(&sisusb->lock); in sisusbcon_switch()
501 mutex_unlock(&sisusb->lock); in sisusbcon_switch()
502 dev_dbg(&sisusb->sisusb_dev->dev, "ASSERT ORIGIN != SCREENBUF!\n"); in sisusbcon_switch()
508 (int)(sisusb->scrbuf + sisusb->scrbuf_size - c->vc_origin)); in sisusbcon_switch()
513 sisusb_copy_memory(sisusb, (u8 *)c->vc_origin, in sisusbcon_switch()
514 sisusb_haddr(sisusb, c, 0, 0), length); in sisusbcon_switch()
516 mutex_unlock(&sisusb->lock); in sisusbcon_switch()
525 struct sisusb_usb_data *sisusb; in sisusbcon_save_screen() local
532 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_save_screen()
533 if (!sisusb) in sisusbcon_save_screen()
538 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_save_screen()
539 mutex_unlock(&sisusb->lock); in sisusbcon_save_screen()
545 (int)(sisusb->scrbuf + sisusb->scrbuf_size - c->vc_origin)); in sisusbcon_save_screen()
550 mutex_unlock(&sisusb->lock); in sisusbcon_save_screen()
557 struct sisusb_usb_data *sisusb; in sisusbcon_set_palette() local
565 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_set_palette()
566 if (!sisusb) in sisusbcon_set_palette()
571 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_set_palette()
572 mutex_unlock(&sisusb->lock); in sisusbcon_set_palette()
577 if (sisusb_setreg(sisusb, SISCOLIDX, table[i])) in sisusbcon_set_palette()
579 if (sisusb_setreg(sisusb, SISCOLDATA, c->vc_palette[j++] >> 2)) in sisusbcon_set_palette()
581 if (sisusb_setreg(sisusb, SISCOLDATA, c->vc_palette[j++] >> 2)) in sisusbcon_set_palette()
583 if (sisusb_setreg(sisusb, SISCOLDATA, c->vc_palette[j++] >> 2)) in sisusbcon_set_palette()
587 mutex_unlock(&sisusb->lock); in sisusbcon_set_palette()
594 struct sisusb_usb_data *sisusb; in sisusbcon_blank() local
598 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_blank()
599 if (!sisusb) in sisusbcon_blank()
605 sisusb->is_gfx = blank ? 1 : 0; in sisusbcon_blank()
607 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_blank()
608 mutex_unlock(&sisusb->lock); in sisusbcon_blank()
619 sisusb_copy_memory(sisusb, (u8 *)c->vc_origin, in sisusbcon_blank()
620 sisusb_haddr(sisusb, c, 0, 0), in sisusbcon_blank()
622 sisusb->con_blanked = 1; in sisusbcon_blank()
634 sisusb->con_blanked = 0; in sisusbcon_blank()
655 mutex_unlock(&sisusb->lock); in sisusbcon_blank()
659 sisusb_setidxregandor(sisusb, SISSR, 0x01, ~0x20, sr1); in sisusbcon_blank()
660 sisusb_setidxregandor(sisusb, SISCR, 0x17, 0x7f, cr17); in sisusbcon_blank()
661 sisusb_setidxregandor(sisusb, SISSR, 0x1f, 0x3f, pmreg); in sisusbcon_blank()
662 sisusb_setidxregandor(sisusb, SISCR, 0x63, 0xbf, cr63); in sisusbcon_blank()
666 mutex_unlock(&sisusb->lock); in sisusbcon_blank()
675 struct sisusb_usb_data *sisusb; in sisusbcon_scrolldelta() local
677 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_scrolldelta()
678 if (!sisusb) in sisusbcon_scrolldelta()
683 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_scrolldelta()
684 mutex_unlock(&sisusb->lock); in sisusbcon_scrolldelta()
688 vc_scrolldelta_helper(c, lines, sisusb->con_rolled_over, in sisusbcon_scrolldelta()
689 (void *)sisusb->scrbuf, sisusb->scrbuf_size); in sisusbcon_scrolldelta()
691 sisusbcon_set_start_address(sisusb, c); in sisusbcon_scrolldelta()
693 mutex_unlock(&sisusb->lock); in sisusbcon_scrolldelta()
700 struct sisusb_usb_data *sisusb; in sisusbcon_cursor() local
703 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_cursor()
704 if (!sisusb) in sisusbcon_cursor()
709 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_cursor()
710 mutex_unlock(&sisusb->lock); in sisusbcon_cursor()
716 sisusbcon_set_start_address(sisusb, c); in sisusbcon_cursor()
720 sisusb_setidxregor(sisusb, SISCR, 0x0a, 0x20); in sisusbcon_cursor()
721 sisusb->sisusb_cursor_size_to = -1; in sisusbcon_cursor()
722 mutex_unlock(&sisusb->lock); in sisusbcon_cursor()
726 sisusb_set_cursor(sisusb, (c->vc_pos - sisusb->scrbuf) / 2); in sisusbcon_cursor()
752 if (sisusb->sisusb_cursor_size_from != from || in sisusbcon_cursor()
753 sisusb->sisusb_cursor_size_to != to) { in sisusbcon_cursor()
755 sisusb_setidxreg(sisusb, SISCR, 0x0a, from); in sisusbcon_cursor()
756 sisusb_setidxregandor(sisusb, SISCR, 0x0b, 0xe0, to); in sisusbcon_cursor()
758 sisusb->sisusb_cursor_size_from = from; in sisusbcon_cursor()
759 sisusb->sisusb_cursor_size_to = to; in sisusbcon_cursor()
762 mutex_unlock(&sisusb->lock); in sisusbcon_cursor()
766 sisusbcon_scroll_area(struct vc_data *c, struct sisusb_usb_data *sisusb, in sisusbcon_scroll_area() argument
770 int cols = sisusb->sisusb_num_columns; in sisusbcon_scroll_area()
785 memmove(sisusb_vaddr(sisusb, c, 0, t), in sisusbcon_scroll_area()
786 sisusb_vaddr(sisusb, c, 0, t + lines), in sisusbcon_scroll_area()
788 sisusbcon_memsetw(sisusb_vaddr(sisusb, c, 0, b - lines), in sisusbcon_scroll_area()
793 memmove(sisusb_vaddr(sisusb, c, 0, t + lines), in sisusbcon_scroll_area()
794 sisusb_vaddr(sisusb, c, 0, t), in sisusbcon_scroll_area()
796 sisusbcon_memsetw(sisusb_vaddr(sisusb, c, 0, t), eattr, in sisusbcon_scroll_area()
801 sisusb_copy_memory(sisusb, sisusb_vaddr(sisusb, c, 0, t), in sisusbcon_scroll_area()
802 sisusb_haddr(sisusb, c, 0, t), length); in sisusbcon_scroll_area()
804 mutex_unlock(&sisusb->lock); in sisusbcon_scroll_area()
814 struct sisusb_usb_data *sisusb; in sisusbcon_scroll() local
830 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_scroll()
831 if (!sisusb) in sisusbcon_scroll()
836 if (sisusb_is_inactive(c, sisusb)) { in sisusbcon_scroll()
837 mutex_unlock(&sisusb->lock); in sisusbcon_scroll()
843 return sisusbcon_scroll_area(c, sisusb, t, b, dir, lines); in sisusbcon_scroll()
847 sisusbcon_set_start_address(sisusb, c); in sisusbcon_scroll()
861 sisusb->scrbuf + sisusb->scrbuf_size) { in sisusbcon_scroll()
862 memcpy((u16 *)sisusb->scrbuf, in sisusbcon_scroll()
865 c->vc_origin = sisusb->scrbuf; in sisusbcon_scroll()
866 sisusb->con_rolled_over = oldorigin - sisusb->scrbuf; in sisusbcon_scroll()
879 if (oldorigin - delta < sisusb->scrbuf) { in sisusbcon_scroll()
880 memmove((void *)sisusb->scrbuf + sisusb->scrbuf_size - in sisusbcon_scroll()
884 c->vc_origin = sisusb->scrbuf + in sisusbcon_scroll()
885 sisusb->scrbuf_size - in sisusbcon_scroll()
887 sisusb->con_rolled_over = 0; in sisusbcon_scroll()
900 sisusb_copy_memory(sisusb, in sisusbcon_scroll()
902 sisusb_haddr(sisusb, c, 0, 0), in sisusbcon_scroll()
905 sisusb_copy_memory(sisusb, in sisusbcon_scroll()
907 sisusb_haddr(sisusb, c, 0, 0) + in sisusbcon_scroll()
911 sisusb_copy_memory(sisusb, in sisusbcon_scroll()
913 sisusb_haddr(sisusb, c, 0, 0), in sisusbcon_scroll()
919 sisusbcon_set_start_address(sisusb, c); in sisusbcon_scroll()
923 mutex_unlock(&sisusb->lock); in sisusbcon_scroll()
932 struct sisusb_usb_data *sisusb; in sisusbcon_set_origin() local
939 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_set_origin()
940 if (!sisusb) in sisusbcon_set_origin()
945 if (sisusb_is_inactive(c, sisusb) || sisusb->con_blanked) { in sisusbcon_set_origin()
946 mutex_unlock(&sisusb->lock); in sisusbcon_set_origin()
950 c->vc_origin = c->vc_visible_origin = sisusb->scrbuf; in sisusbcon_set_origin()
952 sisusbcon_set_start_address(sisusb, c); in sisusbcon_set_origin()
954 sisusb->con_rolled_over = 0; in sisusbcon_set_origin()
956 mutex_unlock(&sisusb->lock); in sisusbcon_set_origin()
966 struct sisusb_usb_data *sisusb; in sisusbcon_resize() local
969 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_resize()
970 if (!sisusb) in sisusbcon_resize()
973 fh = sisusb->current_font_height; in sisusbcon_resize()
975 mutex_unlock(&sisusb->lock); in sisusbcon_resize()
991 sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, in sisusbcon_do_font_op() argument
1009 mutex_unlock(&sisusb->lock); in sisusbcon_do_font_op()
1014 sisusb->font_slot = slot; in sisusbcon_do_font_op()
1024 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x01); /* Reset */ in sisusbcon_do_font_op()
1025 err |= sisusb_setidxreg(sisusb, SISSR, 0x02, 0x04); /* Write to plane 2 */ in sisusbcon_do_font_op()
1026 err |= sisusb_setidxreg(sisusb, SISSR, 0x04, 0x07); /* Memory mode a0-bf */ in sisusbcon_do_font_op()
1027 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x03); /* Reset */ in sisusbcon_do_font_op()
1032 err |= sisusb_setidxreg(sisusb, SISGR, 0x04, 0x03); /* Select plane read 2 */ in sisusbcon_do_font_op()
1033 err |= sisusb_setidxreg(sisusb, SISGR, 0x05, 0x00); /* Disable odd/even */ in sisusbcon_do_font_op()
1034 err |= sisusb_setidxreg(sisusb, SISGR, 0x06, 0x00); /* Address range a0-bf */ in sisusbcon_do_font_op()
1042 err |= sisusb_writeb(sisusb, in sisusbcon_do_font_op()
1043 sisusb->vrambase + offset + i, in sisusbcon_do_font_op()
1050 err |= sisusb_readb(sisusb, in sisusbcon_do_font_op()
1051 sisusb->vrambase + offset + i, in sisusbcon_do_font_op()
1065 err |= sisusb_writeb(sisusb, in sisusbcon_do_font_op()
1066 sisusb->vrambase + offset + in sisusbcon_do_font_op()
1074 err |= sisusb_readb(sisusb, in sisusbcon_do_font_op()
1075 sisusb->vrambase + offset + in sisusbcon_do_font_op()
1087 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x01); /* Reset */ in sisusbcon_do_font_op()
1088 err |= sisusb_setidxreg(sisusb, SISSR, 0x02, 0x03); /* Write to planes 0+1 */ in sisusbcon_do_font_op()
1089 err |= sisusb_setidxreg(sisusb, SISSR, 0x04, 0x03); /* Memory mode a0-bf */ in sisusbcon_do_font_op()
1091 sisusb_setidxreg(sisusb, SISSR, 0x03, font_select); in sisusbcon_do_font_op()
1092 err |= sisusb_setidxreg(sisusb, SISSR, 0x00, 0x03); /* Reset end */ in sisusbcon_do_font_op()
1097 err |= sisusb_setidxreg(sisusb, SISGR, 0x04, 0x00); /* Select plane read 0 */ in sisusbcon_do_font_op()
1098 err |= sisusb_setidxreg(sisusb, SISGR, 0x05, 0x10); /* Enable odd/even */ in sisusbcon_do_font_op()
1099 err |= sisusb_setidxreg(sisusb, SISGR, 0x06, 0x06); /* Address range b8-bf */ in sisusbcon_do_font_op()
1104 if ((set) && (ch512 != sisusb->current_font_512)) { in sisusbcon_do_font_op()
1115 sisusb->current_font_512 = ch512; in sisusbcon_do_font_op()
1120 sisusb_getreg(sisusb, SISINPSTAT, &dummy); in sisusbcon_do_font_op()
1121 sisusb_setreg(sisusb, SISAR, 0x12); in sisusbcon_do_font_op()
1122 sisusb_setreg(sisusb, SISAR, ch512 ? 0x07 : 0x0f); in sisusbcon_do_font_op()
1124 sisusb_getreg(sisusb, SISINPSTAT, &dummy); in sisusbcon_do_font_op()
1125 sisusb_setreg(sisusb, SISAR, 0x20); in sisusbcon_do_font_op()
1126 sisusb_getreg(sisusb, SISINPSTAT, &dummy); in sisusbcon_do_font_op()
1148 sisusb_getidxreg(sisusb, SISCR, 0x07, &ovr); in sisusbcon_do_font_op()
1153 sisusb_setidxreg(sisusb, SISCR, 0x07, ovr); in sisusbcon_do_font_op()
1154 sisusb_setidxreg(sisusb, SISCR, 0x12, vde); in sisusbcon_do_font_op()
1158 sisusb_getidxreg(sisusb, SISCR, 0x09, &fsr); in sisusbcon_do_font_op()
1160 sisusb_setidxreg(sisusb, SISCR, 0x09, fsr); in sisusbcon_do_font_op()
1161 sisusb->current_font_height = fh; in sisusbcon_do_font_op()
1163 sisusb->sisusb_cursor_size_from = -1; in sisusbcon_do_font_op()
1164 sisusb->sisusb_cursor_size_to = -1; in sisusbcon_do_font_op()
1169 mutex_unlock(&sisusb->lock); in sisusbcon_do_font_op()
1193 mutex_unlock(&sisusb->lock); in sisusbcon_do_font_op()
1203 struct sisusb_usb_data *sisusb; in sisusbcon_font_set() local
1209 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_font_set()
1210 if (!sisusb) in sisusbcon_font_set()
1219 if (sisusb->font_backup) { in sisusbcon_font_set()
1220 if (sisusb->font_backup_size < charcount) { in sisusbcon_font_set()
1221 vfree(sisusb->font_backup); in sisusbcon_font_set()
1222 sisusb->font_backup = NULL; in sisusbcon_font_set()
1226 if (!sisusb->font_backup) in sisusbcon_font_set()
1227 sisusb->font_backup = vmalloc(array_size(charcount, 32)); in sisusbcon_font_set()
1229 if (sisusb->font_backup) { in sisusbcon_font_set()
1230 memcpy(sisusb->font_backup, font->data, array_size(charcount, 32)); in sisusbcon_font_set()
1231 sisusb->font_backup_size = charcount; in sisusbcon_font_set()
1232 sisusb->font_backup_height = font->height; in sisusbcon_font_set()
1233 sisusb->font_backup_512 = (charcount == 512) ? 1 : 0; in sisusbcon_font_set()
1238 return sisusbcon_do_font_op(sisusb, 1, 2, font->data, in sisusbcon_font_set()
1248 struct sisusb_usb_data *sisusb; in sisusbcon_font_get() local
1250 sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num); in sisusbcon_font_get()
1251 if (!sisusb) in sisusbcon_font_get()
1261 mutex_unlock(&sisusb->lock); in sisusbcon_font_get()
1265 if (!sisusb->font_backup) { in sisusbcon_font_get()
1266 mutex_unlock(&sisusb->lock); in sisusbcon_font_get()
1271 memcpy(font->data, sisusb->font_backup, 256 * 32); in sisusbcon_font_get()
1273 mutex_unlock(&sisusb->lock); in sisusbcon_font_get()
1363 sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last) in sisusb_console_init() argument
1367 mutex_lock(&sisusb->lock); in sisusb_console_init()
1370 if (sisusb->haveconsole || !sisusb->SiS_Pr) { in sisusb_console_init()
1371 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1375 sisusb->con_first = first; in sisusb_console_init()
1376 sisusb->con_last = last; in sisusb_console_init()
1381 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1386 if (!sisusb->gfxinit || first < 1 || last < 1) { in sisusb_console_init()
1387 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1391 sisusb->sisusb_cursor_loc = -1; in sisusb_console_init()
1392 sisusb->sisusb_cursor_size_from = -1; in sisusb_console_init()
1393 sisusb->sisusb_cursor_size_to = -1; in sisusb_console_init()
1396 if (sisusb_reset_text_mode(sisusb, 1)) { in sisusb_console_init()
1397 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1398 dev_err(&sisusb->sisusb_dev->dev, "Failed to set up text mode\n"); in sisusb_console_init()
1403 sisusb_initialize(sisusb); in sisusb_console_init()
1407 mysisusbs[i] = sisusb; in sisusb_console_init()
1411 sisusb->sisusb_num_columns = 80; in sisusb_console_init()
1414 sisusb->scrbuf_size = 32 * 1024; in sisusb_console_init()
1417 if (!(sisusb->scrbuf = (unsigned long)vmalloc(sisusb->scrbuf_size))) { in sisusb_console_init()
1418 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1419 dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate screen buffer\n"); in sisusb_console_init()
1423 mutex_unlock(&sisusb->lock); in sisusb_console_init()
1430 sisusb->haveconsole = 1; in sisusb_console_init()
1440 sisusb_console_exit(struct sisusb_usb_data *sisusb) in sisusb_console_exit() argument
1470 if (sisusb->haveconsole) { in sisusb_console_exit()
1472 if (sisusb->havethisconsole[i]) { in sisusb_console_exit()
1480 sisusb->haveconsole = 0; in sisusb_console_exit()
1483 vfree((void *)sisusb->scrbuf); in sisusb_console_exit()
1484 sisusb->scrbuf = 0; in sisusb_console_exit()
1486 vfree(sisusb->font_backup); in sisusb_console_exit()
1487 sisusb->font_backup = NULL; in sisusb_console_exit()