From patchwork Fri Oct 6 21:38:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuogee Hsieh X-Patchwork-Id: 149416 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp608707vqo; Fri, 6 Oct 2023 14:39:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCNK5YbSBjeisGQgWj17hqnypI/fLlQVhUXW6BIwEweeHJaoIlUmsvUKxlQv1tA+nJXb5N X-Received: by 2002:a17:90b:38c9:b0:268:b0b:a084 with SMTP id nn9-20020a17090b38c900b002680b0ba084mr9376651pjb.46.1696628381982; Fri, 06 Oct 2023 14:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696628381; cv=none; d=google.com; s=arc-20160816; b=gnM7NFaP0YrYgJjWcMDMmjzEk9IkVnmZ5GActq4qHyJMRQ5ybf/NI/YkUbalUAR+RZ pa/Hf/G0Ie5N+enZQevRlIllP9Gw1BB3AQXJkApnoE2anrGSh6qAjFL+CjygsMKEsRjd R55bWNs+1bPfdpec/7ciRVWeLKkoEukKmCXRbgSfOc0vdQkjg7GProApguvyDO0IET9b qvZOJaG0zVPgv2EiXvfJrj+IIMBu0P+e/qMmQFzXrw2yt+lC8ciFn+IkF+zFXoR7kfvs 8KO52iTMU7E9t463ndnhBX0YufiQqIP/RTo2THU6mE7MWxwBaUhCoWvZ+ewLCctA/t3H 4MUQ== 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=zBySumyWUsTUJ5MWaB2XFCUX7En9cQIYGAhkyMs/2jM=; fh=WdvorNt9W2LCUPiGPsn75/bW5381IkpXRxF82JgZV7c=; b=n8aTpRZI1cHYRvy1nffIaY5wrVmwoezTYijGloLSRbR/z8jsBAwW9w8APdYhB+KLtX 0FpAvYjAY0cj3blzZHpdELwwDCrmJayJiUB8GzadYsLwdq7XT9SGDB3fpoCAnIgIaH0V kYKgJM0t4TlttkpfcCFLFiNyrdsRQS52VlekgT8m/bzs3ASJjCeimJ4VpScN74vgSlPT vqcubyAa9r1xfzUhzbugg3qcJEDku67YV5c/sTGpg7KJlT/IwaIj21vSEjdTTlu4vyHR cBJtzXP74glGtpuuK8ULb04wL4GElu3c34gSmZJCG7r6FSQ/oeloJuuoCDjIhtwPlCjj greA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=djrX4fGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id cx14-20020a17090afd8e00b0027766994586si6574553pjb.71.2023.10.06.14.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:39:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=djrX4fGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id A885C8043D01; Fri, 6 Oct 2023 14:39:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233715AbjJFVjU (ORCPT + 18 others); Fri, 6 Oct 2023 17:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233707AbjJFVjG (ORCPT ); Fri, 6 Oct 2023 17:39:06 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6111C6; Fri, 6 Oct 2023 14:39:04 -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 396LF0L0023886; Fri, 6 Oct 2023 21:38:56 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=zBySumyWUsTUJ5MWaB2XFCUX7En9cQIYGAhkyMs/2jM=; b=djrX4fGT6m/IQ+TNS9G8n5xkSN/u6NT+kWtcwKsIdFUVRlx/vVoCfxRD32PPDH9uwZfJ ihfj0Y1ei3jxsq4m5h2ge6zScAC24BIZzcULo9CoB7GPnFpFZkoPudy/4t8pR1OLcB0Y 2g8zQMi/CAa71ce+GDRRHTKfvMraPbGOsxjxib/N+6NQJTjVL4/OT/x3gNWDneJR1sQz n+ig77nRhkeIe9gbbr2iIRQqcEz0S47nJsCpCn0NOMWtlKADbrJ7IIkYb7fFtdZlncAq Rg6rVwIfmD5V9MYcJf4ynVWpuMTj1pEUzpDvGCM0a5O2n2UhONUK0FztM0D9xvRT9crg Rw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3thrjdvd8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Oct 2023 21:38:56 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 396LctFr030895 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Oct 2023 21:38:55 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; Fri, 6 Oct 2023 14:38:54 -0700 From: Kuogee Hsieh To: , , , , , , , , , , CC: Kuogee Hsieh , , , , , , , Subject: [PATCH v6 4/7] drm/msm/dp: move parser->parse() and dp_power_client_init() to probe Date: Fri, 6 Oct 2023 14:38:35 -0700 Message-ID: <1696628318-15095-5-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1696628318-15095-1-git-send-email-quic_khsieh@quicinc.com> References: <1696628318-15095-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: mxeyiVF2MEJX3St54dornCjpIyMMi6HG X-Proofpoint-GUID: mxeyiVF2MEJX3St54dornCjpIyMMi6HG 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-06_15,2023-10-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310060166 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Fri, 06 Oct 2023 14:39:39 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779043802353125798 X-GMAIL-MSGID: 1779043802353125798 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 v6: -- move dp_power_client_deinit() to remove() Changes in v5: -- 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 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 32663ea..89fad67 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) { @@ -328,7 +318,6 @@ static void dp_display_unbind(struct device *dev, struct device *master, of_dp_aux_depopulate_bus(dp->aux); - dp_power_client_deinit(dp->power); dp_unregister_audio_driver(dev, dp->audio); dp_aux_unregister(dp->aux); dp->drm_dev = NULL; @@ -1250,6 +1239,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); @@ -1284,6 +1285,7 @@ static int dp_display_remove(struct platform_device *pdev) struct dp_display_private *dp = dev_get_dp_display_private(&pdev->dev); component_del(&pdev->dev, &dp_display_comp_ops); + dp_power_client_deinit(dp->power); dp_display_deinit_sub_modules(dp); platform_set_drvdata(pdev, NULL);