[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+Px+wUbDU8ZD_TOoWRGT2qXh1KS-jh_P6NUDdUA-GuO8CiFiw@mail.gmail.com>
Date: Tue, 10 Aug 2021 19:13:42 +0800
From: Tzung-Bi Shih <tzungbi@...gle.com>
To: Yunfei Dong <Yunfei.Dong@...iatek.com>
Cc: Alexandre Courbot <acourbot@...omium.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Tzung-Bi Shih <tzungbi@...omium.org>,
Tiffany Lin <tiffany.lin@...iatek.com>,
Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Tomasz Figa <tfiga@...gle.com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Fritz Koenig <frkoenig@...omium.org>,
Irui Wang <irui.wang@...iatek.com>,
linux-media@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
srv_heupstream@...iatek.com, linux-mediatek@...ts.infradead.org,
Project_Global_Chrome_Upstream_Group@...iatek.com,
George Sun <george.sun@...iatek.com>
Subject: Re: [PATCH v4, 04/15] media: mtk-vcodec: Use component framework to
manage each hardware information
On Tue, Aug 10, 2021 at 04:30:36PM +0800, Yunfei Dong wrote:
> > Looking up "mediatek,mtk-vcodec-core" to determine if it uses component framwork sounds like...
> Add prameter in pdata, for all platform will use compoent after mt8183
>
> >> + if (dev->is_comp_supported) {
> >> + ret = mtk_vcodec_init_master(dev);
> >> + if (ret < 0)
> >> + goto err_component_match;
> >> + } else {
> >> + platform_set_drvdata(pdev, dev);
> >> + }
> > + Has asked the same question in [1]. Why it removes the
> > +platform_set_drvdata() above? mtk_vcodec_init_master() also calls platform_set_drvdata().
> Must call component_master_add_with_match after platform_set_drvdata for component architecture.
I am confused. The condition "call component_master_add_with_match
after platform_set_drvdata" is already true even if without the
change. See below.
> +static int mtk_vcodec_init_master(struct mtk_vcodec_dev *dev)
> +{
> + struct platform_device *pdev = dev->plat_dev;
> + struct component_match *match;
> + int ret;
> +
> + match = mtk_vcodec_match_add(dev);
> + if (IS_ERR_OR_NULL(match))
> + return -EINVAL;
> +
> + platform_set_drvdata(pdev, dev);
> + ret = component_master_add_with_match(&pdev->dev, &mtk_vdec_ops, match);
Point [1].
> @@ -311,7 +413,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
> MTK_VCODEC_DEC_NAME);
> video_set_drvdata(vfd_dec, dev);
> dev->vfd_dec = vfd_dec;
> - platform_set_drvdata(pdev, dev);
Point [2].
> @@ -362,8 +463,16 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
> mtk_v4l2_debug(0, "decoder registered as /dev/video%d",
> vfd_dec->num);
>
> - return 0;
> + if (dev->vdec_pdata->is_comp_supported) {
> + ret = mtk_vcodec_init_master(dev);
Point [3].
The calling sequence is: [2] -> component_master_add_with_match() -> [1] -> [3].
Don't understand why it removes the platform_set_drvdata() at point [2].
Powered by blists - more mailing lists