From: Krzysztof Kozlowski <krzk@kernel.org>
To: Nas Chung <nas.chung@chipsnmedia.com>,
mchehab@kernel.org, hverkuil@xs4all.nl,
sebastian.fricke@collabora.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org
Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-imx@nxp.com,
linux-arm-kernel@lists.infradead.org,
jackson.lee@chipsnmedia.com, lafley.kim@chipsnmedia.com
Subject: Re: [PATCH 4/8] media: chips-media: wave6: Add Wave6 codec driver
Date: Mon, 10 Feb 2025 18:40:44 +0100 [thread overview]
Message-ID: <7373c956-216a-43a6-939c-4a9be5564c57@kernel.org> (raw)
In-Reply-To: <20250210090725.4580-5-nas.chung@chipsnmedia.com>
On 10/02/2025 10:07, Nas Chung wrote:
> +
> + dev->debugfs = debugfs_lookup(WAVE6_VPU_DEBUGFS_DIR, NULL);
> + if (IS_ERR_OR_NULL(dev->debugfs))
> + dev->debugfs = debugfs_create_dir(WAVE6_VPU_DEBUGFS_DIR, NULL);
> +
> + pm_runtime_enable(&pdev->dev);
> +
> + if (dev->res->codec_types & WAVE6_IS_DEC) {
> + ret = wave6_vpu_dec_register_device(dev);
> + if (ret) {
> + dev_err(&pdev->dev, "wave6_vpu_dec_register_device fail: %d\n", ret);
> + goto err_temp_vbuf_free;
> + }
> + }
> + if (dev->res->codec_types & WAVE6_IS_ENC) {
> + ret = wave6_vpu_enc_register_device(dev);
> + if (ret) {
> + dev_err(&pdev->dev, "wave6_vpu_enc_register_device fail: %d\n", ret);
> + goto err_dec_unreg;
> + }
> + }
> +
> + if (dev->ctrl && wave6_vpu_ctrl_support_follower(dev->ctrl)) {
> + wave6_vpu_activate(dev);
> + ret = pm_runtime_resume_and_get(dev->dev);
> + if (ret)
> + goto err_enc_unreg;
> + }
> +
> + dev_dbg(&pdev->dev, "Added wave6 driver with caps %s %s\n",
> + dev->res->codec_types & WAVE6_IS_ENC ? "'ENCODE'" : "",
> + dev->res->codec_types & WAVE6_IS_DEC ? "'DECODE'" : "");
> +
> + return 0;
> +
> +err_enc_unreg:
> + if (dev->res->codec_types & WAVE6_IS_ENC)
> + wave6_vpu_enc_unregister_device(dev);
> +err_dec_unreg:
> + if (dev->res->codec_types & WAVE6_IS_DEC)
> + wave6_vpu_dec_unregister_device(dev);
> +err_temp_vbuf_free:
> + wave6_free_dma(&dev->temp_vbuf);
> +err_kfifo_free:
> + kfifo_free(&dev->irq_status);
> +err_m2m_dev_release:
> + wave6_vpu_release_m2m_dev(dev);
> +err_v4l2_unregister:
> + v4l2_device_unregister(&dev->v4l2_dev);
> +
> + return ret;
> +}
> +
> +static void wave6_vpu_remove(struct platform_device *pdev)
> +{
> + struct vpu_device *dev = dev_get_drvdata(&pdev->dev);
> +
> + if (dev->ctrl && wave6_vpu_ctrl_support_follower(dev->ctrl)) {
> + if (!pm_runtime_suspended(&pdev->dev))
> + pm_runtime_put_sync(&pdev->dev);
> + }
> + pm_runtime_disable(&pdev->dev);
> +
> + wave6_vpu_enc_unregister_device(dev);
> + wave6_vpu_dec_unregister_device(dev);
> + wave6_free_dma(&dev->temp_vbuf);
> + kfifo_free(&dev->irq_status);
> + wave6_vpu_release_m2m_dev(dev);
> + v4l2_device_unregister(&dev->v4l2_dev);
> +}
> +
> +#ifdef CONFIG_PM
> +static int wave6_vpu_runtime_suspend(struct device *dev)
> +{
> + struct vpu_device *vpu_dev = dev_get_drvdata(dev);
> +
> + if (!vpu_dev)
> + return -ENODEV;
> +
> + dprintk(dev, "runtime suspend\n");
Drop
> + if (vpu_dev->ctrl && vpu_dev->active)
> + wave6_vpu_ctrl_put_sync(vpu_dev->ctrl, &vpu_dev->entity);
> + if (vpu_dev->num_clks)
> + clk_bulk_disable_unprepare(vpu_dev->num_clks, vpu_dev->clks);
> +
> + return 0;
> +}
> +
> +static int wave6_vpu_runtime_resume(struct device *dev)
> +{
> + struct vpu_device *vpu_dev = dev_get_drvdata(dev);
> + int ret = 0;
> +
> + if (!vpu_dev)
> + return -ENODEV;
> +
> + dprintk(dev, "runtime resume\n");
Drop
> + if (vpu_dev->num_clks) {
> + ret = clk_bulk_prepare_enable(vpu_dev->num_clks, vpu_dev->clks);
> + if (ret) {
> + dev_err(dev, "failed to enable clocks: %d\n", ret);
> + return ret;
> + }
> + }
> +
> + if (vpu_dev->ctrl && vpu_dev->active) {
> + ret = wave6_vpu_ctrl_resume_and_get(vpu_dev->ctrl, &vpu_dev->entity);
> + if (ret && vpu_dev->num_clks)
> + clk_bulk_disable_unprepare(vpu_dev->num_clks, vpu_dev->clks);
> + } else {
> + wave6_vpu_check_state(vpu_dev);
> + }
> +
> + return ret;
> +}
> +#endif
> +
> +#ifdef CONFIG_PM_SLEEP
> +static int wave6_vpu_suspend(struct device *dev)
> +{
> + int ret;
> +
> + dprintk(dev, "suspend\n");
Drop. Don't re-implement existing tracing.
> + wave6_vpu_pause(dev, 0);
> +
> + ret = pm_runtime_force_suspend(dev);
> + if (ret)
> + wave6_vpu_pause(dev, 1);
> +
> + return ret;
> +}
> +
> +static int wave6_vpu_resume(struct device *dev)
> +{
> + int ret;
> +
> + dprintk(dev, "resume\n");
Drop, useless.
> + ret = pm_runtime_force_resume(dev);
> + if (ret)
> + return ret;
> +
> + wave6_vpu_pause(dev, 1);
> + return 0;
> +}
> +#endif
> +static const struct dev_pm_ops wave6_vpu_pm_ops = {
> + SET_RUNTIME_PM_OPS(wave6_vpu_runtime_suspend, wave6_vpu_runtime_resume, NULL)
> + SET_SYSTEM_SLEEP_PM_OPS(wave6_vpu_suspend, wave6_vpu_resume)
> +};
> +
> +static const struct of_device_id wave6_dt_ids[] = {
> + { .compatible = "nxp,imx95-wave633c", .data = &wave633c_data },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, wave6_dt_ids);
> +
> +static struct platform_driver wave6_vpu_driver = {
> + .driver = {
> + .name = VPU_PLATFORM_DEVICE_NAME,
> + .of_match_table = of_match_ptr(wave6_dt_ids),
Drop of_match_ptr, you have here warnings.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-02-10 17:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 9:07 [PATCH 0/8] Add support for Wave6 video codec driver Nas Chung
2025-02-10 9:07 ` [PATCH 1/8] media: platform: chips-media: wave5: Rename Kconfig parameter Nas Chung
2025-02-10 17:24 ` Krzysztof Kozlowski
2025-02-11 4:23 ` Nas Chung
2025-02-10 9:07 ` [PATCH 2/8] media: v4l2-common: Add YUV24 format info Nas Chung
2025-02-10 14:00 ` Sebastian Fricke
2025-02-11 1:58 ` Nas Chung
2025-02-10 9:07 ` [PATCH 3/8] dt-bindings: media: nxp: Add Wave6 video codec device Nas Chung
2025-02-10 17:30 ` Krzysztof Kozlowski
2025-02-13 7:50 ` Nas Chung
2025-02-13 8:49 ` Krzysztof Kozlowski
2025-02-18 9:21 ` Nas Chung
2025-02-19 12:31 ` Krzysztof Kozlowski
2025-02-20 7:35 ` Nas Chung
2025-02-20 8:32 ` Krzysztof Kozlowski
2025-02-21 8:29 ` Nas Chung
2025-02-10 9:07 ` [PATCH 4/8] media: chips-media: wave6: Add Wave6 codec driver Nas Chung
2025-02-10 17:40 ` Krzysztof Kozlowski [this message]
2025-02-11 8:28 ` Nas Chung
2025-02-10 9:07 ` [PATCH 7/8] media: chips-media: wave6: Add Wave6 control driver Nas Chung
2025-02-10 17:37 ` Krzysztof Kozlowski
2025-02-11 8:55 ` Nas Chung
2025-02-11 20:25 ` kernel test robot
2025-02-12 1:31 ` kernel test robot
2025-02-10 9:07 ` [PATCH 8/8] media: chips-media: wave6: Improve debugging capabilities Nas Chung
2025-02-11 16:43 ` kernel test robot
2025-02-10 13:05 ` [PATCH 0/8] Add support for Wave6 video codec driver Sebastian Fricke
2025-02-11 4:47 ` Nas Chung
2025-02-11 6:07 ` [EXT] " Ming Qian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7373c956-216a-43a6-939c-4a9be5564c57@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=jackson.lee@chipsnmedia.com \
--cc=krzk+dt@kernel.org \
--cc=lafley.kim@chipsnmedia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nas.chung@chipsnmedia.com \
--cc=robh@kernel.org \
--cc=sebastian.fricke@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).