#endif 
static int __init aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent){	struct fb_info *info = pci_get_drvdata(pdev);	struct aty128fb_par *par = info->par;	struct fb_var_screeninfo var;	char video_card[DEVICE_NAME_SIZE];	u8 chip_rev;	u32 dac;	if (!par->vram_size)	/* may have already been probed */		par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;	/* Get the chip revision */	chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;	strcpy(video_card, "Rage128 XX ");	video_card[8] = ent->device >> 8;	video_card[9] = ent->device & 0xFF;	    	/* range check to make sure */	if (ent->driver_data < (sizeof(r128_family)/sizeof(char *)))	    strncat(video_card, r128_family[ent->driver_data], sizeof(video_card));	printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev);	if (par->vram_size % (1024 * 1024) == 0)		printk("%dM %s\n", par->vram_size / (1024*1024), par->mem->name);	else		printk("%dk %s\n", par->vram_size / 1024, par->mem->name);	par->chip_gen = ent->driver_data;	/* fill in info */	info->fbops = &aty128fb_ops;	info->flags = FBINFO_FLAG_DEFAULT;#ifdef CONFIG_PMAC_PBOOK	par->lcd_on = default_lcd_on;	par->crt_on = default_crt_on;#endif	var = default_var;#ifdef CONFIG_PPC_PMAC	if (_machine == _MACH_Pmac) {		/* Indicate sleep capability */		if (par->chip_gen == rage_M3) {			pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1);			pmac_set_early_video_resume(aty128_early_resume, par);		}		/* Find default mode */		if (mode_option) {			if (!mac_find_mode(&var, info, mode_option, 8))				var = default_var;		} else {			if (default_vmode <= 0 || default_vmode > VMODE_MAX)				default_vmode = VMODE_1024_768_60;			/* iMacs need that resolution			 * PowerMac2,1 first r128 iMacs			 * PowerMac2,2 summer 2000 iMacs			 * PowerMac4,1 january 2001 iMacs "flower power"			 */			if (machine_is_compatible("PowerMac2,1") ||			    machine_is_compatible("PowerMac2,2") ||			    machine_is_compatible("PowerMac4,1"))				default_vmode = VMODE_1024_768_75;			/* iBook SE */			if (machine_is_compatible("PowerBook2,2"))				default_vmode = VMODE_800_600_60;			/* PowerBook Firewire (Pismo), iBook Dual USB */			if (machine_is_compatible("PowerBook3,1") ||			    machine_is_compatible("PowerBook4,1"))				default_vmode = VMODE_1024_768_60;			/* PowerBook Titanium */			if (machine_is_compatible("PowerBook3,2"))				default_vmode = VMODE_1152_768_60;				if (default_cmode > 16) 			    default_cmode = CMODE_32;			else if (default_cmode > 8) 			    default_cmode = CMODE_16;			else 			    default_cmode = CMODE_8;			if (mac_vmode_to_var(default_vmode, default_cmode, &var))				var = default_var;		}	} else#endif /* CONFIG_PPC_PMAC */	{		if (mode_option)			if (fb_find_mode(&var, info, mode_option, NULL, 					 0, &defaultmode, 8) == 0)				var = default_var;	}	var.accel_flags &= ~FB_ACCELF_TEXT;//	var.accel_flags |= FB_ACCELF_TEXT;/* FIXME Will add accel later */	if (aty128fb_check_var(&var, info)) {		printk(KERN_ERR "aty128fb: Cannot set default mode.\n");		return 0;	}	/* setup the DAC the way we like it */	dac = aty_ld_le32(DAC_CNTL);	dac |= (DAC_8BIT_EN | DAC_RANGE_CNTL);	dac |= DAC_MASK;	if (par->chip_gen == rage_M3)		dac |= DAC_PALETTE2_SNOOP_EN;	aty_st_le32(DAC_CNTL, dac);	/* turn off bus mastering, just in case */	aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL) | BUS_MASTER_DIS);	info->var = var;	fb_alloc_cmap(&info->cmap, 256, 0);	var.activate = FB_ACTIVATE_NOW;	aty128_init_engine(par);	if (register_framebuffer(info) < 0)		return 0;#ifdef CONFIG_PMAC_BACKLIGHT	/* Could be extended to Rage128Pro LVDS output too */	if (par->chip_gen == rage_M3)		register_backlight_controller(&aty128_backlight_controller, par, "ati");#endif /* CONFIG_PMAC_BACKLIGHT */	par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);	par->pdev = pdev;	par->asleep = 0;	par->lock_blank = 0;		printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",	       info->node, info->fix.id, video_card);	return 1;	/* success! */}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8c8709334cec803368a432a33e0f2e116d48fe07/aty128fb.c/buggy/drivers/video/aty/aty128fb.c