mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
media: platform: rockchip: cif: register cif itf dev when clear unready subdev
Signed-off-by: Allon Huang <allon.huang@rock-chips.com> Change-Id: Icc051ac055cbfea78305327ebe8554d2d0963dc4
This commit is contained in:
@@ -587,14 +587,15 @@ static int _set_pipeline_default_fmt(struct rkcif_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void subdev_itf_register_work(struct work_struct *work)
|
||||
static int subdev_asyn_register_itf(struct rkcif_device *dev)
|
||||
{
|
||||
struct rkcif_device *dev = container_of(work,
|
||||
struct rkcif_device,
|
||||
async_register_work);
|
||||
struct sditf_priv *sditf = dev->sditf;
|
||||
int ret = 0;
|
||||
|
||||
if (dev->chip_id >= CHIP_RK1808_CIF)
|
||||
platform_driver_register(&rkcif_subdev_driver);
|
||||
if (sditf)
|
||||
ret = v4l2_async_register_subdev_sensor_common(&sditf->sd);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int subdev_notifier_complete(struct v4l2_async_notifier *notifier)
|
||||
@@ -681,14 +682,6 @@ static int subdev_notifier_complete(struct v4l2_async_notifier *notifier)
|
||||
if (ret < 0)
|
||||
goto unregister_lvds;
|
||||
|
||||
INIT_WORK(&dev->async_register_work, subdev_itf_register_work);
|
||||
if (schedule_work(&dev->async_register_work))
|
||||
v4l2_info(&dev->v4l2_dev,
|
||||
"async register subdev itf successfully\n");
|
||||
else
|
||||
v4l2_info(&dev->v4l2_dev,
|
||||
"async register subdev itf failed\n");
|
||||
|
||||
v4l2_info(&dev->v4l2_dev, "Async subdev notifier completed\n");
|
||||
|
||||
return ret;
|
||||
@@ -1243,8 +1236,12 @@ static int __maybe_unused __rkcif_clr_unready_dev(void)
|
||||
struct rkcif_device *cif_dev;
|
||||
|
||||
mutex_lock(&rkcif_dev_mutex);
|
||||
list_for_each_entry(cif_dev, &rkcif_device_list, list)
|
||||
|
||||
list_for_each_entry(cif_dev, &rkcif_device_list, list) {
|
||||
subdev_asyn_register_itf(cif_dev);
|
||||
v4l2_async_notifier_clr_unready_dev(&cif_dev->notifier);
|
||||
}
|
||||
|
||||
mutex_unlock(&rkcif_dev_mutex);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -514,7 +514,6 @@ struct rkcif_device {
|
||||
struct rkcif_work_struct reset_work;
|
||||
bool reset_work_cancel;
|
||||
struct rkcif_timer reset_watchdog_timer;
|
||||
struct work_struct async_register_work;
|
||||
unsigned int buf_wake_up_cnt;
|
||||
|
||||
bool iommu_en;
|
||||
|
||||
@@ -943,8 +943,10 @@ static int rkcif_plat_hw_probe(struct platform_device *pdev)
|
||||
|
||||
if (data->chip_id == CHIP_RK1808_CIF ||
|
||||
data->chip_id == CHIP_RV1126_CIF ||
|
||||
data->chip_id == CHIP_RK3568_CIF)
|
||||
data->chip_id == CHIP_RK3568_CIF) {
|
||||
platform_driver_register(&rkcif_plat_drv);
|
||||
platform_driver_register(&rkcif_subdev_driver);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,8 @@ static int rkcif_subdev_media_init(struct sditf_priv *priv)
|
||||
return ret;
|
||||
|
||||
strncpy(priv->sd.name, dev_name(cif_dev->dev), sizeof(priv->sd.name));
|
||||
return v4l2_async_register_subdev(&priv->sd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rkcif_subdev_probe(struct platform_device *pdev)
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
*1. rv1126/rk356x support bt656/bt1120 multi channels function
|
||||
*2. add dynamic cropping function
|
||||
*3. optimize dts config of cif's pipeline
|
||||
*4. register cif itf dev when clear unready subdev
|
||||
*/
|
||||
|
||||
#define RKCIF_DRIVER_VERSION RKCIF_API_VERSION
|
||||
|
||||
Reference in New Issue
Block a user