From patchwork Wed Oct 4 16:26:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuogee Hsieh X-Patchwork-Id: 148409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp254521vqb; Wed, 4 Oct 2023 09:27:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE29tf/TwGt++2IjHz6UFELMKjeFOwh37axf31Lw70iJ9PSIOA0bkdV9Y4b3OAezvLFbTTj X-Received: by 2002:a05:6358:71c:b0:150:8ba9:4d with SMTP id e28-20020a056358071c00b001508ba9004dmr2703615rwj.3.1696436869225; Wed, 04 Oct 2023 09:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696436869; cv=none; d=google.com; s=arc-20160816; b=HXVqfgLZWZA6BbcN8vmkQ4MR30ZntaYyx0fdLQMK2fCAP2AbHNnmg+CTOm3RJRhL3W iT2p6Job/mg26K00huoi1i3c3TUQ4BBY+3C0GW1xJuZVmppJnjiQ1hGyYSQ+lF8FjTwu LUEXxB0VLTbL52gavPWVpoDcJK5PEYGkXpm44FhWw+pT/4BpYnpx8fceoMRMLcwY6/VJ O/FJnHWn3zB4QSUav+bl1chZgQhHG4YWwivDCOvv/kFKVDvPUbRbMWENkHII/WRLTuyg Ce7psJmoQPsQPGz/s1EEywxIRhUu0ZIM83Ga+6SnBIF20RoRYqyMGrdQKcL3m7v3VhYZ 4lPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+XPJywM8p04YM1fVL8Xoj/vVcb2RPupdZlFyebE/Ed8=; fh=WdvorNt9W2LCUPiGPsn75/bW5381IkpXRxF82JgZV7c=; b=Y8QSk+PHDTZc8393ax5+8vRlGByXUCbgt9D68g0cd7MFr/g07sjOoP0Mw7LOWP2NPV ddaUUv/ngNsY658CB5opJjufqV52usrkeAjijt7c02/oXkMutst8HjRjNtc76rOtGDVC yM/bst4yCUDQgtHOpsC7K01rckxQrF+K0pioC4utHuo1rJOdg4eMHjsAgjYJfZYAbqrh GbEMiA1qKXtfpJtPDLexdzeVi4xZ6WudyIs4+ug7hsqorhuJcqjd8dXxwfkSGQfellJw 9zMg6UchI4r1m9ZUYZPXKxh4sK4B8j9kiAwJGq4SOCnXyzy0CRHfXA8Ye+pxN8W1KwM5 l5Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Rk8MqKHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id fa24-20020a17090af0d800b00262e5a82047si1723828pjb.44.2023.10.04.09.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 09:27:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Rk8MqKHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3B8948371D16; Wed, 4 Oct 2023 09:27:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243405AbjJDQ1j (ORCPT + 19 others); Wed, 4 Oct 2023 12:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243303AbjJDQ1a (ORCPT ); Wed, 4 Oct 2023 12:27:30 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60AA2F0; Wed, 4 Oct 2023 09:27:26 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 394FAA19021217; Wed, 4 Oct 2023 16:27:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=+XPJywM8p04YM1fVL8Xoj/vVcb2RPupdZlFyebE/Ed8=; b=Rk8MqKHbaRV6nSTMmhqpz7RZ4dhmKRtWF6nf2wFKUFk+AjxOEEzWnn6JEHpwTHCmzGN7 wFcpKhQJkAx3VILYhlch6EJkwabgluE9m4vrZ0YnfoeP61NRS8jUGzDFjRtBr/G39MJn gMvWeL4kHh/izd0olv4mYEiKTShFfiNXq2mf/fLGYW06lf+GUvBthYyTLXZtrFqDu8gv 26BTDE3Q2ck4jVNGXv9z1Z9Bxoy2GqDItOzEgABEmQZDW4kJ0yVTyTOljXyg7cNSq/+R Xu+zoH0yO8qGFVSMvafeFnJu/NGsEleQpD7a03vUuJJcEVrUAluX/Mr1rR5440jvmcAA vw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tgqth2j3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 16:27:18 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 394GRHqv019475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 4 Oct 2023 16:27:17 GMT Received: from khsieh-linux1.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Wed, 4 Oct 2023 09:27:17 -0700 From: Kuogee Hsieh To: , , , , , , , , , , CC: Kuogee Hsieh , , , , , , , Subject: [PATCH v5 4/7] drm/msm/dp: move parser->parse() and dp_power_client_init() to probe Date: Wed, 4 Oct 2023 09:26:58 -0700 Message-ID: <1696436821-14261-5-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1696436821-14261-1-git-send-email-quic_khsieh@quicinc.com> References: <1696436821-14261-1-git-send-email-quic_khsieh@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: QbK6xQMQUpx2eOaCIRb42K-dzzz6SzBM X-Proofpoint-GUID: QbK6xQMQUpx2eOaCIRb42K-dzzz6SzBM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_07,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 clxscore=1015 malwarescore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040117 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 09:27:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778842986757577647 X-GMAIL-MSGID: 1778842986757577647 Original both parser->parse() and dp_power_client_init() are done at dp_display_bind() since eDP population is done at binding time. In the preparation of having eDP population done at probe() time, move both function from dp_display_bind() to dp_display_probe(). Changes in v4: -- explain why parser->parse() and dp_power_client_init() are moved to probe time -- tear down sub modules if failed Changes in v4: -- split this patch out of "incorporate pm_runtime framework into DP driver" patch Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_display.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 32663ea..e4942fc 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -276,11 +276,6 @@ static int dp_display_bind(struct device *dev, struct device *master, dp->dp_display.drm_dev = drm; priv->dp[dp->id] = &dp->dp_display; - rc = dp->parser->parse(dp->parser); - if (rc) { - DRM_ERROR("device tree parsing failed\n"); - goto end; - } dp->drm_dev = drm; @@ -291,11 +286,6 @@ static int dp_display_bind(struct device *dev, struct device *master, goto end; } - rc = dp_power_client_init(dp->power); - if (rc) { - DRM_ERROR("Power client create failed\n"); - goto end; - } rc = dp_register_audio_driver(dev, dp->audio); if (rc) { @@ -1250,6 +1240,18 @@ static int dp_display_probe(struct platform_device *pdev) return -EPROBE_DEFER; } + rc = dp->parser->parse(dp->parser); + if (rc) { + DRM_ERROR("device tree parsing failed\n"); + goto err; + } + + rc = dp_power_client_init(dp->power); + if (rc) { + DRM_ERROR("Power client create failed\n"); + goto err; + } + /* setup event q */ mutex_init(&dp->event_mutex); init_waitqueue_head(&dp->event_q);