Skip to content

Commit b8836ab

Browse files
ioannis-karachaliosMaureenHelm
authored andcommitted
drivers: display: smartbond: Acquire power rail when using PM
The power rail of a peripheral block should always be acquired/released before/after its employment even if it's known that it should already be up and running. Signed-off-by: Ioannis Karachalios <[email protected]>
1 parent 99097bd commit b8836ab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/mipi_dbi/mipi_dbi_smartbond.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,24 @@ static int mipi_dbi_smartbond_pm_action(const struct device *dev, enum pm_device
497497
/* Sleep is only allowed when there are no active LCDC operations */
498498
if (!data->is_active) {
499499
(void)mipi_dbi_smartbond_suspend(dev);
500+
/*
501+
* Once the display block is turned off, its power domain
502+
* can be released as well.
503+
*/
504+
da1469x_pd_release_nowait(MCU_PD_DOMAIN_SYS);
500505
ret = 0;
501506
}
502507
break;
503508
case PM_DEVICE_ACTION_RESUME:
504509
__ASSERT_NO_MSG(!data->is_active);
510+
511+
/*
512+
* Although PD_SYS should already be turned on, make sure LCD controller's
513+
* power domain is up and running before accessing the display block.
514+
* Acquiring PD_SYS is mandatory when in PM runtime mode.
515+
*/
516+
da1469x_pd_acquire(MCU_PD_DOMAIN_SYS);
517+
505518
/*
506519
* The resume error code should not be taken into consideration
507520
* by the PM subsystem.
@@ -546,6 +559,7 @@ static int mipi_dbi_smartbond_init(const struct device *dev)
546559

547560
ret = pm_device_runtime_enable(dev);
548561
#else
562+
da1469x_pd_acquire(MCU_PD_DOMAIN_SYS);
549563
/* Resme if either PM is not used at all or if PM without runtime is used. */
550564
ret = mipi_dbi_smartbond_resume(dev);
551565
#endif

0 commit comments

Comments
 (0)