OSDN Git Service

Revert "adv7481: return error when PLL lock fails"
authorSuprith Malligere Shankaregowda <supgow@codeaurora.org>
Wed, 11 Apr 2018 19:11:31 +0000 (00:41 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Fri, 27 Apr 2018 06:56:40 +0000 (23:56 -0700)
This reverts commit 44d8abb6e009123c8535cf85157be4377a895049.

If we return error on PLL lock failure, it results in open_stream
failure for TIF. So, if we open the TV app first and then connect
HDMI cable, it will not start streaming. Therefore reverting this
change.

Change-Id: Ic99a6986a3138bc3abb9e65eb598a743f1634c5c
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
drivers/media/i2c/adv7481.c

index 9c8159c..43a5f3d 100644 (file)
@@ -55,6 +55,8 @@
 #define LOCK_MAX_SLEEP         6000
 #define LOCK_NUM_TRIES         200
 
+#define MAX_DEFAULT_WIDTH       1280
+#define MAX_DEFAULT_HEIGHT      720
 #define MAX_DEFAULT_FRAME_RATE  60
 #define MAX_DEFAULT_PIX_CLK_HZ  74240000
 
@@ -1705,7 +1707,8 @@ static int adv7481_get_hdmi_timings(struct adv7481_state *state,
        } else {
                pr_err("%s(%d): PLL not locked return EBUSY\n",
                                __func__, __LINE__);
-               return -EBUSY;
+               ret = -EBUSY;
+               goto set_default;
        }
 
        /* Check Timing Lock */
@@ -1825,6 +1828,17 @@ static int adv7481_get_hdmi_timings(struct adv7481_state *state,
                                                (hdmi_params->pix_rep + 1));
        }
 
+set_default:
+       if (ret) {
+               pr_debug("%s(%d), error %d resort to default fmt\n",
+                       __func__, __LINE__, ret);
+               vid_params->act_pix = MAX_DEFAULT_WIDTH;
+               vid_params->act_lines = MAX_DEFAULT_HEIGHT;
+               vid_params->fr_rate = MAX_DEFAULT_FRAME_RATE;
+               vid_params->pix_clk = MAX_DEFAULT_PIX_CLK_HZ;
+               vid_params->intrlcd = 0;
+               ret = 0;
+       }
 
        pr_debug("%s(%d), adv7481 TMDS Resolution: %d x %d @ %d fps\n",
                        __func__, __LINE__,