Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4385851rwb; Sun, 7 Aug 2022 23:11:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR66leLN0DukBG9mvR61+0T6N106uIo3oznjVi47n0BnqsPJNkC/EGSVSEm6ZINlqhSJG6Wp X-Received: by 2002:a17:906:93f0:b0:730:6d25:8a1e with SMTP id yl16-20020a17090693f000b007306d258a1emr12717845ejb.431.1659939098416; Sun, 07 Aug 2022 23:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659939098; cv=none; d=google.com; s=arc-20160816; b=Vl0lme7ZPsZy4bUz7HIYXVaFk9PTb34Mz/XhjTKfZNQuxszRAqs9c1lXgOICsKNlg4 wz6uNqVEroweT07o/lMIXG1yu/2beWjeX/RM7dFjo6xfIhu3ui6+8fG1md1hoLsiABtX rbGhXn+soxc91l1ibVNJR640U5yWu3I7XF3vYjBqyMyCKIsQwCd+D+WlF0Z2ejIzivW6 oyoR9h/6FhNEmymVznts8RYliob+9oMCCwmoRPAlAcJx3r7eqU7EH/4JgQxuWHRGnwA9 cD4deDDntKDkIZXC82R42OiW61TYSPMr/87YSw20NdtN1ExktUu/27gtsC+q/HTpaLeE JXuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=VYf6ezy+/tgRHSxGzJXfNlPkkPg4ZknRRAkBfdbZORU=; b=tDjkf/BpuUmxjcF2lVaqU4HpQzCXYlaOzWmGrXajMyHUCTsr5kE8C6Z7bPEImmHyHY DzRPPcHr2w4XfWnVqDTyqz4TbxdM8wZE0LuBE2Aa5rgecz1JExu1U6jp0w3Jb0GdHTsz zzqu33H8q38pDh/X5taAdlsR6Grhgach2gVXUXCobs+eFU7CUVaJuAdRDth2hWBeYwjg hXcpVVjW5+h3gc3DznBh1FUG8Ew+kZBqtPrDW0DlLyQqV6ePkxKKUOCTVX1Qt4Mmmk1I 27FUsoBNNkMHxG+b9/Q6kCJnCXMVUXTGYsmdLInv4EzdgMO9JLIgku//wF8XVtefzbri oojw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jDvh4+64; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt12-20020a0564020a4c00b0043c7ceb229asi5072563edb.207.2022.08.07.23.11.06; Sun, 07 Aug 2022 23:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jDvh4+64; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235460AbiHHFqy (ORCPT + 99 others); Mon, 8 Aug 2022 01:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233140AbiHHFqv (ORCPT ); Mon, 8 Aug 2022 01:46:51 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC5C5DFD4; Sun, 7 Aug 2022 22:46:42 -0700 (PDT) X-UUID: 5f9f0a52b07f45639a2c320be271104a-20220808 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=VYf6ezy+/tgRHSxGzJXfNlPkkPg4ZknRRAkBfdbZORU=; b=jDvh4+64DMoZeeiCyFLavW6xLEs1PQPUnXjuZEqNk4jUFU0YnroyL0xZAg70bt+KNlyNpvw8JJpAsAM2wwm5FSxrsJ8U1pJMxCizUF45TyJ7xRC+dpg1iwc/kpgKFKpH+0g1+cvz193a7fgwNShpkzyI7BaK5jC/WXtU1TpHSsM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.9,REQID:1145f007-8b2c-427d-be21-a07512c8074d,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_H am,ACTION:release,TS:0 X-CID-META: VersionHash:3d8acc9,CLOUDID:38fb2fae-9535-44a6-aa9b-7f62b79b6ff6,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 5f9f0a52b07f45639a2c320be271104a-20220808 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 902237526; Mon, 08 Aug 2022 13:46:39 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 8 Aug 2022 13:46:39 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 8 Aug 2022 13:46:39 +0800 Message-ID: Subject: Re: [PATCH v16 3/8] drm/mediatek: Add MT8195 Embedded DisplayPort driver From: CK Hu To: Bo-Chen Chen , , , , , , , , , , CC: , , , , , , , , , , , , Date: Mon, 8 Aug 2022 13:46:39 +0800 In-Reply-To: <20220805101459.3386-4-rex-bc.chen@mediatek.com> References: <20220805101459.3386-1-rex-bc.chen@mediatek.com> <20220805101459.3386-4-rex-bc.chen@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N 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_MSPIKE_H2, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR,T_SPF_TEMPERROR, UNPARSEABLE_RELAY 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 Hi, Bo-Chen: On Fri, 2022-08-05 at 18:14 +0800, Bo-Chen Chen wrote: > From: Markus Schneider-Pargmann > > This patch adds a embedded displayport driver for the MediaTek mt8195 > SoC. > > It supports the MT8195, the embedded DisplayPort units. It offers > DisplayPort 1.4 with up to 4 lanes. > > The driver creates a child device for the phy. The child device will > never exist without the parent being active. As they are sharing a > register range, the parent passes a regmap pointer to the child so > that > both can work with the same register range. The phy driver sets > device > data that is read by the parent to get the phy device that can be > used > to control the phy properties. > > This driver is based on an initial version by > Jitao shi > > Signed-off-by: Markus Schneider-Pargmann > Signed-off-by: Guillaume Ranquet > Signed-off-by: Bo-Chen Chen > Tested-by: AngeloGioacchino Del Regno < > angelogioacchino.delregno@collabora.com> > Reviewed-by: AngeloGioacchino Del Regno < > angelogioacchino.delregno@collabora.com> > --- [snip] > + > +static irqreturn_t mtk_dp_hpd_event(int hpd, void *dev) > +{ > + struct mtk_dp *mtk_dp = dev; > + struct mtk_dp_train_info *train_info = &mtk_dp->train_info; > + u32 irq_status; > + > + irq_status = mtk_dp_read(mtk_dp, MTK_DP_TOP_IRQ_STATUS); > + > + if (!(irq_status & RGS_IRQ_STATUS_TRANSMITTER)) > + return IRQ_HANDLED; If one of MTK_DP_HPD_INTERRUPT, MTK_DP_HPD_CONNECT, MTK_DP_HPD_DISCONNECT exist, does it imply RGS_IRQ_STATUS_TRANSMITTER exist? If so, I think this checking is redundant because we could directly check MTK_DP_HPD_INTERRUPT, MTK_DP_HPD_CONNECT, MTK_DP_HPD_DISCONNECT. > + > + irq_status = mtk_dp_swirq_get_clear(mtk_dp) | > + mtk_dp_hwirq_get_clear(mtk_dp); > + > + if (!irq_status) > + return IRQ_HANDLED; > + > + if (irq_status & MTK_DP_HPD_INTERRUPT) > + train_info->hpd_inerrupt = true; train_info->hpd_inerrupt is useless, so drop it. > + > + if (!(irq_status & MTK_DP_HPD_CONNECT || > + irq_status & MTK_DP_HPD_DISCONNECT)) > + return IRQ_WAKE_THREAD; this could be changed to if (irq_status == MTK_DP_HPD_INTERRUPT) return IRQ_WAKE_THREAD; But I find one problem. If irq_status == MTK_DP_HPD_INTERRUPT | MTK_DP_HPD_CONNECT, the thread would not be waked up. Is this what you want? Regards, CK > + > + if (!!(mtk_dp_read(mtk_dp, MTK_DP_TRANS_P0_3414) & > + HPD_DB_DP_TRANS_P0_MASK)) > + train_info->cable_plugged_in = true; > + else > + train_info->cable_plugged_in = false; > + > + mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_PWR_STATE, > + DP_PWR_STATE_BANDGAP_TPLL_LANE, > + DP_PWR_STATE_MASK); > + > + return IRQ_HANDLED; > +} > +