|
@@ -105,6 +105,7 @@ static struct mmp_camera *mmpcam_find_device(struct platform_device *pdev)
|
|
|
#define CPU_SUBSYS_PMU_BASE 0xd4282800
|
|
|
#define REG_CCIC_DCGCR 0x28 /* CCIC dyn clock gate ctrl reg */
|
|
|
#define REG_CCIC_CRCR 0x50 /* CCIC clk reset ctrl reg */
|
|
|
+#define REG_CCIC2_CRCR 0xf4 /* CCIC2 clk reset ctrl reg */
|
|
|
|
|
|
static void mcam_clk_enable(struct mcam_camera *mcam)
|
|
|
{
|
|
@@ -194,6 +195,28 @@ static void mmpcam_power_down(struct mcam_camera *mcam)
|
|
|
mcam_clk_disable(mcam);
|
|
|
}
|
|
|
|
|
|
+void mcam_ctlr_reset(struct mcam_camera *mcam)
|
|
|
+{
|
|
|
+ unsigned long val;
|
|
|
+ struct mmp_camera *cam = mcam_to_cam(mcam);
|
|
|
+
|
|
|
+ if (mcam->ccic_id) {
|
|
|
+ /*
|
|
|
+ * Using CCIC2
|
|
|
+ */
|
|
|
+ val = ioread32(cam->power_regs + REG_CCIC2_CRCR);
|
|
|
+ iowrite32(val & ~0x2, cam->power_regs + REG_CCIC2_CRCR);
|
|
|
+ iowrite32(val | 0x2, cam->power_regs + REG_CCIC2_CRCR);
|
|
|
+ } else {
|
|
|
+ /*
|
|
|
+ * Using CCIC1
|
|
|
+ */
|
|
|
+ val = ioread32(cam->power_regs + REG_CCIC_CRCR);
|
|
|
+ iowrite32(val & ~0x2, cam->power_regs + REG_CCIC_CRCR);
|
|
|
+ iowrite32(val | 0x2, cam->power_regs + REG_CCIC_CRCR);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* calc the dphy register values
|
|
|
* There are three dphy registers being used.
|
|
@@ -354,9 +377,11 @@ static int mmpcam_probe(struct platform_device *pdev)
|
|
|
mcam = &cam->mcam;
|
|
|
mcam->plat_power_up = mmpcam_power_up;
|
|
|
mcam->plat_power_down = mmpcam_power_down;
|
|
|
+ mcam->ctlr_reset = mcam_ctlr_reset;
|
|
|
mcam->calc_dphy = mmpcam_calc_dphy;
|
|
|
mcam->dev = &pdev->dev;
|
|
|
mcam->use_smbus = 0;
|
|
|
+ mcam->ccic_id = pdev->id;
|
|
|
mcam->mclk_min = pdata->mclk_min;
|
|
|
mcam->mclk_src = pdata->mclk_src;
|
|
|
mcam->mclk_div = pdata->mclk_div;
|