aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:54:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:54:07 -0500
commit541ef5cbb8e68189d47272cea52a69abc30259bc (patch)
tree09c871320e6918ebb9b642a632971b364684d8a3 /drivers/video
parent0191b625ca5a46206d2fb862bb08f36f2fcb3b31 (diff)
parentaa6eeeef78263e9891185c6cfaaf64808460a54a (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: use the new byteorder headers fbcon: Protect free_irq() by MACH_IS_ATARI check fbcon: remove broken mac vbl handler m68k: fix trigraph ignored warning in setox.S macfb annotations and compiler warning fix m68k: mac baboon interrupt enable/disable m68k: machw.h cleanup m68k: Mac via cleanup and commentry m68k: Reinstate mac rtc
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/console/fbcon.c78
-rw-r--r--drivers/video/macfb.c33
2 files changed, 21 insertions, 90 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 0b2adefe9e3d..4bcff81b50e0 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -81,9 +81,6 @@
81#ifdef CONFIG_ATARI 81#ifdef CONFIG_ATARI
82#include <asm/atariints.h> 82#include <asm/atariints.h>
83#endif 83#endif
84#ifdef CONFIG_MAC
85#include <asm/macints.h>
86#endif
87#if defined(__mc68000__) 84#if defined(__mc68000__)
88#include <asm/machdep.h> 85#include <asm/machdep.h>
89#include <asm/setup.h> 86#include <asm/setup.h>
@@ -160,8 +157,6 @@ static int fbcon_set_origin(struct vc_data *);
160 157
161/* # VBL ints between cursor state changes */ 158/* # VBL ints between cursor state changes */
162#define ATARI_CURSOR_BLINK_RATE (42) 159#define ATARI_CURSOR_BLINK_RATE (42)
163#define MAC_CURSOR_BLINK_RATE (32)
164#define DEFAULT_CURSOR_BLINK_RATE (20)
165 160
166static int vbl_cursor_cnt; 161static int vbl_cursor_cnt;
167static int fbcon_cursor_noblink; 162static int fbcon_cursor_noblink;
@@ -210,19 +205,6 @@ static void fbcon_start(void);
210static void fbcon_exit(void); 205static void fbcon_exit(void);
211static struct device *fbcon_device; 206static struct device *fbcon_device;
212 207
213#ifdef CONFIG_MAC
214/*
215 * On the Macintoy, there may or may not be a working VBL int. We need to probe
216 */
217static int vbl_detected;
218
219static irqreturn_t fb_vbl_detect(int irq, void *dummy)
220{
221 vbl_detected++;
222 return IRQ_HANDLED;
223}
224#endif
225
226#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION 208#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
227static inline void fbcon_set_rotation(struct fb_info *info) 209static inline void fbcon_set_rotation(struct fb_info *info)
228{ 210{
@@ -421,7 +403,7 @@ static void fb_flashcursor(struct work_struct *work)
421 release_console_sem(); 403 release_console_sem();
422} 404}
423 405
424#if defined(CONFIG_ATARI) || defined(CONFIG_MAC) 406#ifdef CONFIG_ATARI
425static int cursor_blink_rate; 407static int cursor_blink_rate;
426static irqreturn_t fb_vbl_handler(int irq, void *dev_id) 408static irqreturn_t fb_vbl_handler(int irq, void *dev_id)
427{ 409{
@@ -949,9 +931,7 @@ static const char *fbcon_startup(void)
949 struct fb_info *info = NULL; 931 struct fb_info *info = NULL;
950 struct fbcon_ops *ops; 932 struct fbcon_ops *ops;
951 int rows, cols; 933 int rows, cols;
952 int irqres;
953 934
954 irqres = 1;
955 /* 935 /*
956 * If num_registered_fb is zero, this is a call for the dummy part. 936 * If num_registered_fb is zero, this is a call for the dummy part.
957 * The frame buffer devices weren't initialized yet. 937 * The frame buffer devices weren't initialized yet.
@@ -1040,56 +1020,11 @@ static const char *fbcon_startup(void)
1040#ifdef CONFIG_ATARI 1020#ifdef CONFIG_ATARI
1041 if (MACH_IS_ATARI) { 1021 if (MACH_IS_ATARI) {
1042 cursor_blink_rate = ATARI_CURSOR_BLINK_RATE; 1022 cursor_blink_rate = ATARI_CURSOR_BLINK_RATE;
1043 irqres = 1023 (void)request_irq(IRQ_AUTO_4, fb_vbl_handler,
1044 request_irq(IRQ_AUTO_4, fb_vbl_handler,
1045 IRQ_TYPE_PRIO, "framebuffer vbl", 1024 IRQ_TYPE_PRIO, "framebuffer vbl",
1046 info); 1025 info);
1047 } 1026 }
1048#endif /* CONFIG_ATARI */ 1027#endif /* CONFIG_ATARI */
1049
1050#ifdef CONFIG_MAC
1051 /*
1052 * On a Macintoy, the VBL interrupt may or may not be active.
1053 * As interrupt based cursor is more reliable and race free, we
1054 * probe for VBL interrupts.
1055 */
1056 if (MACH_IS_MAC) {
1057 int ct = 0;
1058 /*
1059 * Probe for VBL: set temp. handler ...
1060 */
1061 irqres = request_irq(IRQ_MAC_VBL, fb_vbl_detect, 0,
1062 "framebuffer vbl", info);
1063 vbl_detected = 0;
1064
1065 /*
1066 * ... and spin for 20 ms ...
1067 */
1068 while (!vbl_detected && ++ct < 1000)
1069 udelay(20);
1070
1071 if (ct == 1000)
1072 printk
1073 ("fbcon_startup: No VBL detected, using timer based cursor.\n");
1074
1075 free_irq(IRQ_MAC_VBL, fb_vbl_detect);
1076
1077 if (vbl_detected) {
1078 /*
1079 * interrupt based cursor ok
1080 */
1081 cursor_blink_rate = MAC_CURSOR_BLINK_RATE;
1082 irqres =
1083 request_irq(IRQ_MAC_VBL, fb_vbl_handler, 0,
1084 "framebuffer vbl", info);
1085 } else {
1086 /*
1087 * VBL not detected: fall through, use timer based cursor
1088 */
1089 irqres = 1;
1090 }
1091 }
1092#endif /* CONFIG_MAC */
1093 1028
1094 fbcon_add_cursor_timer(info); 1029 fbcon_add_cursor_timer(info);
1095 fbcon_has_exited = 0; 1030 fbcon_has_exited = 0;
@@ -3520,11 +3455,8 @@ static void fbcon_exit(void)
3520 return; 3455 return;
3521 3456
3522#ifdef CONFIG_ATARI 3457#ifdef CONFIG_ATARI
3523 free_irq(IRQ_AUTO_4, fb_vbl_handler); 3458 if (MACH_IS_ATARI)
3524#endif 3459 free_irq(IRQ_AUTO_4, fb_vbl_handler);
3525#ifdef CONFIG_MAC
3526 if (MACH_IS_MAC && vbl_detected)
3527 free_irq(IRQ_MAC_VBL, fb_vbl_handler);
3528#endif 3460#endif
3529 3461
3530 kfree((void *)softback_buf); 3462 kfree((void *)softback_buf);
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c
index ee380d5f3410..d66887e8cbb1 100644
--- a/drivers/video/macfb.c
+++ b/drivers/video/macfb.c
@@ -36,7 +36,6 @@
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/macintosh.h> 37#include <asm/macintosh.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/machw.h>
40 39
41/* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */ 40/* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */
42#define DAC_BASE 0x50f24000 41#define DAC_BASE 0x50f24000
@@ -78,34 +77,34 @@ static int csc_setpalette (unsigned int regno, unsigned int red,
78 unsigned int green, unsigned int blue, 77 unsigned int green, unsigned int blue,
79 struct fb_info *fb_info); 78 struct fb_info *fb_info);
80 79
81static volatile struct { 80static struct {
82 unsigned char addr; 81 unsigned char addr;
83 /* Note: word-aligned */ 82 /* Note: word-aligned */
84 char pad[3]; 83 char pad[3];
85 unsigned char lut; 84 unsigned char lut;
86} *valkyrie_cmap_regs; 85} __iomem *valkyrie_cmap_regs;
87 86
88static volatile struct { 87static struct {
89 unsigned char addr; 88 unsigned char addr;
90 unsigned char lut; 89 unsigned char lut;
91} *v8_brazil_cmap_regs; 90} __iomem *v8_brazil_cmap_regs;
92 91
93static volatile struct { 92static struct {
94 unsigned char addr; 93 unsigned char addr;
95 char pad1[3]; /* word aligned */ 94 char pad1[3]; /* word aligned */
96 unsigned char lut; 95 unsigned char lut;
97 char pad2[3]; /* word aligned */ 96 char pad2[3]; /* word aligned */
98 unsigned char cntl; /* a guess as to purpose */ 97 unsigned char cntl; /* a guess as to purpose */
99} *rbv_cmap_regs; 98} __iomem *rbv_cmap_regs;
100 99
101static volatile struct { 100static struct {
102 unsigned long reset; 101 unsigned long reset;
103 unsigned long pad1[3]; 102 unsigned long pad1[3];
104 unsigned char pad2[3]; 103 unsigned char pad2[3];
105 unsigned char lut; 104 unsigned char lut;
106} *dafb_cmap_regs; 105} __iomem *dafb_cmap_regs;
107 106
108static volatile struct { 107static struct {
109 unsigned char addr; /* OFFSET: 0x00 */ 108 unsigned char addr; /* OFFSET: 0x00 */
110 unsigned char pad1[15]; 109 unsigned char pad1[15];
111 unsigned char lut; /* OFFSET: 0x10 */ 110 unsigned char lut; /* OFFSET: 0x10 */
@@ -114,16 +113,16 @@ static volatile struct {
114 unsigned char pad3[7]; 113 unsigned char pad3[7];
115 unsigned long vbl_addr; /* OFFSET: 0x28 */ 114 unsigned long vbl_addr; /* OFFSET: 0x28 */
116 unsigned int status2; /* OFFSET: 0x2C */ 115 unsigned int status2; /* OFFSET: 0x2C */
117} *civic_cmap_regs; 116} __iomem *civic_cmap_regs;
118 117
119static volatile struct { 118static struct {
120 char pad1[0x40]; 119 char pad1[0x40];
121 unsigned char clut_waddr; /* 0x40 */ 120 unsigned char clut_waddr; /* 0x40 */
122 char pad2; 121 char pad2;
123 unsigned char clut_data; /* 0x42 */ 122 unsigned char clut_data; /* 0x42 */
124 char pad3[0x3]; 123 char pad3[0x3];
125 unsigned char clut_raddr; /* 0x46 */ 124 unsigned char clut_raddr; /* 0x46 */
126} *csc_cmap_regs; 125} __iomem *csc_cmap_regs;
127 126
128/* We will leave these the way they are for the time being */ 127/* We will leave these the way they are for the time being */
129struct mdc_cmap_regs { 128struct mdc_cmap_regs {
@@ -507,10 +506,10 @@ static int csc_setpalette (unsigned int regno, unsigned int red,
507 struct fb_info *info) 506 struct fb_info *info)
508{ 507{
509 mdelay(1); 508 mdelay(1);
510 csc_cmap_regs->clut_waddr = regno; 509 nubus_writeb(regno, &csc_cmap_regs->clut_waddr);
511 csc_cmap_regs->clut_data = red; 510 nubus_writeb(red, &csc_cmap_regs->clut_data);
512 csc_cmap_regs->clut_data = green; 511 nubus_writeb(green, &csc_cmap_regs->clut_data);
513 csc_cmap_regs->clut_data = blue; 512 nubus_writeb(blue, &csc_cmap_regs->clut_data);
514 return 0; 513 return 0;
515} 514}
516 515