Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
To: linux-arm-kernel@lists.infradead.org,
	Alex Guo <alexguo1023@gmail.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Russell King <linux@armlinux.org.uk>,
	Ethan Nelson-Moore <enelsonmoore@gmail.com>,
	Helge Deller <deller@gmx.de>
Subject: [PATCH] video: acornfb: remove unused code for 26-bit hardware
Date: Mon, 14 Sep 2026 22:20:29 -0700	[thread overview]
Message-ID: <20260915052038.626258-1-enelsonmoore@gmail.com> (raw)

The acornfb driver contains code to support machines with a MEMC chip
and without IOMD and VIDC20 chips. All 32-bit Acorn hardware has IOMD
and VIDC20 chips and does not have a MEMC chip.

Linux formerly supported 26-bit Acorn computers, but that support was
removed in commit 99eb8a550dbc ("Remove the arm26 port") because it had
bitrotted to the extent that it did not even compile.

Remove this unused code. Also take the opportunity to remove incorrect
file paths in the file headers, which are bad style regardless.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
 drivers/video/fbdev/acornfb.c | 57 +++++++++--------------------------
 drivers/video/fbdev/acornfb.h |  8 +----
 2 files changed, 15 insertions(+), 50 deletions(-)

diff --git a/drivers/video/fbdev/acornfb.c b/drivers/video/fbdev/acornfb.c
index f0600f6ca254..30781679c90a 100644
--- a/drivers/video/fbdev/acornfb.c
+++ b/drivers/video/fbdev/acornfb.c
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- *  linux/drivers/video/acornfb.c
- *
  *  Copyright (C) 1998-2001 Russell King
  *
  * Frame buffer code for Acorn platforms
@@ -94,7 +92,6 @@ static struct vidc_timing current_vidc;
 
 extern unsigned int vram_size;	/* set by setup.c */
 
-#ifdef HAS_VIDC20
 #include <mach/acornfb.h>
 
 #define MAX_SIZE	(2*1024*1024)
@@ -306,7 +303,6 @@ acornfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 
 	return 0;
 }
-#endif
 
 /*
  * Before selecting the timing parameters, adjust
@@ -390,7 +386,6 @@ acornfb_adjust_timing(struct fb_info *info, struct fb_var_screeninfo *var, u_int
 	/* hsync_len must be even */
 	var->hsync_len = (var->hsync_len + 1) & ~1;
 
