Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1873103pxu; Sun, 13 Dec 2020 06:11:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD0aGX0DQYMG5y1CNxwXYEegv64mpxyHKh67Nrw5e+NnqC8YCSL+nB5CeREdcmXZRQr35i X-Received: by 2002:a50:c315:: with SMTP id a21mr20821590edb.50.1607868708461; Sun, 13 Dec 2020 06:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607868708; cv=none; d=google.com; s=arc-20160816; b=VbnR/BzdTu0H75c2Txt+KFiL6FliIGQ+aIc5LhtSzTChhkdzJzEKr0+4UMX5+k6EIa ReqxbVtNU5UxUPu11K3i5euXiBipBwbeOASA6HgVtr3fto/DwtZ4Ti8hABTEc3PQcM8T svpvCQMXD0HQcUA4BADNgvrLUTRKw+dfkYd0hmRN/wyCuMvWW0Sq03PB7Ej2vX5QvYYr deiyahb/J8LP6K2dZrS1YybO0rmhFJR9SqGfHHw0vIBpKTlMaVHVQbFDJqndTOnr16Ea fUPSH4JVCPX4qiZxnTcUMb4VUeRY6mkCePxiSmVprxokubZd72zSpfp3AIpjt6tonT1A 0Jxw== 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; bh=6uAqTDfdvItMQE4D6zrYtDJkhBb1Bn0R8z+JtIbyga0=; b=ZCvSXz+D7uhgFw+PLU8fPR+z7jbf7HH6acb9aMFqBjYoMU1wzGS36A4AA1yjVDrGXa J6TIYVRCLWP+clgver38rr00bqaCC5cVkm6wEzVQ9rXfhw9GsUORX+jKXqthHWi5zGMR JebgBZXCAAFjfVIepiPWcLc7qemeq5jSAWPWawuccxLyyHqp4+Z9kRWBQvSrPpAqlcYP z/jscVI0LdNL9Bm/97gx//y4wq5VrLa072Ew1e6ZfXsL9z+4Kr57TozLkotjJNvRP1pW +rNusbVHoBOfEZo6ZN9LzwAf2D99MmrJaUm9Sjk1Gt8l+1jab24zLZcd9X5B6vRyWqz/ Ky0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si698048edn.483.2020.12.13.06.11.26; Sun, 13 Dec 2020 06:11:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438123AbgLLEOl (ORCPT + 99 others); Fri, 11 Dec 2020 23:14:41 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:38987 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2438214AbgLLEOJ (ORCPT ); Fri, 11 Dec 2020 23:14:09 -0500 X-UUID: 15d7e683883a4853bc8420bafcdf88ba-20201212 X-UUID: 15d7e683883a4853bc8420bafcdf88ba-20201212 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1316618047; Sat, 12 Dec 2020 12:12:29 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 12 Dec 2020 12:12:12 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 12 Dec 2020 12:12:11 +0800 From: Yongqiang Niu To: CK Hu , Philipp Zabel , "Rob Herring" , Matthias Brugger CC: David Airlie , Daniel Vetter , "Mark Rutland" , , , , , , Yongqiang Niu Subject: [PATCH v2, 14/17] soc: mediatek: mmsys: Use function call for setting mmsys ovl mout register Date: Sat, 12 Dec 2020 12:11:54 +0800 Message-ID: <1607746317-4696-15-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1607746317-4696-1-git-send-email-yongqiang.niu@mediatek.com> References: <1607746317-4696-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use function call for setting mmsys ovl mout register Signed-off-by: Yongqiang Niu --- drivers/soc/mediatek/mmsys/mtk-mmsys.c | 18 ++++++++++++++++++ include/linux/soc/mediatek/mtk-mmsys.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/drivers/soc/mediatek/mmsys/mtk-mmsys.c b/drivers/soc/mediatek/mmsys/mtk-mmsys.c index cb76e64..2558b42 100644 --- a/drivers/soc/mediatek/mmsys/mtk-mmsys.c +++ b/drivers/soc/mediatek/mmsys/mtk-mmsys.c @@ -78,6 +78,15 @@ void mtk_mmsys_ddp_connect(struct device *dev, reg = readl_relaxed(mmsys->regs + addr) | value; writel_relaxed(reg, mmsys->regs + addr); } + + if (!funcs->ovl_mout_en) + return; + + value = funcs->ovl_mout_en(cur, next, &addr); + if (value) { + reg = readl_relaxed(mmsys->regs + addr) | value; + writel_relaxed(reg, mmsys->regs + addr); + } } EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_connect); @@ -103,6 +112,15 @@ void mtk_mmsys_ddp_disconnect(struct device *dev, reg = readl_relaxed(mmsys->regs + addr) & ~value; writel_relaxed(reg, mmsys->regs + addr); } + + if (!funcs->ovl_mout_en) + return; + + value = funcs->ovl_mout_en(cur, next, &addr); + if (value) { + reg = readl_relaxed(mmsys->regs + addr) & ~value; + writel_relaxed(reg, mmsys->regs + addr); + } } EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_disconnect); diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h index aa4f60e..220203d 100644 --- a/include/linux/soc/mediatek/mtk-mmsys.h +++ b/include/linux/soc/mediatek/mtk-mmsys.h @@ -49,6 +49,9 @@ struct mtk_mmsys_conn_funcs { u32 (*mout_en)(enum mtk_ddp_comp_id cur, enum mtk_ddp_comp_id next, unsigned int *addr); + u32 (*ovl_mout_en)(enum mtk_ddp_comp_id cur, + enum mtk_ddp_comp_id next, + unsigned int *addr); u32 (*sel_in)(enum mtk_ddp_comp_id cur, enum mtk_ddp_comp_id next, unsigned int *addr); -- 1.8.1.1.dirty