From 0e6f34b90b7dee1271c4264b32668dbf7c198624 Mon Sep 17 00:00:00 2001 From: ChuanHu Sun Date: Wed, 3 Jul 2024 14:48:49 +0800 Subject: [PATCH] video: rockchip: mpp_osal: add api mpp_device_add_driver() for rockit Signed-off-by: ChuanHu Sun Change-Id: I2f945004f199b61935a4a1f5a49cf2d1c1ec093b --- drivers/video/rockchip/mpp_osal/mpp_osal.c | 13 +++++++++++++ drivers/video/rockchip/mpp_osal/mpp_osal.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/video/rockchip/mpp_osal/mpp_osal.c b/drivers/video/rockchip/mpp_osal/mpp_osal.c index 18f0185848ae..abdaf4be6a22 100644 --- a/drivers/video/rockchip/mpp_osal/mpp_osal.c +++ b/drivers/video/rockchip/mpp_osal/mpp_osal.c @@ -4,6 +4,7 @@ * */ #include "mpp_osal.h" +#include struct device_node *mpp_dev_of_node(struct device *dev) { @@ -28,3 +29,15 @@ int mpp_device_init_wakeup(struct device *dev, bool enable) return device_init_wakeup(dev, enable); } EXPORT_SYMBOL(mpp_device_init_wakeup); + +void mpp_device_add_driver(void *dev, void *drv) +{ +#ifdef CONFIG_PM_SLEEP + struct device *kdev = (struct device *)dev; + struct platform_driver *mpi_driver = (struct platform_driver *)drv; + + kdev->driver = &mpi_driver->driver; + kdev->power.no_pm_callbacks = 0; +#endif +} +EXPORT_SYMBOL(mpp_device_add_driver); diff --git a/drivers/video/rockchip/mpp_osal/mpp_osal.h b/drivers/video/rockchip/mpp_osal/mpp_osal.h index 733dd5a2bde6..826f006d8552 100644 --- a/drivers/video/rockchip/mpp_osal/mpp_osal.h +++ b/drivers/video/rockchip/mpp_osal/mpp_osal.h @@ -14,5 +14,6 @@ struct device_node *mpp_dev_of_node(struct device *dev); void mpp_pm_relax(struct device *dev); void mpp_pm_stay_awake(struct device *dev); int mpp_device_init_wakeup(struct device *dev, bool enable); +void mpp_device_add_driver(void *dev, void *drv); #endif