From patchwork Wed Aug 25 06:33:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eizan Miyamoto X-Patchwork-Id: 12456527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51DBDC4338F for ; Wed, 25 Aug 2021 06:37:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1ED03610E8 for ; Wed, 25 Aug 2021 06:37:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1ED03610E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uu8/Z5oIBWOjTNpVIDyoYcdQrVYG8kec6Gnc5x4s4PM=; b=rgCsqLs9Y42ijE SqCv+Khey+6FCRDy0O/xyN/Vs52GChWEHIIlNMz6Czg89uSYttSosUkayTjFspTRWUFpB4Or+JJam Ac46hHW8lYsqQ0Jqzj7JUltxhbem21ug8+gcUk9jO1dNtxypBr9OZBZ8FnzI/2QyKT/ES2kxYvVye Wvv+vRV4x1BcuwNclO6YlWZpxptkJd++GV7SpAYQXOjDBY180MBQCN5N+4C2Ypc+rrj4Nt13ozrO1 nREW0gqb1mnoFmGtp2ntQLQVgUsjrbkAHHkCYzMkF6JMu6Gg6pSaqgMdg5i0lT24TcuWPvOYuySxv j3H0IcJZ1GLmxlxEOI+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mImVy-005gUs-Cl; Wed, 25 Aug 2021 06:35:58 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mImUb-005flt-3i for linux-arm-kernel@lists.infradead.org; Wed, 25 Aug 2021 06:34:37 +0000 Received: by mail-pg1-x535.google.com with SMTP id c17so22077270pgc.0 for ; Tue, 24 Aug 2021 23:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fzlvJ2pAHb+sQ8dhm6xnHR8froez4GvdycGHyMNLelc=; b=F5WiZhJXhxWF/mbzczkd9cNjwJ7S8d9ymOQjMsx98QRxA/cRwjk7CT7VlyyPZ8SMhW 6da0jFGq6g5+LO8kceKVimbN5cE10MTXCRR9QGTyuWnBhktP6IxBUmeDLqAnLqM7WKDK BDkqDUPZIyf2oas8jRvXhgZerNuyKQV0G0uSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fzlvJ2pAHb+sQ8dhm6xnHR8froez4GvdycGHyMNLelc=; b=G3Vcj8XgJwU/Ry5PtjaaH7VlLaxO+PMdH1B9Okh6R9V02I2NkoNMCACNqJ8PKDuEM1 NVq8JLOjWkgugE5GmpLdj4Vp9MkLbQxHZreIUFwxgnBhlFF6snqI5Ffl8U4LAqK6TkBK bL7saddvHeebdhs0DQSZvOwmIpnY9eWKwiEfQCV7E4kizNcrcu5l9je9/MOOJ70lryIh 64WBT8H2m3zoMncoRyUTV4HSfk/1MfsZs0fgHwcRqwkV7gR54qpULjqJj0QiVosNqCvk UC6DyBIL/3MXdwZ64yfe76bBm/gSO4PPVS4aMkLlbeFqSKiGgD/WtlunEiI6J62oEdvZ DCOw== X-Gm-Message-State: AOAM532lbf6PX/jaUxMxhOFL4ZGbj/niW2KPEvFQRFizxm53scG8DTl6 1EgCQZ9Mud97cMCq3tzW1apcCKNKlNnPeA== X-Google-Smtp-Source: ABdhPJx2TfFNIn39qLNwd5ZRKN9W2+I5qUl2jnGzviCUVZz+vZQt1XYHenjGJ99AZJTmbQntBR4yZA== X-Received: by 2002:a63:4206:: with SMTP id p6mr32630642pga.449.1629873272423; Tue, 24 Aug 2021 23:34:32 -0700 (PDT) Received: from localhost ([2401:fa00:9:14:3f2f:9e23:8a5:952]) by smtp.gmail.com with UTF8SMTPSA id b10sm21105718pfi.122.2021.08.24.23.34.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Aug 2021 23:34:32 -0700 (PDT) From: Eizan Miyamoto To: linux-kernel@vger.kernel.org Cc: chunkuang.hu@kernel.org, yong.wu@mediatek.com, wenst@chromium.org, ck.hu@mediatek.com, houlong.wei@mediatek.com, enric.balletbo@collabora.com, yongqiang.niu@mediatek.com, Eizan Miyamoto , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v7 6/7] soc: mediatek: mmsys: instantiate mdp virtual device from mmsys Date: Wed, 25 Aug 2021 16:33:22 +1000 Message-Id: <20210825163247.v7.6.Ie4214d2cc73ab276dd7c41d4f63c98e011fb42d4@changeid> X-Mailer: git-send-email 2.33.0.rc2.250.ged5fa647cd-goog In-Reply-To: <20210825063323.3607738-1-eizan@chromium.org> References: <20210825063323.3607738-1-eizan@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210824_233433_189751_4B4D4DAD X-CRM114-Status: GOOD ( 17.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A virtual device that is probed by the mtk_mdp_core driver is instantiated by the mtk_mmsys driver. This better reflects the logical organization of the hardware and driver: there are a number of hardware blocks that are used by the MDP that have no strict hierarchy, and the software driver is responsible for driving them properly. Signed-off-by: Eizan Miyamoto Reviewed-by: Enric Balletbo i Serra Reviewed-by: Houlong Wei --- (no changes since v1) drivers/soc/mediatek/mtk-mmsys.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index 080660ef11bf..e681029fe804 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -97,6 +97,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev) struct platform_device *clks; struct platform_device *drm; struct mtk_mmsys *mmsys; + struct platform_device *mdp; int ret; mmsys = devm_kzalloc(dev, sizeof(*mmsys), GFP_KERNEL); @@ -122,10 +123,27 @@ static int mtk_mmsys_probe(struct platform_device *pdev) PLATFORM_DEVID_AUTO, NULL, 0); if (IS_ERR(drm)) { platform_device_unregister(clks); - return PTR_ERR(drm); + ret = PTR_ERR(drm); + goto err_drm; + } + + mdp = platform_device_register_data(&pdev->dev, "mtk-mdp", + PLATFORM_DEVID_AUTO, NULL, 0); + if (IS_ERR(mdp)) { + ret = PTR_ERR(mdp); + dev_err(dev, "Failed to register mdp: %d\n", ret); + goto err_mdp; } return 0; + +err_mdp: + platform_device_unregister(drm); + +err_drm: + platform_device_unregister(clks); + + return ret; } static const struct of_device_id of_match_mtk_mmsys[] = {