media: ov01a10: Enable runtime PM before registering async sub-device
authorBingbu Cao <bingbu.cao@intel.com>
Wed, 22 Nov 2023 09:46:07 +0000 (17:46 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 4 Dec 2023 10:21:46 +0000 (11:21 +0100)
commit47a78052db51b16e8045524fbf33373b58f1323b
treeed28ffbb8eabbbfd031ce7870bda64ee0ebc3c1f
parentefa5fe19c0a9199f49e36e1f5242ed5c88da617d
media: ov01a10: Enable runtime PM before registering async sub-device

As the sensor device maybe accessible right after its async sub-device is
registered, such as ipu-bridge will try to power up sensor by sensor's
client device's runtime PM from the async notifier callback, if runtime PM
is not enabled, it will fail.

So runtime PM should be ready before its async sub-device is registered
and accessible by others.

It also sets the runtime PM status to active as the sensor was turned
on by i2c-core.

Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/ov01a10.c