summaryrefslogtreecommitdiff
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
parent25e36e506e4710a7f9ef4495805c2ff07774a9a0 (diff)
downloadnuttx-d48c14a36cc386389cc8159ab7b88d5e668806df.tar.gz
nuttx-d48c14a36cc386389cc8159ab7b88d5e668806df.tar.bz2
nuttx-d48c14a36cc386389cc8159ab7b88d5e668806df.zip
mio283qt2.c: Need select/deselect LCD in setpower method; hwinitialize did not deselect LCD
-rw-r--r--nuttx/ChangeLog5
-rw-r--r--nuttx/configs/pirelli_dpl10/nsh_highram/ld.script19
-rw-r--r--nuttx/drivers/lcd/mio283qt2.c26
3 files changed, 36 insertions, 14 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 98f0a740d..e7286abe0 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -4673,4 +4673,7 @@
(from Craig Comstock via Alan Alan Carvalho de Assis, 2013-5-3).
* arch/arm/src/calypso: Fix some compilation warnings (2013-5-5).
* configs/pirelli_dpl10/nsh_highram: Converted to use the
- kconfig-frontends tools (2013-5-5). \ No newline at end of file
+ kconfig-frontends tools (2013-5-5).
+ * drivers/lcd/mio283qt2.c: LCD was not being selected in setpower
+ method (also not being deselected in hwinitialize function)
+ (2013-5-6).
diff --git a/nuttx/configs/pirelli_dpl10/nsh_highram/ld.script b/nuttx/configs/pirelli_dpl10/nsh_highram/ld.script
index 35fa84728..5bdefbe06 100644
--- a/nuttx/configs/pirelli_dpl10/nsh_highram/ld.script
+++ b/nuttx/configs/pirelli_dpl10/nsh_highram/ld.script
@@ -13,8 +13,8 @@ MEMORY
{
/* 0x800000-0x83ffff */
/* compal-loaded binary: our text, initialized data */
- LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000
- TRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00010000
+ LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 128K
+ TRAM (rw) : ORIGIN = 0x00820000, LENGTH = 64K
/* compal-loaded binary: our unitialized data, stacks, heap */
IRAM (rw) : ORIGIN = 0x00830000, LENGTH = 0x00010000
}
@@ -34,7 +34,7 @@ SECTIONS
PROVIDE(__start = .);
KEEP(*(.text.start))
*(.text.start)
- } > TRAM
+ } > LRAM
/* exception vectors from 0x80001c to 0x800034 */
.text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) {
@@ -46,8 +46,7 @@ SECTIONS
/* code */
. = ALIGN(4);
- .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) :
- AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) {
+ .text : {
/* regular code */
*(.text*)
/* always-in-ram code */
@@ -55,7 +54,7 @@ SECTIONS
/* gcc voodoo */
*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
. = ALIGN(4);
- } > TRAM
+ } > LRAM
PROVIDE(_text_start = LOADADDR(.text));
PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text));
@@ -67,7 +66,7 @@ SECTIONS
KEEP(*(SORT(.ctors)))
/* end of list */
LONG(0)
- } > TRAM
+ } > LRAM
PROVIDE(_ctor_start = LOADADDR(.ctors));
PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors));
@@ -79,7 +78,7 @@ SECTIONS
KEEP(*(SORT(.dtors)))
/* end of list */
LONG(0)
- } > TRAM
+ } > LRAM
PROVIDE(_dtor_start = LOADADDR(.dtors));
PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors));
@@ -87,14 +86,16 @@ SECTIONS
. = ALIGN(4);
.rodata : {
*(.rodata*)
- } > TRAM
+ } > LRAM
PROVIDE(_rodata_start = LOADADDR(.rodata));
PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata));
/* initialized data */
. = ALIGN(4);
.data : {
+ _sdata = ABSOLUTE(.);
*(.data)
+ _edata = ABSOLUTE(.);
} > TRAM
PROVIDE(_data_start = LOADADDR(.data));
PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data));
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;
}
/*************************************************************************************