/* enable LCD controller clock */ pxa_set_cken(CKEN16_LCD, 1); 
int __init pxafb_probe(struct device *dev){	struct pxafb_info *fbi;	struct pxafb_mach_info *inf;	int ret;	dev_dbg(dev, "pxafb_probe\n");	inf = dev->platform_data;	ret = -ENOMEM;	fbi = NULL;	if (!inf)		goto failed;#ifdef CONFIG_FB_PXA_PARAMETERS	ret = pxafb_parse_options(dev, g_options);	if (ret < 0)		goto failed;#endif#ifdef DEBUG_VAR        /* Check for various illegal bit-combinations. Currently only	 * a warning is given. */        if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)                dev_warn(dev, "machine LCCR0 setting contains illegal bits: %08x\n",                        inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);        if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)                dev_warn(dev, "machine LCCR3 setting contains illegal bits: %08x\n",                        inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);        if (inf->lccr0 & LCCR0_DPD &&	    ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||	     (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||	     (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))                dev_warn(dev, "Double Pixel Data (DPD) mode is only valid in passive mono"			 " single panel mode\n");        if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&	    (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)                dev_warn(dev, "Dual panel only valid in passive mode\n");        if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&             (inf->upper_margin || inf->lower_margin))                dev_warn(dev, "Upper and lower margins must be 0 in passive mode\n");#endif	dev_dbg(dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp);	if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) {		dev_err(dev, "Invalid resolution or bit depth\n");		ret = -EINVAL;		goto failed;	}	pxafb_backlight_power = inf->pxafb_backlight_power;	pxafb_lcd_power = inf->pxafb_lcd_power;	fbi = pxafb_init_fbinfo(dev);	if (!fbi) {		dev_err(dev, "Failed to initialize framebuffer device\n");		ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc		goto failed;	}	/* Initialize video memory */	ret = pxafb_map_video_memory(fbi);	if (ret) {		dev_err(dev, "Failed to allocate video RAM: %d\n", ret);		ret = -ENOMEM;		goto failed;	}	/* enable LCD controller clock */	pxa_set_cken(CKEN16_LCD, 1);	ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi);	if (ret) {		dev_err(dev, "request_irq failed: %d\n", ret);		ret = -EBUSY;		goto failed;	}	/*	 * This makes sure that our colour bitfield	 * descriptors are correctly initialised.	 */	pxafb_check_var(&fbi->fb.var, &fbi->fb);	pxafb_set_par(&fbi->fb);	dev_set_drvdata(dev, fbi);	ret = register_framebuffer(&fbi->fb);	if (ret < 0) {		dev_err(dev, "Failed to register framebuffer device: %d\n", ret);		goto failed;	}#ifdef CONFIG_PM	// TODO#endif#ifdef CONFIG_CPU_FREQ	fbi->freq_transition.notifier_call = pxafb_freq_transition;	fbi->freq_policy.notifier_call = pxafb_freq_policy;	cpufreq_register_notifier(&fbi->freq_transition, CPUFREQ_TRANSITION_NOTIFIER);	cpufreq_register_notifier(&fbi->freq_policy, CPUFREQ_POLICY_NOTIFIER);#endif	/*	 * Ok, now enable the LCD controller	 */	set_ctrlr_state(fbi, C_ENABLE);	return 0;failed:	dev_set_drvdata(dev, NULL);	kfree(fbi);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8d3722667762af1490db18ba927386d3be89a32b/pxafb.c/clean/drivers/video/pxafb.c