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

int _ipu_csi_set_mipi_di ( uint32_t  num,
uint32_t  di_val,
uint32_t  csi 
)

_ipu_csi_set_mipi_di

Parameters:
num MIPI data identifier 0-3 handled by CSI
di_val data identifier value
csi csi 0 or csi 1
Returns:
Returns 0 on success or negative error code on fail

Definition at line 411 of file ipu_capture.c.

{
      uint32_t temp;
      int retval = 0;
      unsigned long lock_flags;

      if (di_val > 0xFFL) {
            retval = -EINVAL;
            goto err;
      }

      spin_lock_irqsave(&ipu_lock, lock_flags);

      temp = __raw_readl(CSI_MIPI_DI(csi));

      switch (num) {
      case IPU_CSI_MIPI_DI0:
            temp &= ~CSI_MIPI_DI0_MASK;
            temp |= (di_val << CSI_MIPI_DI0_SHIFT);
            __raw_writel(temp, CSI_MIPI_DI(csi));
            break;
      case IPU_CSI_MIPI_DI1:
            temp &= ~CSI_MIPI_DI1_MASK;
            temp |= (di_val << CSI_MIPI_DI1_SHIFT);
            __raw_writel(temp, CSI_MIPI_DI(csi));
            break;
      case IPU_CSI_MIPI_DI2:
            temp &= ~CSI_MIPI_DI2_MASK;
            temp |= (di_val << CSI_MIPI_DI2_SHIFT);
            __raw_writel(temp, CSI_MIPI_DI(csi));
            break;
      case IPU_CSI_MIPI_DI3:
            temp &= ~CSI_MIPI_DI3_MASK;
            temp |= (di_val << CSI_MIPI_DI3_SHIFT);
            __raw_writel(temp, CSI_MIPI_DI(csi));
            break;
      default:
            retval = -EINVAL;
            goto err;
      }

      spin_unlock_irqrestore(&ipu_lock, lock_flags);
err:
      return retval;
}


Generated by  Doxygen 1.6.0   Back to index