Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 28th, 2012  |  syntax: Diff  |  size: 3.26 KB  |  views: 55  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c
  2. index 21ca321..b2e1347 100644
  3. --- a/firmware/target/arm/rk27xx/lcd-hifiman.c
  4. +++ b/firmware/target/arm/rk27xx/lcd-hifiman.c
  5. @@ -29,7 +29,7 @@
  6.  
  7.  static bool display_on = false;
  8.  
  9. -void lcd_display_init()
  10. +static void lcd_display_init(void)
  11.  {
  12.      unsigned int x, y;
  13.  
  14. @@ -108,6 +108,12 @@ void lcd_display_init()
  15.      display_on = true;
  16.  }
  17.  
  18. +void lcd_init_device(void)
  19. +{
  20. +    lcdif_init(LCDIF_16BIT);
  21. +    lcd_display_init();
  22. +}
  23. +
  24.  void lcd_enable (bool on)
  25.  {
  26.      if (on)
  27. diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.c b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
  28. index ff60279..affc49b 100644
  29. --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c
  30. +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
  31. @@ -123,27 +123,26 @@ static void lcdctrl_init(void)
  32.  }
  33.  
  34.  /* configure pins to drive lcd in 18bit mode (16bit mode for HiFiMAN's) */
  35. -static void iomux_lcd(void)
  36. +static void iomux_lcd(enum lcdif_mode_t mode)
  37.  {
  38.      unsigned long muxa;
  39.  
  40.      muxa = SCU_IOMUXA_CON & ~(IOMUX_LCD_VSYNC|IOMUX_LCD_DEN|0xff);
  41.  
  42. -#if !defined(HM801) && !defined(HM60x)
  43. -    muxa |= IOMUX_LCD_D18|IOMUX_LCD_D20|IOMUX_LCD_D22|IOMUX_LCD_D17|IOMUX_LCD_D16;
  44. -#endif
  45. +    if (mode == LCDIF_18BIT)
  46. +    {
  47. +        muxa |= IOMUX_LCD_D18|IOMUX_LCD_D20|IOMUX_LCD_D22|IOMUX_LCD_D17|IOMUX_LCD_D16;
  48. +    }
  49.  
  50.      SCU_IOMUXA_CON = muxa;
  51.      SCU_IOMUXB_CON |= IOMUX_LCD_D815;
  52.  }
  53.  
  54. -void lcd_init_device()
  55. +void lcdif_init(enum lcdif_mode_t mode)
  56.  {
  57. -    iomux_lcd();       /* setup pins for 16bit lcd interface */
  58. +    iomux_lcd(mode);   /* setup pins for lcd interface */
  59.      lcdctrl_init();    /* basic lcdc module configuration */
  60. -
  61.      lcdctrl_bypass(1); /* run in bypass mode - all writes goes directly to lcd controller */
  62. -    lcd_display_init();
  63.  }
  64.  
  65.  /* This is ugly hack. We drive lcd in bypass mode
  66. diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.h b/firmware/target/arm/rk27xx/lcdif-rk27xx.h
  67. index caf97c8..1d7b810 100644
  68. --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.h
  69. +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.h
  70. @@ -1,11 +1,16 @@
  71.  #ifndef _LCDIF_RK27XX_H
  72.  #define _LCDIF_RK27XX_H
  73.  
  74. +enum lcdif_mode_t {
  75. +    LCDIF_16BIT,
  76. +    LCDIF_18BIT
  77. +};
  78. +
  79.  unsigned int lcd_data_transform(unsigned int data);
  80.  
  81.  void lcd_cmd(unsigned int cmd);
  82.  void lcd_data(unsigned int data);
  83.  void lcd_write_reg(unsigned int reg, unsigned int val);
  84. -void lcd_display_init(void);
  85. +void lcdif_init(enum lcdif_mode_t mode);
  86.  
  87.  #endif /* _LCDIF_RK27XX_H */
  88. diff --git a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
  89. index 6b989a6..044ab9b 100644
  90. --- a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
  91. +++ b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
  92. @@ -71,7 +71,7 @@ static void lcd_sleep(bool sleep)
  93.      lcd_cmd(GRAM_WRITE);
  94.  }
  95.  
  96. -void lcd_display_init()
  97. +static void lcd_display_init(void)
  98.  {
  99.      unsigned int x, y;
  100.  
  101. @@ -173,6 +173,12 @@ void lcd_display_init()
  102.      lcd_sleep(false);
  103.  }
  104.  
  105. +void lcd_init_device(void)
  106. +{
  107. +    lcdif_init(LCDIF_18BIT);
  108. +    lcd_display_init();
  109. +}
  110. +
  111.  void lcd_update_rect(int x, int y, int width, int height)
  112.  {
  113.      int px = x, py = y;