Hi, Thanks for replying....
Ya i am planning to move to 2.6 but at later stage,
I have defined init in which hardware initialisation is done and then defined these functions as given in skeletonfb.c
static struct xxxfb_info fb_info;
static struct xxxfb_par current_par;
static struct display disp;
//Hardware switch function definitions
static void xxx_detect(void)
{
return 0;
}
static int xxx_encode_fix(struct fb_fix_screeninfo *fix,
const void * _par, struct fb_info_gen * _info)
{
struct xxxfb_info *info = (struct xxxfb_info *)_info ;
struct xxxfb_par *par= (struct xxxfb_par *)_par;
memset(fix,0,sizeof(struct fb_screeninfo));
fix->smem_start = info->fb_phys;
fix->smem_len = info->fb_size;
fix->type = ;
fix->visual =;
fix->line_length = current_par.line_length;
return 0;
}
static int xxx_decode_var(const struct fb_var_screeninfo *var,
void *_par, struct fb_info_gen *_info)
{
memset(par, 0, sizeof(struct xxxfb_par));
par->var = *var;
switch (par->var->bits_per_pixel) {
case 8:
par->var->red.offset = ;
par->var->red.length = ;
par->var->green.offset = ;
par->var->green.length = ;
par->var->blue.offset = ;
par->var->blue.length = ;
par->var->transp.offset = ;
par->var->transp.length = ;
break;
case 16 :
par->var->red.offset = ;
par->var->red.length = ;
par->var->green.offset = ;
par->var->green.length = ;
par->var->blue.offset = ;
par->var->blue.length = ;
par->var->transp.offset = ;
par->var->transp.length = ;
break;
case 18:
par->var->red.offset = ;
par->var->red.length = ;
par->var->green.offset = ;
par->var->green.length = ;
par->var->blue.offset = ;
par->var->blue.length = ;
par->var->transp.offset = ;
par->var->transp.length = ;
break;
}
}
static int xxx_encode_var(struct fb_var_screeninfo *var,
const void *par, struct fb_info_gen *_info)
{
*var = ((struct xxxfb_par *) par)->var;
return 0;
}
static void xxx_get_par(void *_par, struct fb_info_gen *_info)
{
*(struct xxxfb_par *)_par = current_par;
}
static void xxx_set_par(const void *par, struct fb_info_gen *info)
{
}
static int xxx_getcolreg(unsigned regno, unsigned *red, unsigned *green,
unsigned *blue, unsigned *transp,
struct fb_info *info)
{
struct xxxfb_info *cmap_info = (struct xxxfb_info *)info;
if (regno > 255)
return 1;
*red = (unsigned short) cmap_info->palette[regno].red;
*green = (unsigned short) cmap_info->palette[regno].green;
*blue = (unsigned short) cmap_info->palette[regno].blue;
*transp = (unsigned short) cmap_info->palette[regno].transp;
return 0;
}
static int xxx_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
struct xxxfb_info * cmap_info = (struct xxxfb_info *) info ;
if (regno > 255)
return 1;
else
{
if (regno < 16)
{
switch (BITS_PER_PIXEL) {
#ifdef FBCON_HAS_CFB8
case 8:
//Call to ex-feature to initialise the palette
break;
#endif
#ifdef FBCON_HAS_CFB16
case 16:
cmap_info->fbcon_cmap16[regno]=( (red & 0xFC00 )>>0 | (green & 0xFC00)>>6 | (blue & 0xFC00)>>12);
break;
default :
break;
}
}
if (regno < 255)
{
cmap_info->palette[regno].red = red >>8;
cmap_info->palette[regno].green = green >>8;
cmap_info->palette[regno].blue = blue >>8;
cmap_info->palette[regno].transp = transp>>8;
}
}
return 0;
}
static int xxx_blank(int blank_mode, struct fb_info_gen *_info)
{
switch (blank_mode) {
case VESA_NO_BLANKING:
/* turn on panel */
panel
break;
case VESA_VSYNC_SUSPEND:
case VESA_HSYNC_SUSPEND:
case VESA_POWERDOWN:
/* turn off panel */
break;
default:
break;
}
return 0;
}
/*!
* \brief
* \param[in] unused : Void pointer.
* \param[in] disp : Display structure pointer.
* \param[in] info : fb_info_gen Structure pointer.
* \return
*
*/
static void xxx_set_disp(const void *unused, struct display *disp,
struct fb_info_gen *info)
{
disp->screen_base = (char *) fb_info.fb_virt.start;
switch (disp->var.bits_per_pixel) {
#ifdef FBCON_HAS_CFB8
case 8:
disp->dispsw = &fbcon_cfb8;
break;
#endif
#ifdef FBCON_HAS_CFB18
case 18:
disp->dispsw = &fbcon_cfb16;
disp->dispsw_data = fb_info.fbcon_cmap16;
break;
default :
disp->dispsw = &fbcon_dummy;
disp->dispsw_data = NULL;
break;
}
}
/*!
* \brief
* \param[in] var : fb_var_screeninfo structure pointer.
* \param[in] info : fb_info_gen structure pointer.
* \return
*
*/
int xxx_pan_display(const struct fb_var_screeninfo *var,
struct fb_info_gen *info)
{
return 0;
}
static int xxx_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg, int con, struct fb_info *info)
{
return -EINVAL;
}
These are the API's expected by the FB layer from low level driver.
But there is no mention of handling interrupts here.
is it fine ?
|