title: What causes "resource temporarily unavailable" in v4l2
body: <p>I have compiled adv7180 driver available <a href="http://github.com/SolidRun/linux-fslc/blob/3.14-1.0.x-mx6-sr/drivers/media/platform/mxc/capture/adv7180.c" rel="nofollow noreferrer">here.</a></p>
  
  <p>I am unloading the ov5642 cameradriver(which in my case is built-in) and loading the adv7180_tvin module and after I am loading mxcv4l2_capture module which creates video0 in /dev/.
  (dmesg command says: "mxc camera on IPU2_CSI1 registered as video0")</p>
  
  <p>But when I try to access video0 with v4l2-ctl I got a message "resource temporarily unavailable" or when I am using gstreamer I got message "Can not open /dev/video0" (but the device is really created).</p>
  
  <p>Is that a problem in device tree settings or it can be caused by something else? Which tools should I use to find out what causes this issue?</p>
  
  <p>My device tree settings look like below:</p>
  
  <pre><code>&amp;i2c3{
  adv7180: adv7180@20{
  compatible = "adv,adv7180";
  reg = &lt;0x20&gt;;
  clocks = &lt;&amp;clks IMX6QDL_CLK_CKO2&gt;;
  clock-names = "csi_mclk";
  pwn-gpios = &lt;&amp;gpio3 10 GPIO_ACTIVE_LOW&gt;;
  ipu_id = &lt;1&gt;;
  csi_id = &lt;1&gt;;
  mclk = &lt;24000000&gt;;
  mclk_source = &lt;0&gt;;
  pinctrl-names = "default";
  pinctrl-0 = &lt;&amp;pinctrl_hummingboard2_parallel&gt;;
  
  cvbs = &lt;1&gt;;
  
  };
  };
  </code></pre>
  
  <p>I need to add that before adv7180 I was using above settings for ov5642 camera (excluding cvbs setting) and everything worked properly.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Ok I got one clue. </p>
  
  <p>When I load modules in dmesg message "<strong><em>mxc_v4l2_master_attach: ipu(0:1)/csi(1:1)/mipi(0:0) doesn't match</em></strong>" shows.
  But it only happens when <strong>ipu_id=&lt;1</strong>> in v4l2_cap device tree settings and in adv7180 settings. When i change ipu_id to <strong>ipu_id=&lt;0></strong> in v4l2 settings and adv7180 dmesg now shows "<strong><em>parallel attach to IPU1 CSI1</em></strong> and I can access the <strong>/dev/video0</strong> succesfully with v4l2-ctl tool.</p>
  
  <p>But In my case there is only one possibility to use <strong>IPU2_CSI1</strong>.</p>
  
  <p>Why can't I set IPU2 to adv7180 when I was using it successfully to ov5642 ? </p>