static int __devinit fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id) { struct fb_info *info; unsigned long *ptr; int is_fm; int x, y; is_fm = z->id == ZORRO_PROD_BSC_FRAMEMASTER_II; if (!zorro_request_device(z,"fm2fb")) return -ENXIO; info = framebuffer_alloc(256 * sizeof(u32), &z->dev); if (!info) { zorro_release_device(z); return -ENOMEM; } if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { framebuffer_release(info); zorro_release_device(z); return -ENOMEM; } /* assigning memory to kernel space */ fb_fix.smem_start = zorro_resource_start(z); info->screen_base = ioremap(fb_fix.smem_start, FRAMEMASTER_SIZE); fb_fix.mmio_start = fb_fix.smem_start + FRAMEMASTER_REG; fm2fb_reg = (unsigned char *)(info->screen_base+FRAMEMASTER_REG); strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II"); /* make EBU color bars on display */ ptr = (unsigned long *)fb_fix.smem_start; for (y = 0; y < 576; y++) { for (x = 0; x < 96; x++) *ptr++ = 0xffffff;/* white */ for (x = 0; x < 96; x++) *ptr++ = 0xffff00;/* yellow */ for (x = 0; x < 96; x++) *ptr++ = 0x00ffff;/* cyan */ for (x = 0; x < 96; x++) *ptr++ = 0x00ff00;/* green */ for (x = 0; x < 96; x++) *ptr++ = 0xff00ff;/* magenta */ for (x = 0; x < 96; x++) *ptr++ = 0xff0000;/* red */ for (x = 0; x < 96; x++) *ptr++ = 0x0000ff;/* blue */ for (x = 0; x < 96; x++) *ptr++ = 0x000000;/* black */ } fm2fb_blank(0, info); if (fm2fb_mode == -1) fm2fb_mode = FM2FB_MODE_PAL; info->fbops = &fm2fb_ops; info->var = fb_var_modes[fm2fb_mode]; info->pseudo_palette = info->par; info->par = NULL; info->fix = fb_fix; info->flags = FBINFO_DEFAULT; if (register_framebuffer(info) < 0) { fb_dealloc_cmap(&info->cmap); framebuffer_release(info); zorro_release_device(z); return -EINVAL; } printk("fb%d: %s frame buffer device\n", info->node, fb_fix.id); return 0; }
static int __devinit zorro7xx_init_one(struct zorro_dev *z, const struct zorro_device_id *ent) { struct Scsi_Host * host = NULL; struct NCR_700_Host_Parameters *hostdata; struct zorro_driver_data *zdd; unsigned long board, ioaddr; board = zorro_resource_start(z); zdd = (struct zorro_driver_data *)ent->driver_data; if (zdd->absolute) { ioaddr = zdd->offset; } else { ioaddr = board + zdd->offset; } if (!zorro_request_device(z, zdd->name)) { printk(KERN_ERR "zorro7xx: cannot reserve region 0x%lx, abort\n", board); return -EBUSY; } hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); if (hostdata == NULL) { printk(KERN_ERR "zorro7xx: Failed to allocate host data\n"); goto out_release; } memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters)); /* Fill in the required pieces of hostdata */ if (ioaddr > 0x01000000) hostdata->base = ioremap(ioaddr, zorro_resource_len(z)); else hostdata->base = (void __iomem *)ZTWO_VADDR(ioaddr); hostdata->clock = 50; hostdata->chip710 = 1; /* Settings for at least WarpEngine 40xx */ hostdata->ctest7_extra = CTEST7_TT1; zorro7xx_scsi_driver_template.name = zdd->name; /* and register the chip */ host = NCR_700_detect(&zorro7xx_scsi_driver_template, hostdata, &z->dev); if (!host) { printk(KERN_ERR "zorro7xx: No host detected; " "board configuration problem?\n"); goto out_free; } host->this_id = 7; host->base = ioaddr; host->irq = IRQ_AMIGA_PORTS; if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "zorro7xx-scsi", host)) { printk(KERN_ERR "zorro7xx: request_irq failed\n"); goto out_put_host; } zorro_set_drvdata(z, host); scsi_scan_host(host); return 0; out_put_host: scsi_host_put(host); out_free: if (ioaddr > 0x01000000) iounmap(hostdata->base); kfree(hostdata); out_release: zorro_release_device(z); return -ENODEV; }