From: Frank Li <Frank.li@oss.nxp.com>
To: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Cc: nicolas.dufresne@collabora.com, p.zabel@pengutronix.de,
mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Frank.Li@nxp.com, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel@collabora.com
Subject: Re: [PATCH v3 3/3] media: verisilicon: Remove useless internal fields
Date: Thu, 24 Sep 2026 09:19:12 -0500 [thread overview]
Message-ID: <arUxYI0DP-nwjmg1@SMW015318> (raw)
In-Reply-To: <20260924130453.196299-4-benjamin.gaignard@collabora.com>
On Thu, Sep 24, 2026 at 03:04:53PM +0200, Benjamin Gaignard wrote:
> No more variants are using multiple registers regions.
> Remove the useless fields and simplify driver code.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> drivers/media/platform/verisilicon/hantro.h | 9 ++-------
> .../media/platform/verisilicon/hantro_drv.c | 20 +++++--------------
> 2 files changed, 7 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h
> index 0353de154a1e..ca03bc690fbf 100644
> --- a/drivers/media/platform/verisilicon/hantro.h
> +++ b/drivers/media/platform/verisilicon/hantro.h
> @@ -72,8 +72,6 @@ struct hantro_irq {
> * @num_irqs: number of irqs in the array
> * @clk_names: array of clock names
> * @num_clocks: number of clocks in the array
> - * @reg_names: array of register range names
> - * @num_regs: number of register range names in the array
> * @double_buffer: core needs double buffering
> * @legacy_regs: core uses legacy register set
> * @late_postproc: postproc must be set up at the end of the job
> @@ -97,8 +95,6 @@ struct hantro_variant {
> int num_irqs;
> const char * const *clk_names;
> int num_clocks;
> - const char * const *reg_names;
> - int num_regs;
> unsigned int double_buffer : 1;
> unsigned int legacy_regs : 1;
> unsigned int late_postproc : 1;
> @@ -184,7 +180,7 @@ hantro_vdev_to_func(struct video_device *vdev)
> * dev_ macros.
> * @clocks: Array of clock handles.
> * @resets: Array of reset handles.
> - * @reg_bases: Mapped addresses of VPU registers.
> + * @reg_base: Mapped address of VPU registers.
> * @enc_base: Mapped address of VPU encoder register for convenience.
> * @dec_base: Mapped address of VPU decoder register for convenience.
> * @ctrl_base: Mapped address of VPU control block.
> @@ -204,10 +200,9 @@ struct hantro_dev {
> struct device *dev;
> struct clk_bulk_data *clocks;
> struct reset_control *resets;
> - void __iomem **reg_bases;
> + void __iomem *reg_base;
> void __iomem *enc_base;
> void __iomem *dec_base;
> - void __iomem *ctrl_base;
>
> struct mutex vpu_mutex; /* video_device lock */
> spinlock_t irqlock;
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index 12c804dcc669..6e3a24156a69 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -1080,7 +1080,6 @@ static int hantro_probe(struct platform_device *pdev)
> {
> const struct of_device_id *match;
> struct hantro_dev *vpu;
> - int num_bases;
> int i, ret;
>
> vpu = devm_kzalloc(&pdev->dev, sizeof(*vpu), GFP_KERNEL);
> @@ -1128,21 +1127,12 @@ static int hantro_probe(struct platform_device *pdev)
> if (IS_ERR(vpu->resets))
> return PTR_ERR(vpu->resets);
>
> - num_bases = vpu->variant->num_regs ?: 1;
> - vpu->reg_bases = devm_kcalloc(&pdev->dev, num_bases,
> - sizeof(*vpu->reg_bases), GFP_KERNEL);
> - if (!vpu->reg_bases)
> - return -ENOMEM;
> + vpu->reg_base = devm_platform_ioremap_resource(pdev, 0);
Please descript reg_bases -> reg_base change in commit message, it is not
simpile remove.
Frank
> + if (IS_ERR(vpu->reg_base))
> + return PTR_ERR(vpu->reg_base);
>
> - for (i = 0; i < num_bases; i++) {
> - vpu->reg_bases[i] = vpu->variant->reg_names ?
> - devm_platform_ioremap_resource_byname(pdev, vpu->variant->reg_names[i]) :
> - devm_platform_ioremap_resource(pdev, 0);
> - if (IS_ERR(vpu->reg_bases[i]))
> - return PTR_ERR(vpu->reg_bases[i]);
> - }
> - vpu->enc_base = vpu->reg_bases[0] + vpu->variant->enc_offset;
> - vpu->dec_base = vpu->reg_bases[0] + vpu->variant->dec_offset;
> + vpu->enc_base = vpu->reg_base + vpu->variant->enc_offset;
> + vpu->dec_base = vpu->reg_base + vpu->variant->dec_offset;
>
> /**
> * TODO: Eventually allow taking advantage of full 64-bit address space.
> --
> 2.53.0
>
>
prev parent reply other threads:[~2026-09-24 14:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 13:04 [PATCH v3 0/3] Remove unused variant and code clean up Benjamin Gaignard
2026-09-24 13:04 ` [PATCH v3 1/3] media: verisilicon: Remove deprecated variant Benjamin Gaignard
2026-09-24 14:16 ` Frank Li
2026-09-24 13:04 ` [PATCH v3 2/3] media: dt-bindings: media: nxp, imx8mq-vpu: Remove nxp,imx8mq-vpu Benjamin Gaignard
2026-09-24 14:19 ` Frank Li
2026-09-24 16:55 ` Conor Dooley
2026-09-24 17:51 ` Nicolas Dufresne
2026-09-24 13:04 ` [PATCH v3 3/3] media: verisilicon: Remove useless internal fields Benjamin Gaignard
2026-09-24 14:19 ` Frank Li [this message]
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=arUxYI0DP-nwjmg1@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=benjamin.gaignard@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@collabora.com \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
/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
all inboxes | Powered by JetHome®