extern void vopStop () { socle_vop_write(VOP_INT_DISABLE, SOCLE_VOP_INTE); socle_vop_write(VOP_CTRL_DISPLAY_DIS, SOCLE_VOP_CTRL); free_irq(SOCLE_INTC_VOP0); }
extern void vopStart() { socle_vop_write(VOP_AHBR_CTRL_INCR16, SOCLE_VOP_AHBR_CTRL); socle_vop_write(VOP_INTE_BUFFER_UNDERRUN | VOP_INTE_DISPLAY_COMPLETE, SOCLE_VOP_INTE); socle_vop_write(socle_vop_read(SOCLE_VOP_CTRL) | VOP_CTRL_DISPLAY_EN, SOCLE_VOP_CTRL); }
extern void vopReset() { socle_vop_write(VOP_CTRL_RESET | VOP_CTRL_DISPLAY_DIS, SOCLE_VOP_CTRL); MSDELAY(260); socle_vop_write(VOP_INT_DISABLE, SOCLE_VOP_INTE); socle_vop_write(VOP_CTRL_NO_RESET | VOP_CTRL_DISPLAY_DIS, SOCLE_VOP_CTRL); }
static void vopReset() { socle_vop_write(VOP_CTRL_RESET | VOP_CTRL_DISPLAY_DIS, SOCLE_VOP_CTRL); msleep(260); socle_vop_write(VOP_INT_DISABLE, SOCLE_VOP_INTE); socle_vop_write(VOP_CTRL_NO_RESET | VOP_CTRL_DISPLAY_DIS, SOCLE_VOP_CTRL); }
static void vopStart() { socle_vop_write(VOP_AHBR_CTRL_INCR16, SOCLE_VOP_AHBR_CTRL); #ifdef USE_INT socle_vop_write(VOP_INTE_DISPLAY_COMPLETE, SOCLE_VOP_INTE); #endif socle_vop_write(socle_vop_read(SOCLE_VOP_CTRL) | VOP_CTRL_DISPLAY_EN, SOCLE_VOP_CTRL); }
extern int vopSetOutFormat(int format) { if(format==FORMAT_NTSC) socle_vop_write(socle_vop_read(SOCLE_VOP_CTRL) & ~VOP_CTRL_FORMAT_PAL, SOCLE_VOP_CTRL); else if(format==FORMAT_PAL) socle_vop_write(socle_vop_read(SOCLE_VOP_CTRL) | VOP_CTRL_FORMAT_PAL, SOCLE_VOP_CTRL); else { printf("VOP : Error Output Format!!\n"); return -1; } return 0; }
static int vopSetOutFormat(int format) { if(format==FORMAT_NTSC) { VOP_DBG("Out format NTSC\n"); socle_vop_write(socle_vop_read(SOCLE_VOP_CTRL) & ~VOP_CTRL_FORMAT_PAL, SOCLE_VOP_CTRL); } else if(format==FORMAT_PAL) { VOP_DBG("Out format PAL\n"); socle_vop_write(socle_vop_read(SOCLE_VOP_CTRL) | VOP_CTRL_FORMAT_PAL, SOCLE_VOP_CTRL); } else { printk("VOP : Error Output Format!!\n"); return -1; } return 0; }
extern int vopSetFrameSize(int framesize) { u32 size; switch(framesize) { case FRAMESIZE_QCIF: size=(176<<10)+144; break; case FRAMESIZE_CIF: size=(352<<10)+288; break; case FRAMESIZE_QVGA: size=(320<<10)+240; break; case FRAMESIZE_VGA: size=(640<<10)+480; break; case FRAMESIZE_D1: size=(720<<10)+480; break; default: printf("VOP : Error Frame Size!!\n"); return -1; } socle_vop_write(size, SOCLE_VOP_FSS); return 0; }
static irqreturn_t vopOneFrameIsr (int irq, void *dev) { u32 int_sts = socle_vop_read(SOCLE_VOP_INT_STS); u32 frame_sts = socle_vop_read(SOCLE_VOP_FBS); if (int_sts & VOP_INT_STS_DISPLAY_COMPLETE) { if ((frame_sts & VOP_FBS_FRAME1_USE_BY_HW) == 0) socle_vop_write(VOP_FBS_FRAME1_USE_BY_HW, SOCLE_VOP_FBS); } if (int_sts & VOP_INT_STS_BUFFER_UNDERUN) { int line_num; line_num = int_sts >> VOP_INT_STS_LINE_NUM_OF_UNDERUN_SHIFT; printk("VOP : Buffer Underflow at line 0x%x\n",line_num); }
extern int vopSetFrameDisplayAddr(int frameNum, u32 Y_pt, u32 Cb_pt, u32 Cr_pt) { if(frameNum==FRAME1) { socle_vop_write(Y_pt, SOCLE_VOP_DRF1SAY); socle_vop_write(Cb_pt, SOCLE_VOP_DRF1SACB); socle_vop_write(Cr_pt, SOCLE_VOP_DRF1SACR); socle_vop_write(VOP_FBS_FRAME1_USE_BY_HW, SOCLE_VOP_FBS); } else if(frameNum==FRAME2) { socle_vop_write(Y_pt, SOCLE_VOP_DRF2SAY); socle_vop_write(Cb_pt, SOCLE_VOP_DRF2SACB); socle_vop_write(Cr_pt, SOCLE_VOP_DRF2SACR); socle_vop_write(VOP_FBS_FRAME2_USE_BY_HW, SOCLE_VOP_FBS); } else { printf("Error Frame Number!!\n"); return -1; } return 0; }
static int vopSetFrameSize(u32 framesize) { int ret=0; int width=(framesize >> 10); int height=(framesize & 0x3ff); if(width>720 || height>480) { printk("VOP: display size error\n"); return -1; } VOP_DBG(" width=%d height=%d\n",width,height); addr_y = frame_pa; addr_cb = (addr_y + width*height); addr_cr = (addr_cb + width*height/4); socle_vop_write(framesize, SOCLE_VOP_FSS); ret |= vopSetFrameDisplayAddr(FRAME1, addr_y, addr_cb, addr_cr); return ret; }
static int vopSetFrameDisplayAddr(int frameNum, u32 Y_pt, u32 Cb_pt, u32 Cr_pt) { VOP_DBG(" frameNum %d addr Y_pt=%d Cb_pt=%d Cr_pt=%d\n",frameNum,Y_pt,Cb_pt,Cr_pt); if(frameNum==FRAME1) { socle_vop_write(Y_pt, SOCLE_VOP_DRF1SAY); socle_vop_write(Cb_pt, SOCLE_VOP_DRF1SACB); socle_vop_write(Cr_pt, SOCLE_VOP_DRF1SACR); socle_vop_write(VOP_FBS_FRAME1_USE_BY_HW, SOCLE_VOP_FBS); } else if(frameNum==FRAME2) { socle_vop_write(Y_pt, SOCLE_VOP_DRF2SAY); socle_vop_write(Cb_pt, SOCLE_VOP_DRF2SACB); socle_vop_write(Cr_pt, SOCLE_VOP_DRF2SACR); socle_vop_write(VOP_FBS_FRAME2_USE_BY_HW, SOCLE_VOP_FBS); } else { printk("VOP: Error Frame Number!!\n"); return -1; } return 0; }
static void vopStop () { socle_vop_write(VOP_INT_DISABLE, SOCLE_VOP_INTE); socle_vop_write(VOP_CTRL_DISPLAY_DIS, SOCLE_VOP_CTRL); }