From patchwork Fri Dec 2 02:32:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zain Wang X-Patchwork-Id: 9457645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B8DD6074E for ; Fri, 2 Dec 2016 02:33:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D2ED284E9 for ; Fri, 2 Dec 2016 02:33:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8192528505; Fri, 2 Dec 2016 02:33:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36434284E9 for ; Fri, 2 Dec 2016 02:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752955AbcLBCdC (ORCPT ); Thu, 1 Dec 2016 21:33:02 -0500 Received: from regular1.263xmail.com ([211.150.99.134]:41823 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480AbcLBCdB (ORCPT ); Thu, 1 Dec 2016 21:33:01 -0500 Received: from wzz?rock-chips.com (unknown [192.168.167.130]) by regular1.263xmail.com (Postfix) with ESMTP id B9EBF91F3; Fri, 2 Dec 2016 10:32:52 +0800 (CST) X-263anti-spam: X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 3A97D3BF; Fri, 2 Dec 2016 10:32:25 +0800 (CST) X-RL-SENDER: wzz@rock-chips.com X-FST-TO: seanpaul@chromium.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: wzz@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: zain.wang@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 11236HHIATB; Fri, 02 Dec 2016 10:32:42 +0800 (CST) From: zain wang To: Sean Paul , Daniel Vetter , Inki Dae , David Airlie Cc: Tomeu Vizoso , Mika Kahola , =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Tomasz Figa , dianders@chromium.org, Thierry Reding , Krzysztof Kozlowski , Heiko Stuebner , Jingoo Han , Javier Martinez Canillas , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, zain wang Subject: [PATCH] drm/bridge: analogix: Don't return -EINVAL when panel not support PSR in PSR functions Date: Fri, 2 Dec 2016 10:32:22 +0800 Message-Id: <1480645942-29912-1-git-send-email-wzz@rock-chips.com> X-Mailer: git-send-email 1.9.1 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We will ignored PSR setting if panel not support it. So, in this case, we should return from analogix_dp_enable/disable_psr() without any error code. Let's retrun 0 instead of -EINVAL when panel not support PSR in analogix_dp_enable/disable_psr(). Signed-off-by: zain wang --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 6e0447f..0cb3695 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -112,7 +112,7 @@ int analogix_dp_enable_psr(struct device *dev) struct edp_vsc_psr psr_vsc; if (!dp->psr_support) - return -EINVAL; + return 0; /* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */ memset(&psr_vsc, 0, sizeof(psr_vsc)); @@ -135,7 +135,7 @@ int analogix_dp_disable_psr(struct device *dev) struct edp_vsc_psr psr_vsc; if (!dp->psr_support) - return -EINVAL; + return 0; /* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */ memset(&psr_vsc, 0, sizeof(psr_vsc)); @@ -878,6 +878,8 @@ static void analogix_dp_commit(struct analogix_dp_device *dp) dp->psr_support = analogix_dp_detect_sink_psr(dp); if (dp->psr_support) analogix_dp_enable_sink_psr(dp); + else + dev_warn(dp->dev, "Sink not support PSR\n"); } /*