Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8901360pxu; Mon, 28 Dec 2020 00:40:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhqKtDy7vuuqUIh/Jb8vsUeys4Pu6OCIzAJZONbsYxPF7hyotL/h+nGCLJxdwQaszN9Mjs X-Received: by 2002:a17:906:3b8b:: with SMTP id u11mr40195078ejf.489.1609144856590; Mon, 28 Dec 2020 00:40:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609144856; cv=none; d=google.com; s=arc-20160816; b=bdAtB0rUoJZtXhLYGTKUSKWnmZVqQbb2RxyHOYFYXnhc/3lAdrdZ73wH7SEozPVYIx chxgGtpy9TNz3U9i/EBpztO5OFJrKoPG4OQ3KH0hfeCdffqxFOKnJPdD3ziDc+jLaTSl jvJEGKgDX8wJOxY4FVmqlaVv7Yp+qgxAwZcxtzLV03dz6YLbADn+i6lD26iRUtz6IIXh wEAOJdu2QCkbzQVdC6IZIcluvy9KsaCPjmRWgf7mt34+wZmhH/l/tJ8L1M1Rbyxn/sFw xdbxVFFm19kFli83f2osUX/uimUD2Tu6Osq8eVU6kXlvKwjPH9j0qQBh272l3C5KHz/V cfZw== 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=hi1p1fL/oVKzTOnu05Fz+/i64jscXOYGdBsi/aYDmpI=; b=lkYt1sdlIAib2rWB6lvc0B5hxGdn6XC+SEIB8qBKk65MjThG6zHuYHonNSUY3Efowc 0ioETyXKdKAzY40nN3k+q+g961FcAh8HzF8E0UsLaDTUxQgzPzxyKqrz3Y4wAeK8i/S5 2qMJVkCRnxDRS1C7fTuujUNg5+9H/boJ5RIL0Mj+dW+foTTCXIjUgObzXCFJxQC7lXcf Fx9WeUF0t3+kDoy/KbpS4ci0ABLWnWIihZEOIy5QBDa59xOg8FBkMxuHAvrpkUb+3oZQ zBqjzo82rZ7nP3Im2jusTB/REroDGRyBk1eoSg/6OAmnu11um8iw9O3prYzzZabSEFId H9Vg== 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 kq16si16748584ejb.253.2020.12.28.00.40.34; Mon, 28 Dec 2020 00:40:56 -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 S1726628AbgL1IiV (ORCPT + 99 others); Mon, 28 Dec 2020 03:38:21 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:57864 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726602AbgL1IiU (ORCPT ); Mon, 28 Dec 2020 03:38:20 -0500 X-UUID: 53f74bec2cee4880a46433ae295a2791-20201228 X-UUID: 53f74bec2cee4880a46433ae295a2791-20201228 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.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 959070899; Mon, 28 Dec 2020 16:37:20 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Dec 2020 16:38:28 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Dec 2020 16:38:26 +0800 From: Yongqiang Niu To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , , Yongqiang Niu Subject: [PATCH v3, 7/8] soc: mediatek: mmsys: Use function call for setting mmsys ovl mout register Date: Mon, 28 Dec 2020 16:37:09 +0800 Message-ID: <1609144630-14721-8-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1609144630-14721-1-git-send-email-yongqiang.niu@mediatek.com> References: <1609144630-14721-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 | 20 ++++++++++++++++++++ include/linux/soc/mediatek/mtk-mmsys.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/drivers/soc/mediatek/mmsys/mtk-mmsys.c b/drivers/soc/mediatek/mmsys/mtk-mmsys.c index dae665b..ea36a11 100644 --- a/drivers/soc/mediatek/mmsys/mtk-mmsys.c +++ b/drivers/soc/mediatek/mmsys/mtk-mmsys.c @@ -74,6 +74,17 @@ 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; + + if (funcs->ovl_mout_en) { + 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); @@ -99,6 +110,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