Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp165330pxb; Tue, 24 Aug 2021 23:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoPhQVQHvPsiLyVkZ8iihTIyoVUzkevqfIg2EYrrOljJpkRdbex6cSYXjUoxNQZUD0CodK X-Received: by 2002:a17:906:2acc:: with SMTP id m12mr45866586eje.231.1629873572349; Tue, 24 Aug 2021 23:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629873572; cv=none; d=google.com; s=arc-20160816; b=iGrcERsM5H/BBwymqOWCqN/yNfm1UQytPm2FyzwUhHkM+ZK3ld+CJ/SVNR+inpgLw4 aHzlwqdLwFjIw5/LN/NsfZ+lCZZ+Kd1PmQ3ON2A3wq/zMMaHxYgS8iWqv3UOmKb/pGk9 mk1nQn4Z0oSA144Y8VzumcIoxmCwpxUu0VZCyoAmEFMg1dh4i5apsSWNQLfrdkZs6nmb FmYo5yhnfedlW8oBs+yGTmvr/iqQeOZe6MFJ9A3mc0/QemyFKIsRJNbwa7HuuV4P5kwU XQsocJQHtt+dMt0VpmgT+F0BSW2OjEinqTL55lIrWuMXtdCCelbJmdRhnZYKi16/Gdcc pLvg== 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=fzlvJ2pAHb+sQ8dhm6xnHR8froez4GvdycGHyMNLelc=; b=CRMQjonvGiMNPnojYGF9hjSrGc4DLKZxkEEEVOjyUWQbIGcnhxWOn3GX11gzVopx5I eJ2VTj3tz/Evbnju+67c0RAcUwyWE+f6SLedZ0zCpy6K6CLZi/PSHt2YAteqxTUijrSt 1ag7ef5qaghXuhYttYXMkqDlfnhyubfFbY/XoPLazZdDgmWaKyLW+J7Srl8mrCUN4wmm hD8tUp+roGaQvlLr9+ZvUuz5IC1OKuFpD1e58EDqwkMaIlbzuJsMwZun8vS1gUTD1WLF DWwOTmuJ6JG8MVL2+FRVhCDguVSUnfX+RQpnqB8V+C+Ewj3lz1AlLeFLNLMuR9IX0A2E JZjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=F5WiZhJX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si17937395ejk.403.2021.08.24.23.39.08; Tue, 24 Aug 2021 23:39:32 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b=F5WiZhJX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239250AbhHYGfZ (ORCPT + 99 others); Wed, 25 Aug 2021 02:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239200AbhHYGfS (ORCPT ); Wed, 25 Aug 2021 02:35:18 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D800C0613CF for ; Tue, 24 Aug 2021 23:34:33 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id x4so22085882pgh.1 for ; Tue, 24 Aug 2021 23:34:33 -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=f++rD5fLOBLnFRpgCNlDN8gkSzW+nmVEJWrkG3KuRY99rZOU+GR7vCvrCdmFwho8LI Gk+Yjz5Qc+Ll/K3qKs9Z9l9SixER/hWC3MP0pcYc4qSCMuxaE6PQLWIbVe6laVbDnhd1 uUnbxSqlYXTtT41d71cSGsoqEnErDZZfY7Q4alZKD+8rZNTgpqThoNxH2Tx5cmKdG7Vz EmjOzgr1i+EEuL+87C71TPCP1Hx14SWS03MYAnvKlazpFzdyFeniLCxqHfOT/qH/w4lX fJU+l2eeaQe5LJEY36y0dtK4ttoYj/Fnyh0dzg8TeikU+upTmCD3jjn9YD3qlsqtjeOG a1SQ== X-Gm-Message-State: AOAM533OhK9skwaHW+xzGkj1/3hEhovAAQ1zHff6dvaW2jmODJVOLCh0 4opITYjfg6z4BCKdrQLQdeL2ZP+ZsWkksg== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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[] = { -- 2.33.0.rc2.250.ged5fa647cd-goog