err_req_gpio: while (--i >= 0)
gpio_free(gpios[i]);
return err;
}
staticvoid am200_cleanup(struct metronomefb_par *par)
{ int i;
free_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), par);
for (i = 0; i < ARRAY_SIZE(gpios); i++)
gpio_free(gpios[i]);
}
staticint am200_share_video_mem(struct fb_info *info)
{ /* rough check if this is our desired fb and not something else */ if ((info->var.xres != am200_fb_info.modes->xres)
|| (info->var.yres != am200_fb_info.modes->yres)) return0;
/* we've now been notified that we have our new fb */
am200_board.metromem = info->screen_base;
am200_board.host_fbinfo = info;
/* try to refcount host drv since we are the consumer after this */ if (!try_module_get(info->fbops->owner)) return -ENODEV;
/* this gets called as part of our init. these steps must be done now so
* that we can use pxa_set_fb_info */ staticvoid __init am200_presetup_fb(void)
{ int fw; int fh; int padding_size; int totalsize;
/* waveform must be 16k + 2 for checksum */
am200_board.wfm_size = roundup(16*1024 + 2, fw);
padding_size = PAGE_SIZE + (4 * fw);
/* total is 1 cmd , 1 wfm, padding and image */
totalsize = fw + am200_board.wfm_size + padding_size + (fw*fh);
/* save this off because we're manipulating fw after this and
* we'll need it when we're ready to setup the framebuffer */
am200_board.fw = fw;
am200_board.fh = fh;
/* the reason we do this adjustment is because we want to acquire *moreframebuffermemorywithoutimposingcustomawarenessonthe
* underlying pxafb driver */
am200_fb_info.modes->yres = DIV_ROUND_UP(totalsize, fw);
/* we divide since we told the LCD controller we're 16bpp */
am200_fb_info.modes->xres /= 2;
pxa_set_fb_info(NULL, &am200_fb_info);
}
/* this gets called by metronomefb as part of its init, in our case, we *havealreadycompletedinitialframebufferinitinpresetup_fbsowe
* can just setup the fb access pointers */ staticint am200_setup_fb(struct metronomefb_par *par)
{ int fw; int fh;
fw = am200_board.fw;
fh = am200_board.fh;
/* metromem was set up by the notifier in share_video_mem so now
* we can use its value to calculate the other entries */
par->metromem_cmd = (struct metromem_cmd *) am200_board.metromem;
par->metromem_wfm = am200_board.metromem + fw;
par->metromem_img = par->metromem_wfm + am200_board.wfm_size;
par->metromem_img_csum = (u16 *) (par->metromem_img + (fw * fh));
par->metromem_dma = am200_board.host_fbinfo->fix.smem_start;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.