From patchwork Fri Jun 11 04:01:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eizan Miyamoto X-Patchwork-Id: 12314709 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=-16.9 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=unavailable 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 7A18EC4743D for ; Fri, 11 Jun 2021 04:08:35 +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 4C5916135C for ; Fri, 11 Jun 2021 04:08:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C5916135C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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=7L5eoD5spsNmRMyM05rqTr8e6QXWWNN71GWCz55daXI=; b=OphmflK+6PhSQd AhYEzVzBTMX5nOLBHVIzHIhs7g01cpEqrEY0/JvxSp9TjE6zr2kU7RdlSx8XdoWNxhY1cF7x9xSpV Uy2Cssa0h861ODsAiqzWdcyswe2vpLXUQCDNsmIpIlwykXJDjwYaKDvrTMZcDi0mHN5Kpuuv0KnQY DcPIobrcyqfhqbQGkwS4FzV3fXvl7VNydujiO5/CMhdm5Khzl9kmTlU23Yd8loQZw5BQxtQEece75 8sTjPjp9xuIW/doTluepTnneKfIGXxJf8bgCPnK48DEigezK0hzVOe08AAcNXGqYqGkin8vjrQXYL zEDmGIyyhedtdkOnhKpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrYRR-003Tj2-OW; Fri, 11 Jun 2021 04:06:46 +0000 Received: from mail-pj1-f44.google.com ([209.85.216.44]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrYOT-003SAY-OA for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 04:03:43 +0000 Received: by mail-pj1-f44.google.com with SMTP id g4so4960253pjk.0 for ; Thu, 10 Jun 2021 21:03:41 -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=zpuuyZX5Ieel/toEhqaynm1+cB0UGivDIT7WkJ9Wrbs=; b=UJOx/qDoUCJiQuVKW4HhgE64kdIaaBumhGmNb/IqxFb/8RJTE/PmuFechrbRkxYw4s FurmOw8/eGeyXX6TrsU/oXeEIN/6gZUKv2Ay63XGTzLlehG13PC7eHEzTBN5EkJhqrBt oSendpq5KOfCmQd6HXd/iwDdXcawHA3yfHC+8= 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=zpuuyZX5Ieel/toEhqaynm1+cB0UGivDIT7WkJ9Wrbs=; b=ThHHzCZUyM2s5tRCcC/UloaDbOx3mYAsViWhsLCC+xtTYbevE9el3W2ytpS43QtXdN rq0tXGY/M4ZSDkjqYgqlYpDVjZ7Yb7CmpjZ3B8+xvkubzXi7gcsw1iJ3t/d/5IcPQVhG o4FgnaoIPVloiiSOQMV2bgQldV0+xt+K+VTFKtB413sw/hoCr+y1GaoEWBxPwCtO09uD nzCpf/qQuZZSIDiB31o+L2T/Wkq3/j9BlDOsYoYDqTVHF5zga32PcieUL6ckaerxuSB1 SNJlBhSjeyNVuMEuInJAX2XkB3XeUjP/yfojWtMUGxzJ0ip4OAcaeHsHMy2RcFi2y2pp eqag== X-Gm-Message-State: AOAM532QrotYJgNOsYUK3haM8uP8to1zZZ4SQfj9d7u+a8iOrFdxggF5 UGSGCeUUvh6rYlvi6NiH8kKIgw== X-Google-Smtp-Source: ABdhPJz9UGkfR/m5Tcy+qUD1mlxKWaupak7n44yapumthpB/XHCSLVasmdM/x73NiTdzhzOkN6Q7OQ== X-Received: by 2002:a17:902:b181:b029:fc:c069:865c with SMTP id s1-20020a170902b181b02900fcc069865cmr2061779plr.28.1623384161010; Thu, 10 Jun 2021 21:02:41 -0700 (PDT) Received: from localhost ([2401:fa00:9:14:db52:e918:e5f9:9e14]) by smtp.gmail.com with UTF8SMTPSA id v18sm3752881pff.90.2021.06.10.21.02.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 21:02:40 -0700 (PDT) From: Eizan Miyamoto To: linux-kernel@vger.kernel.org Cc: houlong.wei@mediatek.com, enric.balletbo@collabora.com, yong.wu@mediatek.com, chunkuang.hu@kernel.org, Eizan Miyamoto , Andrew-CT Chen , Matthias Brugger , Mauro Carvalho Chehab , Minghsiu Tsai , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 5/8] media: mtk-mdp: search for vpu node instead of linking it to a property Date: Fri, 11 Jun 2021 14:01:42 +1000 Message-Id: <20210611140124.v2.5.I0cbd6691d3edfa2757bd6f5de7acfce94b101480@changeid> X-Mailer: git-send-email 2.32.0.272.g935e593368-goog In-Reply-To: <20210611040145.2085329-1-eizan@chromium.org> References: <20210611040145.2085329-1-eizan@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210610_210341_807932_608EB379 X-CRM114-Status: GOOD ( 15.48 ) 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 Since there is only one vpu node, it suffices to search for it instead of having a link coded into the primary mdp device node. Signed-off-by: Eizan Miyamoto --- (no changes since v1) drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 ---- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 28 +++++++++++++------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c index fdbb46a5330a..3d9bb7265159 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c @@ -117,12 +117,6 @@ static int mtk_mdp_comp_bind(struct device *dev, struct device *master, if (vpu_node) { int ret; - mdp->vpu_dev = of_find_device_by_node(vpu_node); - if (WARN_ON(!mdp->vpu_dev)) { - dev_err(dev, "vpu pdev failed\n"); - of_node_put(vpu_node); - } - ret = v4l2_device_register(dev, &mdp->v4l2_dev); if (ret) { dev_err(dev, "Failed to register v4l2 device\n"); diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 267e4cb4bf32..48e9a557c446 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -113,6 +113,7 @@ static void release_of(struct device *dev, void *data) static int mtk_mdp_master_bind(struct device *dev) { int status; + struct device_node *vpu_node; struct mtk_mdp_dev *mdp = dev_get_drvdata(dev); status = component_bind_all(dev, mdp); @@ -121,15 +122,24 @@ static int mtk_mdp_master_bind(struct device *dev) goto err_component_bind_all; } - if (mdp->vpu_dev) { - int ret = vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp, - VPU_RST_MDP); - if (ret) { - dev_err(dev, "Failed to register reset handler\n"); - goto err_wdt_reg; - } - } else { - dev_err(dev, "no vpu_dev found\n"); + vpu_node = of_find_node_by_name(NULL, "vpu"); + if (!vpu_node) { + dev_err(dev, "unable to find vpu node"); + status = -ENODEV; + goto err_wdt_reg; + } + + mdp->vpu_dev = of_find_device_by_node(vpu_node); + if (!mdp->vpu_dev) { + dev_err(dev, "unable to find vpu device"); + status = -ENODEV; + goto err_wdt_reg; + } + + status = vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp, VPU_RST_MDP); + if (status) { + dev_err(dev, "Failed to register reset handler\n"); + goto err_wdt_reg; } status = mtk_mdp_register_m2m_device(mdp);