[PATCH] Xilinx framebuffer device driver
Arnd Bergmann
arnd at arndb.de
Wed Apr 25 08:35:18 EST 2007
> + .activate = FB_ACTIVATE_NOW,
> + .height = 99, /* in mm of NEC NL6448BC20-08 on ML300 */
> + .width = 132 /* in mm of NEC NL6448BC20-08 on ML300 */
> +};
The size looks very specific to a particular display hardware. I guess
when the driver gets converted to an of_platform_driver, this should come
from the device tree.
Until then, maybe a config option, with a reasonable default would be
right.
> +
> +struct xilinxfb_drvdata {
> +
> + struct fb_info info; /* FB driver info record */
> +
> + unsigned long regs_phys; /* phys. address of the control registers */
> + u32 *regs; /* virt. address of the control registers */
> +
> + unsigned char *fb_virt; /* virt. address of the frame buffer */
The virtual addresses should be marked as __iomem, so you can check the correct
usage with sparse.
Not sure about regs_phys. Can this be beyond the 32 bit limit on any machine?
> +
> + drvdata = kmalloc(sizeof(struct xilinxfb_drvdata), GFP_KERNEL);
> + if (!drvdata) {
> + printk(KERN_ERR "Couldn't allocate device private record\n");
> + return -ENOMEM;
> + }
> + memset((void*)drvdata, 0, sizeof(struct xilinxfb_drvdata));
Use
drvdata = kzalloc(sizeof (*drvdata), GFP_KERNEL);
> + drvdata->regs_phys = regs_res->start;
> + drvdata->regs = (u32 *) ioremap(regs_res->start, 8);
u32 __iomem*
Arnd <><
More information about the Linuxppc-embedded
mailing list