From 429dbf53bca49b110f1058f0d9417a59115c41b8 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Tue, 18 Nov 2008 20:45:20 +0100 Subject: m68k: machw.h cleanup Remove some more cruft from machw.h and drop the #include where it isn't needed. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- drivers/ide/macide.c | 1 - drivers/macintosh/via-cuda.c | 1 - drivers/macintosh/via-macii.c | 1 - drivers/macintosh/via-maciisi.c | 1 - drivers/macintosh/via-pmu68k.c | 1 - drivers/scsi/mac_scsi.c | 1 - drivers/video/macfb.c | 1 - 7 files changed, 7 deletions(-) (limited to 'drivers') diff --git a/drivers/ide/macide.c b/drivers/ide/macide.c index 43f97cc1d30e..3c60064f1d4f 100644 --- a/drivers/ide/macide.c +++ b/drivers/ide/macide.c @@ -18,7 +18,6 @@ #include #include -#include #include #include #include diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 741a93a3eb61..62dd1fdafecf 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c @@ -23,7 +23,6 @@ #else #include #include -#include #include #endif #include diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index 6e6dd17ab572..817f37a875c9 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index 2dc788042707..4d686c0bdea0 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c @@ -24,7 +24,6 @@ #include #include #include -#include #include static volatile unsigned char *via; diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index b64741c95ac4..fb9fa614a0e8 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c @@ -35,7 +35,6 @@ #include #include -#include #include #include diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 0248919bc2df..bf2a1c516293 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c @@ -47,7 +47,6 @@ #include #include -#include #include #include "scsi.h" diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index ee380d5f3410..3a437f937779 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c @@ -36,7 +36,6 @@ #include #include #include -#include /* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */ #define DAC_BASE 0x50f24000 -- cgit v1.2.3-55-g7522 From 3839d01d61195d76d53943ac36b603d7e7ca4b6e Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Tue, 18 Nov 2008 20:45:22 +0100 Subject: macfb annotations and compiler warning fix Add some __iomem annotations. Remove some volatile qualifiers to fix several compiler warnings: "passing arg 1 of `iounmap' discards qualifiers from pointer target type". Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- drivers/video/macfb.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index 3a437f937779..d66887e8cbb1 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c @@ -77,34 +77,34 @@ static int csc_setpalette (unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, struct fb_info *fb_info); -static volatile struct { +static struct { unsigned char addr; /* Note: word-aligned */ char pad[3]; unsigned char lut; -} *valkyrie_cmap_regs; +} __iomem *valkyrie_cmap_regs; -static volatile struct { +static struct { unsigned char addr; unsigned char lut; -} *v8_brazil_cmap_regs; +} __iomem *v8_brazil_cmap_regs; -static volatile struct { +static struct { unsigned char addr; char pad1[3]; /* word aligned */ unsigned char lut; char pad2[3]; /* word aligned */ unsigned char cntl; /* a guess as to purpose */ -} *rbv_cmap_regs; +} __iomem *rbv_cmap_regs; -static volatile struct { +static struct { unsigned long reset; unsigned long pad1[3]; unsigned char pad2[3]; unsigned char lut; -} *dafb_cmap_regs; +} __iomem *dafb_cmap_regs; -static volatile struct { +static struct { unsigned char addr; /* OFFSET: 0x00 */ unsigned char pad1[15]; unsigned char lut; /* OFFSET: 0x10 */ @@ -113,16 +113,16 @@ static volatile struct { unsigned char pad3[7]; unsigned long vbl_addr; /* OFFSET: 0x28 */ unsigned int status2; /* OFFSET: 0x2C */ -} *civic_cmap_regs; +} __iomem *civic_cmap_regs; -static volatile struct { +static struct { char pad1[0x40]; unsigned char clut_waddr; /* 0x40 */ char pad2; unsigned char clut_data; /* 0x42 */ char pad3[0x3]; unsigned char clut_raddr; /* 0x46 */ -} *csc_cmap_regs; +} __iomem *csc_cmap_regs; /* We will leave these the way they are for the time being */ struct mdc_cmap_regs { @@ -506,10 +506,10 @@ static int csc_setpalette (unsigned int regno, unsigned int red, struct fb_info *info) { mdelay(1); - csc_cmap_regs->clut_waddr = regno; - csc_cmap_regs->clut_data = red; - csc_cmap_regs->clut_data = green; - csc_cmap_regs->clut_data = blue; + nubus_writeb(regno, &csc_cmap_regs->clut_waddr); + nubus_writeb(red, &csc_cmap_regs->clut_data); + nubus_writeb(green, &csc_cmap_regs->clut_data); + nubus_writeb(blue, &csc_cmap_regs->clut_data); return 0; } -- cgit v1.2.3-55-g7522 From 79f0c9a0479060e3a8607d93bc8d81ff962acc87 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Tue, 18 Nov 2008 20:45:23 +0100 Subject: fbcon: remove broken mac vbl handler Remove the Mac VBL interrupt code as it doesn't work properly and doesn't bring any benefit when fixed. Also remove unused DEFAULT_CURSOR_BLINK_RATE macro and irqres variable. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- drivers/video/console/fbcon.c | 75 ++----------------------------------------- 1 file changed, 3 insertions(+), 72 deletions(-) (limited to 'drivers') diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 0b2adefe9e3d..e99bb7c51798 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -81,9 +81,6 @@ #ifdef CONFIG_ATARI #include #endif -#ifdef CONFIG_MAC -#include -#endif #if defined(__mc68000__) #include #include @@ -160,8 +157,6 @@ static int fbcon_set_origin(struct vc_data *); /* # VBL ints between cursor state changes */ #define ATARI_CURSOR_BLINK_RATE (42) -#define MAC_CURSOR_BLINK_RATE (32) -#define DEFAULT_CURSOR_BLINK_RATE (20) static int vbl_cursor_cnt; static int fbcon_cursor_noblink; @@ -210,19 +205,6 @@ static void fbcon_start(void); static void fbcon_exit(void); static struct device *fbcon_device; -#ifdef CONFIG_MAC -/* - * On the Macintoy, there may or may not be a working VBL int. We need to probe - */ -static int vbl_detected; - -static irqreturn_t fb_vbl_detect(int irq, void *dummy) -{ - vbl_detected++; - return IRQ_HANDLED; -} -#endif - #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION static inline void fbcon_set_rotation(struct fb_info *info) { @@ -421,7 +403,7 @@ static void fb_flashcursor(struct work_struct *work) release_console_sem(); } -#if defined(CONFIG_ATARI) || defined(CONFIG_MAC) +#ifdef CONFIG_ATARI static int cursor_blink_rate; static irqreturn_t fb_vbl_handler(int irq, void *dev_id) { @@ -949,9 +931,7 @@ static const char *fbcon_startup(void) struct fb_info *info = NULL; struct fbcon_ops *ops; int rows, cols; - int irqres; - irqres = 1; /* * If num_registered_fb is zero, this is a call for the dummy part. * The frame buffer devices weren't initialized yet. @@ -1040,56 +1020,11 @@ static const char *fbcon_startup(void) #ifdef CONFIG_ATARI if (MACH_IS_ATARI) { cursor_blink_rate = ATARI_CURSOR_BLINK_RATE; - irqres = - request_irq(IRQ_AUTO_4, fb_vbl_handler, + (void)request_irq(IRQ_AUTO_4, fb_vbl_handler, IRQ_TYPE_PRIO, "framebuffer vbl", info); } -#endif /* CONFIG_ATARI */ - -#ifdef CONFIG_MAC - /* - * On a Macintoy, the VBL interrupt may or may not be active. - * As interrupt based cursor is more reliable and race free, we - * probe for VBL interrupts. - */ - if (MACH_IS_MAC) { - int ct = 0; - /* - * Probe for VBL: set temp. handler ... - */ - irqres = request_irq(IRQ_MAC_VBL, fb_vbl_detect, 0, - "framebuffer vbl", info); - vbl_detected = 0; - - /* - * ... and spin for 20 ms ... - */ - while (!vbl_detected && ++ct < 1000) - udelay(20); - - if (ct == 1000) - printk - ("fbcon_startup: No VBL detected, using timer based cursor.\n"); - - free_irq(IRQ_MAC_VBL, fb_vbl_detect); - - if (vbl_detected) { - /* - * interrupt based cursor ok - */ - cursor_blink_rate = MAC_CURSOR_BLINK_RATE; - irqres = - request_irq(IRQ_MAC_VBL, fb_vbl_handler, 0, - "framebuffer vbl", info); - } else { - /* - * VBL not detected: fall through, use timer based cursor - */ - irqres = 1; - } - } -#endif /* CONFIG_MAC */ +#endif /* CONFIG_ATARI */ fbcon_add_cursor_timer(info); fbcon_has_exited = 0; @@ -3522,10 +3457,6 @@ static void fbcon_exit(void) #ifdef CONFIG_ATARI free_irq(IRQ_AUTO_4, fb_vbl_handler); #endif -#ifdef CONFIG_MAC - if (MACH_IS_MAC && vbl_detected) - free_irq(IRQ_MAC_VBL, fb_vbl_handler); -#endif kfree((void *)softback_buf); softback_buf = 0UL; -- cgit v1.2.3-55-g7522 From 7f877ebb32ac9a4b0783e825cef84c6ace87fe90 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 18 Nov 2008 20:45:23 +0100 Subject: fbcon: Protect free_irq() by MACH_IS_ATARI check Add missing check for Atari in free_irq() call, which could cause problems on multi-platform m68k kernels. Reported-by: Brad Boyer Signed-off-by: Geert Uytterhoeven --- drivers/video/console/fbcon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index e99bb7c51798..4bcff81b50e0 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -3455,7 +3455,8 @@ static void fbcon_exit(void) return; #ifdef CONFIG_ATARI - free_irq(IRQ_AUTO_4, fb_vbl_handler); + if (MACH_IS_ATARI) + free_irq(IRQ_AUTO_4, fb_vbl_handler); #endif kfree((void *)softback_buf); -- cgit v1.2.3-55-g7522