Skip to content
Snippets Groups Projects
Commit 1e83202a authored by Liu Ying's avatar Liu Ying Committed by Jason Liu
Browse files

MLK-16581-7 drm/imx: ldb: Add system power management support


This patch adds system power management support for imx-ldb drm driver
by proper PHY power/exit/init handling where necessary and pixel link
re-initialization in the resume operation.  The driver depends on the
imx-drm core driver to handle ldb bridge power management operations.

Signed-off-by: default avatarLiu Ying <victor.liu@nxp.com>
parent afec58e8
No related merge requests found
...@@ -1291,12 +1291,50 @@ static int imx_ldb_remove(struct platform_device *pdev) ...@@ -1291,12 +1291,50 @@ static int imx_ldb_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int imx_ldb_suspend(struct device *dev)
{
struct imx_ldb *imx_ldb = dev_get_drvdata(dev);
struct imx_ldb_channel *channel;
int i;
for (i = 0; i < 2; i++) {
channel = &imx_ldb->channel[i];
if (channel->phy_is_on)
phy_power_off(channel->phy);
phy_exit(channel->phy);
}
return 0;
}
static int imx_ldb_resume(struct device *dev)
{
struct imx_ldb *imx_ldb = dev_get_drvdata(dev);
int i;
if (imx_ldb->visible_phy)
for (i = 0; i < 2; i++)
phy_init(imx_ldb->channel[i].phy);
if (imx_ldb->pixel_link_init_quirks)
ldb_pixel_link_init(imx_ldb->id);
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(imx_ldb_pm_ops, imx_ldb_suspend, imx_ldb_resume);
static struct platform_driver imx_ldb_driver = { static struct platform_driver imx_ldb_driver = {
.probe = imx_ldb_probe, .probe = imx_ldb_probe,
.remove = imx_ldb_remove, .remove = imx_ldb_remove,
.driver = { .driver = {
.of_match_table = imx_ldb_dt_ids, .of_match_table = imx_ldb_dt_ids,
.name = DRIVER_NAME, .name = DRIVER_NAME,
.pm = &imx_ldb_pm_ops,
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment