X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fvideo%2Fof_display_timing.c;h=e393412faf6637788222a4e3f3c8adf473644c62;hb=83fb4e1f93adb50a1c90d1554e72a0d64ce6eb57;hp=8a1076beecd33aa29891849f5feaa36b42027036;hpb=3c87b791880a2e0dad281c6494b94968d412bfa3;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 8a1076beecd3..e393412faf66 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -61,6 +61,10 @@ static int of_parse_display_timing(const struct device_node *np, { u32 val = 0; int ret = 0; +#if defined(CONFIG_FB_ROCKCHIP) + struct property *prop; + int length; +#endif memset(dt, 0, sizeof(*dt)); @@ -94,6 +98,52 @@ static int of_parse_display_timing(const struct device_node *np, dt->flags |= DISPLAY_FLAGS_DOUBLESCAN; if (of_property_read_bool(np, "doubleclk")) dt->flags |= DISPLAY_FLAGS_DOUBLECLK; +#if defined(CONFIG_FB_ROCKCHIP) + if (!of_property_read_u32(np, "swap-rg", &val)) + dt->flags |= val ? DISPLAY_FLAGS_SWAP_RG : 0; + if (!of_property_read_u32(np, "swap-gb", &val)) + dt->flags |= val ? DISPLAY_FLAGS_SWAP_GB : 0; + if (!of_property_read_u32(np, "swap-rb", &val)) + dt->flags |= val ? DISPLAY_FLAGS_SWAP_RB : 0; + if (!of_property_read_u32(np, "screen-type", &val)) + dt->screen_type = val; + if (!of_property_read_u32(np, "lvds-format", &val)) + dt->lvds_format = val; + if (!of_property_read_u32(np, "out-face", &val)) + dt->face = val; + if (!of_property_read_u32(np, "color-mode", &val)) + dt->color_mode = val; + if (!of_property_read_u32(np, "screen-width", &val)) + dt->screen_widt = val; + if (!of_property_read_u32(np, "screen-hight", &val)) + dt->screen_hight = val; + prop = of_find_property(np, "dsp-lut", &length); + if (prop) { + dt->dsp_lut = kzalloc(length, GFP_KERNEL); + if (dt->dsp_lut) + ret = of_property_read_u32_array(np, + "dsp-lut", dt->dsp_lut, length >> 2); + } + prop = of_find_property(np, "cabc-lut", &length); + if (prop) { + dt->cabc_lut = kzalloc(length, GFP_KERNEL); + if (dt->cabc_lut) + ret = of_property_read_u32_array(np, + "cabc-lut", + dt->cabc_lut, + length >> 2); + } + + prop = of_find_property(np, "cabc-gamma-base", &length); + if (prop) { + dt->cabc_gamma_base = kzalloc(length, GFP_KERNEL); + if (dt->cabc_gamma_base) + ret = of_property_read_u32_array(np, + "cabc-gamma-base", + dt->cabc_gamma_base, + length >> 2); + } +#endif if (ret) { pr_err("%s: error reading timing properties\n",