Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3224206rwa; Tue, 23 Aug 2022 00:32:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR46y1/rK5XH4hmatnSr9aHEvi6TfXas7Zb0Ah+k81FBIz7U8UgA4C4Ztf47JBO/CDNgFeYB X-Received: by 2002:a17:90b:1d84:b0:1f5:b66:7460 with SMTP id pf4-20020a17090b1d8400b001f50b667460mr2099781pjb.50.1661239948593; Tue, 23 Aug 2022 00:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661239948; cv=none; d=google.com; s=arc-20160816; b=w5giK5GCQRsvkkbIHGwzf9IfLvf2vhi/uw/xhmtg3Ny6+WsrtF6JINfAcmL6PGkJbV kjrrsKBP0dtYFBfP/360SwpwKuPVXYq3Zq8njNCeU6Crt1YdapUxbcTAphq8roP4xEjV KWZcHyYJLvbcmktdIF+UyyVeYtPkNedFZRAVJQE3C2EVxgzpfb9ftMHH5Hd19r9lJc6A /8GJoBGkpqfZMTZJ/apL2GsBw7cPV58tUE1M/K58TRayGNn4WBruGN6RlXJ57/s+jtFd fcwmgJnGNUT9ZTP5ywmhFIa9+7IdeGYUC7vp+BC9VQWTuPm9FYWBScPvtKILxnAD88ka zr2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=WfZgnut6JZuH/+nmD0AA81Q20ZP8mPmvVqetOYk0NH8=; b=hrPybzwbIdWRHcStMu8lv3WtNUuf8uJSrfuy5TWkv1Arr7USDLiQHg4hRQrT88f63q pZtOdfbw2plQUEi6pGZvFG6oCVih8qzl55VJbo2UvlhL/i44EwvQZ7cvyBITkX1G1pXM cMpTI5TGytcyyD/N4kxlRYcTmqlbuZzT38YRcx1R9q2zAZGjJ+kIApCLhzhAVle4sHR/ XPHbJ+Yfkd5eVWZMSE32OGHu/uu8cucZtVDQfT3MvTt3Fq9A9DwESVqXSq0gzOprbOJR huU0P9hj09QkKE4P0ULSufZQc+o2zOZx31cqLWksy0j5TeaX2w4a3A/xDvdjhz+JBY4A W0Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ANSLVs9r; 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 r125-20020a632b83000000b003816043f10bsi15168251pgr.768.2022.08.23.00.32.16; Tue, 23 Aug 2022 00:32: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=ANSLVs9r; 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 S240725AbiHWGig (ORCPT + 99 others); Tue, 23 Aug 2022 02:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240718AbiHWGid (ORCPT ); Tue, 23 Aug 2022 02:38:33 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DB5A10FC0 for ; Mon, 22 Aug 2022 23:38:31 -0700 (PDT) X-UUID: 2964142b420044b9a10a108ecb7c5943-20220823 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=WfZgnut6JZuH/+nmD0AA81Q20ZP8mPmvVqetOYk0NH8=; b=ANSLVs9rqghn/5R5wKDMnqyNwG9IqyrV559H0gFhWpKHXEgFYj0yUSE2sQqXFVfs9YeBEoJ+g4/1JU+NvNfBP9V3fQHLnJrMemO5jLbqfy1rg7Dc5nzGCvgR/97pxrF9x7MKqA+xJ6q6Q73eBwtK+cRZLfej1FPUAoRzeMBsmHY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:3835331f-8ac5-41bc-a8a6-587a73d1b8f0,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release _Ham,ACTION:release,TS:-5 X-CID-META: VersionHash:84eae18,CLOUDID:00a40468-a9d9-4672-a3c8-12721739a220,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: 2964142b420044b9a10a108ecb7c5943-20220823 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1835730470; Tue, 23 Aug 2022 14:38:27 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 23 Aug 2022 14:38:25 +0800 Received: from mszsdaap41.gcn.mediatek.inc (10.16.6.141) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 23 Aug 2022 14:38:24 +0800 From: To: , , , , , , , , CC: , , , , , Xinlei Lee , Jitao Shi Subject: [PATCH v3,1/2] soc: mediatek: Add mmsys func to adapt to dpi output for MT8186 Date: Tue, 23 Aug 2022 14:38:22 +0800 Message-ID: <1661236702-30682-1-git-send-email-xinlei.lee@mediatek.com> X-Mailer: git-send-email 2.6.4 MIME-Version: 1.0 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,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,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 From: Xinlei Lee Add mmsys function to manipulate dpi output format configuration for MT8186. Co-developed-by: Jitao Shi Signed-off-by: Jitao Shi Signed-off-by: Xinlei Lee --- drivers/soc/mediatek/mt8186-mmsys.h | 1 + drivers/soc/mediatek/mtk-mmsys.c | 8 ++++++++ include/linux/soc/mediatek/mtk-mmsys.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/drivers/soc/mediatek/mt8186-mmsys.h b/drivers/soc/mediatek/mt8186-mmsys.h index eb1ad9c37a9c..6eca3445bea3 100644 --- a/drivers/soc/mediatek/mt8186-mmsys.h +++ b/drivers/soc/mediatek/mt8186-mmsys.h @@ -3,6 +3,7 @@ #ifndef __SOC_MEDIATEK_MT8186_MMSYS_H #define __SOC_MEDIATEK_MT8186_MMSYS_H +#define MT8186_DPI_OUTPUT_FORMAT 0x400 #define MT8186_MMSYS_OVL_CON 0xF04 #define MT8186_MMSYS_OVL0_CON_MASK 0x3 #define MT8186_MMSYS_OVL0_2L_CON_MASK 0xC diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index 114defd48298..aeda6e2bf80b 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -252,6 +252,14 @@ void mtk_mmsys_ddp_disconnect(struct device *dev, } EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_disconnect); +void mtk_mmsys_ddp_dpi_fmt_config(struct device *dev, u32 mask, u32 val, + struct cmdq_pkt *cmdq_pkt) +{ + mtk_mmsys_update_bits(dev_get_drvdata(dev), MT8186_DPI_OUTPUT_FORMAT, mask, + val, cmdq_pkt); +} +EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_dpi_fmt_config); + void mtk_mmsys_merge_async_config(struct device *dev, int idx, int width, int height, struct cmdq_pkt *cmdq_pkt) { diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h index 343e093f0fc3..08caa2b8a374 100644 --- a/include/linux/soc/mediatek/mtk-mmsys.h +++ b/include/linux/soc/mediatek/mtk-mmsys.h @@ -90,4 +90,7 @@ void mtk_mmsys_mixer_in_config(struct device *dev, int idx, bool alpha_sel, u16 void mtk_mmsys_mixer_in_channel_swap(struct device *dev, int idx, bool channel_swap, struct cmdq_pkt *cmdq_pkt); +void mtk_mmsys_ddp_dpi_fmt_config(struct device *dev, u32 mask, u32 val, + struct cmdq_pkt *cmdq_pkt); + #endif /* __MTK_MMSYS_H */ -- 2.18.0