atomisp: do not do full release if more video pipes are on use
The bug (TZSP-3288) is more or less easily reproducible on systems with
udev-like software. The helper (v4l_id) is run in parallel for all /dev/videoX
nodes twice with only purpose of checking capabilities:
->open("/dev/videoX")
->ioctl(VIDIOC_QUERYCAP)
->release("/dev/videoX")
The atomisp_open() call does two stages init of the internal structures. In
case of 1st opened node it does full (stage 1 + stage 2) init. Otherwise it is
a fast path (stage 1 only).
However, atomisp_release() does a fast path for non-main pipes as well. This
triggers the unbalanced power management calls:
->open
-> stage 1
-> stage 2
-> pm_runtime_get_sync
->release
-> stage 1
-> is_main? -> (no) -> fast path
The patch is a rough approach to fix this. Any better solution is welcome.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Yong Wang <yong.y.wang@intel.com>