create firmware image for the Ubiquiti LS-SR71 board
[openwrt/openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1297-glamo_fb-Cosmetic-cleanup.patch
1 From 3817f491a41455d4a97f5d86217520816c2b6111 Mon Sep 17 00:00:00 2001
2 From: Harald Welte <laforge@openmoko.org>
3 Date: Wed, 8 Oct 2008 21:35:56 +0100
4 Subject: [PATCH] glamo_fb: Cosmetic cleanup
5
6 Remove dead code and coding style fixes. Purely cosmetic.
7
8 Signed-off-by: Harald Welte <laforge@openmoko.org>
9 ---
10 drivers/mfd/glamo/glamo-fb.c | 78 +++++++++++------------------------------
11 1 files changed, 21 insertions(+), 57 deletions(-)
12
13 diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c
14 index 7feef32..aa901dd 100644
15 --- a/drivers/mfd/glamo/glamo-fb.c
16 +++ b/drivers/mfd/glamo/glamo-fb.c
17 @@ -1,6 +1,6 @@
18 /* Smedia Glamo 336x/337x driver
19 *
20 - * (C) 2007 by Openmoko, Inc.
21 + * (C) 2007-2008 by Openmoko, Inc.
22 * Author: Harald Welte <laforge@openmoko.org>
23 * All rights reserved.
24 *
25 @@ -237,11 +237,10 @@ enum orientation {
26 };
27
28
29 -static void rotate_lcd(struct glamofb_handle *glamo,
30 - __u32 rotation)
31 +/* the caller has to enxure lock_cmd is held and we are in cmd mode */
32 +static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation)
33 {
34 int glamo_rot;
35 -/* unsigned long flags; */
36
37 switch (rotation) {
38 case FB_ROTATE_UR:
39 @@ -261,14 +260,6 @@ static void rotate_lcd(struct glamofb_handle *glamo,
40 break;
41 }
42
43 - /*
44 - * ha ha we are only called when we are in cmd mode already
45 - * printk(KERN_ERR"rotate_lcd spin_lock_irqsave\n");
46 - * spin_lock_irqsave(&glamo->lock_cmd, flags);
47 - *
48 - * if (glamofb_cmd_mode(glamo, 1))
49 - * goto out_unlock;
50 - */
51 reg_set_bit_mask(glamo,
52 GLAMO_REG_LCD_WIDTH,
53 GLAMO_LCD_ROT_MODE_MASK,
54 @@ -278,12 +269,6 @@ static void rotate_lcd(struct glamofb_handle *glamo,
55 GLAMO_LCD_MODE1_ROTATE_EN,
56 (glamo_rot != GLAMO_LCD_ROT_MODE_0)?
57 GLAMO_LCD_MODE1_ROTATE_EN : 0);
58 -/* glamofb_cmd_mode(glamo, 0);
59 -
60 -out_unlock:
61 - printk(KERN_ERR"rotate_lcd spin_unlock_irqrestore\n");
62 - spin_unlock_irqrestore(&glamo->lock_cmd, flags);
63 -*/
64 }
65
66 static enum orientation get_orientation(struct fb_var_screeninfo *var)
67 @@ -296,14 +281,17 @@ static enum orientation get_orientation(struct fb_var_screeninfo *var)
68
69 static int will_orientation_change(struct fb_var_screeninfo *var)
70 {
71 - enum orientation orient = get_orientation(var);
72 + enum orientation orient = get_orientation(var);
73 +
74 switch (orient) {
75 case ORIENTATION_LANDSCAPE:
76 - if (var->rotate == FB_ROTATE_UR || var->rotate == FB_ROTATE_UD)
77 + if (var->rotate == FB_ROTATE_UR ||
78 + var->rotate == FB_ROTATE_UD)
79 return 1;
80 break;
81 case ORIENTATION_PORTRAIT:
82 - if (var->rotate == FB_ROTATE_CW || var->rotate == FB_ROTATE_CCW)
83 + if (var->rotate == FB_ROTATE_CW ||
84 + var->rotate == FB_ROTATE_CCW)
85 return 1;
86 break;
87 }
88 @@ -316,8 +304,6 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo,
89 int sync, bp, disp, fp, total, xres, yres, pitch, orientation_changing;
90 unsigned long flags;
91
92 -/* GLAMO_LOG("enter: glamo:%#x, var:%#x\n", (unsigned)glamo, (unsigned)var);
93 -*/
94 if (!glamo || !var)
95 return;
96
97 @@ -333,27 +319,18 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo,
98
99 xres = var->xres;
100 yres = var->yres;
101 -/* GLAMO_LOG("xres:%d, yres:%d, rotate:%d\n", xres, yres, var->rotate);
102 -*/
103 - /*
104 - * figure out if orientation is going to change
105 - */
106 +
107 + /* figure out if orientation is going to change */
108 orientation_changing = will_orientation_change(var);
109 -/* GLAMO_LOG("orientation_changing:%d\n", orientation_changing);
110 -*/
111 - /*
112 - * adjust the pitch according to new orientation to come
113 - */
114 +
115 + /* adjust the pitch according to new orientation to come */
116 if (orientation_changing) {
117 pitch = var->yres * var->bits_per_pixel / 8;
118 } else {
119 pitch = var->xres * var->bits_per_pixel / 8;
120 }
121 -/* GLAMO_LOG("pitch:%d\n", pitch);
122 -*/
123 - /*
124 - * set the awaiten LCD geometry
125 - */
126 +
127 + /* set the awaiten LCD geometry */
128 reg_set_bit_mask(glamo,
129 GLAMO_REG_LCD_WIDTH,
130 GLAMO_LCD_WIDTH_MASK,
131 @@ -367,16 +344,10 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo,
132 GLAMO_LCD_PITCH_MASK,
133 pitch);
134
135 -/* GLAMO_LOG("mark:\n");*/
136 - /*
137 - * honour the rotation request
138 - */
139 - rotate_lcd(glamo, var->rotate);
140 + /* honour the rotation request */
141 + __rotate_lcd(glamo, var->rotate);
142
143 - /*
144 - * update the reported geometry
145 - * of the framebuffer.
146 - */
147 + /* update the reported geometry of the framebuffer. */
148 if (orientation_changing) {
149 var->xres_virtual = var->xres = yres;
150 var->yres_virtual = var->yres = xres;
151 @@ -385,11 +356,7 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo,
152 var->yres_virtual = var->yres = yres;
153 }
154
155 -/* GLAMO_LOG("reported res:(%d,%d)\n", var->xres, var->yres);
156 -*/
157 - /*
158 - * update scannout timings
159 - */
160 + /* update scannout timings */
161 sync = 0;
162 bp = sync + var->hsync_len;
163 disp = bp + var->left_margin;
164 @@ -407,8 +374,6 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo,
165 reg_set_bit_mask(glamo, GLAMO_REG_LCD_HORIZ_DISP_END,
166 GLAMO_LCD_HV_RETR_DISP_END_MASK, fp);
167
168 -/* GLAMO_LOG("mark:\n");
169 -*/
170 sync = 0;
171 bp = sync + var->vsync_len;
172 disp = bp + var->upper_margin;
173 @@ -426,10 +391,8 @@ static void glamofb_update_lcd_controller(struct glamofb_handle *glamo,
174 reg_set_bit_mask(glamo, GLAMO_REG_LCD_VERT_DISP_END,
175 GLAMO_LCD_HV_RETR_DISP_END_MASK, fp);
176
177 -/* GLAMO_LOG("mark:\n"); */
178 glamofb_cmd_mode(glamo, 0);
179
180 -/* GLAMO_LOG("leave:\n"); */
181 out_unlock:
182 spin_unlock_irqrestore(&glamo->lock_cmd, flags);
183 }
184 @@ -461,7 +424,8 @@ static int glamofb_blank(int blank_mode, struct fb_info *info)
185 return 0;
186 }
187
188 -static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield *bf)
189 +static inline unsigned int chan_to_field(unsigned int chan,
190 + struct fb_bitfield *bf)
191 {
192 chan &= 0xffff;
193 chan >>= 16 - bf->length;
194 --
195 1.5.6.5
196