Re: [RFC PATCH v1 0/2] media: pci: AVMatrix HWS capture driver refresh

Ben Hoff
2025-11-21T09:32:37Z

Hi Hans,

Thanks for the review and for the guidance — much appreciated.

> 1. wait until you finish the audio validation, or
> 2. make this a staging driver…

Thanks for the pointers. I’ll wait until I have the audio paths fully
validated before sending v1. I’ll be running extended testing at that
point, so it makes sense to submit the driver once the capture and
audio paths are both stable.

> Can you add a URL to the driver?

Yes — this is a rework of the vendor’s GPL out-of-tree driver. I’ll
include a link to the original source (or the widely mirrored version
if that is the only available copy) in the commit log of the main
driver patch.

> Is the vendor involved?

At the moment the vendor is not directly involved; I took their GPL
driver as the starting point and restructured it to follow V4L2/ALSA
idioms, add runtime PM, and bring it closer to what is expected
upstream. I’ll note that explicitly in the cover letter for v1.

> Please include v4l2-compliance output…

Will do. I’ll regenerate the results using the latest v4l-utils (built
from git) and include the full report in the v1 cover letter.

Thanks again for the review — I’ll follow up with a cleaned-up v1 once
I fold in this feedback.

On Mon, Nov 3, 2025 at 9:57 AM Hans Verkuil <hverkuil+cisco@kernel.org> wrote:
>
> Hi Ben,
>
> Thank you for working on this!
>
> On 27/10/2025 20:56, Ben Hoff wrote:
> > Hi all,
> >
> > This RFC series significantly refactors the downstream AVMatrix HWS PCIe
> > capture driver so it is maintainable in-tree and aligns with upstream
> > media driver expectations. The new implementation follows V4L2 and ALSA
> > subsystem patterns, splits the hardware plumbing across focused source
> > files, and introduces proper runtime PM and interrupt handling. The goal
> > is to keep future maintenance manageable while providing a direct path for
> > existing users of the vendor tree.
> >
> > Current status / open items:
> > - Audio capture paths have been refactored from the vendor driver but have
> > not yet been validated on real hardware. I would appreciate guidance
> > on whether you would prefer that I drop the ALSA pieces from the
> > initial submission and stage them as a follow-up once I finish
> > validation.
> > - `v4l2-compliance` passes for each video node, and I have exercised
> > basic capture in OBS. I still plan to do heavier soak testing across
> > all inputs and audio channels, as well as cover the suspend/resume
> > paths.
> >
> > Any feedback on the overall structure, subsystem integration, and in
> > particular the best way to stage the audio support would be very welcome.
>
> I think you have two options:
>
> 1) wait until you finish the audio validation, or
> 2) make this a staging driver (drivers/staging/media), add the audio part
> later and then move it to drivers/media/pci.
>
> Regarding this driver: I gather that this is a rework of a GPL out-of-tree
> driver? Can you should at least add a URL that driver? That should definitely
> be part of the commit log of the driver.
>
> Is the vendor involved in this upstream driver work? Or you just took their
> code and made it suitable for mainlining? Just curious.
>
> Finally, for the next v1 please include the v4l2-compliance output in the
> cover letter. And make sure you compile v4l2-compliance from the v4l-utils
> git repo so you are using the latest and greatest version.
>
> Regards,
>
> Hans
>
> > Once I hear back on the preferred direction I will respin this as a
> > formal v1 submission.
> >
> > Thanks for taking a look!
> >
> > Ben
> >
> > Ben Hoff (2):
> > media: pci: add AVMatrix HWS capture driver
> > MAINTAINERS: add entry for AVMatrix HWS driver
> >
> > MAINTAINERS | 6 +
> > drivers/media/pci/Kconfig | 1 +
> > drivers/media/pci/Makefile | 1 +
> > drivers/media/pci/hws/Kconfig | 13 +
> > drivers/media/pci/hws/Makefile | 4 +
> > drivers/media/pci/hws/hws.h | 194 +++
> > drivers/media/pci/hws/hws_audio.c | 571 +++++++++
> > drivers/media/pci/hws/hws_audio.h | 22 +
> > drivers/media/pci/hws/hws_irq.c | 281 +++++
> > drivers/media/pci/hws/hws_irq.h | 12 +
> > drivers/media/pci/hws/hws_pci.c | 708 +++++++++++
> > drivers/media/pci/hws/hws_reg.h | 142 +++
> > drivers/media/pci/hws/hws_v4l2_ioctl.c | 576 +++++++++
> > drivers/media/pci/hws/hws_v4l2_ioctl.h | 32 +
> > drivers/media/pci/hws/hws_video.c | 1542 ++++++++++++++++++++++++
> > drivers/media/pci/hws/hws_video.h | 24 +
> > 16 files changed, 4129 insertions(+)
> > create mode 100644 drivers/media/pci/hws/Kconfig
> > create mode 100644 drivers/media/pci/hws/Makefile
> > create mode 100644 drivers/media/pci/hws/hws.h
> > create mode 100644 drivers/media/pci/hws/hws_audio.c
> > create mode 100644 drivers/media/pci/hws/hws_audio.h
> > create mode 100644 drivers/media/pci/hws/hws_irq.c
> > create mode 100644 drivers/media/pci/hws/hws_irq.h
> > create mode 100644 drivers/media/pci/hws/hws_pci.c
> > create mode 100644 drivers/media/pci/hws/hws_reg.h
> > create mode 100644 drivers/media/pci/hws/hws_v4l2_ioctl.c
> > create mode 100644 drivers/media/pci/hws/hws_v4l2_ioctl.h
> > create mode 100644 drivers/media/pci/hws/hws_video.c
> > create mode 100644 drivers/media/pci/hws/hws_video.h
> >
>