Advertisement
Guest User

455_x1000_LCD_Sleep_Clock_Off.diff

a guest
Sep 3rd, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.55 KB | Source Code | 0 0
  1. x1000_LCD_Sleep_Clock_Off 'revisited' for cd91c238de and newer
  2.  
  3. When LCD Sleep, Turn LCD Clock off
  4. NEW: Dont mess with Bootloader (or Boot to OF gives Black Screen)
  5.      (Question: does it save Power to Stop the Clock, when no this is not useful)
  6.  
  7. Credit ZappBranigan2972 on forums / F. Jacobsen on the Theme Site
  8.  
  9. ---
  10.  
  11. --- a/firmware/target/mips/ingenic_x1000/lcd-x1000.c.orig   2024-07-20 09:55:10.726080038 +0200
  12. +++ b/firmware/target/mips/ingenic_x1000/lcd-x1000.c    2024-07-20 09:22:14.643605844 +0200
  13. @@ -360,6 +360,20 @@
  14.      jz_writef(CPM_LPCDR, CE(0));
  15.  }
  16.  
  17. +static void lcd_clock_sleep(bool sleep)
  18. +{
  19. +#ifdef BOOTLOADER
  20. +    (void)sleep;
  21. +#else
  22. +    if (sleep)
  23. +        jz_writef(CPM_LPCDR, CE(1), STOP(1));
  24. +    else
  25. +        jz_writef(CPM_LPCDR, CE(1), STOP(0));
  26. +    while(jz_readf(CPM_LPCDR, BUSY));
  27. +    jz_writef(CPM_LPCDR, CE(0));
  28. +#endif
  29. +}
  30. +
  31.  void lcd_exec_commands(const uint32_t* cmdseq)
  32.  {
  33.      while(*cmdseq != LCD_INSTR_END) {
  34. @@ -389,6 +403,7 @@
  35.  void lcd_init_device(void)
  36.  {
  37.      jz_writef(CPM_CLKGR, LCD(0));
  38. +    lcd_clock_sleep(false); /* LCD Clock on, or Rolo etc. goes haywire */
  39.  
  40.      lcd_init_controller(&lcd_tgt_config);
  41.      lcd_init_descriptors(&lcd_tgt_config);
  42. @@ -431,10 +446,12 @@
  43.  #if defined(LCD_X1000_FASTSLEEP)
  44.      if(state && !en) {
  45.          lcd_tgt_sleep(true);
  46. +        lcd_clock_sleep(true);
  47.          lcd_sleeping = true;
  48.      } else
  49.  #endif
  50.      if(!state && en && lcd_sleeping) {
  51. +        lcd_clock_sleep(false);
  52.          lcd_tgt_sleep(false);
  53.          lcd_sleeping = false;
  54.      }
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement