Commit 91fcfb90 authored by Daniel Mack's avatar Daniel Mack Committed by Eric Miao

[ARM] pxa: Add Colibri LCD functions

This adds LCD functions for Colibri PXA300 and Colibri PXA320 and
configures a LQ043T3DX02 panel.
Original-code-by: default avatarMatthias Meier <matthias.j.meier@gmx.net>
Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
Signed-off-by: default avatarEric Miao <eric.miao@marvell.com>
parent bac07ecd
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <mach/pxa300.h> #include <mach/pxa300.h>
#include <mach/colibri.h> #include <mach/colibri.h>
#include <mach/ohci.h> #include <mach/ohci.h>
#include <mach/pxafb.h>
#include "generic.h" #include "generic.h"
#include "devices.h" #include "devices.h"
...@@ -106,10 +107,49 @@ static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = { ...@@ -106,10 +107,49 @@ static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
GPIO6_MMC1_DAT3, GPIO6_MMC1_DAT3,
}; };
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
GPIO54_LCD_LDD_0,
GPIO55_LCD_LDD_1,
GPIO56_LCD_LDD_2,
GPIO57_LCD_LDD_3,
GPIO58_LCD_LDD_4,
GPIO59_LCD_LDD_5,
GPIO60_LCD_LDD_6,
GPIO61_LCD_LDD_7,
GPIO62_LCD_LDD_8,
GPIO63_LCD_LDD_9,
GPIO64_LCD_LDD_10,
GPIO65_LCD_LDD_11,
GPIO66_LCD_LDD_12,
GPIO67_LCD_LDD_13,
GPIO68_LCD_LDD_14,
GPIO69_LCD_LDD_15,
GPIO70_LCD_LDD_16,
GPIO71_LCD_LDD_17,
GPIO62_LCD_CS_N,
GPIO72_LCD_FCLK,
GPIO73_LCD_LCLK,
GPIO74_LCD_PCLK,
GPIO75_LCD_BIAS,
GPIO76_LCD_VSYNC,
};
static void __init colibri_pxa300_init_lcd(void)
{
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_lcd_pin_config));
}
#else
static inline void colibri_pxa300_init_lcd(void) {}
#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
void __init colibri_pxa300_init(void) void __init colibri_pxa300_init(void)
{ {
colibri_pxa300_init_eth(); colibri_pxa300_init_eth();
colibri_pxa300_init_ohci(); colibri_pxa300_init_ohci();
colibri_pxa300_init_lcd();
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config),
mfp_to_gpio(MFP_PIN_GPIO13)); mfp_to_gpio(MFP_PIN_GPIO13));
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <mach/pxa3xx-regs.h> #include <mach/pxa3xx-regs.h>
#include <mach/mfp-pxa320.h> #include <mach/mfp-pxa320.h>
#include <mach/colibri.h> #include <mach/colibri.h>
#include <mach/pxafb.h>
#include <mach/ohci.h> #include <mach/ohci.h>
#include "generic.h" #include "generic.h"
...@@ -108,10 +109,48 @@ static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { ...@@ -108,10 +109,48 @@ static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
GPIO21_MMC1_DAT3 GPIO21_MMC1_DAT3
}; };
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
GPIO6_2_LCD_LDD_0,
GPIO7_2_LCD_LDD_1,
GPIO8_2_LCD_LDD_2,
GPIO9_2_LCD_LDD_3,
GPIO10_2_LCD_LDD_4,
GPIO11_2_LCD_LDD_5,
GPIO12_2_LCD_LDD_6,
GPIO13_2_LCD_LDD_7,
GPIO63_LCD_LDD_8,
GPIO64_LCD_LDD_9,
GPIO65_LCD_LDD_10,
GPIO66_LCD_LDD_11,
GPIO67_LCD_LDD_12,
GPIO68_LCD_LDD_13,
GPIO69_LCD_LDD_14,
GPIO70_LCD_LDD_15,
GPIO71_LCD_LDD_16,
GPIO72_LCD_LDD_17,
GPIO73_LCD_CS_N,
GPIO74_LCD_VSYNC,
GPIO14_2_LCD_FCLK,
GPIO15_2_LCD_LCLK,
GPIO16_2_LCD_PCLK,
GPIO17_2_LCD_BIAS,
};
static void __init colibri_pxa320_init_lcd(void)
{
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_lcd_pin_config));
}
#else
static inline void colibri_pxa320_init_lcd(void) {}
#endif
void __init colibri_pxa320_init(void) void __init colibri_pxa320_init(void)
{ {
colibri_pxa320_init_eth(); colibri_pxa320_init_eth();
colibri_pxa320_init_ohci(); colibri_pxa320_init_ohci();
colibri_pxa320_init_lcd();
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
mfp_to_gpio(MFP_PIN_GPIO28)); mfp_to_gpio(MFP_PIN_GPIO28));
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <mach/mfp-pxa300.h> #include <mach/mfp-pxa300.h>
#include <mach/colibri.h> #include <mach/colibri.h>
#include <mach/mmc.h> #include <mach/mmc.h>
#include <mach/pxafb.h>
#include "generic.h" #include "generic.h"
#include "devices.h" #include "devices.h"
...@@ -73,3 +74,48 @@ void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) ...@@ -73,3 +74,48 @@ void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
} }
#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static int lcd_bl_pin;
/*
* LCD panel (Sharp LQ043T3DX02)
*/
static void colibri_lcd_backlight(int on)
{
gpio_set_value(lcd_bl_pin, !!on);
}
static struct pxafb_mode_info sharp_lq43_mode = {
.pixclock = 101936,
.xres = 480,
.yres = 272,
.bpp = 32,
.depth = 18,
.hsync_len = 41,
.left_margin = 2,
.right_margin = 2,
.vsync_len = 10,
.upper_margin = 2,
.lower_margin = 2,
.sync = 0,
.cmap_greyscale = 0,
};
static struct pxafb_mach_info sharp_lq43_info = {
.modes = &sharp_lq43_mode,
.num_modes = 1,
.cmap_inverse = 0,
.cmap_static = 0,
.lcd_conn = LCD_COLOR_TFT_18BPP,
.pxafb_backlight_power = colibri_lcd_backlight,
};
void __init colibri_pxa3xx_init_lcd(int bl_pin)
{
lcd_bl_pin = bl_pin;
gpio_request(bl_pin, "lcd backlight");
gpio_direction_output(bl_pin, 0);
set_pxa_fb_info(&sharp_lq43_info);
}
#endif
...@@ -10,6 +10,12 @@ extern void colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin); ...@@ -10,6 +10,12 @@ extern void colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin);
static inline void colibri_pxa3xx_init_mmc(mfp_cfg_t *, int, int) {} static inline void colibri_pxa3xx_init_mmc(mfp_cfg_t *, int, int) {}
#endif #endif
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
extern void colibri_pxa3xx_init_lcd(int bl_pin);
#else
static inline void colibri_pxa3xx_init_lcd(int) {}
#endif
/* physical memory regions */ /* physical memory regions */
#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ #define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment