summaryrefslogtreecommitdiff
path: root/nuttx/drivers/lcd
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-05-06 08:34:53 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-05-06 08:34:53 -0600
commitd48c14a36cc386389cc8159ab7b88d5e668806df (patch)
tree8d636e2e3ecb326359568dd10f91d933e973410f /nuttx/drivers/lcd
parent25e36e506e4710a7f9ef4495805c2ff07774a9a0 (diff)
downloadpx4-nuttx-d48c14a36cc386389cc8159ab7b88d5e668806df.tar.gz
px4-nuttx-d48c14a36cc386389cc8159ab7b88d5e668806df.tar.bz2
px4-nuttx-d48c14a36cc386389cc8159ab7b88d5e668806df.zip
mio283qt2.c: Need select/deselect LCD in setpower method; hwinitialize did not deselect LCD
Diffstat (limited to 'nuttx/drivers/lcd')
-rw-r--r--nuttx/drivers/lcd/mio283qt2.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/nuttx/drivers/lcd/mio283qt2.c b/nuttx/drivers/lcd/mio283qt2.c
index 4c8835eef..3a1087c20 100644
--- a/nuttx/drivers/lcd/mio283qt2.c
+++ b/nuttx/drivers/lcd/mio283qt2.c
@@ -690,6 +690,10 @@ static int mio283qt2_getpower(FAR struct lcd_dev_s *dev)
static int mio283qt2_poweroff(FAR struct mio283qt2_lcd_s *lcd)
{
+ /* Select the LCD */
+
+ lcd->select(lcd);
+
/* Set the backlight off */
lcd->backlight(lcd, 0);
@@ -698,6 +702,10 @@ static int mio283qt2_poweroff(FAR struct mio283qt2_lcd_s *lcd)
mio283qt2_putreg(lcd, 0x28, 0x0000); /* GON=0, DTE=0, D=0 */
+ /* Deselect the LCD */
+
+ lcd->deselect(lcd);
+
/* Remember the power off state */
g_lcddev.power = 0;
@@ -725,6 +733,10 @@ static int mio283qt2_setpower(FAR struct lcd_dev_s *dev, int power)
if (power > 0)
{
+ /* Select the LCD */
+
+ lcd->select(lcd);
+
/* Set the backlight level */
lcd->backlight(lcd, power);
@@ -733,12 +745,16 @@ static int mio283qt2_setpower(FAR struct lcd_dev_s *dev, int power)
* D=ON(3) CM=0 DTE=1 GON=1 SPT=0 VLE=0 PT=0
*/
- /* Display on */
-
mio283qt2_putreg(lcd, 0x28, 0x0038); /* GON=1, DTE=1, D=2 */
up_mdelay(40);
mio283qt2_putreg(lcd, 0x28, 0x003c); /* GON=1, DTE=1, D=3 */
+ /* Deselect the LCD */
+
+ lcd->deselect(lcd);
+
+ /* Remember the power on state */
+
g_lcddev.power = power;
}
else
@@ -793,6 +809,7 @@ static inline int mio283qt2_hwinitialize(FAR struct mio283qt2_dev_s *priv)
#ifndef CONFIG_LCD_NOGETRUN
uint16_t id;
#endif
+ int ret;
/* Select the LCD */
@@ -903,19 +920,20 @@ static inline int mio283qt2_hwinitialize(FAR struct mio283qt2_dev_s *priv)
/* Window setting */
mio283qt2_setarea(lcd, 0, 0, (MIO283QT2_XRES-1), (MIO283QT2_YRES-1));
- return OK;
+ ret = OK;
}
#ifndef CONFIG_LCD_NOGETRUN
else
{
lcddbg("Unsupported LCD type\n");
- return -ENODEV;
+ ret = -ENODEV;
}
#endif
/* De-select the LCD */
lcd->deselect(lcd);
+ return ret;
}
/*************************************************************************************