[U-Boot] [PATCH 4/8] video: sunxi: Hook up SSD2828 with the sunxi video driver

2015-01-09 Thread Siarhei Siamashka
Expose the necessary configuration parameters in Kconfig.
Add SSD2828 initialization between enabling the parallel LCD
interface and turning on the backlight.

Signed-off-by: Siarhei Siamashka 
---
 board/sunxi/Kconfig | 60 +
 drivers/video/sunxi_display.c   |  3 +++
 drivers/video/sunxi_lcd_panel.c | 38 ++
 drivers/video/sunxi_lcd_panel.h |  3 +++
 4 files changed, 104 insertions(+)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index adee5ed..92dbce7 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -345,6 +345,60 @@ config VIDEO_LCD_BL_PWM
Set the backlight pwm pin for the LCD panel. This takes a string in the
format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
 
+config VIDEO_LCD_SPI_CS
+   string "SPI CS pin for LCD related config job"
+   depends on VIDEO_LCD_SSD2828
+   default ""
+   ---help---
+   This is one of the SPI communication pins, involved in setting up a
+   working LCD configuration. The exact role of SPI may differ for
+   different hardware setups. The option takes a string in the format
+   understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SPI_SCLK
+   string "SPI SCLK pin for LCD related config job"
+   depends on VIDEO_LCD_SSD2828
+   default ""
+   ---help---
+   This is one of the SPI communication pins, involved in setting up a
+   working LCD configuration. The exact role of SPI may differ for
+   different hardware setups. The option takes a string in the format
+   understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SPI_MOSI
+   string "SPI MOSI pin for LCD related config job"
+   depends on VIDEO_LCD_SSD2828
+   default ""
+   ---help---
+   This is one of the SPI communication pins, involved in setting up a
+   working LCD configuration. The exact role of SPI may differ for
+   different hardware setups. The option takes a string in the format
+   understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SPI_MISO
+   string "SPI MISO pin for LCD related config job (optional)"
+   depends on VIDEO_LCD_SSD2828
+   default ""
+   ---help---
+   This is one of the SPI communication pins, involved in setting up a
+   working LCD configuration. The exact role of SPI may differ for
+   different hardware setups. If wired up, this pin may provide additional
+   useful functionality. Such as bi-directional communication with the
+   hardware and LCD panel id retrieval (if the panel can report it). The
+   option takes a string in the format understood by sunxi_name_to_gpio,
+   e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SSD2828_RESET
+   string "RESET pin of SSD2828"
+   depends on VIDEO_LCD_SSD2828
+   default ""
+   ---help---
+   The reset pin of SSD2828 chip. This takes a string in the format
+   understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
+config VIDEO_LCD_SSD2828
+   bool
+   select VIDEO_LCD_IF_PARALLEL
 
 # Note only one of these may be selected at a time! But hidden choices are
 # not supported by Kconfig
@@ -373,6 +427,12 @@ config VIDEO_LCD_PANEL_HITACHI_TX18D42VM
bool "Hitachi tx18d42vm LCD panel"
select VIDEO_LCD_IF_LVDS
 
+config VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828
+   bool "MIPI 4-lane, 513Mbps LCD panel via SSD2828 bridge chip"
+   select VIDEO_LCD_SSD2828
+   ---help---
+7.85" 768x1024 LCD panels, such as LG LP079X01 or AUO B079XAN01.0
+
 endchoice
 
 
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index c3fc732..f11b241 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -850,6 +850,9 @@ static void sunxi_mode_set(const struct ctfb_res_modes 
*mode,
sunxi_lcdc_tcon0_mode_set(mode);
sunxi_composer_enable();
sunxi_lcdc_enable();
+#ifdef CONFIG_VIDEO_LCD_SSD2828
+   sunxi_ssd2828_init(mode);
+#endif
sunxi_lcdc_backlight_enable();
break;
case sunxi_monitor_vga:
diff --git a/drivers/video/sunxi_lcd_panel.c b/drivers/video/sunxi_lcd_panel.c
index 9ebaff2..cdde639 100644
--- a/drivers/video/sunxi_lcd_panel.c
+++ b/drivers/video/sunxi_lcd_panel.c
@@ -11,6 +11,8 @@
 #include 
 #include 
 #include 
+#include "sunxi_lcd_panel.h"
+#include "ssd2828.h"
 
 #ifdef CONFIG_VIDEO_LCD_PANEL_HITACHI_TX18D42VM
 
@@ -66,3 +68,39 @@ void sunxi_lcd_panel_hitachi_tx18d42vm_init(void)
 }
 
 #endif
+
+#ifdef CONFIG_VIDEO_LCD_SSD2828
+
+int sunxi_ssd2828_init(const struct ctfb_res_modes *mode)
+{
+   struct ssd2828_config cfg = {
+   .csx_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_CS),
+   .sck_pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_SPI_SC

Re: [U-Boot] [PATCH 4/8] video: sunxi: Hook up SSD2828 with the sunxi video driver

2015-01-09 Thread Anatolij Gustschin
On Fri,  9 Jan 2015 12:01:12 +0200
Siarhei Siamashka  wrote:
...
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index adee5ed..92dbce7 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -345,6 +345,60 @@ config VIDEO_LCD_BL_PWM
>   Set the backlight pwm pin for the LCD panel. This takes a string in the
>   format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
>  
> +config VIDEO_LCD_SPI_CS
> + string "SPI CS pin for LCD related config job"
> + depends on VIDEO_LCD_SSD2828
> + default ""
> + ---help---
> + This is one of the SPI communication pins, involved in setting up a
> + working LCD configuration. The exact role of SPI may differ for
> + different hardware setups. The option takes a string in the format
> + understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.

please address comments from Hans regarding the Kconfig changes.

Thanks,

Anatolij
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot