^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* sunxvr2500.c: Sun 3DLABS XVR-2500 et al. fb driver for sparc64 systems
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * License: GPL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/fb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/of_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct s3d_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct fb_info *info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct pci_dev *pdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) char __iomem *fb_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) unsigned long fb_base_phys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct device_node *of_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) unsigned int width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) unsigned int height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) unsigned int depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) unsigned int fb_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) u32 pseudo_palette[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) static int s3d_get_props(struct s3d_info *sp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) sp->width = of_getintprop_default(sp->of_node, "width", 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) sp->height = of_getintprop_default(sp->of_node, "height", 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) sp->depth = of_getintprop_default(sp->of_node, "depth", 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) if (!sp->width || !sp->height) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) printk(KERN_ERR "s3d: Critical properties missing for %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) pci_name(sp->pdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) static int s3d_setcolreg(unsigned regno,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) unsigned red, unsigned green, unsigned blue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) unsigned transp, struct fb_info *info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) u32 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) if (regno < 16) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) red >>= 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) green >>= 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) blue >>= 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) value = (blue << 24) | (green << 16) | (red << 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) ((u32 *)info->pseudo_palette)[regno] = value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) static const struct fb_ops s3d_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) .owner = THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) .fb_setcolreg = s3d_setcolreg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) .fb_fillrect = cfb_fillrect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) .fb_copyarea = cfb_copyarea,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) .fb_imageblit = cfb_imageblit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) static int s3d_set_fbinfo(struct s3d_info *sp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) struct fb_info *info = sp->info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct fb_var_screeninfo *var = &info->var;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) info->flags = FBINFO_DEFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) info->fbops = &s3d_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) info->screen_base = sp->fb_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) info->screen_size = sp->fb_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) info->pseudo_palette = sp->pseudo_palette;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) /* Fill fix common fields */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) strlcpy(info->fix.id, "s3d", sizeof(info->fix.id));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) info->fix.smem_start = sp->fb_base_phys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) info->fix.smem_len = sp->fb_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) info->fix.type = FB_TYPE_PACKED_PIXELS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) if (sp->depth == 32 || sp->depth == 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) info->fix.visual = FB_VISUAL_TRUECOLOR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) var->xres = sp->width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) var->yres = sp->height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) var->xres_virtual = var->xres;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) var->yres_virtual = var->yres;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) var->bits_per_pixel = sp->depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) var->red.offset = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) var->red.length = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) var->green.offset = 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) var->green.length = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) var->blue.offset = 24;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) var->blue.length = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) var->transp.offset = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) var->transp.length = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) if (fb_alloc_cmap(&info->cmap, 256, 0)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) printk(KERN_ERR "s3d: Cannot allocate color map.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) static int s3d_pci_register(struct pci_dev *pdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) const struct pci_device_id *ent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) struct fb_info *info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) struct s3d_info *sp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) err = pci_enable_device(pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) if (err < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) printk(KERN_ERR "s3d: Cannot enable PCI device %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) pci_name(pdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) goto err_out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) info = framebuffer_alloc(sizeof(struct s3d_info), &pdev->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) if (!info) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) err = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) goto err_disable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) sp = info->par;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) sp->info = info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) sp->pdev = pdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) sp->of_node = pci_device_to_OF_node(pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) if (!sp->of_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) printk(KERN_ERR "s3d: Cannot find OF node of %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) pci_name(pdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) err = -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) goto err_release_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) sp->fb_base_phys = pci_resource_start (pdev, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) err = pci_request_region(pdev, 1, "s3d framebuffer");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) if (err < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) printk("s3d: Cannot request region 1 for %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) pci_name(pdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) goto err_release_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) err = s3d_get_props(sp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) goto err_release_pci;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) /* XXX 'linebytes' is often wrong, it is equal to the width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * XXX with depth of 32 on my XVR-2500 which is clearly not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * XXX right. So we don't try to use it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) switch (sp->depth) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) case 8:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) info->fix.line_length = sp->width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) case 16:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) info->fix.line_length = sp->width * 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) case 24:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) info->fix.line_length = sp->width * 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) case 32:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) info->fix.line_length = sp->width * 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) sp->fb_size = info->fix.line_length * sp->height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) if (!sp->fb_base) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) err = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) goto err_release_pci;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) err = s3d_set_fbinfo(sp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) goto err_unmap_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) pci_set_drvdata(pdev, info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) printk("s3d: Found device at %s\n", pci_name(pdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) err = register_framebuffer(info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) if (err < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) printk(KERN_ERR "s3d: Could not register framebuffer %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) pci_name(pdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) goto err_unmap_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) err_unmap_fb:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) iounmap(sp->fb_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) err_release_pci:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) pci_release_region(pdev, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) err_release_fb:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) framebuffer_release(info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) err_disable:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) pci_disable_device(pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) err_out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) static const struct pci_device_id s3d_pci_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002c), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002d), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002e), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x002f), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x0030), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x0031), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x0032), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x0033), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) { 0, }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) static struct pci_driver s3d_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) .driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) .suppress_bind_attrs = true,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) .name = "s3d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) .id_table = s3d_pci_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) .probe = s3d_pci_register,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) static int __init s3d_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) if (fb_get_options("s3d", NULL))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) return pci_register_driver(&s3d_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) device_initcall(s3d_init);