aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-14 07:03:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-21 06:56:19 -0500
commit086ada54abaa4316e8603f02410fe8ebc9ba2de1 (patch)
tree0cbcbc821d15d037cb5ad6ab74d9546ceec624b1 /arch/arm/mach-sa1100
parente1b7a72aeb8292502c97b43eceb01aea47ded40f (diff)
FB: sa1100: remove global sa1100fb_.*_power function pointers
Now that we have platform data contained within the individual board code, we can get rid of the global function pointers, placing them inside the platform data instead. Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100')
-rw-r--r--arch/arm/mach-sa1100/assabet.c90
-rw-r--r--arch/arm/mach-sa1100/generic.c6
-rw-r--r--arch/arm/mach-sa1100/generic.h3
-rw-r--r--arch/arm/mach-sa1100/h3100.c3
-rw-r--r--arch/arm/mach-sa1100/h3600.c3
5 files changed, 64 insertions, 41 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 37fb0cd1a29..65b0a9a3fb9 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -71,33 +71,6 @@ void ASSABET_BCR_frob(unsigned int mask, unsigned int val)
71 71
72EXPORT_SYMBOL(ASSABET_BCR_frob); 72EXPORT_SYMBOL(ASSABET_BCR_frob);
73 73
74static void assabet_backlight_power(int on)
75{
76#ifndef ASSABET_PAL_VIDEO
77 if (on)
78 ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
79 else
80#endif
81 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
82}
83
84/*
85 * Turn on/off the backlight. When turning the backlight on,
86 * we wait 500us after turning it on so we don't cause the
87 * supplies to droop when we enable the LCD controller (and
88 * cause a hard reset.)
89 */
90static void assabet_lcd_power(int on)
91{
92#ifndef ASSABET_PAL_VIDEO
93 if (on) {
94 ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
95 udelay(500);
96 } else
97#endif
98 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
99}
100
101 74
102/* 75/*
103 * Assabet flash support code. 76 * Assabet flash support code.
@@ -206,7 +179,49 @@ static struct mcp_plat_data assabet_mcp_data = {
206 .sclk_rate = 11981000, 179 .sclk_rate = 11981000,
207}; 180};
208 181
182static void assabet_lcd_set_visual(u32 visual)
183{
184 u_int is_true_color = visual == FB_VISUAL_TRUECOLOR;
185
186 if (machine_is_assabet()) {
187#if 1 // phase 4 or newer Assabet's
188 if (is_true_color)
189 ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
190 else
191 ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
192#else
193 // older Assabet's
194 if (is_true_color)
195 ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
196 else
197 ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
198#endif
199 }
200}
201
209#ifndef ASSABET_PAL_VIDEO 202#ifndef ASSABET_PAL_VIDEO
203static void assabet_lcd_backlight_power(int on)
204{
205 if (on)
206 ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
207 else
208 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
209}
210
211/*
212 * Turn on/off the backlight. When turning the backlight on, we wait
213 * 500us after turning it on so we don't cause the supplies to droop
214 * when we enable the LCD controller (and cause a hard reset.)
215 */
216static void assabet_lcd_power(int on)
217{
218 if (on) {
219 ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
220 udelay(500);
221 } else
222 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
223}
224
210/* 225/*
211 * The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually 226 * The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually
212 * takes an RGB666 signal, but we provide it with an RGB565 signal 227 * takes an RGB666 signal, but we provide it with an RGB565 signal
@@ -224,8 +239,22 @@ static struct sa1100fb_mach_info lq039q2ds54_info = {
224 239
225 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, 240 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
226 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), 241 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
242
243 .backlight_power = assabet_lcd_backlight_power,
244 .lcd_power = assabet_lcd_power,
245 .set_visual = assabet_lcd_set_visual,
227}; 246};
228#else 247#else
248static void assabet_pal_backlight_power(int on)
249{
250 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
251}
252
253static void assabet_pal_power(int on)
254{
255 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
256}
257
229static struct sa1100fb_mach_info pal_info = { 258static struct sa1100fb_mach_info pal_info = {
230 .pixclock = 67797, .bpp = 16, 259 .pixclock = 67797, .bpp = 16,
231 .xres = 640, .yres = 512, 260 .xres = 640, .yres = 512,
@@ -236,6 +265,10 @@ static struct sa1100fb_mach_info pal_info = {
236 265
237 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, 266 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
238 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512), 267 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
268
269 .backlight_power = assabet_pal_backlight_power,
270 .lcd_power = assabet_pal_power,
271 .set_visual = assabet_lcd_set_visual,
239}; 272};
240#endif 273#endif
241 274
@@ -266,9 +299,6 @@ static void __init assabet_init(void)
266 PPDR |= PPC_TXD3 | PPC_TXD1; 299 PPDR |= PPC_TXD3 | PPC_TXD1;
267 PPSR |= PPC_TXD3 | PPC_TXD1; 300 PPSR |= PPC_TXD3 | PPC_TXD1;
268 301
269 sa1100fb_lcd_power = assabet_lcd_power;
270 sa1100fb_backlight_power = assabet_backlight_power;
271
272 if (machine_has_neponset()) { 302 if (machine_has_neponset()) {
273 /* 303 /*
274 * Angel sets this, but other bootloaders may not. 304 * Angel sets this, but other bootloaders may not.
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index f57808fb182..9cb4062b1e9 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -374,12 +374,6 @@ static int __init sa1100_init(void)
374 374
375arch_initcall(sa1100_init); 375arch_initcall(sa1100_init);
376 376
377void (*sa1100fb_backlight_power)(int on);
378void (*sa1100fb_lcd_power)(int on);
379
380EXPORT_SYMBOL(sa1100fb_backlight_power);
381EXPORT_SYMBOL(sa1100fb_lcd_power);
382
383 377
384/* 378/*
385 * Common I/O mapping: 379 * Common I/O mapping:
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 3b903f42464..5c68be858e0 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -16,9 +16,6 @@ extern void sa11x0_restart(char, const char *);
16 mi->bank[__nr].start = (__start), \ 16 mi->bank[__nr].start = (__start), \
17 mi->bank[__nr].size = (__size) 17 mi->bank[__nr].size = (__size)
18 18
19extern void (*sa1100fb_backlight_power)(int on);
20extern void (*sa1100fb_lcd_power)(int on);
21
22extern void sa1110_mb_enable(void); 19extern void sa1110_mb_enable(void);
23extern void sa1110_mb_disable(void); 20extern void sa1110_mb_disable(void);
24 21
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index 1f8a271dc66..f23e7d0b2fb 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -52,6 +52,8 @@ static struct sa1100fb_mach_info h3100_lcd_info = {
52 52
53 .lccr0 = LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas, 53 .lccr0 = LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas,
54 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), 54 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
55
56 .lcd_power = h3100_lcd_power,
55}; 57};
56 58
57static void __init h3100_map_io(void) 59static void __init h3100_map_io(void)
@@ -96,7 +98,6 @@ static void __init h3100_mach_init(void)
96 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio)); 98 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio));
97 h3xxx_mach_init(); 99 h3xxx_mach_init();
98 100
99 sa1100fb_lcd_power = h3100_lcd_power;
100 sa11x0_register_lcd(&h3100_lcd_info); 101 sa11x0_register_lcd(&h3100_lcd_info);
101 sa11x0_register_irda(&h3100_irda_data); 102 sa11x0_register_irda(&h3100_irda_data);
102} 103}
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 3dd39bfe348..2feac56ec90 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -79,6 +79,8 @@ static struct sa1100fb_mach_info h3600_lcd_info = {
79 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), 79 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
80 80
81 .rgb[RGB_16] = &h3600_rgb_16, 81 .rgb[RGB_16] = &h3600_rgb_16,
82
83 .lcd_power = h3600_lcd_power,
82}; 84};
83 85
84 86
@@ -146,7 +148,6 @@ static void __init h3600_mach_init(void)
146 h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio)); 148 h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio));
147 h3xxx_mach_init(); 149 h3xxx_mach_init();
148 150
149 sa1100fb_lcd_power = h3600_lcd_power;
150 sa11x0_register_lcd(&h3600_lcd_info); 151 sa11x0_register_lcd(&h3600_lcd_info);
151 sa11x0_register_irda(&h3600_irda_data); 152 sa11x0_register_irda(&h3600_irda_data);
152} 153}