LCD: Added existing FBIO_SETPOWER support to lcd_framebuffer.c

This commit is contained in:
Cis van Mierlo 2022-05-09 12:04:35 +02:00 committed by Xiang Xiao
parent a71f11d480
commit e2b0d7ef6e

View File

@ -105,6 +105,8 @@ static int lcdfb_setcursor(FAR struct fb_vtable_s *vtable,
FAR struct fb_setcursor_s *settings);
#endif
static int lcdfb_setpower(FAR struct fb_vtable_s *vtable, FAR int power);
/****************************************************************************
* Private Data
****************************************************************************/
@ -436,6 +438,35 @@ static int lcdfb_setcursor(FAR struct fb_vtable_s *vtable,
}
#endif
/****************************************************************************
* Name: lcdfb_setpower
****************************************************************************/
static int lcdfb_setpower(FAR struct fb_vtable_s *vtable, FAR int power)
{
int ret = -EINVAL;
FAR struct lcdfb_dev_s *priv;
FAR struct lcd_dev_s *lcd;
DEBUGASSERT(vtable != NULL);
priv = (FAR struct lcdfb_dev_s *)vtable;
if (priv != NULL)
{
lcd = priv->lcd;
DEBUGASSERT(lcd->setpower != NULL);
ret = lcd->setpower(lcd, power);
if (ret < 0)
{
lcderr("ERROR: LCD setpower() failed: %d\n", ret);
}
}
return ret;
}
/****************************************************************************
* Public Functions
****************************************************************************/
@ -491,6 +522,7 @@ int up_fbinitialize(int display)
priv->vtable.setcursor = lcdfb_setcursor,
#endif
priv->vtable.updatearea = lcdfb_updateearea,
priv->vtable.setpower = lcdfb_setpower,
#ifdef CONFIG_LCD_EXTERNINIT
/* Use external graphics driver initialization */