[RFC PATCH 0/2] Add support for Geniatech/MyGica A681B and PT682C USB ATSC/QAM TV tuners

Forest Crossman posted 2 patches 15 hours ago
drivers/media/dvb-frontends/mxl692.c  | 38 ++++++++++-----
drivers/media/dvb-frontends/mxl692.h  | 19 ++++++++
drivers/media/usb/dvb-usb-v2/Kconfig  |  1 +
drivers/media/usb/dvb-usb-v2/dvbsky.c | 69 +++++++++++++++++++++++++++
drivers/media/usb/em28xx/em28xx-dvb.c |  9 ++++
include/media/dvb-usb-ids.h           |  2 +
6 files changed, 126 insertions(+), 12 deletions(-)
[RFC PATCH 0/2] Add support for Geniatech/MyGica A681B and PT682C USB ATSC/QAM TV tuners
Posted by Forest Crossman 15 hours ago
Hello, all,

This patch series adds support for the Geniatech/MyGica A681B and
PT682C, which are USB TV tuners that support ATSC/QAM. These devices
both use the MxL692 combo tuner+demodulator IC, so adding support for
them only required adding the USB IDs and modifying the existing MxL692
driver to take some configuration parameters from the drivers that use
it.

I've sent this series as an RFC for now because I wasn't really sure how
best to pass the clock and MPEG parameters from the USB device drivers
to the MxL692 driver. I ended up just adding some extra members to the
structs and copying the parameters to the MxL692 configuration on probe,
but this feels like the wrong approach. The only other ways I could
think of to do this were:

1. Making the mxl692 module aware of the TV tuners that use it by
   storing the configurations for each TV tuner in the module and
   selecting between them with an enum.
2. Including mxl692_defs.h in the TV tuner drivers that use the module
   and initializing the xtal and mpeg structs directly.

But I wasn't sure which option would be best, or if there was another
way that I hadn't though of. If anyone has any suggestions on how best
to handle this, I'd be happy to hear them!

This is the first change I've made to a driver that's more than just a
handful of lines adding some device IDs, so I'd appreciate any advice I
can get. And if you have any questions, please let me know!

Thanks,
Forest

P.S.: I couldn't find the MxL692 firmware image anywhere, so I wrote a
script to extract it from the driver for Windows and have posted that
script here[1]. Also, for the sake of completeness there is a newer
firmware image embedded in the Geniatech/MyGica drivers for Ubuntu
20.04, but that firmware image didn't work with the mainline driver so I
haven't bothered to publish a script to extract it.

[1]: https://gist.github.com/cyrozap/f07a8b9803d2e9e3d0ee7acf54843ab0


Forest Crossman (2):
  media: mxl692: Add configurable crystal and MPEG settings
  media: dvb-usb-v2: Add support for Geniatech/MyGica A681B and PT682C

 drivers/media/dvb-frontends/mxl692.c  | 38 ++++++++++-----
 drivers/media/dvb-frontends/mxl692.h  | 19 ++++++++
 drivers/media/usb/dvb-usb-v2/Kconfig  |  1 +
 drivers/media/usb/dvb-usb-v2/dvbsky.c | 69 +++++++++++++++++++++++++++
 drivers/media/usb/em28xx/em28xx-dvb.c |  9 ++++
 include/media/dvb-usb-ids.h           |  2 +
 6 files changed, 126 insertions(+), 12 deletions(-)

-- 
2.51.0