diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-09-17 18:50:18 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-09-17 18:50:18 +0000 |
commit | 0a584fb06cfd5defd1836d580508a08c8aa35cf0 (patch) | |
tree | e34878c2fc18d4631616cf1a2c7f57b5e67038c3 /firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c | |
parent | 67def0b18c0fdb844aaac76fb3e0c52a83f1ab98 (diff) |
annotate init sequence
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18539 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c')
-rw-r--r-- | firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c | 91 |
1 files changed, 48 insertions, 43 deletions
diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c b/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c index dac0dc6164..e6e14b5e57 100644 --- a/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c +++ b/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c @@ -171,47 +171,74 @@ void lcd_set_flip(bool yesno) } + +void lcd_off(void) +{ + switch(controller_type) + { + case 0x0154: + spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x12); + delay(20); + spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x00); + break; + } +} + +void lcd_on(void) +{ + switch(controller_type) + { + case 0x0154: + spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x12); + delay(20); + spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x13); + break; + } +} /* LCD init */ void lcd_init_device(void) { + init_lcd_spi(); controller_type = lcd_read_id(); switch(controller_type) { case 0x0154: - spi_set_reg(S6D0154_REG_EXTERNAL_INTERFACE_CONTROL, 0x130); - spi_set_reg(S6D0154_REG_MTP_TEST_KEY, 0x8d); + spi_set_reg(S6D0154_REG_EXTERNAL_INTERFACE_CONTROL, 0x130); // RGB interface, RGB interface for PNP mode + spi_set_reg(S6D0154_REG_MTP_TEST_KEY, 0x8d); // ?? spi_set_reg(0x92, 0x10); - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x1b); - spi_set_reg(S6D0154_REG_POWER_CONTROL_3, 0x3101); - spi_set_reg(S6D0154_REG_POWER_CONTROL_4, 0x105f); + /* See also datasheet 11.3 Set up Flow of Generated Power Supply */ + spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x1b); // VC1IEN, 2.76V + spi_set_reg(S6D0154_REG_POWER_CONTROL_3, 0x3101);// VGH=6*VCI1, VGL=-4*VCI1, f(DCCLK):f(DCCLK1)=1:0.5, f(DCCLK) : f(DCCLK3)= 1:0.5 + spi_set_reg(S6D0154_REG_POWER_CONTROL_4, 0x105f);//DCR_EX=1(Use dotclock) spi_set_reg(S6D0154_REG_POWER_CONTROL_5, 0x667f); spi_set_reg(S6D0154_REG_POWER_CONTROL_1, 0x800); - delay(20); + delay(20); // >10ms spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x11b); - delay(20); + delay(20); // >10ms spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x31b); - delay(20); + delay(20); // >10ms spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x71b); - delay(20); + delay(20); // >10ms spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0xf1b); - delay(20); + delay(20); // >10ms spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0xf3b); - delay(20); + delay(30); // >30ms spi_set_reg(S6D0154_REG_DRIVER_OUTPUT_CONTROL, 0x2128); spi_set_reg(S6D0154_REG_LCD_DRIVING_WAVEFORM_CONTROL, 0x100); - spi_set_reg(S6D0154_REG_ENTRY_MODE, 0x1030); - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0); + spi_set_reg(S6D0154_REG_ENTRY_MODE, 0x1030);//{DB [17:12], DB [11:6], DB [5:0]} is assigned to {B, G, R}. Horizontal first, auto increment address, write from 0x0000 to 0xdbaf + spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0); // all off spi_set_reg(S6D0154_REG_BLANK_PERIOD_CONTROL, 0x808); spi_set_reg(S6D0154_REG_FRAME_CYCLE_CONTROL, 0x1100); - spi_set_reg(S6D0154_REG_START_OSCILLATION, 0xf01); + spi_set_reg(S6D0154_REG_START_OSCILLATION, 0xf01);// Start oscillator, X 1.25 spi_set_reg(S6D0154_REG_VCI_RECYCLING, 0); spi_set_reg(S6D0154_REG_GATE_SCAN_POSITION, 0); - spi_set_reg(S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_1, 0x13f); - spi_set_reg(S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_2, 0); - spi_set_reg(S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_1, 0xef); - spi_set_reg(S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_2, 0); - spi_set_reg(S6D0154_REG_VERTICAL_WINDOW_ADDRESS_1, 0x13f); - spi_set_reg(S6D0154_REG_VERTICAL_WINDOW_ADDRESS_2, 0); + /* Set things up to write to the entire screen */ + spi_set_reg(S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_1, 319); // end of partial screen + spi_set_reg(S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_2, 0); // start of partial screen + spi_set_reg(S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_1, 239); // end of window + spi_set_reg(S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_2, 0); // start of window + spi_set_reg(S6D0154_REG_VERTICAL_WINDOW_ADDRESS_1, 319); // end of window + spi_set_reg(S6D0154_REG_VERTICAL_WINDOW_ADDRESS_2, 0); // start of window spi_set_reg(S6D0154_REG_GAMMA_CONTROL_1, 0); spi_set_reg(S6D0154_REG_GAMMA_CONTROL_2, 0xf00); spi_set_reg(S6D0154_REG_GAMMA_CONTROL_3, 0xa03); @@ -222,34 +249,12 @@ void lcd_init_device(void) spi_set_reg(S6D0154_REG_GAMMA_CONTROL_8, 3); spi_set_reg(S6D0154_REG_GAMMA_CONTROL_9, 0x1f07); spi_set_reg(S6D0154_REG_GAMMA_CONTROL_10, 0x71f); - break; - } -} - - -void lcd_off(void) -{ - switch(controller_type) - { - case 0x0154: - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x12); delay(20); - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x00); + lcd_on(); break; } } -void lcd_on(void) -{ - switch(controller_type) - { - case 0x0154: - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x12); - delay(20); - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x13); - break; - } -} /*** Update functions ***/ |