From patchwork Wed Nov 29 17:46:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuogee Hsieh X-Patchwork-Id: 171526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp508853vqn; Wed, 29 Nov 2023 09:47:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe361k6dVcju9WBwf67z/hhvPoewtojlu8CPbG49/Yh40clgW0N3dhkLqTt3Q9hqJgclA3 X-Received: by 2002:a17:90a:e7cf:b0:285:73ed:b84f with SMTP id kb15-20020a17090ae7cf00b0028573edb84fmr18842397pjb.5.1701280072419; Wed, 29 Nov 2023 09:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701280072; cv=none; d=google.com; s=arc-20160816; b=UpFzMjvhDLxlZGPr6VdweXYWmDoG6cxbiaXZZmWpxatUK0AYAuh8GMr9FWkNh5Rmd/ /q99GBoRvkkdlYZTjWkyf3RFV28mjq37TcZmKHG2Jcoc/10BV6uK9V3dunyMlDLVqikb CvDBQhLgqFVH6xf3h7Prq+63Yljzd4pjy8Nzpvd+Alz6K2nGjlQ7H0TjNYXeMG6q8Eim 0RcnvvQTwhiqqbCCdS5MuYS6MGoFlCWTpzxmI36frLbr9+kS/nUZKa2tKNlVDhLEW+dB xrFq6SsWwKqaUauYsmrwcQaPWVzDOP6FlSRji29SnMKupFkYp+JzdGnlRzkMKLFS/BJ9 PbqA== 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=eDIQEnWChwnYjGIPd4gCsvQ7mXaKi02IMRM0vKfaFec=; fh=WdvorNt9W2LCUPiGPsn75/bW5381IkpXRxF82JgZV7c=; b=LVkk7r+28eiwQ22NMDt9DREi56SqN0ZySSZdDoRuelU7bXuEGAuKdLHrq4wAAYs2vz 7GpZPrpRRU2vBORkuYvtfASGGTl/UsRM8GKckkwbQw++SU+4pj+1CTLarihRqCtzJ5k8 a/MHdfSZWy1AgPHOH2JDI/pYH8z/CI4xNBngGcyY3Kz13S8B8CAZwo7ghTDlWFvTXuDu zrDWUglW47FUwYeLw+pGEbtCWTeK///XvBLIfBoXu0Ak4T74L28UIFv8r+fljHBw0Zy+ T4RGG6kSGqJVOpcZ7vi/uyVXz8YCtZG070xmpViyOE8hDqPRxEwbScm9IrdET2cAFiR0 l4cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Z9JSGRgr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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. [23.128.96.34]) by mx.google.com with ESMTPS id l3-20020a17090a850300b00276b87c8b8esi1728550pjn.59.2023.11.29.09.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:47:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Z9JSGRgr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 68631804BC29; Wed, 29 Nov 2023 09:47:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbjK2Rrb (ORCPT + 99 others); Wed, 29 Nov 2023 12:47:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231436AbjK2RrZ (ORCPT ); Wed, 29 Nov 2023 12:47:25 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 228C4120; Wed, 29 Nov 2023 09:47:27 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ATFREkL021475; Wed, 29 Nov 2023 17:47:15 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=eDIQEnWChwnYjGIPd4gCsvQ7mXaKi02IMRM0vKfaFec=; b=Z9JSGRgrhPrtZauta943F6qs9RhCWy7k/kQOsfLFfUZvMxX1x79Mb0vFO/lJL4P3jHm5 /hgoWQMn8j6HT/8ueh+FdsWmsTD7rtROZDRIaPfmKEElxKAlJ4Wp0jY28wNiS0n4l0U4 odKb/2QFmkJknt9eYMqEhVzIDEbRIWrgqMvIRBswxH/W5bmLqdXH3jY4Yt0eigpImlBU 7XfdMkFS2dCpJVPd4twB5q2RKx7bpDySKzBx1YxPpYF2hgTxY4hpozZ1k64ONIVmJbuh 3AMNDR6Y/4NRYa19fFseBVQSeZja9cuASw1I7f0KeFOsKrv4/fRdH3Uz8mb2Q61cc7DW lg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3up4cf926e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 17:47:15 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3ATHlEr9029931 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 17:47:14 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.40; Wed, 29 Nov 2023 09:47:13 -0800 From: Kuogee Hsieh To: , , , , , , , , , , CC: Kuogee Hsieh , , , , , , , Subject: [PATCH v8 4/7] drm/msm/dp: move parser->parse() and dp_power_client_init() to probe Date: Wed, 29 Nov 2023 09:46:47 -0800 Message-ID: <1701280010-32476-5-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1701280010-32476-1-git-send-email-quic_khsieh@quicinc.com> References: <1701280010-32476-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-GUID: OcRwnuQ-B1xUZ5qEwPaHYf_i8lNgDtPw X-Proofpoint-ORIG-GUID: OcRwnuQ-B1xUZ5qEwPaHYf_i8lNgDtPw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-29_16,2023-11-29_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 priorityscore=1501 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311290135 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:47:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783921453055352182 X-GMAIL-MSGID: 1783921453055352182 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 Reviewed-by: Dmitry Baryshkov --- 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 c2e3247..a99a786 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -275,11 +275,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; @@ -290,11 +285,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) { @@ -327,7 +317,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; @@ -1241,6 +1230,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); @@ -1275,6 +1276,7 @@ static void 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);