From 37a91b995952a556a6eb90c31736ee773b86999c Mon Sep 17 00:00:00 2001 From: Ethan Nelson-Moore Date: Sat, 2 May 2026 21:56:34 -0700 Subject: [PATCH 01/43] fbdev: remove Hercules monochrome ISA graphics adapter driver The hgafb driver supports graphics adapters compatible with the Hercules adapter from 1984. These were ISA cards or onboard devices that supported monochrome 720x348 graphics. This driver was created in 1999 by Ferenc Bakonyi. In the entire Git history (since Linux 2.6.12-rc2), there has only been one commit in 2010 which indicated that the driver was in use, commit 529ed806d454 ("video: Fix the HGA framebuffer driver"). The commit message states: Only tested with fbcon, since most fbdev-based software appears to only support 12bpp and up. It does not appear that this driver has worked for at least the entire 2.6.x series, perhaps since 2002. Given the age and limited capabilities of the hardware and the lack of users, remove this driver and move the former maintainer to CREDITS. Signed-off-by: Ethan Nelson-Moore Acked-by: Thomas Zimmermann Signed-off-by: Helge Deller --- CREDITS | 3 + MAINTAINERS | 7 - drivers/video/fbdev/Kconfig | 13 - drivers/video/fbdev/Makefile | 1 - drivers/video/fbdev/hgafb.c | 685 ----------------------------------- 5 files changed, 3 insertions(+), 706 deletions(-) delete mode 100644 drivers/video/fbdev/hgafb.c diff --git a/CREDITS b/CREDITS index 17962bdd6dbd..59d5de3eeb5b 100644 --- a/CREDITS +++ b/CREDITS @@ -197,6 +197,9 @@ S: Hauptstrasse 19 S: 79837 St. Blasien S: Germany +N: Ferenc Bakonyi +D: Hercules graphics adapter framebuffer driver + N: Krishna Balasubramanian E: balasub@cis.ohio-state.edu D: Wrote SYS V IPC (part of standard kernel since 0.99.10) diff --git a/MAINTAINERS b/MAINTAINERS index c2c6d79275c6..261671ba6f73 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11382,13 +11382,6 @@ F: Documentation/filesystems/hfsplus.rst F: fs/hfsplus/ F: include/linux/hfs_common.h -HGA FRAMEBUFFER DRIVER -M: Ferenc Bakonyi -L: linux-nvidia@lists.surfsouth.com -S: Maintained -W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml -F: drivers/video/fbdev/hgafb.c - HIBERNATION (aka Software Suspend, aka swsusp) M: "Rafael J. Wysocki" R: Pavel Machek diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 1c73d560f196..085d3a202148 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -453,19 +453,6 @@ config FB_N411 This enables support for the Apollo display controller in its Hecuba form using the n411 devkit. -config FB_HGA - tristate "Hercules mono graphics support" - depends on FB && X86 - select FB_IOMEM_FOPS - help - Say Y here if you have a Hercules mono graphics card. - - To compile this driver as a module, choose M here: the - module will be called hgafb. - - As this card technology is at least 25 years old, - most people will answer N here. - config FB_GBE bool "SGI Graphics Backend frame buffer support" depends on (FB = y) && HAS_IOMEM diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 36a18d958ba0..0b17c878154d 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -59,7 +59,6 @@ obj-$(CONFIG_FB_ATARI) += atafb.o c2p_iplan2.o atafb_mfb.o \ obj-$(CONFIG_FB_MAC) += macfb.o obj-$(CONFIG_FB_HECUBA) += hecubafb.o obj-$(CONFIG_FB_N411) += n411.o -obj-$(CONFIG_FB_HGA) += hgafb.o obj-$(CONFIG_FB_XVR500) += sunxvr500.o obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c deleted file mode 100644 index d32fd1c5217c..000000000000 --- a/drivers/video/fbdev/hgafb.c +++ /dev/null @@ -1,685 +0,0 @@ -/* - * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device - * - * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu) - * Based on skeletonfb.c by Geert Uytterhoeven and - * mdacon.c by Andrew Apted - * - * History: - * - * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api. - * - * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards - * being detected as Hercules. (Paul G.) - * - Revision 0.1.6 (17 Aug 2000): new style structs - * documentation - * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc - * minor fixes - * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for - * HGA-only systems - * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure - * screen is cleared after rmmod - * virtual resolutions - * module parameter 'nologo={0|1}' - * the most important: boot logo :) - * - Revision 0.1.0 (6 Dec 1999): faster scrolling and minor fixes - * - First release (25 Nov 1999) - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if 0 -#define DPRINTK(args...) printk(KERN_DEBUG __FILE__": " ##args) -#else -#define DPRINTK(args...) -#endif - -#if 0 -#define CHKINFO(ret) if (info != &fb_info) { printk(KERN_DEBUG __FILE__": This should never happen, line:%d \n", __LINE__); return ret; } -#else -#define CHKINFO(ret) -#endif - -/* Description of the hardware layout */ - -static void __iomem *hga_vram; /* Base of video memory */ -static unsigned long hga_vram_len; /* Size of video memory */ - -#define HGA_ROWADDR(row) ((row%4)*8192 + (row>>2)*90) -#define HGA_TXT 0 -#define HGA_GFX 1 - -static inline u8 __iomem * rowaddr(struct fb_info *info, u_int row) -{ - return info->screen_base + HGA_ROWADDR(row); -} - -static int hga_mode = -1; /* 0 = txt, 1 = gfx mode */ - -static enum { TYPE_HERC, TYPE_HERCPLUS, TYPE_HERCCOLOR } hga_type; -static char *hga_type_name; - -#define HGA_INDEX_PORT 0x3b4 /* Register select port */ -#define HGA_VALUE_PORT 0x3b5 /* Register value port */ -#define HGA_MODE_PORT 0x3b8 /* Mode control port */ -#define HGA_STATUS_PORT 0x3ba /* Status and Config port */ -#define HGA_GFX_PORT 0x3bf /* Graphics control port */ - -/* HGA register values */ - -#define HGA_CURSOR_BLINKING 0x00 -#define HGA_CURSOR_OFF 0x20 -#define HGA_CURSOR_SLOWBLINK 0x60 - -#define HGA_MODE_GRAPHICS 0x02 -#define HGA_MODE_VIDEO_EN 0x08 -#define HGA_MODE_BLINK_EN 0x20 -#define HGA_MODE_GFX_PAGE1 0x80 - -#define HGA_STATUS_HSYNC 0x01 -#define HGA_STATUS_VSYNC 0x80 -#define HGA_STATUS_VIDEO 0x08 - -#define HGA_CONFIG_COL132 0x08 -#define HGA_GFX_MODE_EN 0x01 -#define HGA_GFX_PAGE_EN 0x02 - -/* Global locks */ - -static DEFINE_SPINLOCK(hga_reg_lock); - -/* Framebuffer driver structures */ - -static const struct fb_var_screeninfo hga_default_var = { - .xres = 720, - .yres = 348, - .xres_virtual = 720, - .yres_virtual = 348, - .bits_per_pixel = 1, - .red = {0, 1, 0}, - .green = {0, 1, 0}, - .blue = {0, 1, 0}, - .transp = {0, 0, 0}, - .height = -1, - .width = -1, -}; - -static struct fb_fix_screeninfo hga_fix = { - .id = "HGA", - .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */ - .visual = FB_VISUAL_MONO10, - .xpanstep = 8, - .ypanstep = 8, - .line_length = 90, - .accel = FB_ACCEL_NONE -}; - -/* Don't assume that tty1 will be the initial current console. */ -static int release_io_port = 0; -static int release_io_ports = 0; -static bool nologo = 0; - -/* ------------------------------------------------------------------------- - * - * Low level hardware functions - * - * ------------------------------------------------------------------------- */ - -static void write_hga_b(unsigned int val, unsigned char reg) -{ - outb_p(reg, HGA_INDEX_PORT); - outb_p(val, HGA_VALUE_PORT); -} - -static void write_hga_w(unsigned int val, unsigned char reg) -{ - outb_p(reg, HGA_INDEX_PORT); outb_p(val >> 8, HGA_VALUE_PORT); - outb_p(reg+1, HGA_INDEX_PORT); outb_p(val & 0xff, HGA_VALUE_PORT); -} - -static int test_hga_b(unsigned char val, unsigned char reg) -{ - outb_p(reg, HGA_INDEX_PORT); - outb (val, HGA_VALUE_PORT); - udelay(20); val = (inb_p(HGA_VALUE_PORT) == val); - return val; -} - -static void hga_clear_screen(void) -{ - unsigned char fillchar = 0xbf; /* magic */ - unsigned long flags; - - spin_lock_irqsave(&hga_reg_lock, flags); - if (hga_mode == HGA_TXT) - fillchar = ' '; - else if (hga_mode == HGA_GFX) - fillchar = 0x00; - spin_unlock_irqrestore(&hga_reg_lock, flags); - if (fillchar != 0xbf) - memset_io(hga_vram, fillchar, hga_vram_len); -} - -static void hga_txt_mode(void) -{ - unsigned long flags; - - spin_lock_irqsave(&hga_reg_lock, flags); - outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_BLINK_EN, HGA_MODE_PORT); - outb_p(0x00, HGA_GFX_PORT); - outb_p(0x00, HGA_STATUS_PORT); - - write_hga_b(0x61, 0x00); /* horizontal total */ - write_hga_b(0x50, 0x01); /* horizontal displayed */ - write_hga_b(0x52, 0x02); /* horizontal sync pos */ - write_hga_b(0x0f, 0x03); /* horizontal sync width */ - - write_hga_b(0x19, 0x04); /* vertical total */ - write_hga_b(0x06, 0x05); /* vertical total adjust */ - write_hga_b(0x19, 0x06); /* vertical displayed */ - write_hga_b(0x19, 0x07); /* vertical sync pos */ - - write_hga_b(0x02, 0x08); /* interlace mode */ - write_hga_b(0x0d, 0x09); /* maximum scanline */ - write_hga_b(0x0c, 0x0a); /* cursor start */ - write_hga_b(0x0d, 0x0b); /* cursor end */ - - write_hga_w(0x0000, 0x0c); /* start address */ - write_hga_w(0x0000, 0x0e); /* cursor location */ - - hga_mode = HGA_TXT; - spin_unlock_irqrestore(&hga_reg_lock, flags); -} - -static void hga_gfx_mode(void) -{ - unsigned long flags; - - spin_lock_irqsave(&hga_reg_lock, flags); - outb_p(0x00, HGA_STATUS_PORT); - outb_p(HGA_GFX_MODE_EN, HGA_GFX_PORT); - outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT); - - write_hga_b(0x35, 0x00); /* horizontal total */ - write_hga_b(0x2d, 0x01); /* horizontal displayed */ - write_hga_b(0x2e, 0x02); /* horizontal sync pos */ - write_hga_b(0x07, 0x03); /* horizontal sync width */ - - write_hga_b(0x5b, 0x04); /* vertical total */ - write_hga_b(0x02, 0x05); /* vertical total adjust */ - write_hga_b(0x57, 0x06); /* vertical displayed */ - write_hga_b(0x57, 0x07); /* vertical sync pos */ - - write_hga_b(0x02, 0x08); /* interlace mode */ - write_hga_b(0x03, 0x09); /* maximum scanline */ - write_hga_b(0x00, 0x0a); /* cursor start */ - write_hga_b(0x00, 0x0b); /* cursor end */ - - write_hga_w(0x0000, 0x0c); /* start address */ - write_hga_w(0x0000, 0x0e); /* cursor location */ - - hga_mode = HGA_GFX; - spin_unlock_irqrestore(&hga_reg_lock, flags); -} - -static void hga_show_logo(struct fb_info *info) -{ -/* - void __iomem *dest = hga_vram; - char *logo = linux_logo_bw; - int x, y; - - for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup * - for (x = 0; x < 10 ; x++) - writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40)); -*/ -} - -static void hga_pan(unsigned int xoffset, unsigned int yoffset) -{ - unsigned int base; - unsigned long flags; - - base = (yoffset / 8) * 90 + xoffset; - spin_lock_irqsave(&hga_reg_lock, flags); - write_hga_w(base, 0x0c); /* start address */ - spin_unlock_irqrestore(&hga_reg_lock, flags); - DPRINTK("hga_pan: base:%d\n", base); -} - -static void hga_blank(int blank_mode) -{ - unsigned long flags; - - spin_lock_irqsave(&hga_reg_lock, flags); - if (blank_mode) { - outb_p(0x00, HGA_MODE_PORT); /* disable video */ - } else { - outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT); - } - spin_unlock_irqrestore(&hga_reg_lock, flags); -} - -static int hga_card_detect(struct platform_device *pdev) -{ - int count = 0; - void __iomem *p, *q; - unsigned short p_save, q_save; - - hga_vram_len = 0x08000; - - if (!devm_request_mem_region(&pdev->dev, 0xb0000, hga_vram_len, "hgafb")) { - dev_err(&pdev->dev, "cannot reserve video memory at 0xb0000\n"); - return -EBUSY; - } - - hga_vram = ioremap(0xb0000, hga_vram_len); - if (!hga_vram) - return -ENOMEM; - - if (request_region(0x3b0, 12, "hgafb")) - release_io_ports = 1; - if (request_region(0x3bf, 1, "hgafb")) - release_io_port = 1; - - /* do a memory check */ - - p = hga_vram; - q = hga_vram + 0x01000; - - p_save = readw(p); q_save = readw(q); - - writew(0xaa55, p); if (readw(p) == 0xaa55) count++; - writew(0x55aa, p); if (readw(p) == 0x55aa) count++; - writew(p_save, p); - - if (count != 2) - goto error; - - /* Ok, there is definitely a card registering at the correct - * memory location, so now we do an I/O port test. - */ - - if (!test_hga_b(0x66, 0x0f)) /* cursor low register */ - goto error; - - if (!test_hga_b(0x99, 0x0f)) /* cursor low register */ - goto error; - - /* See if the card is a Hercules, by checking whether the vsync - * bit of the status register is changing. This test lasts for - * approximately 1/10th of a second. - */ - - p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC; - - for (count=0; count < 50000 && p_save == q_save; count++) { - q_save = inb(HGA_STATUS_PORT) & HGA_STATUS_VSYNC; - udelay(2); - } - - if (p_save == q_save) - goto error; - - switch (inb_p(HGA_STATUS_PORT) & 0x70) { - case 0x10: - hga_type = TYPE_HERCPLUS; - hga_type_name = "HerculesPlus"; - break; - case 0x50: - hga_type = TYPE_HERCCOLOR; - hga_type_name = "HerculesColor"; - break; - default: - hga_type = TYPE_HERC; - hga_type_name = "Hercules"; - break; - } - return 0; -error: - if (release_io_ports) - release_region(0x3b0, 12); - if (release_io_port) - release_region(0x3bf, 1); - - iounmap(hga_vram); - - pr_err("hgafb: HGA card not detected.\n"); - - return -EINVAL; -} - -/** - * hgafb_open - open the framebuffer device - * @info: pointer to fb_info object containing info for current hga board - * @init: open by console system or userland. - * - * Returns: %0 - */ - -static int hgafb_open(struct fb_info *info, int init) -{ - hga_gfx_mode(); - hga_clear_screen(); - if (!nologo) hga_show_logo(info); - return 0; -} - -/** - * hgafb_release - open the framebuffer device - * @info: pointer to fb_info object containing info for current hga board - * @init: open by console system or userland. - * - * Returns: %0 - */ - -static int hgafb_release(struct fb_info *info, int init) -{ - hga_txt_mode(); - hga_clear_screen(); - return 0; -} - -/** - * hgafb_setcolreg - set color registers - * @regno:register index to set - * @red:red value, unused - * @green:green value, unused - * @blue:blue value, unused - * @transp:transparency value, unused - * @info:unused - * - * This callback function is used to set the color registers of a HGA - * board. Since we have only two fixed colors only @regno is checked. - * A zero is returned on success and 1 for failure. - * - * Returns: %0 - */ - -static int hgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) -{ - if (regno > 1) - return 1; - return 0; -} - -/** - * hgafb_pan_display - pan or wrap the display - * @var:contains new xoffset, yoffset and vmode values - * @info:pointer to fb_info object containing info for current hga board - * - * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP - * flag in @var. If input parameters are correct it calls hga_pan() to - * program the hardware. @info->var is updated to the new values. - * - * Returns: %0 on success or %-EINVAL for failure. - */ - -static int hgafb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - if (var->vmode & FB_VMODE_YWRAP) { - if (var->yoffset >= info->var.yres_virtual || - var->xoffset) - return -EINVAL; - } else { - if (var->xoffset + info->var.xres > info->var.xres_virtual - || var->yoffset + info->var.yres > info->var.yres_virtual - || var->yoffset % 8) - return -EINVAL; - } - - hga_pan(var->xoffset, var->yoffset); - return 0; -} - -/** - * hgafb_blank - (un)blank the screen - * @blank_mode:blanking method to use - * @info:unused - * - * Blank the screen if blank_mode != 0, else unblank. - * Implements VESA suspend and powerdown modes on hardware that supports - * disabling hsync/vsync: - * @blank_mode == 2 means suspend vsync, - * @blank_mode == 3 means suspend hsync, - * @blank_mode == 4 means powerdown. - * - * Returns: %0 - */ - -static int hgafb_blank(int blank_mode, struct fb_info *info) -{ - hga_blank(blank_mode); - return 0; -} - -/* - * Accel functions - */ -static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) -{ - u_int rows, y; - u8 __iomem *dest; - - y = rect->dy; - - for (rows = rect->height; rows--; y++) { - dest = rowaddr(info, y) + (rect->dx >> 3); - switch (rect->rop) { - case ROP_COPY: - memset_io(dest, rect->color, (rect->width >> 3)); - break; - case ROP_XOR: - fb_writeb(~(fb_readb(dest)), dest); - break; - } - } -} - -static void hgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) -{ - u_int rows, y1, y2; - u8 __iomem *src; - u8 __iomem *dest; - - if (area->dy <= area->sy) { - y1 = area->sy; - y2 = area->dy; - - for (rows = area->height; rows--; ) { - src = rowaddr(info, y1) + (area->sx >> 3); - dest = rowaddr(info, y2) + (area->dx >> 3); - memmove(dest, src, (area->width >> 3)); - y1++; - y2++; - } - } else { - y1 = area->sy + area->height - 1; - y2 = area->dy + area->height - 1; - - for (rows = area->height; rows--;) { - src = rowaddr(info, y1) + (area->sx >> 3); - dest = rowaddr(info, y2) + (area->dx >> 3); - memmove(dest, src, (area->width >> 3)); - y1--; - y2--; - } - } -} - -static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image) -{ - u8 __iomem *dest; - u8 *cdat = (u8 *) image->data; - u_int rows, y = image->dy; - u_int x; - u8 d; - - for (rows = image->height; rows--; y++) { - for (x = 0; x < image->width; x+= 8) { - d = *cdat++; - dest = rowaddr(info, y) + ((image->dx + x)>> 3); - fb_writeb(d, dest); - } - } -} - -static const struct fb_ops hgafb_ops = { - .owner = THIS_MODULE, - .fb_open = hgafb_open, - .fb_release = hgafb_release, - __FB_DEFAULT_IOMEM_OPS_RDWR, - .fb_setcolreg = hgafb_setcolreg, - .fb_pan_display = hgafb_pan_display, - .fb_blank = hgafb_blank, - .fb_fillrect = hgafb_fillrect, - .fb_copyarea = hgafb_copyarea, - .fb_imageblit = hgafb_imageblit, - __FB_DEFAULT_IOMEM_OPS_MMAP, -}; - -/* ------------------------------------------------------------------------- * - * - * Functions in fb_info - * - * ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ - - /* - * Initialization - */ - -static int hgafb_probe(struct platform_device *pdev) -{ - struct fb_info *info; - int ret; - - ret = hga_card_detect(pdev); - if (ret) - return ret; - - printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n", - hga_type_name, hga_vram_len/1024); - - info = framebuffer_alloc(0, &pdev->dev); - if (!info) { - iounmap(hga_vram); - return -ENOMEM; - } - - hga_fix.smem_start = (unsigned long)hga_vram; - hga_fix.smem_len = hga_vram_len; - - info->flags = FBINFO_HWACCEL_YPAN; - info->var = hga_default_var; - info->fix = hga_fix; - info->monspecs.hfmin = 0; - info->monspecs.hfmax = 0; - info->monspecs.vfmin = 10000; - info->monspecs.vfmax = 10000; - info->monspecs.dpms = 0; - info->fbops = &hgafb_ops; - info->screen_base = hga_vram; - - if (register_framebuffer(info) < 0) { - framebuffer_release(info); - iounmap(hga_vram); - return -EINVAL; - } - - fb_info(info, "%s frame buffer device\n", info->fix.id); - platform_set_drvdata(pdev, info); - return 0; -} - -static void hgafb_remove(struct platform_device *pdev) -{ - struct fb_info *info = platform_get_drvdata(pdev); - - hga_txt_mode(); - hga_clear_screen(); - - if (info) { - unregister_framebuffer(info); - framebuffer_release(info); - } - - iounmap(hga_vram); - - if (release_io_ports) - release_region(0x3b0, 12); - - if (release_io_port) - release_region(0x3bf, 1); -} - -static struct platform_driver hgafb_driver = { - .probe = hgafb_probe, - .remove = hgafb_remove, - .driver = { - .name = "hgafb", - }, -}; - -static struct platform_device *hgafb_device; - -static int __init hgafb_init(void) -{ - int ret; - - if (fb_get_options("hgafb", NULL)) - return -ENODEV; - - ret = platform_driver_register(&hgafb_driver); - - if (!ret) { - hgafb_device = platform_device_register_simple("hgafb", 0, NULL, 0); - - if (IS_ERR(hgafb_device)) { - platform_driver_unregister(&hgafb_driver); - ret = PTR_ERR(hgafb_device); - } - } - - return ret; -} - -static void __exit hgafb_exit(void) -{ - platform_device_unregister(hgafb_device); - platform_driver_unregister(&hgafb_driver); -} - -/* ------------------------------------------------------------------------- - * - * Modularization - * - * ------------------------------------------------------------------------- */ - -MODULE_AUTHOR("Ferenc Bakonyi "); -MODULE_DESCRIPTION("FBDev driver for Hercules Graphics Adaptor"); -MODULE_LICENSE("GPL"); - -module_param(nologo, bool, 0); -MODULE_PARM_DESC(nologo, "Disables startup logo if != 0 (default=0)"); -module_init(hgafb_init); -module_exit(hgafb_exit); From e38b27199e0f5b530fd2b033e3b63241a0b16596 Mon Sep 17 00:00:00 2001 From: Ethan Nelson-Moore Date: Tue, 19 May 2026 20:31:36 -0700 Subject: [PATCH 02/43] console: mdacon: remove this obsolete driver The mdacon driver supports using ISA MDA or Hercules-compatible display adapters as a secondary text console. This was commonly used in the 1990s and earlier for debugging software which took over the primary display. It is highly unlikely anyone is doing so nowadays because serial consoles and much better methods of debugging exist. The driver is not enabled by any defconfig, nor any of the dozens of distro configs collected at [1]. It has been relegated to VTs 13-16 since commit 0b9cf3aa6b1e ("mdacon messing up default vc's - set default to vc13-16 again") in Linux 2.6.27 (and before Linux 2.5.53 - see the link in the message of the above commit). The change in 2.6.27 was done because it was incorrectly detecting non-MDA adapters as MDA and taking over all VTs, rendering them unusable. Furthermore, vgacon supports using MDA/Hercules-compatible adapters as the primary text console, so any systems with only one of these adapters were already using vgacon and will not experience any loss in functionality from the removal of this driver. Given all of these factors, the mdacon driver is likely entirely unused. Remove it. [1] https://github.com/nyrahul/linux-kernel-configs/tree/f0bee86a135a0406ea427855f52702dd00d770f9 Signed-off-by: Ethan Nelson-Moore Signed-off-by: Helge Deller --- .../admin-guide/kernel-parameters.txt | 5 - arch/alpha/kernel/io.c | 2 +- arch/powerpc/include/asm/vga.h | 4 +- drivers/tty/vt/vt.c | 3 - drivers/video/console/Kconfig | 15 - drivers/video/console/Makefile | 1 - drivers/video/console/mdacon.c | 566 ------------------ include/linux/console.h | 2 - include/linux/vt_buffer.h | 2 +- 9 files changed, 4 insertions(+), 596 deletions(-) delete mode 100644 drivers/video/console/mdacon.c diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 4d0f545fb3ec..e873b27cdd30 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -36,7 +36,6 @@ M68k M68k architecture is enabled. These options have more detailed description inside of Documentation/arch/m68k/kernel-options.rst. - MDA MDA console support is enabled. MIPS MIPS architecture is enabled. MOUSE Appropriate mouse support is enabled. MSI Message Signaled Interrupts (PCI). @@ -3816,10 +3815,6 @@ Kernel parameters md= [HW] RAID subsystems devices and level See Documentation/admin-guide/md.rst. - mdacon= [MDA] - Format: , - Specifies range of consoles to be captured by the MDA. - mds= [X86,INTEL,EARLY] Control mitigation for the Micro-architectural Data Sampling (MDS) vulnerability. diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c index c28035d6d1e6..2bad1b4fb240 100644 --- a/arch/alpha/kernel/io.c +++ b/arch/alpha/kernel/io.c @@ -647,7 +647,7 @@ void _memset_c_io(volatile void __iomem *to, unsigned long c, long count) EXPORT_SYMBOL(_memset_c_io); -#if IS_ENABLED(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE) +#if IS_ENABLED(CONFIG_VGA_CONSOLE) #include diff --git a/arch/powerpc/include/asm/vga.h b/arch/powerpc/include/asm/vga.h index f2dc40e1c52a..e45063b02b45 100644 --- a/arch/powerpc/include/asm/vga.h +++ b/arch/powerpc/include/asm/vga.h @@ -14,7 +14,7 @@ #include -#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) +#ifdef CONFIG_VGA_CONSOLE #define VT_BUF_HAVE_RW /* @@ -40,7 +40,7 @@ static inline void scr_memsetw(u16 *s, u16 v, unsigned int n) memset16(s, cpu_to_le16(v), n / 2); } -#endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */ +#endif /* !CONFIG_VGA_CONSOLE */ #ifdef __powerpc64__ #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s)) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index e99636ab9db5..3ca5e3dc5ac0 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3978,9 +3978,6 @@ int __init vty_init(const struct file_operations *console_fops) panic("Couldn't register console driver\n"); kbd_init(); console_map_init(); -#ifdef CONFIG_MDA_CONSOLE - mda_console_init(); -#endif return 0; } diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index 12f54480f57f..9f81af3506da 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -23,21 +23,6 @@ config VGA_CONSOLE Say Y. -config MDA_CONSOLE - depends on VGA_CONSOLE && ISA - tristate "MDA text console (dual-headed)" - help - Say Y here if you have an old MDA or monochrome Hercules graphics - adapter in your system acting as a second head ( = video card). You - will then be able to use two monitors with your Linux system. Do not - say Y here if your MDA card is the primary card in your system; the - normal VGA driver will handle it. - - To compile this driver as a module, choose M here: the - module will be called mdacon. - - If unsure, say N. - config SGI_NEWPORT_CONSOLE tristate "SGI Newport Console support" depends on SGI_IP22 && HAS_IOMEM diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile index fd79016a0d95..f1000605210c 100644 --- a/drivers/video/console/Makefile +++ b/drivers/video/console/Makefile @@ -7,4 +7,3 @@ obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o obj-$(CONFIG_STI_CONSOLE) += sticon.o obj-$(CONFIG_VGA_CONSOLE) += vgacon.o -obj-$(CONFIG_MDA_CONSOLE) += mdacon.o diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c deleted file mode 100644 index d52cd99cd18b..000000000000 --- a/drivers/video/console/mdacon.c +++ /dev/null @@ -1,566 +0,0 @@ -/* - * linux/drivers/video/mdacon.c -- Low level MDA based console driver - * - * (c) 1998 Andrew Apted - * - * including portions (c) 1995-1998 Patrick Caulfield. - * - * slight improvements (c) 2000 Edward Betts - * - * This file is based on the VGA console driver (vgacon.c): - * - * Created 28 Sep 1997 by Geert Uytterhoeven - * - * Rewritten by Martin Mares , July 1998 - * - * and on the old console.c, vga.c and vesa_blank.c drivers: - * - * Copyright (C) 1991, 1992 Linus Torvalds - * 1995 Jay Estabrook - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * Changelog: - * Paul G. (03/2001) Fix mdacon= boot prompt to use __setup(). - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static DEFINE_SPINLOCK(mda_lock); - -/* description of the hardware layout */ - -static u16 *mda_vram_base; /* Base of video memory */ -static unsigned long mda_vram_len; /* Size of video memory */ -static unsigned int mda_num_columns; /* Number of text columns */ -static unsigned int mda_num_lines; /* Number of text lines */ - -static unsigned int mda_index_port; /* Register select port */ -static unsigned int mda_value_port; /* Register value port */ -static unsigned int mda_mode_port; /* Mode control port */ -static unsigned int mda_status_port; /* Status and Config port */ -static unsigned int mda_gfx_port; /* Graphics control port */ - -/* current hardware state */ - -static int mda_cursor_loc=-1; -static int mda_cursor_size_from=-1; -static int mda_cursor_size_to=-1; - -static enum { TYPE_MDA, TYPE_HERC, TYPE_HERCPLUS, TYPE_HERCCOLOR } mda_type; -static char *mda_type_name; - -/* console information */ - -static int mda_first_vc = 13; -static int mda_last_vc = 16; - -static struct vc_data *mda_display_fg = NULL; - -module_param(mda_first_vc, int, 0); -MODULE_PARM_DESC(mda_first_vc, "First virtual console. Default: 13"); -module_param(mda_last_vc, int, 0); -MODULE_PARM_DESC(mda_last_vc, "Last virtual console. Default: 16"); - -/* MDA register values - */ - -#define MDA_CURSOR_BLINKING 0x00 -#define MDA_CURSOR_OFF 0x20 -#define MDA_CURSOR_SLOWBLINK 0x60 - -#define MDA_MODE_GRAPHICS 0x02 -#define MDA_MODE_VIDEO_EN 0x08 -#define MDA_MODE_BLINK_EN 0x20 -#define MDA_MODE_GFX_PAGE1 0x80 - -#define MDA_STATUS_HSYNC 0x01 -#define MDA_STATUS_VSYNC 0x80 -#define MDA_STATUS_VIDEO 0x08 - -#define MDA_CONFIG_COL132 0x08 -#define MDA_GFX_MODE_EN 0x01 -#define MDA_GFX_PAGE_EN 0x02 - - -/* - * MDA could easily be classified as "pre-dinosaur hardware". - */ - -static void write_mda_b(unsigned int val, unsigned char reg) -{ - unsigned long flags; - - spin_lock_irqsave(&mda_lock, flags); - - outb_p(reg, mda_index_port); - outb_p(val, mda_value_port); - - spin_unlock_irqrestore(&mda_lock, flags); -} - -static void write_mda_w(unsigned int val, unsigned char reg) -{ - unsigned long flags; - - spin_lock_irqsave(&mda_lock, flags); - - outb_p(reg, mda_index_port); outb_p(val >> 8, mda_value_port); - outb_p(reg+1, mda_index_port); outb_p(val & 0xff, mda_value_port); - - spin_unlock_irqrestore(&mda_lock, flags); -} - -#ifdef TEST_MDA_B -static int test_mda_b(unsigned char val, unsigned char reg) -{ - unsigned long flags; - - spin_lock_irqsave(&mda_lock, flags); - - outb_p(reg, mda_index_port); - outb (val, mda_value_port); - - udelay(20); val = (inb_p(mda_value_port) == val); - - spin_unlock_irqrestore(&mda_lock, flags); - return val; -} -#endif - -static inline void mda_set_cursor(unsigned int location) -{ - if (mda_cursor_loc == location) - return; - - write_mda_w(location >> 1, 0x0e); - - mda_cursor_loc = location; -} - -static inline void mda_set_cursor_size(int from, int to) -{ - if (mda_cursor_size_from==from && mda_cursor_size_to==to) - return; - - if (from > to) { - write_mda_b(MDA_CURSOR_OFF, 0x0a); /* disable cursor */ - } else { - write_mda_b(from, 0x0a); /* cursor start */ - write_mda_b(to, 0x0b); /* cursor end */ - } - - mda_cursor_size_from = from; - mda_cursor_size_to = to; -} - - -#ifndef MODULE -static int __init mdacon_setup(char *str) -{ - /* command line format: mdacon=, */ - - int ints[3]; - - str = get_options(str, ARRAY_SIZE(ints), ints); - - if (ints[0] < 2) - return 0; - - if (ints[1] < 1 || ints[1] > MAX_NR_CONSOLES || - ints[2] < 1 || ints[2] > MAX_NR_CONSOLES) - return 0; - - mda_first_vc = ints[1]; - mda_last_vc = ints[2]; - return 1; -} - -__setup("mdacon=", mdacon_setup); -#endif - -static int mda_detect(void) -{ - int count=0; - u16 *p, p_save; - u16 *q, q_save; - - /* do a memory check */ - - p = mda_vram_base; - q = mda_vram_base + 0x01000 / 2; - - p_save = scr_readw(p); - q_save = scr_readw(q); - - scr_writew(0xAA55, p); - if (scr_readw(p) == 0xAA55) - count++; - - scr_writew(0x55AA, p); - if (scr_readw(p) == 0x55AA) - count++; - - scr_writew(p_save, p); - - if (count != 2) { - return 0; - } - - /* check if we have 4K or 8K */ - - scr_writew(0xA55A, q); - scr_writew(0x0000, p); - if (scr_readw(q) == 0xA55A) - count++; - - scr_writew(0x5AA5, q); - scr_writew(0x0000, p); - if (scr_readw(q) == 0x5AA5) - count++; - - scr_writew(p_save, p); - scr_writew(q_save, q); - - if (count == 4) { - mda_vram_len = 0x02000; - } - - /* Ok, there is definitely a card registering at the correct - * memory location, so now we do an I/O port test. - */ - -#ifdef TEST_MDA_B - /* Edward: These two mess `tests' mess up my cursor on bootup */ - - /* cursor low register */ - if (!test_mda_b(0x66, 0x0f)) - return 0; - - /* cursor low register */ - if (!test_mda_b(0x99, 0x0f)) - return 0; -#endif - - /* See if the card is a Hercules, by checking whether the vsync - * bit of the status register is changing. This test lasts for - * approximately 1/10th of a second. - */ - - p_save = q_save = inb_p(mda_status_port) & MDA_STATUS_VSYNC; - - for (count = 0; count < 50000 && p_save == q_save; count++) { - q_save = inb(mda_status_port) & MDA_STATUS_VSYNC; - udelay(2); - } - - if (p_save != q_save) { - switch (inb_p(mda_status_port) & 0x70) { - case 0x10: - mda_type = TYPE_HERCPLUS; - mda_type_name = "HerculesPlus"; - break; - case 0x50: - mda_type = TYPE_HERCCOLOR; - mda_type_name = "HerculesColor"; - break; - default: - mda_type = TYPE_HERC; - mda_type_name = "Hercules"; - break; - } - } - - return 1; -} - -static void mda_initialize(void) -{ - write_mda_b(97, 0x00); /* horizontal total */ - write_mda_b(80, 0x01); /* horizontal displayed */ - write_mda_b(82, 0x02); /* horizontal sync pos */ - write_mda_b(15, 0x03); /* horizontal sync width */ - - write_mda_b(25, 0x04); /* vertical total */ - write_mda_b(6, 0x05); /* vertical total adjust */ - write_mda_b(25, 0x06); /* vertical displayed */ - write_mda_b(25, 0x07); /* vertical sync pos */ - - write_mda_b(2, 0x08); /* interlace mode */ - write_mda_b(13, 0x09); /* maximum scanline */ - write_mda_b(12, 0x0a); /* cursor start */ - write_mda_b(13, 0x0b); /* cursor end */ - - write_mda_w(0x0000, 0x0c); /* start address */ - write_mda_w(0x0000, 0x0e); /* cursor location */ - - outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, mda_mode_port); - outb_p(0x00, mda_status_port); - outb_p(0x00, mda_gfx_port); -} - -static const char *mdacon_startup(void) -{ - mda_num_columns = 80; - mda_num_lines = 25; - - mda_vram_len = 0x01000; - mda_vram_base = (u16 *)VGA_MAP_MEM(0xb0000, mda_vram_len); - - mda_index_port = 0x3b4; - mda_value_port = 0x3b5; - mda_mode_port = 0x3b8; - mda_status_port = 0x3ba; - mda_gfx_port = 0x3bf; - - mda_type = TYPE_MDA; - mda_type_name = "MDA"; - - if (! mda_detect()) { - printk("mdacon: MDA card not detected.\n"); - return NULL; - } - - if (mda_type != TYPE_MDA) { - mda_initialize(); - } - - /* cursor looks ugly during boot-up, so turn it off */ - mda_set_cursor(mda_vram_len - 1); - - printk("mdacon: %s with %ldK of memory detected.\n", - mda_type_name, mda_vram_len/1024); - - return "MDA-2"; -} - -static void mdacon_init(struct vc_data *c, bool init) -{ - c->vc_complement_mask = 0x0800; /* reverse video */ - c->vc_display_fg = &mda_display_fg; - - if (init) { - c->vc_cols = mda_num_columns; - c->vc_rows = mda_num_lines; - } else - vc_resize(c, mda_num_columns, mda_num_lines); - - /* make the first MDA console visible */ - - if (mda_display_fg == NULL) - mda_display_fg = c; -} - -static void mdacon_deinit(struct vc_data *c) -{ - /* con_set_default_unimap(c->vc_num); */ - - if (mda_display_fg == c) - mda_display_fg = NULL; -} - -static inline u16 mda_convert_attr(u16 ch) -{ - u16 attr = 0x0700; - - /* Underline and reverse-video are mutually exclusive on MDA. - * Since reverse-video is used for cursors and selected areas, - * it takes precedence. - */ - - if (ch & 0x0800) attr = 0x7000; /* reverse */ - else if (ch & 0x0400) attr = 0x0100; /* underline */ - - return ((ch & 0x0200) << 2) | /* intensity */ - (ch & 0x8000) | /* blink */ - (ch & 0x00ff) | attr; -} - -static u8 mdacon_build_attr(struct vc_data *c, u8 color, - enum vc_intensity intensity, - bool blink, bool underline, bool reverse, - bool italic) -{ - /* The attribute is just a bit vector: - * - * Bit 0..1 : intensity (0..2) - * Bit 2 : underline - * Bit 3 : reverse - * Bit 7 : blink - */ - - return (intensity & VCI_MASK) | - (underline << 2) | - (reverse << 3) | - (italic << 4) | - (blink << 7); -} - -static void mdacon_invert_region(struct vc_data *c, u16 *p, int count) -{ - for (; count > 0; count--) { - scr_writew(scr_readw(p) ^ 0x0800, p); - p++; - } -} - -static inline u16 *mda_addr(unsigned int x, unsigned int y) -{ - return mda_vram_base + y * mda_num_columns + x; -} - -static void mdacon_putcs(struct vc_data *c, const u16 *s, unsigned int count, - unsigned int y, unsigned int x) -{ - u16 *dest = mda_addr(x, y); - - for (; count > 0; count--) { - scr_writew(mda_convert_attr(scr_readw(s++)), dest++); - } -} - -static void mdacon_clear(struct vc_data *c, unsigned int y, unsigned int x, - unsigned int width) -{ - u16 *dest = mda_addr(x, y); - u16 eattr = mda_convert_attr(c->vc_video_erase_char); - - scr_memsetw(dest, eattr, width * 2); -} - -static bool mdacon_switch(struct vc_data *c) -{ - return true; /* redrawing needed */ -} - -static bool mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank, - bool mode_switch) -{ - if (mda_type == TYPE_MDA) { - if (blank) - scr_memsetw(mda_vram_base, - mda_convert_attr(c->vc_video_erase_char), - c->vc_screenbuf_size); - /* Tell console.c that it has to restore the screen itself */ - return true; - } else { - if (blank) - outb_p(0x00, mda_mode_port); /* disable video */ - else - outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, - mda_mode_port); - return false; - } -} - -static void mdacon_cursor(struct vc_data *c, bool enable) -{ - if (!enable) { - mda_set_cursor(mda_vram_len - 1); - return; - } - - mda_set_cursor(c->state.y * mda_num_columns * 2 + c->state.x * 2); - - switch (CUR_SIZE(c->vc_cursor_type)) { - - case CUR_LOWER_THIRD: mda_set_cursor_size(10, 13); break; - case CUR_LOWER_HALF: mda_set_cursor_size(7, 13); break; - case CUR_TWO_THIRDS: mda_set_cursor_size(4, 13); break; - case CUR_BLOCK: mda_set_cursor_size(1, 13); break; - case CUR_NONE: mda_set_cursor_size(14, 13); break; - default: mda_set_cursor_size(12, 13); break; - } -} - -static bool mdacon_scroll(struct vc_data *c, unsigned int t, unsigned int b, - enum con_scroll dir, unsigned int lines) -{ - u16 eattr = mda_convert_attr(c->vc_video_erase_char); - - if (!lines) - return false; - - if (lines > c->vc_rows) /* maximum realistic size */ - lines = c->vc_rows; - - switch (dir) { - - case SM_UP: - scr_memmovew(mda_addr(0, t), mda_addr(0, t + lines), - (b-t-lines)*mda_num_columns*2); - scr_memsetw(mda_addr(0, b - lines), eattr, - lines*mda_num_columns*2); - break; - - case SM_DOWN: - scr_memmovew(mda_addr(0, t + lines), mda_addr(0, t), - (b-t-lines)*mda_num_columns*2); - scr_memsetw(mda_addr(0, t), eattr, lines*mda_num_columns*2); - break; - } - - return false; -} - - -/* - * The console `switch' structure for the MDA based console - */ - -static const struct consw mda_con = { - .owner = THIS_MODULE, - .con_startup = mdacon_startup, - .con_init = mdacon_init, - .con_deinit = mdacon_deinit, - .con_clear = mdacon_clear, - .con_putcs = mdacon_putcs, - .con_cursor = mdacon_cursor, - .con_scroll = mdacon_scroll, - .con_switch = mdacon_switch, - .con_blank = mdacon_blank, - .con_build_attr = mdacon_build_attr, - .con_invert_region = mdacon_invert_region, -}; - -int __init mda_console_init(void) -{ - int err; - - if (mda_first_vc > mda_last_vc) - return 1; - console_lock(); - err = do_take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0); - console_unlock(); - return err; -} - -static void __exit mda_console_exit(void) -{ - give_up_console(&mda_con); -} - -module_init(mda_console_init); -module_exit(mda_console_exit); - -MODULE_DESCRIPTION("MDA based console driver"); -MODULE_LICENSE("GPL"); - diff --git a/include/linux/console.h b/include/linux/console.h index 5520e4477ad7..d624200cfc17 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -718,8 +718,6 @@ extern bool console_suspend_enabled; extern void console_suspend_all(void); extern void console_resume_all(void); -int mda_console_init(void); - void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h index b6eeb8cb6070..6c15c6a15f74 100644 --- a/include/linux/vt_buffer.h +++ b/include/linux/vt_buffer.h @@ -16,7 +16,7 @@ #include -#if IS_ENABLED(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE) +#if IS_ENABLED(CONFIG_VGA_CONSOLE) #include #endif From 608a9fe171a770b62bf34aaa1f4992061c9dcdb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 18 May 2026 18:08:08 +0200 Subject: [PATCH 03/43] fbdev: matroxfb/ssd1307fb: Use named initializers for struct i2c_device_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition. While touching all these arrays, unify usage of whitespace in the list terminator. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. Signed-off-by: Uwe Kleine-König (The Capable Hub) Signed-off-by: Helge Deller --- drivers/video/fbdev/matrox/matroxfb_maven.c | 2 +- drivers/video/fbdev/ssd1307fb.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/matrox/matroxfb_maven.c b/drivers/video/fbdev/matrox/matroxfb_maven.c index 2ea65da6075c..fe057a0b57ec 100644 --- a/drivers/video/fbdev/matrox/matroxfb_maven.c +++ b/drivers/video/fbdev/matrox/matroxfb_maven.c @@ -1282,7 +1282,7 @@ static void maven_remove(struct i2c_client *client) } static const struct i2c_device_id maven_id[] = { - { "maven" }, + { .name = "maven" }, { } }; MODULE_DEVICE_TABLE(i2c, maven_id); diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 83dd31fa1fab..644b8d97b381 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -784,10 +784,10 @@ static void ssd1307fb_remove(struct i2c_client *client) } static const struct i2c_device_id ssd1307fb_i2c_id[] = { - { "ssd1305fb" }, - { "ssd1306fb" }, - { "ssd1307fb" }, - { "ssd1309fb" }, + { .name = "ssd1305fb" }, + { .name = "ssd1306fb" }, + { .name = "ssd1307fb" }, + { .name = "ssd1309fb" }, { } }; MODULE_DEVICE_TABLE(i2c, ssd1307fb_i2c_id); From e840a232a4a017ff61faedf715083fa1785dfde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 30 Apr 2026 13:16:36 +0200 Subject: [PATCH 04/43] fbdev: Consistently define pci_device_ids using named initializers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... and PCI device helpers. The various struct pci_device_id arrays were initialized mostly by list expressions. This isn't easily readable if you're not into PCI. Using named initializers is more explicit and thus easier to parse. Also use PCI_DEVICE* helper macros to assign .vendor, .device, .subvendor and .subdevice where appropriate and skip explicit assignments of 0 (which the compiler takes care of). The secret plan is to make struct pci_device_id::driver_data an anonymous union (similar to https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/) and that requires named initializers. But it's also a nice cleanup on its own. While touching all these arrays, unify usage of whitespace and comma in a few drivers. This change doesn't introduce changes to the compiled pci_device_id array. Tested on x86 and arm64. Signed-off-by: Uwe Kleine-König (The Capable Hub) Signed-off-by: Helge Deller --- drivers/video/fbdev/arkfb.c | 4 +- drivers/video/fbdev/aty/aty128fb.c | 143 +++++++------------ drivers/video/fbdev/aty/radeon_base.c | 2 +- drivers/video/fbdev/carminefb.c | 5 +- drivers/video/fbdev/cirrusfb.c | 2 +- drivers/video/fbdev/cyber2000fb.c | 24 ++-- drivers/video/fbdev/geode/gx1fb_core.c | 10 +- drivers/video/fbdev/kyro/fbdev.c | 5 +- drivers/video/fbdev/matrox/matroxfb_base.c | 40 ++---- drivers/video/fbdev/neofb.c | 29 ++-- drivers/video/fbdev/nvidia/nvidia.c | 9 +- drivers/video/fbdev/pm2fb.c | 11 +- drivers/video/fbdev/pm3fb.c | 5 +- drivers/video/fbdev/pvr2fb.c | 5 +- drivers/video/fbdev/riva/fbdev.c | 128 ++++++----------- drivers/video/fbdev/s3fb.c | 32 ++--- drivers/video/fbdev/savage/savagefb_driver.c | 140 +++++++++--------- drivers/video/fbdev/sis/sis_main.h | 26 ++-- drivers/video/fbdev/tdfxfb.c | 21 +-- drivers/video/fbdev/tridentfb.c | 44 +++--- drivers/video/fbdev/vt8623fb.c | 4 +- 21 files changed, 293 insertions(+), 396 deletions(-) diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c index 866c1165704e..195dbf4a5142 100644 --- a/drivers/video/fbdev/arkfb.c +++ b/drivers/video/fbdev/arkfb.c @@ -1167,8 +1167,8 @@ static const struct dev_pm_ops ark_pci_pm_ops = { /* List of boards that we are trying to support */ static const struct pci_device_id ark_devices[] = { - {PCI_DEVICE(0xEDD8, 0xA099)}, - {0, 0, 0, 0, 0, 0, 0} + { PCI_DEVICE(0xEDD8, 0xA099) }, + { } }; diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index f55b4c7609a8..bcb10e66221c 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -180,101 +180,54 @@ static const struct dev_pm_ops aty128_pci_pm_ops = { /* supported Rage128 chipsets */ static const struct pci_device_id aty128_pci_tbl[] = { - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LE, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LF, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_MF, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M4 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_ML, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M4 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PA, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PB, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PC, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PD, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PE, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PF, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PG, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PH, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PI, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PJ, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PK, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PM, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PN, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PP, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PQ, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PS, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PT, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PU, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PV, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PW, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PX, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RE, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RF, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RG, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RK, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SE, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SF, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pci }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SG, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SH, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SK, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SM, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SN, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TF, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TS, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TT, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra }, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TU, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra }, - { 0, } + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_LE), .driver_data = rage_M3_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_LF), .driver_data = rage_M3 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_MF), .driver_data = rage_M4 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_ML), .driver_data = rage_M4 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PA), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PB), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PC), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PD), .driver_data = rage_128_pro_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PE), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PF), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PG), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PH), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PI), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PJ), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PK), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PL), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PM), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PN), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PO), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PP), .driver_data = rage_128_pro_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PQ), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PR), .driver_data = rage_128_pro_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PS), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PT), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PU), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PV), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PW), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_PX), .driver_data = rage_128_pro }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_RE), .driver_data = rage_128_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_RF), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_RG), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_RK), .driver_data = rage_128_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_RL), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SE), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SF), .driver_data = rage_128_pci }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SG), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SH), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SK), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SL), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SM), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_SN), .driver_data = rage_128 }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_TF), .driver_data = rage_128_ultra }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_TL), .driver_data = rage_128_ultra }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_TR), .driver_data = rage_128_ultra }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_TS), .driver_data = rage_128_ultra }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_TT), .driver_data = rage_128_ultra }, + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_RAGE128_TU), .driver_data = rage_128_ultra }, + { } }; MODULE_DEVICE_TABLE(pci, aty128_pci_tbl); diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index cb006484831b..adb03489bedf 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -95,7 +95,7 @@ #define MIN_MAPPED_VRAM (1024*768*1) #define CHIP_DEF(id, family, flags) \ - { PCI_VENDOR_ID_ATI, id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (flags) | (CHIP_FAMILY_##family) } + { PCI_DEVICE(PCI_VENDOR_ID_ATI, id), .driver_data = (flags) | (CHIP_FAMILY_##family) } static const struct pci_device_id radeonfb_pci_table[] = { /* Radeon Xpress 200m */ diff --git a/drivers/video/fbdev/carminefb.c b/drivers/video/fbdev/carminefb.c index bd4bff6a2484..5f13f1cc79d3 100644 --- a/drivers/video/fbdev/carminefb.c +++ b/drivers/video/fbdev/carminefb.c @@ -753,9 +753,8 @@ static void carminefb_remove(struct pci_dev *dev) #define PCI_VENDOR_ID_FUJITU_LIMITED 0x10cf static struct pci_device_id carmine_devices[] = { -{ - PCI_DEVICE(PCI_VENDOR_ID_FUJITU_LIMITED, 0x202b)}, - {0, 0, 0, 0, 0, 0, 0} + { PCI_DEVICE(PCI_VENDOR_ID_FUJITU_LIMITED, 0x202b) }, + { } }; MODULE_DEVICE_TABLE(pci, carmine_devices); diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c index e29217e476ea..2693b5cc053f 100644 --- a/drivers/video/fbdev/cirrusfb.c +++ b/drivers/video/fbdev/cirrusfb.c @@ -253,7 +253,7 @@ static const struct cirrusfb_board_info_rec { #ifdef CONFIG_PCI #define CHIP(id, btype) \ - { PCI_VENDOR_ID_CIRRUS, id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (btype) } + { PCI_VDEVICE(CIRRUS, id), .driver_data = (btype) } static struct pci_device_id cirrusfb_pci_table[] = { CHIP(PCI_DEVICE_ID_CIRRUS_5436, BT_ALPINE), diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 2d12f8e96c7e..3daba94c6c13 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1796,16 +1796,22 @@ static int __maybe_unused cyberpro_pci_resume(struct device *dev) static struct pci_device_id cyberpro_pci_table[] = { /* Not yet - * { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, - * PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, + * { + * PCI_VDEVICE(INTERG, PCI_DEVICE_ID_INTERG_1682), + * .driver_data = ID_IGA_1682, + * }, */ - { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 }, - { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2010 }, - { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5000, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_5000 }, - { 0, } + { + PCI_VDEVICE(INTERG, PCI_DEVICE_ID_INTERG_2000), + .driver_data = ID_CYBERPRO_2000, + }, { + PCI_VDEVICE(INTERG, PCI_DEVICE_ID_INTERG_2010), + .driver_data = ID_CYBERPRO_2010, + }, { + PCI_VDEVICE(INTERG, PCI_DEVICE_ID_INTERG_5000), + .driver_data = ID_CYBERPRO_5000, + }, + { } }; MODULE_DEVICE_TABLE(pci, cyberpro_pci_table); diff --git a/drivers/video/fbdev/geode/gx1fb_core.c b/drivers/video/fbdev/geode/gx1fb_core.c index a1919c1934ac..7cca46891aef 100644 --- a/drivers/video/fbdev/geode/gx1fb_core.c +++ b/drivers/video/fbdev/geode/gx1fb_core.c @@ -423,10 +423,12 @@ static void __init gx1fb_setup(char *options) #endif static struct pci_device_id gx1fb_id_table[] = { - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_VIDEO, - PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, - 0xff0000, 0 }, - { 0, } + { + PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_VIDEO), + .class = PCI_BASE_CLASS_DISPLAY << 16, + .class_mask = 0xff0000, + }, + { } }; MODULE_DEVICE_TABLE(pci, gx1fb_id_table); diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c index c8b1dfa456a3..d756b3603fa6 100644 --- a/drivers/video/fbdev/kyro/fbdev.c +++ b/drivers/video/fbdev/kyro/fbdev.c @@ -645,9 +645,8 @@ static int kyrofb_ioctl(struct fb_info *info, } static const struct pci_device_id kyrofb_pci_tbl[] = { - { PCI_VENDOR_ID_ST, PCI_DEVICE_ID_STG4000, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0, } + { PCI_DEVICE(PCI_VENDOR_ID_ST, PCI_DEVICE_ID_STG4000) }, + { } }; MODULE_DEVICE_TABLE(pci, kyrofb_pci_tbl); diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index e1a4bc7c2318..ac04a19b6849 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -1642,8 +1642,8 @@ static int initMatrox2(struct matrox_fb_info *minfo, struct board *b) int err; static const struct pci_device_id intel_82437[] = { - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437) }, - { }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82437) }, + { } }; DBG(__func__) @@ -2135,35 +2135,23 @@ static void pci_remove_matrox(struct pci_dev* pdev) { static const struct pci_device_id matroxfb_devices[] = { #ifdef CONFIG_FB_MATROX_MILLENIUM - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL_2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MIL_2_AGP, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_MIL) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_MIL_2) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_MIL_2_AGP) }, #endif #ifdef CONFIG_FB_MATROX_MYSTIQUE - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MYS, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_MYS) }, #endif #ifdef CONFIG_FB_MATROX_G - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_MM, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_AGP, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_PCI, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, 0x0532, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_AGP, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G550, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_G100_MM) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_G100_AGP) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_G200_PCI) }, + { PCI_VDEVICE(MATROX, 0x0532) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_G200_AGP) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_G400) }, + { PCI_VDEVICE(MATROX, PCI_DEVICE_ID_MATROX_G550) }, #endif - {0, 0, - 0, 0, 0, 0, 0} + { } }; MODULE_DEVICE_TABLE(pci, matroxfb_devices); diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c index c1cd028b8991..e0b8d4d6ce79 100644 --- a/drivers/video/fbdev/neofb.c +++ b/drivers/video/fbdev/neofb.c @@ -2126,34 +2126,25 @@ static void neofb_remove(struct pci_dev *dev) } static const struct pci_device_id neofb_devices[] = { - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2070, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2070}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2070), .driver_data = FB_ACCEL_NEOMAGIC_NM2070 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2090, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2090}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2090), .driver_data = FB_ACCEL_NEOMAGIC_NM2090 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2093, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2093}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2093), .driver_data = FB_ACCEL_NEOMAGIC_NM2093 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2097, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2097}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2097), .driver_data = FB_ACCEL_NEOMAGIC_NM2097 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2160, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2160}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2160), .driver_data = FB_ACCEL_NEOMAGIC_NM2160 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2200, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2200}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2200), .driver_data = FB_ACCEL_NEOMAGIC_NM2200 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2230, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2230}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2230), .driver_data = FB_ACCEL_NEOMAGIC_NM2230 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2360, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2360}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2360), .driver_data = FB_ACCEL_NEOMAGIC_NM2360 }, - {PCI_VENDOR_ID_NEOMAGIC, PCI_CHIP_NM2380, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_NEOMAGIC_NM2380}, + { PCI_VDEVICE(NEOMAGIC, PCI_CHIP_NM2380), .driver_data = FB_ACCEL_NEOMAGIC_NM2380 }, - {0, 0, 0, 0, 0, 0, 0} + { } }; MODULE_DEVICE_TABLE(pci, neofb_devices); diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c index 72b85f475605..da2d486022e8 100644 --- a/drivers/video/fbdev/nvidia/nvidia.c +++ b/drivers/video/fbdev/nvidia/nvidia.c @@ -58,9 +58,12 @@ #define MAX_CURS 32 static const struct pci_device_id nvidiafb_pci_tbl[] = { - {PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, - PCI_BASE_CLASS_DISPLAY << 16, 0xff0000, 0}, - { 0, } + { + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID), + .class = PCI_BASE_CLASS_DISPLAY << 16, + .class_mask = 0xff0000 + }, + { } }; MODULE_DEVICE_TABLE(pci, nvidiafb_pci_tbl); diff --git a/drivers/video/fbdev/pm2fb.c b/drivers/video/fbdev/pm2fb.c index f34429829b7d..412ff249b5c7 100644 --- a/drivers/video/fbdev/pm2fb.c +++ b/drivers/video/fbdev/pm2fb.c @@ -1748,13 +1748,10 @@ static void pm2fb_remove(struct pci_dev *pdev) } static const struct pci_device_id pm2fb_id_table[] = { - { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TVP4020, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2V, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0, } + { PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_TVP4020) }, + { PCI_VDEVICE(3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2) }, + { PCI_VDEVICE(3DLABS, PCI_DEVICE_ID_3DLABS_PERMEDIA2V) }, + { } }; static struct pci_driver pm2fb_driver = { diff --git a/drivers/video/fbdev/pm3fb.c b/drivers/video/fbdev/pm3fb.c index 6e55e42514d6..6f552ae36219 100644 --- a/drivers/video/fbdev/pm3fb.c +++ b/drivers/video/fbdev/pm3fb.c @@ -1486,9 +1486,8 @@ static void pm3fb_remove(struct pci_dev *dev) } static const struct pci_device_id pm3fb_id_table[] = { - { PCI_VENDOR_ID_3DLABS, 0x0a, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0, } + { PCI_VDEVICE(3DLABS, 0x000a) }, + { } }; /* For PCI drivers */ diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index 3f6384e631b1..9428716e2dc4 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -993,9 +993,8 @@ static void pvr2fb_pci_remove(struct pci_dev *pdev) } static const struct pci_device_id pvr2fb_pci_tbl[] = { - { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NEON250, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0, }, + { PCI_VDEVICE(NEC, PCI_DEVICE_ID_NEC_NEON250) }, + { } }; MODULE_DEVICE_TABLE(pci, pvr2fb_pci_tbl); diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c index 1e377b2ec089..2268fea4d807 100644 --- a/drivers/video/fbdev/riva/fbdev.c +++ b/drivers/video/fbdev/riva/fbdev.c @@ -103,92 +103,50 @@ static int rivafb_blank(int blank, struct fb_info *info); * ------------------------------------------------------------------------- */ static const struct pci_device_id rivafb_pci_tbl[] = { - { PCI_VENDOR_ID_NVIDIA_SGS, PCI_DEVICE_ID_NVIDIA_SGS_RIVA128, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_UTNT2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_VTNT2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_UVTNT2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_ITNT2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO2_MXR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO2_PRO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_460, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA_SGS, PCI_DEVICE_ID_NVIDIA_SGS_RIVA128) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TNT2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_UTNT2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_VTNT2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_UVTNT2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_ITNT2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GO) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO2_MXR) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO2_PRO) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_460) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440) }, // NF2/IGP version, GeForce 4 MX, NV18 - { PCI_VENDOR_ID_NVIDIA, 0x01f0, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO_M32, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_500XGL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO_M64, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_200, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_550XGL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_500_GOGL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_IGEFORCE2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE3, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE3_1, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE3_2, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO_DDC, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4600, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4400, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4200, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO_5200, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0, } /* terminate list */ + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x01f0) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO_M32) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_500XGL) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO_M64) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_200) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_550XGL) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_500_GOGL) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_IGEFORCE2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE3) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE3_1) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE3_2) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO_DDC) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4600) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4400) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4200) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO_5200) }, + { } /* terminate list */ }; MODULE_DEVICE_TABLE(pci, rivafb_pci_tbl); diff --git a/drivers/video/fbdev/s3fb.c b/drivers/video/fbdev/s3fb.c index ba30e5568cab..831e9e6861b1 100644 --- a/drivers/video/fbdev/s3fb.c +++ b/drivers/video/fbdev/s3fb.c @@ -1563,24 +1563,24 @@ static const struct dev_pm_ops s3_pci_pm_ops = { /* List of boards that we are trying to support */ static const struct pci_device_id s3_devices[] = { - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8810), .driver_data = CHIP_XXX_TRIO}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8811), .driver_data = CHIP_XXX_TRIO}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8814), .driver_data = CHIP_767_TRIO64UVP}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8901), .driver_data = CHIP_XXX_TRIO64V2_DXGX}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8902), .driver_data = CHIP_551_PLATO_PX}, + { PCI_VDEVICE(S3, 0x8810), .driver_data = CHIP_XXX_TRIO }, + { PCI_VDEVICE(S3, 0x8811), .driver_data = CHIP_XXX_TRIO }, + { PCI_VDEVICE(S3, 0x8812), .driver_data = CHIP_M65_AURORA64VP }, + { PCI_VDEVICE(S3, 0x8814), .driver_data = CHIP_767_TRIO64UVP }, + { PCI_VDEVICE(S3, 0x8901), .driver_data = CHIP_XXX_TRIO64V2_DXGX }, + { PCI_VDEVICE(S3, 0x8902), .driver_data = CHIP_551_PLATO_PX }, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x5631), .driver_data = CHIP_325_VIRGE}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x883D), .driver_data = CHIP_988_VIRGE_VX}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A01), .driver_data = CHIP_XXX_VIRGE_DXGX}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A10), .driver_data = CHIP_357_VIRGE_GX2}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A11), .driver_data = CHIP_359_VIRGE_GX2P}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A12), .driver_data = CHIP_359_VIRGE_GX2P}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A13), .driver_data = CHIP_36X_TRIO3D_1X_2X}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8904), .driver_data = CHIP_365_TRIO3D}, - {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8C01), .driver_data = CHIP_260_VIRGE_MX}, + { PCI_VDEVICE(S3, 0x5631), .driver_data = CHIP_325_VIRGE }, + { PCI_VDEVICE(S3, 0x883D), .driver_data = CHIP_988_VIRGE_VX }, + { PCI_VDEVICE(S3, 0x8A01), .driver_data = CHIP_XXX_VIRGE_DXGX }, + { PCI_VDEVICE(S3, 0x8A10), .driver_data = CHIP_357_VIRGE_GX2 }, + { PCI_VDEVICE(S3, 0x8A11), .driver_data = CHIP_359_VIRGE_GX2P }, + { PCI_VDEVICE(S3, 0x8A12), .driver_data = CHIP_359_VIRGE_GX2P }, + { PCI_VDEVICE(S3, 0x8A13), .driver_data = CHIP_36X_TRIO3D_1X_2X }, + { PCI_VDEVICE(S3, 0x8904), .driver_data = CHIP_365_TRIO3D }, + { PCI_VDEVICE(S3, 0x8C01), .driver_data = CHIP_260_VIRGE_MX }, - {0, 0, 0, 0, 0, 0, 0} + { } }; diff --git a/drivers/video/fbdev/savage/savagefb_driver.c b/drivers/video/fbdev/savage/savagefb_driver.c index c2f79357c8da..7789196d2eb5 100644 --- a/drivers/video/fbdev/savage/savagefb_driver.c +++ b/drivers/video/fbdev/savage/savagefb_driver.c @@ -2449,76 +2449,78 @@ static const struct dev_pm_ops savagefb_pm_ops = { }; static const struct pci_device_id savagefb_devices[] = { - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX128, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, + { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_MX128), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_MX64), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_MX64C), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_IX128SDR), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_IX128DDR), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_IX64SDR), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_IX64DDR), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_IXCSDR), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SUPSAV_IXCDDR), + .driver_data = FB_ACCEL_SUPERSAVAGE, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE4), + .driver_data = FB_ACCEL_SAVAGE4, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE3D), + .driver_data = FB_ACCEL_SAVAGE3D, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE3D_MV), + .driver_data = FB_ACCEL_SAVAGE3D_MV, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE2000), + .driver_data = FB_ACCEL_SAVAGE2000, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE_MX_MV), + .driver_data = FB_ACCEL_SAVAGE_MX_MV, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE_MX), + .driver_data = FB_ACCEL_SAVAGE_MX, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE_IX_MV), + .driver_data = FB_ACCEL_SAVAGE_IX_MV, + }, { + PCI_VDEVICE(S3, PCI_CHIP_SAVAGE_IX), + .driver_data = FB_ACCEL_SAVAGE_IX, + }, { + PCI_VDEVICE(S3, PCI_CHIP_PROSAVAGE_PM), + .driver_data = FB_ACCEL_PROSAVAGE_PM, + }, { + PCI_VDEVICE(S3, PCI_CHIP_PROSAVAGE_KM), + .driver_data = FB_ACCEL_PROSAVAGE_KM, + }, { + PCI_VDEVICE(S3, PCI_CHIP_S3TWISTER_P), + .driver_data = FB_ACCEL_S3TWISTER_P, + }, { + PCI_VDEVICE(S3, PCI_CHIP_S3TWISTER_K), + .driver_data = FB_ACCEL_S3TWISTER_K, + }, { + PCI_VDEVICE(S3, PCI_CHIP_PROSAVAGE_DDR), + .driver_data = FB_ACCEL_PROSAVAGE_DDR, + }, { + PCI_VDEVICE(S3, PCI_CHIP_PROSAVAGE_DDRK), + .driver_data = FB_ACCEL_PROSAVAGE_DDRK, + }, - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX64, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_MX64C, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_IX128SDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_IX128DDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_IX64SDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_IX64DDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_IXCSDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SUPSAV_IXCDDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE4, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE4}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE3D, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE3D}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE3D_MV, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE3D_MV}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE2000, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE2000}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE_MX_MV, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_MX_MV}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE_MX, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_MX}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE_IX_MV, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_IX_MV}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_SAVAGE_IX, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_IX}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_PROSAVAGE_PM, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_PM}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_PROSAVAGE_KM, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_KM}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_S3TWISTER_P, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_S3TWISTER_P}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_S3TWISTER_K, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_S3TWISTER_K}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_PROSAVAGE_DDR, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_DDR}, - - {PCI_VENDOR_ID_S3, PCI_CHIP_PROSAVAGE_DDRK, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_DDRK}, - - {0, 0, 0, 0, 0, 0, 0} + { } }; MODULE_DEVICE_TABLE(pci, savagefb_devices); diff --git a/drivers/video/fbdev/sis/sis_main.h b/drivers/video/fbdev/sis/sis_main.h index 0965db9fad6a..4ca487f48205 100644 --- a/drivers/video/fbdev/sis/sis_main.h +++ b/drivers/video/fbdev/sis/sis_main.h @@ -102,22 +102,22 @@ static struct sisfb_chip_info { static struct pci_device_id sisfb_pci_table[] = { #ifdef CONFIG_FB_SIS_300 - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_300), .driver_data = 0 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_540_VGA), .driver_data = 1 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_630_VGA), .driver_data = 2 }, #endif #ifdef CONFIG_FB_SIS_315 - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, - { PCI_VENDOR_ID_XGI,PCI_DEVICE_ID_XGI_20, PCI_ANY_ID, PCI_ANY_ID, 0, 0,10}, - { PCI_VENDOR_ID_XGI,PCI_DEVICE_ID_XGI_40, PCI_ANY_ID, PCI_ANY_ID, 0, 0,11}, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_315H), .driver_data = 3 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_315), .driver_data = 4 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_315PRO), .driver_data = 5 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_550_VGA), .driver_data = 6 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_650_VGA), .driver_data = 7 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_330), .driver_data = 8 }, + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_660_VGA), .driver_data = 9 }, + { PCI_VDEVICE(XGI, PCI_DEVICE_ID_XGI_20), .driver_data = 10 }, + { PCI_VDEVICE(XGI, PCI_DEVICE_ID_XGI_40), .driver_data = 11 }, #endif - { 0 } + { } }; MODULE_DEVICE_TABLE(pci, sisfb_pci_table); diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c index 4c4e53aaea3a..a6b63c09b48f 100644 --- a/drivers/video/fbdev/tdfxfb.c +++ b/drivers/video/fbdev/tdfxfb.c @@ -124,16 +124,17 @@ static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id); static void tdfxfb_remove(struct pci_dev *pdev); static const struct pci_device_id tdfxfb_id_table[] = { - { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE, - PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, - 0xff0000, 0 }, - { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3, - PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, - 0xff0000, 0 }, - { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5, - PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, - 0xff0000, 0 }, - { 0, } + { + PCI_DEVICE(PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE), + .class = PCI_BASE_CLASS_DISPLAY << 16, .class_mask = 0xff0000, + }, { + PCI_DEVICE(PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3), + .class = PCI_BASE_CLASS_DISPLAY << 16, .class_mask = 0xff0000, + }, { + PCI_DEVICE(PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5), + .class = PCI_BASE_CLASS_DISPLAY << 16, .class_mask = 0xff0000, + }, + { } }; static struct pci_driver tdfxfb_driver = { diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c index 17b7253b8fbe..a8fdbae83a80 100644 --- a/drivers/video/fbdev/tridentfb.c +++ b/drivers/video/fbdev/tridentfb.c @@ -1736,28 +1736,28 @@ static void trident_pci_remove(struct pci_dev *dev) /* List of boards that we are trying to support */ static const struct pci_device_id trident_devices[] = { - {PCI_VENDOR_ID_TRIDENT, BLADE3D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi7D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEi1D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEAi1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEAi1D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEE4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, TGUI9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, TGUI9660, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, IMAGE975, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, IMAGE985, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBER9320, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBER9388, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBER9520, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBER9525DVD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBER9397, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBER9397DVD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEXPAi1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEXPm8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_TRIDENT, CYBERBLADEXPm16, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0,} + { PCI_VDEVICE(TRIDENT, BLADE3D) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEi7) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEi7D) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEi1) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEi1D) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEAi1) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEAi1D) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEE4) }, + { PCI_VDEVICE(TRIDENT, TGUI9440) }, + { PCI_VDEVICE(TRIDENT, TGUI9660) }, + { PCI_VDEVICE(TRIDENT, IMAGE975) }, + { PCI_VDEVICE(TRIDENT, IMAGE985) }, + { PCI_VDEVICE(TRIDENT, CYBER9320) }, + { PCI_VDEVICE(TRIDENT, CYBER9388) }, + { PCI_VDEVICE(TRIDENT, CYBER9520) }, + { PCI_VDEVICE(TRIDENT, CYBER9525DVD) }, + { PCI_VDEVICE(TRIDENT, CYBER9397) }, + { PCI_VDEVICE(TRIDENT, CYBER9397DVD) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEXPAi1) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEXPm8) }, + { PCI_VDEVICE(TRIDENT, CYBERBLADEXPm16) }, + { } }; MODULE_DEVICE_TABLE(pci, trident_devices); diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c index df984f3a7ff6..9708d968970a 100644 --- a/drivers/video/fbdev/vt8623fb.c +++ b/drivers/video/fbdev/vt8623fb.c @@ -900,8 +900,8 @@ static const struct dev_pm_ops vt8623_pci_pm_ops = { /* List of boards that we are trying to support */ static const struct pci_device_id vt8623_devices[] = { - {PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122)}, - {0, 0, 0, 0, 0, 0, 0} + { PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x3122) }, + { } }; MODULE_DEVICE_TABLE(pci, vt8623_devices); From 84202754fb1727dc3ee87f47104e4162ecc8ba3a Mon Sep 17 00:00:00 2001 From: Jiacheng Yu Date: Thu, 14 May 2026 17:19:18 +0800 Subject: [PATCH 05/43] fbcon: Use correct type for vc_resize() return value The return value of vc_resize() is int, but fbcon_set_disp() stores it in an unsigned long variable. While the !ret check happens to work correctly by coincidence (negative values become large positive values), the types should match. Use int instead. Eliminates the following W=3 warning: drivers/video/fbdev/core/fbcon.c: In function 'fbcon_set_disp': drivers/video/fbdev/core/fbcon.c:1494:14: warning: implicit conversion from 'int' to 'unsigned long' [-Wconversion] Fixes: af0db3c1f898 ("fbdev: Fix vmalloc out-of-bounds write in fast_imageblit") Cc: stable@vger.kernel.org # v6.17+ Signed-off-by: Jiacheng Yu Reviewed-by: Thomas Zimmermann Signed-off-by: Helge Deller --- drivers/video/fbdev/core/fbcon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index b0e3e765360d..641687a734d5 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -1440,8 +1440,7 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, struct vc_data **default_mode, *vc; struct vc_data *svc; struct fbcon_par *par = info->fbcon_par; - int rows, cols; - unsigned long ret = 0; + int rows, cols, ret; p = &fb_display[unit]; From 3b069f0596e169bc1b1a991fbba64ffaefe8de75 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 18 May 2026 14:13:03 -0700 Subject: [PATCH 06/43] fbdev: imxfb: Use of_device_get_match_data() Use of_device_get_match_data() to fetch the platform ID entry directly instead of open-coding an of_match_device() lookup. No NULL check is needed as every compatible string has a corresponding data section. This also lets the driver drop the of_device.h include. Assisted-by: Codex:GPT-5.5 Signed-off-by: Rosen Penev Signed-off-by: Helge Deller --- drivers/video/fbdev/imxfb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index a077bf346bdf..7a021da0a32a 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -880,7 +879,6 @@ static int imxfb_probe(struct platform_device *pdev) struct lcd_device *lcd; struct fb_info *info; struct imx_fb_videomode *m; - const struct of_device_id *of_id; struct device_node *display_np; int ret, i; int bytes_per_pixel; @@ -891,9 +889,7 @@ static int imxfb_probe(struct platform_device *pdev) if (ret < 0) return ret; - of_id = of_match_device(imxfb_of_dev_id, &pdev->dev); - if (of_id) - pdev->id_entry = of_id->data; + pdev->id_entry = of_device_get_match_data(&pdev->dev); info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); if (!info) From 9402555579cf203151755f51b19ef0b4ecb9da71 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 18 May 2026 17:36:13 -0700 Subject: [PATCH 07/43] fbdev: atmel_lcdfb: Use of_device_get_match_data() Use of_device_get_match_data() to retrieve the driver match data instead of open-coding the OF match lookup and dereferencing match->data. This also removes the deprecated of_device.h include from the driver. No need for NULL check as every compatible has a corresponding data component. Assisted-by: Codex:GPT-5.5 Signed-off-by: Rosen Penev Signed-off-by: Helge Deller --- drivers/video/fbdev/atmel_lcdfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 9dfbc5310210..87406a5a2dcf 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -21,7 +21,6 @@ #include #include #include -#include #include