static int iss_isp_reset(struct iss_device *iss) { unsigned int timeout; /* Fist, ensure that the ISP is IDLE (no transactions happening) */ iss_reg_update(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_SYSCONFIG, ISP5_SYSCONFIG_STANDBYMODE_MASK, ISP5_SYSCONFIG_STANDBYMODE_SMART); iss_reg_set(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_CTRL, ISP5_CTRL_MSTANDBY); timeout = iss_poll_condition_timeout( iss_reg_read(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_CTRL) & ISP5_CTRL_MSTANDBY_WAIT, 1000000, 1000, 1500); if (timeout) { dev_err(iss->dev, "ISP5 standby timeout\n"); return -ETIMEDOUT; } /* Now finally, do the reset */ iss_reg_set(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_SYSCONFIG, ISP5_SYSCONFIG_SOFTRESET); timeout = iss_poll_condition_timeout( !(iss_reg_read(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_SYSCONFIG) & ISP5_SYSCONFIG_SOFTRESET), 1000000, 1000, 1500); if (timeout) { dev_err(iss->dev, "ISP5 reset timeout\n"); return -ETIMEDOUT; } return 0; }
/* * omap4iss_csi2_reset - Resets the CSI2 module. * * Must be called with the phy lock held. * * Returns 0 if successful, or -EBUSY if power command didn't respond. */ int omap4iss_csi2_reset(struct iss_csi2_device *csi2) { unsigned int timeout; if (!csi2->available) return -ENODEV; if (csi2->phy->phy_in_use) return -EBUSY; iss_reg_set(csi2->iss, csi2->regs1, CSI2_SYSCONFIG, CSI2_SYSCONFIG_SOFT_RESET); timeout = iss_poll_condition_timeout( iss_reg_read(csi2->iss, csi2->regs1, CSI2_SYSSTATUS) & CSI2_SYSSTATUS_RESET_DONE, 500, 100, 200); if (timeout) { dev_err(csi2->iss->dev, "CSI2: Soft reset timeout!\n"); return -EBUSY; } iss_reg_set(csi2->iss, csi2->regs1, CSI2_COMPLEXIO_CFG, CSI2_COMPLEXIO_CFG_RESET_CTRL); timeout = iss_poll_condition_timeout( iss_reg_read(csi2->iss, csi2->phy->phy_regs, REGISTER1) & REGISTER1_RESET_DONE_CTRLCLK, 10000, 100, 500); if (timeout) { dev_err(csi2->iss->dev, "CSI2: CSI2_96M_FCLK reset timeout!\n"); return -EBUSY; } iss_reg_update(csi2->iss, csi2->regs1, CSI2_SYSCONFIG, CSI2_SYSCONFIG_MSTANDBY_MODE_MASK | CSI2_SYSCONFIG_AUTO_IDLE, CSI2_SYSCONFIG_MSTANDBY_MODE_NO); return 0; }
static int iss_reset(struct iss_device *iss) { unsigned int timeout; iss_reg_set(iss, OMAP4_ISS_MEM_TOP, ISS_HL_SYSCONFIG, ISS_HL_SYSCONFIG_SOFTRESET); timeout = iss_poll_condition_timeout( !(iss_reg_read(iss, OMAP4_ISS_MEM_TOP, ISS_HL_SYSCONFIG) & ISS_HL_SYSCONFIG_SOFTRESET), 1000, 10, 100); if (timeout) { dev_err(iss->dev, "ISS reset timeout\n"); return -ETIMEDOUT; } iss->crashed = 0; return 0; }