Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static void mxcfb_init_panel ( struct fb_info *  fbi  )  [static]

Function to initialize Asynchronous Display Controller. It also initilizes the ADC System 1 channel. Configure ADC display 0 parallel interface for the panel.

Parameters:
fbi framebuffer information pointer

Definition at line 337 of file mxcfb_epson.c.

Referenced by mxcfb_probe().

{
      int msb;
      int panel_stride;
      ipu_channel_params_t params;
      struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par;

#ifdef CONFIG_FB_MXC_ASYNC_PANEL_IFC_16_BIT
      uint32_t pix_fmt = IPU_PIX_FMT_RGB565;
      ipu_adc_sig_cfg_t sig = { 0, 0, 0, 0, 0, 0, 0, 0,
            IPU_ADC_BURST_WCS,
            IPU_ADC_IFC_MODE_SYS80_TYPE2,
            16, 0, 0, IPU_ADC_SER_NO_RW
      };
      mxc_fbi->disp_num = DISP0;
#elif defined(CONFIG_FB_MXC_ASYNC_PANEL_IFC_8_BIT)
      uint32_t pix_fmt = IPU_PIX_FMT_RGB666;
      ipu_adc_sig_cfg_t sig = { 0, 0, 0, 0, 0, 0, 0, 0,
            IPU_ADC_BURST_WCS,
            IPU_ADC_IFC_MODE_SYS80_TYPE2,
            8, 0, 0, IPU_ADC_SER_NO_RW
      };
      mxc_fbi->disp_num = DISP0;
#else
      uint32_t pix_fmt = IPU_PIX_FMT_RGB565;
      ipu_adc_sig_cfg_t sig = { 0, 1, 0, 0, 0, 0, 0, 0,
            IPU_ADC_BURST_SERIAL,
            IPU_ADC_IFC_MODE_5WIRE_SERIAL_CLK,
            16, 0, 0, IPU_ADC_SER_NO_RW
      };
      fbi->disp_num = DISP1;
#endif

#ifdef PARTIAL_REFRESH
      if (ipu_request_irq(IPU_IRQ_ADC_SYS2_EOF, mxcfb_sys2_eof_irq_handler, 0,
                      MXCFB_NAME, fbi) != 0) {
            dev_err(fbi->device, "Error registering SYS2 irq handler.\n");
            return;
      }

      if (ipu_request_irq(IPU_IRQ_ADC_SYS1_EOF, mxcfb_sys1_eof_irq_handler, 0,
                      MXCFB_NAME, fbi) != 0) {
            dev_err(fbi->device, "Error registering SYS1 irq handler.\n");
            return;
      }
      ipu_disable_irq(IPU_IRQ_ADC_SYS1_EOF);
      ipu_disable_irq(IPU_IRQ_ADC_SYS2_EOF);
#endif
      // Init DI interface
      msb = fls(MXCFB_SCREEN_WIDTH);
      if (!(MXCFB_SCREEN_WIDTH & ((1UL << msb) - 1)))
            msb--;            // Already aligned to power 2
      panel_stride = 1UL << msb;
      ipu_adc_init_panel(mxc_fbi->disp_num,
                     MXCFB_SCREEN_WIDTH + MXCFB_SCREEN_LEFT_OFFSET,
                     MXCFB_SCREEN_HEIGHT,
                     pix_fmt, panel_stride, sig, XY, 0, VsyncInternal);

      ipu_adc_init_ifc_timing(mxc_fbi->disp_num, true,
                        190, 17, 104, 190, 5000000);
      ipu_adc_init_ifc_timing(mxc_fbi->disp_num, false, 123, 17, 68, 0, 0);

      // Needed to turn on ADC clock for panel init
      memset(&params, 0, sizeof(params));
      params.adc_sys1.disp = mxc_fbi->disp_num;
      params.adc_sys1.ch_mode = WriteTemplateNonSeq;
      params.adc_sys1.out_left = MXCFB_SCREEN_LEFT_OFFSET;
      params.adc_sys1.out_top = MXCFB_SCREEN_TOP_OFFSET;
      ipu_init_channel(ADC_SYS1, &params);

      _init_panel(mxc_fbi->disp_num);
      init_channel_template(mxc_fbi->disp_num);
}


Generated by  Doxygen 1.6.0   Back to index