Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x1000_LCD_Sleep_Clock_Off 'revisited' for cd91c238de and newer
- When LCD Sleep, Turn LCD Clock off
- NEW: Dont mess with Bootloader (or Boot to OF gives Black Screen)
- (Question: does it save Power to Stop the Clock, when no this is not useful)
- Credit ZappBranigan2972 on forums / F. Jacobsen on the Theme Site
- ---
- --- a/firmware/target/mips/ingenic_x1000/lcd-x1000.c.orig 2024-07-20 09:55:10.726080038 +0200
- +++ b/firmware/target/mips/ingenic_x1000/lcd-x1000.c 2024-07-20 09:22:14.643605844 +0200
- @@ -360,6 +360,20 @@
- jz_writef(CPM_LPCDR, CE(0));
- }
- +static void lcd_clock_sleep(bool sleep)
- +{
- +#ifdef BOOTLOADER
- + (void)sleep;
- +#else
- + if (sleep)
- + jz_writef(CPM_LPCDR, CE(1), STOP(1));
- + else
- + jz_writef(CPM_LPCDR, CE(1), STOP(0));
- + while(jz_readf(CPM_LPCDR, BUSY));
- + jz_writef(CPM_LPCDR, CE(0));
- +#endif
- +}
- +
- void lcd_exec_commands(const uint32_t* cmdseq)
- {
- while(*cmdseq != LCD_INSTR_END) {
- @@ -389,6 +403,7 @@
- void lcd_init_device(void)
- {
- jz_writef(CPM_CLKGR, LCD(0));
- + lcd_clock_sleep(false); /* LCD Clock on, or Rolo etc. goes haywire */
- lcd_init_controller(&lcd_tgt_config);
- lcd_init_descriptors(&lcd_tgt_config);
- @@ -431,10 +446,12 @@
- #if defined(LCD_X1000_FASTSLEEP)
- if(state && !en) {
- lcd_tgt_sleep(true);
- + lcd_clock_sleep(true);
- lcd_sleeping = true;
- } else
- #endif
- if(!state && en && lcd_sleeping) {
- + lcd_clock_sleep(false);
- lcd_tgt_sleep(false);
- lcd_sleeping = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement