container_of(mode, struct display_modelist, mode);
int vic = 0;
- if (mode == NULL) {
+ if (!mode) {
hdmi->autoset = 1;
vic = hdmi_find_best_mode(hdmi, 0);
} else {
struct hdmi *hdmi = device->priv_data;
struct fb_videomode *vmode;
- if (mode == NULL)
+ if (!mode)
return -1;
if (hdmi->vic) {
vmode = (struct fb_videomode *)
hdmi_vic_to_videomode(hdmi->vic);
- if (unlikely(vmode == NULL))
+ if (unlikely(!vmode))
return -1;
*mode = *vmode;
if (hdmi->vic & HDMI_VIDEO_YUV420)
list_for_each(pos, modelist) {
display_modelist =
list_entry(pos, struct display_modelist, list);
- if (hdmi->vic == display_modelist->vic)
- break;
- else
+ if (hdmi->vic != display_modelist->vic)
display_modelist = NULL;
+ else
+ break;
}
if (!display_modelist)
return -1;
return hdmi->mode_3d;
}
-/*CEA 861-E: Audio Coding Type
- sync width enum hdmi_audio_type
-*/
+/* CEA 861-E: Audio Coding Type
+ * sync width enum hdmi_audio_type
+ */
static const char * const audioformatstr[] = {
"",
"LPCM", /*HDMI_AUDIO_LPCM = 1,*/
memset(audioinfo, 0x00, len);
/*printk("hdmi:edid: audio_num: %d\n", hdmi->edid.audio_num);*/
for (i = 0; i < hdmi->edid.audio_num; i++) {
- audio = &(hdmi->edid.audio[i]);
+ audio = &hdmi->edid.audio[i];
if (audio->type < 1 || audio->type > HDMI_AUDIO_WMA_PRO) {
pr_info("audio type: unsupported.");
continue;
size = strlen(audioformatstr[audio->type]);
memcpy(audioinfo, audioformatstr[audio->type], size);
audioinfo[size] = ',';
- audioinfo += (size+1);
+ audioinfo += (size + 1);
}
return 0;
}
i = snprintf(buf, PAGE_SIZE,
"Supported Color Mode: %d\n", mode);
i += snprintf(buf + i, PAGE_SIZE - i,
- "Current Color Mode: %d\n", hdmi->colormode);
+ "Current Color Mode: %d\n", hdmi->video.color_output);
mode = (1 << 1); /* 24 bit*/
if (hdmi->edid.deepcolor & HDMI_DEEP_COLOR_30BITS &&
i += snprintf(buf + i, PAGE_SIZE - i,
"Supported Color Depth: %d\n", mode);
i += snprintf(buf + i, PAGE_SIZE - i,
- "Current Color Depth: %d\n", hdmi->colordepth);
+ "Current Color Depth: %d\n",
+ hdmi->video.color_output_depth);
i += snprintf(buf + i, PAGE_SIZE - i,
"Supported Colorimetry: %d\n", hdmi->edid.colorimetry);
i += snprintf(buf + i, PAGE_SIZE - i,
if (hdmi->colorimetry != value)
hdmi->colorimetry = value;
} else {
- pr_err("%s unkown event\n", __func__);
return -1;
}
if (hdmi->hotplug == HDMI_HPD_ACTIVED)
return -1;
if (hdmi->edid.specs)
- *monspecs = *(hdmi->edid.specs);
+ *monspecs = *hdmi->edid.specs;
return 0;
}
/**
- * hdmi_show_sink_info: show hdmi sink device infomation
+ * hdmi_show_sink_info: show hdmi sink device information
* @hdmi: handle of hdmi
*/
static int hdmi_show_sink_info(struct hdmi *hdmi, char *buf, int len)
lens += snprintf(buf + lens, PAGE_SIZE - lens,
"\nSupport audio type:");
for (i = 0; i < hdmi->edid.audio_num; i++) {
- audio = &(hdmi->edid.audio[i]);
+ audio = &hdmi->edid.audio[i];
switch (audio->type) {
case HDMI_AUDIO_LPCM:
lens += snprintf(buf + lens, PAGE_SIZE - lens,
break;
default:
lens += snprintf(buf + lens, PAGE_SIZE - lens,
- " Unkown");
+ " Unknown");
break;
}
lens += snprintf(buf + lens, PAGE_SIZE - lens,
lens += snprintf(buf + lens, PAGE_SIZE - lens,
" 192000");
lens += snprintf(buf + lens, PAGE_SIZE - lens,
- "\nSupport audio word lenght:");
+ "\nSupport audio word length:");
if (audio->rate & HDMI_AUDIO_WORD_LENGTH_16bit)
lens += snprintf(buf + lens, PAGE_SIZE - lens,
" 16bit");
if (!hdmi)
return 0;
- len += snprintf(buf+len, PAGE_SIZE - len, "EDID status:%s\n",
+ len += snprintf(buf + len, PAGE_SIZE - len, "EDID status:%s\n",
hdmi->edid.status ? "False" : "Okay");
- len += snprintf(buf+len, PAGE_SIZE - len, "Raw Data:");
+ len += snprintf(buf + len, PAGE_SIZE - len, "Raw Data:");
for (i = 0; i < HDMI_MAX_EDID_BLOCK; i++) {
if (!hdmi->edid.raw[i])
break;
if (j % 16 == 0)
len += snprintf(buf + len,
PAGE_SIZE - len, "\n");
- len += snprintf(buf+len, PAGE_SIZE - len, "0x%02x, ",
+ len += snprintf(buf + len, PAGE_SIZE - len, "0x%02x, ",
buff[j]);
}
}
- len += snprintf(buf+len, PAGE_SIZE, "\n");
+ len += snprintf(buf + len, PAGE_SIZE, "\n");
if (!hdmi->edid.status)
len += hdmi_show_sink_info(hdmi, buf, len);
return len;
}
+static int vr_get_info(struct rk_display_device *device, char *buf)
+{
+ struct hdmi *hdmi = device->priv_data;
+ int valid, width, height, x_w, x_h, hwr, einit, vsync, panel, scan;
+ int len = 0;
+
+ valid = hdmi->prop.valid;
+ width = hdmi->prop.value.width;
+ height = hdmi->prop.value.height;
+ x_w = hdmi->prop.value.x_w;
+ x_h = hdmi->prop.value.x_h;
+ hwr = hdmi->prop.value.hwrotation;
+ einit = hdmi->prop.value.einit;
+ vsync = hdmi->prop.value.vsync;
+ panel = hdmi->prop.value.panel;
+ scan = hdmi->prop.value.scan;
+
+ len = snprintf(buf, PAGE_SIZE,
+ "valid=%d,width=%d,height=%d,xres=%d,yres=%d,hwrotation=%d,orientation=%d,vsync=%d,panel=%d,scan=%d\n",
+ valid, width, height, x_w, x_h, hwr, einit, vsync, panel, scan);
+
+ return len;
+}
+
static struct rk_display_ops hdmi_display_ops = {
.setenable = hdmi_set_enable,
.getenable = hdmi_get_enable,
.setscale = hdmi_set_scale,
.getscale = hdmi_get_scale,
.getdebug = hdmi_get_debug,
+ .getvrinfo = vr_get_info,
};
static int hdmi_display_probe(struct rk_display_device *device, void *devdata)
device->owner = THIS_MODULE;
strcpy(device->type, "HDMI");
+ if (strstr(hdmi->property->name, "dp"))
+ strcpy(device->type, "DP");
+ else
+ strcpy(device->type, "HDMI");
+
device->priority = DISPLAY_PRIORITY_HDMI;
device->name = hdmi->property->name;
device->property = hdmi->property->display;