Commit 15ae0ea4 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Maxime Ripard

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
parent 7e81bda2
...@@ -161,10 +161,10 @@ struct tv_mode { ...@@ -161,10 +161,10 @@ struct tv_mode {
bool dac3_en; bool dac3_en;
bool dac_bit25_en; bool dac_bit25_en;
struct color_gains *color_gains; const struct color_gains *color_gains;
struct burst_levels *burst_levels; const struct burst_levels *burst_levels;
struct video_levels *video_levels; const struct video_levels *video_levels;
struct resync_parameters *resync_params; const struct resync_parameters *resync_params;
}; };
struct sun4i_tv { struct sun4i_tv {
...@@ -178,39 +178,39 @@ struct sun4i_tv { ...@@ -178,39 +178,39 @@ struct sun4i_tv {
struct sun4i_drv *drv; struct sun4i_drv *drv;
}; };
struct video_levels ntsc_video_levels = { static const struct video_levels ntsc_video_levels = {
.black = 282, .blank = 240, .black = 282, .blank = 240,
}; };
struct video_levels pal_video_levels = { static const struct video_levels pal_video_levels = {
.black = 252, .blank = 252, .black = 252, .blank = 252,
}; };
struct burst_levels ntsc_burst_levels = { static const struct burst_levels ntsc_burst_levels = {
.cb = 79, .cr = 0, .cb = 79, .cr = 0,
}; };
struct burst_levels pal_burst_levels = { static const struct burst_levels pal_burst_levels = {
.cb = 40, .cr = 40, .cb = 40, .cr = 40,
}; };
struct color_gains ntsc_color_gains = { static const struct color_gains ntsc_color_gains = {
.cb = 160, .cr = 160, .cb = 160, .cr = 160,
}; };
struct color_gains pal_color_gains = { static const struct color_gains pal_color_gains = {
.cb = 224, .cr = 224, .cb = 224, .cr = 224,
}; };
struct resync_parameters ntsc_resync_parameters = { static const struct resync_parameters ntsc_resync_parameters = {
.field = false, .line = 14, .pixel = 12, .field = false, .line = 14, .pixel = 12,
}; };
struct resync_parameters pal_resync_parameters = { static const struct resync_parameters pal_resync_parameters = {
.field = true, .line = 13, .pixel = 12, .field = true, .line = 13, .pixel = 12,
}; };
struct tv_mode tv_modes[] = { static const struct tv_mode tv_modes[] = {
{ {
.name = "NTSC", .name = "NTSC",
.mode = SUN4I_TVE_CFG0_RES_480i, .mode = SUN4I_TVE_CFG0_RES_480i,
...@@ -289,13 +289,13 @@ drm_connector_to_sun4i_tv(struct drm_connector *connector) ...@@ -289,13 +289,13 @@ drm_connector_to_sun4i_tv(struct drm_connector *connector)
* So far, it doesn't seem to be preserved when the mode is passed by * So far, it doesn't seem to be preserved when the mode is passed by
* to mode_set for some reason. * to mode_set for some reason.
*/ */
static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode) static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct drm_display_mode *mode)
{ {
int i; int i;
/* First try to identify the mode by name */ /* First try to identify the mode by name */
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
struct tv_mode *tv_mode = &tv_modes[i]; const struct tv_mode *tv_mode = &tv_modes[i];
DRM_DEBUG_DRIVER("Comparing mode %s vs %s", DRM_DEBUG_DRIVER("Comparing mode %s vs %s",
mode->name, tv_mode->name); 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,7 +306,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
/* Then by number of lines */ /* Then by number of lines */
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
struct tv_mode *tv_mode = &tv_modes[i]; const struct tv_mode *tv_mode = &tv_modes[i];
DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)", DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)",
mode->name, tv_mode->name, 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,7 +319,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
return NULL; return NULL;
} }
static void sun4i_tv_mode_to_drm_mode(struct tv_mode *tv_mode, static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name); DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name);
...@@ -386,7 +386,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder, ...@@ -386,7 +386,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);
struct sun4i_drv *drv = tv->drv; struct sun4i_drv *drv = tv->drv;
struct sun4i_tcon *tcon = drv->tcon; struct sun4i_tcon *tcon = drv->tcon;
struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode); const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode);
sun4i_tcon1_mode_set(tcon, mode); sun4i_tcon1_mode_set(tcon, mode);
...@@ -508,7 +508,7 @@ static int sun4i_tv_comp_get_modes(struct drm_connector *connector) ...@@ -508,7 +508,7 @@ static int sun4i_tv_comp_get_modes(struct drm_connector *connector)
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
struct drm_display_mode *mode = drm_mode_create(connector->dev); struct drm_display_mode *mode = drm_mode_create(connector->dev);
struct tv_mode *tv_mode = &tv_modes[i]; const struct tv_mode *tv_mode = &tv_modes[i];
strcpy(mode->name, tv_mode->name); strcpy(mode->name, tv_mode->name);
......
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