forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/video/console/newport_con.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * newport_con.c: Abscon for newport hardware
34 *
....@@ -23,7 +24,6 @@
2324 #include <asm/io.h>
2425 #include <linux/uaccess.h>
2526 #include <asm/page.h>
26
-#include <asm/pgtable.h>
2727 #include <asm/gio_device.h>
2828
2929 #include <video/newport.h>
....@@ -125,6 +125,8 @@
125125 npregs->go.hostrw0 = *data++ << 24;
126126
127127 return logo;
128
+#else
129
+ return NULL;
128130 #endif /* CONFIG_LOGO_SGI_CLUT224 */
129131 }
130132
....@@ -356,12 +358,12 @@
356358
357359 if (ystart < yend) {
358360 newport_clear_screen(sx << 3, ystart, xend, yend,
359
- (vc->vc_color & 0xf0) >> 4);
361
+ (vc->state.color & 0xf0) >> 4);
360362 } else {
361363 newport_clear_screen(sx << 3, ystart, xend, 1023,
362
- (vc->vc_color & 0xf0) >> 4);
364
+ (vc->state.color & 0xf0) >> 4);
363365 newport_clear_screen(sx << 3, 0, xend, yend,
364
- (vc->vc_color & 0xf0) >> 4);
366
+ (vc->state.color & 0xf0) >> 4);
365367 }
366368 }
367369
....@@ -586,11 +588,11 @@
586588 topscan = (topscan + (lines << 4)) & 0x3ff;
587589 newport_clear_lines(vc->vc_rows - lines,
588590 vc->vc_rows - 1,
589
- (vc->vc_color & 0xf0) >> 4);
591
+ (vc->state.color & 0xf0) >> 4);
590592 } else {
591593 topscan = (topscan + (-lines << 4)) & 0x3ff;
592594 newport_clear_lines(0, lines - 1,
593
- (vc->vc_color & 0xf0) >> 4);
595
+ (vc->state.color & 0xf0) >> 4);
594596 }
595597 npregs->cset.topscan = (topscan - 1) & 0x3ff;
596598 return false;
....@@ -671,11 +673,6 @@
671673 return true;
672674 }
673675
674
-static int newport_set_origin(struct vc_data *vc)
675
-{
676
- return 0;
677
-}
678
-
679676 static void newport_save_screen(struct vc_data *vc) { }
680677
681678 const struct consw newport_con = {
....@@ -692,7 +689,6 @@
692689 .con_blank = newport_blank,
693690 .con_font_set = newport_font_set,
694691 .con_font_default = newport_font_default,
695
- .con_set_origin = newport_set_origin,
696692 .con_save_screen = newport_save_screen
697693 };
698694
....@@ -744,18 +740,6 @@
744740 .probe = newport_probe,
745741 .remove = newport_remove,
746742 };
747
-
748
-int __init newport_console_init(void)
749
-{
750
- return gio_register_driver(&newport_driver);
751
-}
752
-
753
-void __exit newport_console_exit(void)
754
-{
755
- gio_unregister_driver(&newport_driver);
756
-}
757
-
758
-module_init(newport_console_init);
759
-module_exit(newport_console_exit);
743
+module_driver(newport_driver, gio_register_driver, gio_unregister_driver);
760744
761745 MODULE_LICENSE("GPL");