Exemplo n.º 1
0
/*
 * Set old isp shared port configuration
 */
static void prev_unset_isp_ctrl(void)
{
	u32 val;

	val = omap_readl(ISP_CTRL);

	if (isp_ctrl & ISP_CTRL_SBL_SHARED_RPORTB)
	    val |= ISP_CTRL_SBL_SHARED_RPORTB;

	if (isp_ctrl & ISP_CTRL_SBL_SHARED_RPORTA)
	    val |= ISP_CTRL_SBL_SHARED_RPORTA;

	if (isp_ctrl & (1 << SBL_RD_RAM_EN))
	    val &= ~(1 << SBL_RD_RAM_EN);

	/* write ISP CTRL register */
	omap_writel(val, ISP_CTRL);

	/* disable dark frame and shading compensation */
	isppreview_enable_drkframe(0);
	isppreview_enable_shadcomp(0);

	/* Set output and input adresses to 0 */
	isppreview_set_outaddr(prv_wsdr_addr);
}
Exemplo n.º 2
0
/**
 * prev_hw_setup - Stores the desired configuration in the proper HW registers
 * @config: Structure containing the desired configuration for ISP preview
 *          module.
 *
 * Reads the structure sent, and modifies the desired registers.
 *
 * Always returns 0.
 **/
static int prev_hw_setup(struct prev_params *config)
{
    dev_dbg(prev_dev, "prev_hw_setup E\n");

    if (config->features & PREV_AVERAGER)
        isppreview_config_averager(config->average);
    else
        isppreview_config_averager(0);

    if (config->features & PREV_INVERSE_ALAW)
        isppreview_enable_invalaw(1);
    else
        isppreview_enable_invalaw(0);

    if (config->features & PREV_HORZ_MEDIAN_FILTER) {
        isppreview_config_hmed(config->hmf_params);
        isppreview_enable_hmed(1);
    } else
        isppreview_enable_hmed(0);

    if (config->features & PREV_DARK_FRAME_SUBTRACT) {
        DPRINTK_PREVIEWER("[%s] darkaddr %08x, darklineoffset %d\n",
                          __func__,
                          config->drkf_params.addr,
                          config->drkf_params.offset);
        isppreview_set_darkaddr(config->drkf_params.addr);
        isppreview_config_darklineoffset(config->drkf_params.offset);
        isppreview_enable_drkframe(1);
    } else
        isppreview_enable_drkframe(0);

    if (config->features & PREV_LENS_SHADING) {
        isppreview_config_drkf_shadcomp(config->lens_shading_shift);
        isppreview_enable_shadcomp(1);
    } else
        isppreview_enable_shadcomp(0);

    dev_dbg(prev_dev, "prev_hw_setup L\n");
    return 0;
}