vidioc_int_g_ifparm(cam->sensor, &ifparm);
cam_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ csi_clk_enable();
clk_prepare_enable(sensor->sensor_clk);
vidioc_int_s_power(cam->sensor, 1);
vidioc_int_init(cam->sensor);
file->private_data = NULL;
vidioc_int_s_power(cam->sensor, 0);
clk_disable_unprepare(sensor->sensor_clk);
+ csi_clk_disable();
}
return err;
static int irq_nr;
static csi_irq_callback_t g_callback;
static void *g_callback_data;
+static struct clk *disp_axi_clk;
+static struct clk *dcic_clk;
+static struct clk *csi_clk;
+
+void csi_clk_enable(void)
+{
+ clk_prepare_enable(disp_axi_clk);
+ clk_prepare_enable(dcic_clk);
+ clk_prepare_enable(csi_clk);
+}
+EXPORT_SYMBOL(csi_clk_enable);
+
+void csi_clk_disable(void)
+{
+ clk_disable_unprepare(csi_clk);
+ clk_disable_unprepare(dcic_clk);
+ clk_disable_unprepare(disp_axi_clk);
+}
+EXPORT_SYMBOL(csi_clk_disable);
static irqreturn_t csi_irq_handler(int irq, void *data)
{
goto err;
}
+ disp_axi_clk = devm_clk_get(&pdev->dev, "disp-axi");
+ if (IS_ERR(disp_axi_clk)) {
+ dev_err(&pdev->dev, "get csi clock failed\n");
+ return PTR_ERR(disp_axi_clk);
+ }
+ csi_clk = devm_clk_get(&pdev->dev, "csi_mclk");
+ if (IS_ERR(csi_clk)) {
+ dev_err(&pdev->dev, "get csi mclk failed\n");
+ return PTR_ERR(csi_clk);
+ }
+
+ dcic_clk = devm_clk_get(&pdev->dev, "dcic");
+ if (IS_ERR(dcic_clk)) {
+ dev_err(&pdev->dev, "get dcic clk failed\n");
+ return PTR_ERR(dcic_clk);
+ }
+
+ csi_clk_enable();
csihw_reset();
csi_init_interface();
csi_dmareq_rff_disable();
+ csi_clk_disable();
err:
return ret;
void csi_enable_int(int arg);
void csi_enable(int arg);
void csi_disable_int(void);
-void csi_mclk_enable(void);
-void csi_mclk_disable(void);
+void csi_clk_enable(void);
+void csi_clk_disable(void);
void csi_dmareq_rff_enable(void);
void csi_dmareq_rff_disable(void);