-#if defined(HAS_VIDC20)
 	/* left_margin must be even */
 	if (var->left_margin & 1) {
 		var->left_margin += 1;
@@ -400,7 +395,6 @@ acornfb_adjust_timing(struct fb_info *info, struct fb_var_screeninfo *var, u_int
 	/* right_margin must be even */
 	if (var->right_margin & 1)
 		var->right_margin += 1;
-#endif
 
 	if (var->vsync_len < 1)
 		var->vsync_len = 1;
@@ -436,11 +430,7 @@ acornfb_update_dma(struct fb_info *info, struct fb_var_screeninfo *var)
 {
 	u_int off = var->yoffset * info->fix.line_length;
 
-#if defined(HAS_MEMC)
-	memc_write(VDMA_INIT, off >> 2);
-#elif defined(HAS_IOMD)
 	iomd_writel(info->fix.smem_start + off, IOMD_VIDINIT);
-#endif
 }
 
 static int
@@ -469,7 +459,6 @@ acornfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 		var->transp.length = 0;
 		break;
 
-#ifdef HAS_VIDC20
 	case 16:
 		var->red.offset    = 0;
 		var->red.length    = 5;
@@ -491,7 +480,6 @@ acornfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 		var->transp.offset = 24;
 		var->transp.length = 4;
 		break;
-#endif
 	default:
 		return -EINVAL;
 	}
@@ -519,6 +507,9 @@ acornfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 
 static int acornfb_set_par(struct fb_info *info)
 {
+	unsigned long start, size;
+	u_int control;
+
 	switch (info->var.bits_per_pixel) {
 	case 1:
 		current_par.palette_size = 2;
@@ -536,7 +527,6 @@ static int acornfb_set_par(struct fb_info *info)
 		current_par.palette_size = VIDC_PALETTE_SIZE;
 		info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
 		break;
-#ifdef HAS_VIDC20
 	case 16:
 		current_par.palette_size = 32;
 		info->fix.visual = FB_VISUAL_DIRECTCOLOR;
@@ -545,41 +535,26 @@ static int acornfb_set_par(struct fb_info *info)
 		current_par.palette_size = VIDC_PALETTE_SIZE;
 		info->fix.visual = FB_VISUAL_DIRECTCOLOR;
 		break;
-#endif
 	default:
 		BUG();
 	}
 
 	info->fix.line_length	= (info->var.xres * info->var.bits_per_pixel) / 8;
 
-#if defined(HAS_MEMC)
-	{
-		unsigned long size = info->fix.smem_len - VDMA_XFERSIZE;
+	start = info->fix.smem_start;
+	size  = current_par.screen_end;
 
-		memc_write(VDMA_START, 0);
-		memc_write(VDMA_END, size >> 2);
+	if (current_par.using_vram) {
+		size -= current_par.vram_half_sam;
+		control = DMA_CR_E | (current_par.vram_half_sam / 256);
+	} else {
+		size -= 16;
+		control = DMA_CR_E | DMA_CR_D | 16;
 	}
-#elif defined(HAS_IOMD)
-	{
-		unsigned long start, size;
-		u_int control;
-
-		start = info->fix.smem_start;
-		size  = current_par.screen_end;
-
-		if (current_par.using_vram) {
-			size -= current_par.vram_half_sam;
-			control = DMA_CR_E | (current_par.vram_half_sam / 256);
-		} else {
-			size -= 16;
-			control = DMA_CR_E | DMA_CR_D | 16;
-		}
 
-		iomd_writel(start,   IOMD_VIDSTART);
-		iomd_writel(size,    IOMD_VIDEND);
-		iomd_writel(control, IOMD_VIDCR);
-	}
-#endif
+	iomd_writel(start,   IOMD_VIDSTART);
+	iomd_writel(size,    IOMD_VIDEND);
+	iomd_writel(control, IOMD_VIDCR);
 
 	acornfb_update_dma(info, &info->var);
 	acornfb_set_timing(info);
@@ -709,10 +684,8 @@ static void acornfb_init_fbinfo(void)
 	 */
 	memset(&fb_info.var, 0, sizeof(fb_info.var));
 
-#if defined(HAS_VIDC20)
 	fb_info.var.red.length	   = 8;
 	fb_info.var.transp.length  = 4;
-#endif
 	fb_info.var.green	   = fb_info.var.red;
 	fb_info.var.blue	   = fb_info.var.red;
 	fb_info.var.nonstd	   = 0;
@@ -991,7 +964,6 @@ static int acornfb_probe(struct platform_device *dev)
 
 	size = PAGE_ALIGN(size);
 
-#if defined(HAS_VIDC20)
 	if (!current_par.using_vram) {
 		dma_addr_t handle;
 		void *base;
@@ -1011,7 +983,6 @@ static int acornfb_probe(struct platform_device *dev)
 		fb_info.screen_base = base;
 		fb_info.fix.smem_start = handle;
 	}
-#endif
 	fb_info.fix.smem_len = size;
 	current_par.palette_size   = VIDC_PALETTE_SIZE;
 
diff --git a/drivers/video/fbdev/acornfb.h b/drivers/video/fbdev/acornfb.h
index e65388587f80..e33ea24ae0e1 100644
--- a/drivers/video/fbdev/acornfb.h
+++ b/drivers/video/fbdev/acornfb.h
@@ -1,16 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- *  linux/drivers/video/acornfb.h
- *
  *  Copyright (C) 1998,1999 Russell King
  *
  *  Frame buffer code for Acorn platforms
  */
-#if defined(HAS_VIDC20)
 #include <mach/iomd.h>
+
 #define VIDC_PALETTE_SIZE	256
 #define VIDC_NAME		"VIDC20"
-#endif
 
 #define EXTEND8(x) ((x)|(x)<<8)
 #define EXTEND4(x) ((x)|(x)<<4|(x)<<8|(x)<<12)
@@ -94,7 +91,6 @@ struct modex_params {
 	const struct modey_params *modey;
 };
 
-#ifdef HAS_VIDC20
 /*
  * VIDC20 registers
  */
@@ -162,5 +158,3 @@ struct modex_params {
 #define VIDC20_DCTL_VRAM_PXCLK	(1 << 18)
 #define VIDC20_DCTL_VRAM_PXCLK2	(2 << 18)
 #define VIDC20_DCTL_VRAM_PXCLK4	(3 << 18)
-
-#endif
-- 
2.43.0



             reply	other threads:[~2026-09-15  5:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  5:20 Ethan Nelson-Moore [this message]
2026-09-15  7:12 ` [PATCH] video: acornfb: remove unused code for 26-bit hardware Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260915052038.626258-1-enelsonmoore@gmail.com \
    --to=enelsonmoore@gmail.com \
    --cc=alexguo1023@gmail.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox