diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-03-22 21:04:19 -0400 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-03-22 21:59:55 -0400 |
commit | 91fcfb908d62038c3c2cdecb7fb8aa2c98cb70a2 (patch) | |
tree | df6bae91c0dfac50540532ab4ffc495a3378c83b | |
parent | bac07ecd6c9b16656aced6dc4f9f070120153046 (diff) |
[ARM] pxa: Add Colibri LCD functions
This adds LCD functions for Colibri PXA300 and Colibri PXA320 and
configures a LQ043T3DX02 panel.
Original-code-by: Matthias Meier <matthias.j.meier@gmx.net>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa300.c | 40 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa320.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa3xx.c | 46 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/colibri.h | 6 |
4 files changed, 131 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index 14ef9bf094fa..2858a5978709 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <mach/pxa300.h> | 25 | #include <mach/pxa300.h> |
26 | #include <mach/colibri.h> | 26 | #include <mach/colibri.h> |
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxafb.h> | ||
28 | 29 | ||
29 | #include "generic.h" | 30 | #include "generic.h" |
30 | #include "devices.h" | 31 | #include "devices.h" |
@@ -106,10 +107,49 @@ static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = { | |||
106 | GPIO6_MMC1_DAT3, | 107 | GPIO6_MMC1_DAT3, |
107 | }; | 108 | }; |
108 | 109 | ||
110 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
111 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { | ||
112 | GPIO54_LCD_LDD_0, | ||
113 | GPIO55_LCD_LDD_1, | ||
114 | GPIO56_LCD_LDD_2, | ||
115 | GPIO57_LCD_LDD_3, | ||
116 | GPIO58_LCD_LDD_4, | ||
117 | GPIO59_LCD_LDD_5, | ||
118 | GPIO60_LCD_LDD_6, | ||
119 | GPIO61_LCD_LDD_7, | ||
120 | GPIO62_LCD_LDD_8, | ||
121 | GPIO63_LCD_LDD_9, | ||
122 | GPIO64_LCD_LDD_10, | ||
123 | GPIO65_LCD_LDD_11, | ||
124 | GPIO66_LCD_LDD_12, | ||
125 | GPIO67_LCD_LDD_13, | ||
126 | GPIO68_LCD_LDD_14, | ||
127 | GPIO69_LCD_LDD_15, | ||
128 | GPIO70_LCD_LDD_16, | ||
129 | GPIO71_LCD_LDD_17, | ||
130 | GPIO62_LCD_CS_N, | ||
131 | GPIO72_LCD_FCLK, | ||
132 | GPIO73_LCD_LCLK, | ||
133 | GPIO74_LCD_PCLK, | ||
134 | GPIO75_LCD_BIAS, | ||
135 | GPIO76_LCD_VSYNC, | ||
136 | }; | ||
137 | |||
138 | static void __init colibri_pxa300_init_lcd(void) | ||
139 | { | ||
140 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_lcd_pin_config)); | ||
141 | } | ||
142 | |||
143 | #else | ||
144 | static inline void colibri_pxa300_init_lcd(void) {} | ||
145 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ | ||
146 | |||
109 | void __init colibri_pxa300_init(void) | 147 | void __init colibri_pxa300_init(void) |
110 | { | 148 | { |
111 | colibri_pxa300_init_eth(); | 149 | colibri_pxa300_init_eth(); |
112 | colibri_pxa300_init_ohci(); | 150 | colibri_pxa300_init_ohci(); |
151 | colibri_pxa300_init_lcd(); | ||
152 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); | ||
113 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), | 153 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), |
114 | mfp_to_gpio(MFP_PIN_GPIO13)); | 154 | mfp_to_gpio(MFP_PIN_GPIO13)); |
115 | } | 155 | } |
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index 86cb202847e8..b67736743518 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <mach/pxa3xx-regs.h> | 25 | #include <mach/pxa3xx-regs.h> |
26 | #include <mach/mfp-pxa320.h> | 26 | #include <mach/mfp-pxa320.h> |
27 | #include <mach/colibri.h> | 27 | #include <mach/colibri.h> |
28 | #include <mach/pxafb.h> | ||
28 | #include <mach/ohci.h> | 29 | #include <mach/ohci.h> |
29 | 30 | ||
30 | #include "generic.h" | 31 | #include "generic.h" |
@@ -108,10 +109,48 @@ static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { | |||
108 | GPIO21_MMC1_DAT3 | 109 | GPIO21_MMC1_DAT3 |
109 | }; | 110 | }; |
110 | 111 | ||
112 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
113 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { | ||
114 | GPIO6_2_LCD_LDD_0, | ||
115 | GPIO7_2_LCD_LDD_1, | ||
116 | GPIO8_2_LCD_LDD_2, | ||
117 | GPIO9_2_LCD_LDD_3, | ||
118 | GPIO10_2_LCD_LDD_4, | ||
119 | GPIO11_2_LCD_LDD_5, | ||
120 | GPIO12_2_LCD_LDD_6, | ||
121 | GPIO13_2_LCD_LDD_7, | ||
122 | GPIO63_LCD_LDD_8, | ||
123 | GPIO64_LCD_LDD_9, | ||
124 | GPIO65_LCD_LDD_10, | ||
125 | GPIO66_LCD_LDD_11, | ||
126 | GPIO67_LCD_LDD_12, | ||
127 | GPIO68_LCD_LDD_13, | ||
128 | GPIO69_LCD_LDD_14, | ||
129 | GPIO70_LCD_LDD_15, | ||
130 | GPIO71_LCD_LDD_16, | ||
131 | GPIO72_LCD_LDD_17, | ||
132 | GPIO73_LCD_CS_N, | ||
133 | GPIO74_LCD_VSYNC, | ||
134 | GPIO14_2_LCD_FCLK, | ||
135 | GPIO15_2_LCD_LCLK, | ||
136 | GPIO16_2_LCD_PCLK, | ||
137 | GPIO17_2_LCD_BIAS, | ||
138 | }; | ||
139 | |||
140 | static void __init colibri_pxa320_init_lcd(void) | ||
141 | { | ||
142 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_lcd_pin_config)); | ||
143 | } | ||
144 | #else | ||
145 | static inline void colibri_pxa320_init_lcd(void) {} | ||
146 | #endif | ||
147 | |||
111 | void __init colibri_pxa320_init(void) | 148 | void __init colibri_pxa320_init(void) |
112 | { | 149 | { |
113 | colibri_pxa320_init_eth(); | 150 | colibri_pxa320_init_eth(); |
114 | colibri_pxa320_init_ohci(); | 151 | colibri_pxa320_init_ohci(); |
152 | colibri_pxa320_init_lcd(); | ||
153 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); | ||
115 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), | 154 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), |
116 | mfp_to_gpio(MFP_PIN_GPIO28)); | 155 | mfp_to_gpio(MFP_PIN_GPIO28)); |
117 | } | 156 | } |
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c index cbaa8424fc86..12d0afc54aa5 100644 --- a/arch/arm/mach-pxa/colibri-pxa3xx.c +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <mach/mfp-pxa300.h> | 23 | #include <mach/mfp-pxa300.h> |
24 | #include <mach/colibri.h> | 24 | #include <mach/colibri.h> |
25 | #include <mach/mmc.h> | 25 | #include <mach/mmc.h> |
26 | #include <mach/pxafb.h> | ||
26 | 27 | ||
27 | #include "generic.h" | 28 | #include "generic.h" |
28 | #include "devices.h" | 29 | #include "devices.h" |
@@ -73,3 +74,48 @@ void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) | |||
73 | } | 74 | } |
74 | #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ | 75 | #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ |
75 | 76 | ||
77 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
78 | static int lcd_bl_pin; | ||
79 | |||
80 | /* | ||
81 | * LCD panel (Sharp LQ043T3DX02) | ||
82 | */ | ||
83 | static void colibri_lcd_backlight(int on) | ||
84 | { | ||
85 | gpio_set_value(lcd_bl_pin, !!on); | ||
86 | } | ||
87 | |||
88 | static struct pxafb_mode_info sharp_lq43_mode = { | ||
89 | .pixclock = 101936, | ||
90 | .xres = 480, | ||
91 | .yres = 272, | ||
92 | .bpp = 32, | ||
93 | .depth = 18, | ||
94 | .hsync_len = 41, | ||
95 | .left_margin = 2, | ||
96 | .right_margin = 2, | ||
97 | .vsync_len = 10, | ||
98 | .upper_margin = 2, | ||
99 | .lower_margin = 2, | ||
100 | .sync = 0, | ||
101 | .cmap_greyscale = 0, | ||
102 | }; | ||
103 | |||
104 | static struct pxafb_mach_info sharp_lq43_info = { | ||
105 | .modes = &sharp_lq43_mode, | ||
106 | .num_modes = 1, | ||
107 | .cmap_inverse = 0, | ||
108 | .cmap_static = 0, | ||
109 | .lcd_conn = LCD_COLOR_TFT_18BPP, | ||
110 | .pxafb_backlight_power = colibri_lcd_backlight, | ||
111 | }; | ||
112 | |||
113 | void __init colibri_pxa3xx_init_lcd(int bl_pin) | ||
114 | { | ||
115 | lcd_bl_pin = bl_pin; | ||
116 | gpio_request(bl_pin, "lcd backlight"); | ||
117 | gpio_direction_output(bl_pin, 0); | ||
118 | set_pxa_fb_info(&sharp_lq43_info); | ||
119 | } | ||
120 | #endif | ||
121 | |||
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h index 0becf6215c1d..3f2a01d6a03c 100644 --- a/arch/arm/mach-pxa/include/mach/colibri.h +++ b/arch/arm/mach-pxa/include/mach/colibri.h | |||
@@ -10,6 +10,12 @@ extern void colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin); | |||
10 | static inline void colibri_pxa3xx_init_mmc(mfp_cfg_t *, int, int) {} | 10 | static inline void colibri_pxa3xx_init_mmc(mfp_cfg_t *, int, int) {} |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
14 | extern void colibri_pxa3xx_init_lcd(int bl_pin); | ||
15 | #else | ||
16 | static inline void colibri_pxa3xx_init_lcd(int) {} | ||
17 | #endif | ||
18 | |||
13 | /* physical memory regions */ | 19 | /* physical memory regions */ |
14 | #define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ | 20 | #define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ |
15 | 21 | ||