video: rockchip: hdmi: contrast uboot and kernel resolution
[firefly-linux-kernel-4.4.55.git] / drivers / video / rockchip / hdmi / rockchip-hdmi-sysfs.c
index 94812c17c51ab9639048d7c3f28597ef0410b958..d5d965049db7168d01cf78d0b6b6ce8cda721526 100644 (file)
@@ -196,7 +196,7 @@ static int hdmi_get_color(struct rk_display_device *device, char *buf)
        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 &&
@@ -211,7 +211,8 @@ static int hdmi_get_color(struct rk_display_device *device, char *buf)
        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,
@@ -540,6 +541,30 @@ static int hdmi_get_debug(struct rk_display_device *device, char *buf)
        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,
@@ -556,6 +581,7 @@ static struct rk_display_ops hdmi_display_ops = {
        .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)
@@ -564,6 +590,11 @@ 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;