Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2256713rwd; Fri, 16 Jun 2023 01:08:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DoJ1QLsE01icIEkWzFr6sfXJRZCacAjRm2kzAEUVdVkKbvLRuKqod+q3Z/lb1cXSmeioo X-Received: by 2002:a17:90a:312:b0:25e:b1fc:1951 with SMTP id 18-20020a17090a031200b0025eb1fc1951mr1586218pje.14.1686902908541; Fri, 16 Jun 2023 01:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686902908; cv=none; d=google.com; s=arc-20160816; b=KxOJxpKB7qPSt6yGJJ6BVD4wRrwqky6J7xcw0zUiY5ZqKJ/ebFs+ZQ8HuTZy2cg58b ksqEajYIh4j8vn1kRQzuHVM+Us8p8qN1bVcsq+yoB6ahfWq1OrGCeSB2V8cKq4qHRsc6 r1z8FWCJ6OdIkPfDiHGuOsqLvNjKBh480U+FxrgHc8a1lB8ItJAVagzbBMzxMA7NK6ba tDfaXefGo/N7gpRviwwn97krF2LgKrqiBYoaVJrVG6NO6uo3gcRe4gyVmsDSb9xu4h5D SP1ilLlYdRjInx9VyKy0mjKZeZ0bLIVnSavu2/9IiyHGRO6kkYhNSUuGLchktM4FYf0W VMnQ== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=hSlQPaorM1P9B2NSyWEK4oYVFDuqaVKAFs4EBFP55OY=; b=MCgewl0eaL16emqCms7YM85YkGvyX6TrKC9/T32KQQgwwRhqAdEln+yaX2UFxbNGns qsXqadC+RpQ6UQDTrUIHhrSbGgY9lzy0pnaHaWORbpVtp3vBRYMY2cnck1T+6m9qnNkV JI+TI9n7VabJVw28Hbxw3Qhg89MldENBMjqhJJfkQkomOXxMXc2G/1dcwFOK6BU7f5ek pIMtp1XMkF2fgfvlQ/yA8eKPyInuuQ5nZB7BKjgvu2e1OiPys6r9qymyanZU+87+SwRI LBV4o74U0ufmk0q2264UdEvnmtbQvScP9M/+4I8xqy7Xt4WcGeI8adzsD3dsrViflBCN RSPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WTiJcthb; 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 21-20020a17090a001500b00256b3b4f672si1042676pja.139.2023.06.16.01.08.14; Fri, 16 Jun 2023 01:08:28 -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=WTiJcthb; 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 S245258AbjFPHhB (ORCPT + 99 others); Fri, 16 Jun 2023 03:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245170AbjFPHgw (ORCPT ); Fri, 16 Jun 2023 03:36:52 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAC83268C; Fri, 16 Jun 2023 00:36:46 -0700 (PDT) X-UUID: 890ab7b40c1811ee9cb5633481061a41-20230616 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=hSlQPaorM1P9B2NSyWEK4oYVFDuqaVKAFs4EBFP55OY=; b=WTiJcthb1wuxnUUmdcBos7MH5qSWiv/HKk60YvQ7FhzYKpCCrzELa0ppzL2+f99pDOZWuyWqo2kQB3XbNXCaf55FAC3VbFhImieDhxlrywsXPsbqfE+6n6vbU7vHK4aZPS7huNRgy73la5jmZdnOLHPdKPfmNmseAEe4YOYjgKw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.26,REQID:1e526910-c1cb-48a2-8fd4-91d9423821ca,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:cb9a4e1,CLOUDID:ba3bd23e-7aa7-41f3-a6bd-0433bee822f3,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 890ab7b40c1811ee9cb5633481061a41-20230616 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 78709751; Fri, 16 Jun 2023 15:36:41 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 16 Jun 2023 15:36:40 +0800 Received: from mszsdhlt06.gcn.mediatek.inc (10.16.6.206) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 16 Jun 2023 15:36:39 +0800 From: Shuijing Li To: , , , , , , , , CC: , , , , , , , Shuijing Li Subject: [PATCH v2,3/3] drm/mediatek: dsi: Add dsi cmdq_ctl to send panel initial code Date: Fri, 16 Jun 2023 15:36:59 +0800 Message-ID: <20230616073659.26536-4-shuijing.li@mediatek.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230616073659.26536-1-shuijing.li@mediatek.com> References: <20230616073659.26536-1-shuijing.li@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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 For mt8188, add dsi cmdq reg control to send long packets to panel initialization. Signed-off-by: Shuijing Li Signed-off-by: Jitao Shi --- Changes in v2: use mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); directly, per suggestion from the previous thread: https://lore.kernel.org/lkml/015f4c60-ed77-9e1f-8a6b-cda6e4f6ac93@gmail.com/ --- drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 500a3054282d..8b43d9f48178 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -86,6 +86,7 @@ #define DSI_CMDQ_SIZE 0x60 #define CMDQ_SIZE 0x3f +#define CMDQ_SIZE_SEL BIT(15) #define DSI_HSTX_CKL_WC 0x64 @@ -178,6 +179,7 @@ struct mtk_dsi_driver_data { const u32 reg_cmdq_off; bool has_shadow_ctl; bool has_size_ctl; + bool cmdq_long_packet_ctl; }; struct mtk_dsi { @@ -996,6 +998,8 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg) mtk_dsi_mask(dsi, reg_cmdq_off, cmdq_mask, reg_val); mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE, cmdq_size); + if (dsi->driver_data->cmdq_long_packet_ctl) + mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); } static ssize_t mtk_dsi_host_send_cmd(struct mtk_dsi *dsi, @@ -1200,18 +1204,21 @@ static const struct mtk_dsi_driver_data mt8183_dsi_driver_data = { .reg_cmdq_off = 0x200, .has_shadow_ctl = true, .has_size_ctl = true, + .cmdq_long_packet_ctl = false, }; static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = { .reg_cmdq_off = 0xd00, .has_shadow_ctl = true, .has_size_ctl = true, + .cmdq_long_packet_ctl = false, }; static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = { .reg_cmdq_off = 0xd00, .has_shadow_ctl = true, .has_size_ctl = true, + .cmdq_long_packet_ctl = true, }; static const struct of_device_id mtk_dsi_of_match[] = { -- 2.40.1