aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-09-19 09:33:54 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2016-09-19 15:54:11 -0400
commit15ae0ea4bf4395c5ba7a3242138a528bd3dfbb14 (patch)
tree82c3f857401bdf50e59e1f558129c2fb731b7c45 /drivers/gpu
parent7e81bda23ac3c79b6cf747c195810900b45a77fc (diff)
drm/sun4i: Fix sparse warnings
drm/sun4i/sun4i_tv.c:181:21: warning: symbol 'ntsc_video_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:185:21: warning: symbol 'pal_video_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:189:21: warning: symbol 'ntsc_burst_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:193:21: warning: symbol 'pal_burst_levels' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:197:20: warning: symbol 'ntsc_color_gains' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:201:20: warning: symbol 'pal_color_gains' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:205:26: warning: symbol 'ntsc_resync_parameters' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:209:26: warning: symbol 'pal_resync_parameters' was not declared. Should it be static? drm/sun4i/sun4i_tv.c:213:16: warning: symbol 'tv_modes' was not declared. Should it be static? Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_tv.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index b84147896294..3d69bd34f36c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -161,10 +161,10 @@ struct tv_mode {
161 bool dac3_en; 161 bool dac3_en;
162 bool dac_bit25_en; 162 bool dac_bit25_en;
163 163
164 struct color_gains *color_gains; 164 const struct color_gains *color_gains;
165 struct burst_levels *burst_levels; 165 const struct burst_levels *burst_levels;
166 struct video_levels *video_levels; 166 const struct video_levels *video_levels;
167 struct resync_parameters *resync_params; 167 const struct resync_parameters *resync_params;
168}; 168};
169 169
170struct sun4i_tv { 170struct sun4i_tv {
@@ -178,39 +178,39 @@ struct sun4i_tv {
178 struct sun4i_drv *drv; 178 struct sun4i_drv *drv;
179}; 179};
180 180
181struct video_levels ntsc_video_levels = { 181static const struct video_levels ntsc_video_levels = {
182 .black = 282, .blank = 240, 182 .black = 282, .blank = 240,
183}; 183};
184 184
185struct video_levels pal_video_levels = { 185static const struct video_levels pal_video_levels = {
186 .black = 252, .blank = 252, 186 .black = 252, .blank = 252,
187}; 187};
188 188
189struct burst_levels ntsc_burst_levels = { 189static const struct burst_levels ntsc_burst_levels = {
190 .cb = 79, .cr = 0, 190 .cb = 79, .cr = 0,
191}; 191};
192 192
193struct burst_levels pal_burst_levels = { 193static const struct burst_levels pal_burst_levels = {
194 .cb = 40, .cr = 40, 194 .cb = 40, .cr = 40,
195}; 195};
196 196
197struct color_gains ntsc_color_gains = { 197static const struct color_gains ntsc_color_gains = {
198 .cb = 160, .cr = 160, 198 .cb = 160, .cr = 160,
199}; 199};
200 200
201struct color_gains pal_color_gains = { 201static const struct color_gains pal_color_gains = {
202 .cb = 224, .cr = 224, 202 .cb = 224, .cr = 224,
203}; 203};
204 204
205struct resync_parameters ntsc_resync_parameters = { 205static const struct resync_parameters ntsc_resync_parameters = {
206 .field = false, .line = 14, .pixel = 12, 206 .field = false, .line = 14, .pixel = 12,
207}; 207};
208 208
209struct resync_parameters pal_resync_parameters = { 209static const struct resync_parameters pal_resync_parameters = {
210 .field = true, .line = 13, .pixel = 12, 210 .field = true, .line = 13, .pixel = 12,
211}; 211};
212 212
213struct tv_mode tv_modes[] = { 213static const struct tv_mode tv_modes[] = {
214 { 214 {
215 .name = "NTSC", 215 .name = "NTSC",
216 .mode = SUN4I_TVE_CFG0_RES_480i, 216 .mode = SUN4I_TVE_CFG0_RES_480i,
@@ -289,13 +289,13 @@ drm_connector_to_sun4i_tv(struct drm_connector *connector)
289 * So far, it doesn't seem to be preserved when the mode is passed by 289 * So far, it doesn't seem to be preserved when the mode is passed by
290 * to mode_set for some reason. 290 * to mode_set for some reason.
291 */ 291 */
292static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode) 292static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct drm_display_mode *mode)
293{ 293{
294 int i; 294 int i;
295 295
296 /* First try to identify the mode by name */ 296 /* First try to identify the mode by name */
297 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { 297 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
298 struct tv_mode *tv_mode = &tv_modes[i]; 298 const struct tv_mode *tv_mode = &tv_modes[i];
299 299
300 DRM_DEBUG_DRIVER("Comparing mode %s vs %s", 300 DRM_DEBUG_DRIVER("Comparing mode %s vs %s",
301 mode->name, tv_mode->name); 301 mode->name, tv_mode->name);
@@ -306,7 +306,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
306 306
307 /* Then by number of lines */ 307 /* Then by number of lines */
308 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { 308 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
309 struct tv_mode *tv_mode = &tv_modes[i]; 309 const struct tv_mode *tv_mode = &tv_modes[i];
310 310
311 DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)", 311 DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)",
312 mode->name, tv_mode->name, 312 mode->name, tv_mode->name,
@@ -319,7 +319,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
319 return NULL; 319 return NULL;
320} 320}
321 321
322static void sun4i_tv_mode_to_drm_mode(struct tv_mode *tv_mode, 322static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode,
323 struct drm_display_mode *mode) 323 struct drm_display_mode *mode)
324{ 324{
325 DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name); 325 DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name);
@@ -386,7 +386,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
386 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); 386 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);
387 struct sun4i_drv *drv = tv->drv; 387 struct sun4i_drv *drv = tv->drv;
388 struct sun4i_tcon *tcon = drv->tcon; 388 struct sun4i_tcon *tcon = drv->tcon;
389 struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode); 389 const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode);
390 390
391 sun4i_tcon1_mode_set(tcon, mode); 391 sun4i_tcon1_mode_set(tcon, mode);
392 392
@@ -508,7 +508,7 @@ static int sun4i_tv_comp_get_modes(struct drm_connector *connector)
508 508
509 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { 509 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
510 struct drm_display_mode *mode = drm_mode_create(connector->dev); 510 struct drm_display_mode *mode = drm_mode_create(connector->dev);
511 struct tv_mode *tv_mode = &tv_modes[i]; 511 const struct tv_mode *tv_mode = &tv_modes[i];
512 512
513 strcpy(mode->name, tv_mode->name); 513 strcpy(mode->name, tv_mode->name);
514 514