]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/exynos_dp.c
video: add CONFIG_I2C_EDID and disable CONFIG_DISPLAY by default
[u-boot] / drivers / video / exynos_dp.c
index 87bb90777e3f1c9d89f0d699829bb76a18534cdb..0d5d090d0ee79db5c3e5d26bc79d760a3f071eff 100644 (file)
@@ -3,25 +3,13 @@
  *
  * Author: Donghwa Lee <dh09.lee@samsung.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <config.h>
 #include <common.h>
 #include <malloc.h>
+#include <linux/compat.h>
 #include <linux/err.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/cpu.h>
@@ -34,8 +22,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static struct exynos_dp_platform_data *dp_pd;
-
 void __exynos_set_dp_phy(unsigned int onoff)
 {
 }
@@ -221,7 +207,7 @@ static unsigned int exynos_dp_handle_edid(struct edp_device_info *edp_info)
                return -EINVAL;
        }
 
-       /*Refer VESA Display Port Stnadard Ver1.1a Page 120 */
+       /* Refer VESA Display Port Standard Ver1.1a Page 120 */
        if (edp_info->dpcd_rev == DP_DPCD_REV_11) {
                temp = buf[DPCD_MAX_LANE_COUNT] & 0x1f;
                if (buf[DPCD_MAX_LANE_COUNT] & 0x80)
@@ -284,7 +270,7 @@ static unsigned int exynos_dp_link_start(struct edp_device_info *edp_info)
                return ret;
        }
 
-       /* Set link rate and count as you want to establish*/
+       /* Set link rate and count as you want to establish */
        exynos_dp_set_link_bandwidth(edp_info->lane_bw);
        exynos_dp_set_lane_count(edp_info->lane_cnt);
 
@@ -336,7 +322,7 @@ static unsigned int exynos_dp_training_pattern_dis(void)
        ret = exynos_dp_write_byte_to_dpcd(DPCD_TRAINING_PATTERN_SET,
                        DPCD_TRAINING_PATTERN_DISABLED);
        if (ret != EXYNOS_DP_SUCCESS) {
-               printf("DP requst_link_traninig_req failed\n");
+               printf("DP request_link_training_req failed\n");
                return -EAGAIN;
        }
 
@@ -426,7 +412,7 @@ static unsigned int exynos_dp_read_dpcd_adj_req(unsigned char lane_num,
        unsigned int dpcd_addr;
        unsigned char shift_val[DP_LANE_CNT_4] = {0, 4, 0, 4};
 
-       /*lane_num value is used as arry index, so this range 0 ~ 3 */
+       /* lane_num value is used as array index, so this range 0 ~ 3 */
        dpcd_addr = DPCD_ADJUST_REQUEST_LANE0_1 + (lane_num / 2);
 
        ret = exynos_dp_read_byte_from_dpcd(dpcd_addr, &buf);
@@ -447,7 +433,7 @@ static int exynos_dp_equalizer_err_link(struct edp_device_info *edp_info)
 
        ret = exynos_dp_training_pattern_dis();
        if (ret != EXYNOS_DP_SUCCESS) {
-               printf("DP training_patter_disable() failed\n");
+               printf("DP training_pattern_disable() failed\n");
                edp_info->lt_info.lt_status = DP_LT_FAIL;
        }
 
@@ -537,7 +523,7 @@ static unsigned int exynos_dp_process_clock_recovery(struct edp_device_info
                ret = exynos_dp_write_bytes_to_dpcd(
                                DPCD_TRAINING_PATTERN_SET, 5, buf);
                if (ret != EXYNOS_DP_SUCCESS) {
-                       printf("DP write traning pattern1 failed\n");
+                       printf("DP write training pattern1 failed\n");
                        edp_info->lt_info.lt_status = DP_LT_FAIL;
                        return ret;
                } else
@@ -581,7 +567,7 @@ static unsigned int exynos_dp_process_clock_recovery(struct edp_device_info
                ret = exynos_dp_write_bytes_to_dpcd(
                                DPCD_TRAINING_LANE0_SET, 4, lt_ctl_val);
                if (ret != EXYNOS_DP_SUCCESS) {
-                       printf("DP write traning pattern2 failed\n");
+                       printf("DP write training pattern2 failed\n");
                        edp_info->lt_info.lt_status = DP_LT_FAIL;
                        return ret;
                }
@@ -752,7 +738,7 @@ static unsigned int exynos_dp_set_link_train(struct edp_device_info *edp_info)
 
        ret = exynos_dp_sw_link_training(edp_info);
        if (ret != EXYNOS_DP_SUCCESS)
-               printf("DP dp_sw_link_traning() failed\n");
+               printf("DP dp_sw_link_training() failed\n");
 
        return ret;
 }
@@ -863,7 +849,6 @@ static unsigned int exynos_dp_config_video(struct edp_device_info *edp_info)
        return ret;
 }
 
-#ifdef CONFIG_OF_CONTROL
 int exynos_dp_parse_dt(const void *blob, struct edp_device_info *edp_info)
 {
        unsigned int node = fdtdec_next_compatible(blob, 0,
@@ -917,7 +902,6 @@ int exynos_dp_parse_dt(const void *blob, struct edp_device_info *edp_info)
                                                "samsung,color-depth", 0);
        return 0;
 }
-#endif
 
 unsigned int exynos_init_dp(void)
 {
@@ -930,16 +914,8 @@ unsigned int exynos_init_dp(void)
                return -EFAULT;
        }
 
-#ifdef CONFIG_OF_CONTROL
        if (exynos_dp_parse_dt(gd->fdt_blob, edp_info))
                debug("unable to parse DP DT node\n");
-#else
-       edp_info = dp_pd->edp_dev_info;
-       if (edp_info == NULL) {
-               debug("failed to get edp_info data.\n");
-               return -EFAULT;
-       }
-#endif
 
        exynos_dp_set_base_addr();
 
@@ -979,17 +955,7 @@ unsigned int exynos_init_dp(void)
                return ret;
        }
 
-       printf("Exynos DP init done\n");
+       debug("Exynos DP init done\n");
 
        return ret;
 }
-
-void exynos_set_dp_platform_data(struct exynos_dp_platform_data *pd)
-{
-       if (pd == NULL) {
-               debug("pd is NULL\n");
-               return;
-       }
-
-       dp_pd = pd;
-}