video: rockchip: mpp_osal: add api mpp_device_add_driver() for rockit

Signed-off-by: ChuanHu Sun <aaron.sun@rock-chips.com>
Change-Id: I2f945004f199b61935a4a1f5a49cf2d1c1ec093b
This commit is contained in:
ChuanHu Sun
2024-07-03 14:48:49 +08:00
committed by Tao Huang
parent e1ecb83818
commit 0e6f34b90b
2 changed files with 14 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
*
*/
#include "mpp_osal.h"
#include <linux/platform_device.h>
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);

View File

@@ -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