title: Mipi Csi2 Error: could not get clock csi_mclk
body: <p>I have been working on writing mipi csi-2 imx290 camera driver. I have faced with csi_clock error. <a href="https://i.stack.imgur.com/l4kk5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l4kk5.png" alt="enter image description here"></a></p>
  
  <p>This is my imx290_probe function;</p>
  
  <pre><code>static int imx290_probe(struct i2c_client *client,
    const struct i2c_device_id *id)
  {
  
    struct device *dev = &amp;client-&gt;dev;
    int retval;
    int value;
  
  
  
  
    /* request reset pin */
    xclr = of_get_named_gpio(dev-&gt;of_node, "rst-gpios", 0);
    if (!gpio_is_valid(xclr)) {
      dev_warn(dev, "no sensor reset pin available");
      return -EINVAL;
    }
  
    retval = devm_gpio_request_one(dev, xclr, GPIOF_OUT_INIT_LOW,"imx290_mipi_reset");
    if (retval &lt; 0)
      return retval;
  
  
    /* Set initial values for the sensor struct. */
    memset(&amp;imx290_data, 0, sizeof(imx290_data));
    imx290_data.sensor_clk = devm_clk_get(dev, "csi_mclk");
  
    if (IS_ERR(imx290_data.sensor_clk)) {
  
      /* assuming clock enabled by default */
      imx290_data.sensor_clk = NULL;
      dev_err(dev, "clock-frequency missing or invalid\n");
      return PTR_ERR(imx290_data.sensor_clk);
    }
  
  
    retval = of_property_read_u32(dev-&gt;of_node, "mclk",&amp;(imx290_data.mclk));
  
    if (retval) {
      dev_err(dev, "mclk missing or invalid\n");
      return retval;
    }
  
    retval = of_property_read_u32(dev-&gt;of_node, "mclk_source",
            (u32 *) &amp;(imx290_data.mclk_source));
    if (retval) {
      dev_err(dev, "mclk_source missing or invalid\n");
      return retval;
    }
  
    retval = of_property_read_u32(dev-&gt;of_node, "csi_id",
            &amp;(imx290_data.csi));
    if (retval) {
      dev_err(dev, "csi id missing or invalid\n");
      return retval;
    }
    pr_info("Line 10 is Ok\n ");
    clk_prepare_enable(imx290_data.sensor_clk);
  
    imx290_data.io_init = imx290_reset;
    imx290_data.i2c_client = client;
    imx290_data.pix.pixelformat = V4L2_PIX_FMT_UYVY;
    imx290_data.pix.width = 1920;
    imx290_data.pix.height = 1080;
    imx290_data.streamcap.capability = V4L2_MODE_HIGHQUALITY | V4L2_CAP_TIMEPERFRAME;
    imx290_data.streamcap.capturemode = 0;
    imx290_data.streamcap.timeperframe.denominator = DEFAULT_FPS;
    imx290_data.streamcap.timeperframe.numerator = 1;
  
    imx290_power_on(dev);
  
    imx290_reset();
  
    retval = imx290_write_reg(IMX290_REG_STANDBY, 0x1,NULL);
  
    imx290_int_device.priv = &amp;imx290_data;
    retval = v4l2_int_device_register(&amp;imx290_int_device);
  
    clk_disable_unprepare(imx290_data.sensor_clk);
  
    pr_info("camera imx290_mipi is found\n");
    return retval;
  }
  </code></pre>
  
  <p>and also I m giving the device tree configuration,</p>
  
  <pre><code>imx290_mipi: imx290_mipi@1a {
      compatible = "sony,imx290lqr,imx290,imx290_camera";
      reg = &lt;0x1a&gt;;
      clocks = &lt;&amp;clks 200&gt;;
      clock-names = "csi_mclk";   
      OVDD = &lt;&amp;reg_1p8v&gt;;
      AVDD = &lt;&amp;reg_2p9v&gt;;
      DVDD = &lt;&amp;reg_1p2v&gt;;
      pwn-gpios = &lt;&amp;gpio1 6 1&gt;;
      rst-gpios = &lt;&amp;gpio4 14 0&gt;; /// xclr 
      ipu_id = &lt;0&gt;;
      csi_id = &lt;0&gt;;
      mclk = &lt;37125000&gt;;
      mclk_source = &lt;0&gt;;
      lanes = &lt;4&gt;;
  }
  </code></pre>
  
  <p>What can be wrong while doing this because this probe function as similar as ov5640 camera probe function and it doesn't give any error while probing. 
   My mind get confused a lot , I need second opinion and suggestion.</p>
  
  <p>Thanks </p>
  
  <p>Best Regards </p>
  
  <p>Mustafa </p>