diff mbox series

[1/4] media: tuner-simple: Add support for Tena TNF931D-DFDR1

Message ID 20240203124745.10257-2-nils.rothaug@gmx.de
State New
Headers show
Series media: em28xx: Add support for MyGica UTV3 and its tuner | expand

Commit Message

Nils Rothaug Feb. 3, 2024, 12:47 p.m. UTC
Tuner ranges were determined by USB capturing the vendor driver of a
MyGica UTV3 video capture card.

Signed-off-by: Nils Rothaug <nils.rothaug@gmx.de>
---
 drivers/media/tuners/tuner-types.c | 22 ++++++++++++++++++++++
 include/media/tuner.h              |  1 +
 2 files changed, 23 insertions(+)

--
2.34.1

Comments

Hans Verkuil June 7, 2024, 10:08 a.m. UTC | #1
Hi Nils,

First of all, apologies for the delay in reviewing. I'm afraid that changes
to old USB drivers are low on the priority list.

The good news is that the code looks good except for some minor issues.
However, how it is split up into patches needs to be reorganized a bit.

On 03/02/2024 13:47, Nils Rothaug wrote:
> Tuner ranges were determined by USB capturing the vendor driver of a
> MyGica UTV3 video capture card.
> 
> Signed-off-by: Nils Rothaug <nils.rothaug@gmx.de>
> ---
>  drivers/media/tuners/tuner-types.c | 22 ++++++++++++++++++++++
>  include/media/tuner.h              |  1 +

Add the Documentation/admin-guide/media/tuner-cardlist.rst change to this patch
as well. That keeps all the tuner changes together in one patch.

>  2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/media/tuners/tuner-types.c b/drivers/media/tuners/tuner-types.c
> index ff5a6c0acdd..cec2d6fefd7 100644
> --- a/drivers/media/tuners/tuner-types.c
> +++ b/drivers/media/tuners/tuner-types.c
> @@ -1434,6 +1434,23 @@ static struct tuner_params tuner_sony_btf_pg463z_params[] = {
>  	},
>  };
> 
> +

Drop this empty line to fix a checkpatch warning about duplicate empty lines.

Regards,

	Hans

> +/* ------------- TUNER_TENA_TNF_931D_DFDR1 - NXP TDA6509A ------------- */
> +
> +static struct tuner_range tuner_tena_tnf_931d_dfdr1_ranges[] = {
> +	{ 16 * 161.15 /*MHz*/, 0x8e, 0x01, },
> +	{ 16 * 463.15 /*MHz*/, 0x8e, 0x02, },
> +	{ 16 * 999.99        , 0x8e, 0x08, },
> +};
> +
> +static struct tuner_params tuner_tena_tnf_931d_dfdr1_params[] = {
> +	{
> +		.type   = TUNER_PARAM_TYPE_PAL,
> +		.ranges = tuner_tena_tnf_931d_dfdr1_ranges,
> +		.count  = ARRAY_SIZE(tuner_tena_tnf_931d_dfdr1_ranges),
> +	},
> +};
> +
>  /* --------------------------------------------------------------------- */
> 
>  struct tunertype tuners[] = {
> @@ -1946,6 +1963,11 @@ struct tunertype tuners[] = {
>  		.name   = "Silicon Labs Si2157 tuner",
>  		/* see si2157.c for details */
>  	},
> +	[TUNER_TENA_TNF_931D_DFDR1] = {
> +		.name = "Tena TNF931D-DFDR1",
> +		.params = tuner_tena_tnf_931d_dfdr1_params,
> +		.count = ARRAY_SIZE(tuner_tena_tnf_931d_dfdr1_params),
> +	}
>  };
>  EXPORT_SYMBOL(tuners);
> 
> diff --git a/include/media/tuner.h b/include/media/tuner.h
> index a7796e0a365..c5fd6faabfd 100644
> --- a/include/media/tuner.h
> +++ b/include/media/tuner.h
> @@ -133,6 +133,7 @@
>  #define TUNER_SONY_BTF_PK467Z		90	/* NTSC_JP */
>  #define TUNER_SONY_BTF_PB463Z		91	/* NTSC */
>  #define TUNER_SI2157			92
> +#define TUNER_TENA_TNF_931D_DFDR1	93
> 
>  /* tv card specific */
>  #define TDA9887_PRESENT			(1<<0)
> --
> 2.34.1
> 
>
Nils Rothaug June 23, 2024, 10:35 a.m. UTC | #2
On Fri, 7 Jun 2024 12:08:46 +0200
Hans Verkuil <hverkuil@xs4all.nl> wrote:
> Hi Nils,
>
> First of all, apologies for the delay in reviewing. I'm afraid that changes
> to old USB drivers are low on the priority list.
>
> The good news is that the code looks good except for some minor issues.
> However, how it is split up into patches needs to be reorganized a bit.

Hi Hans,

thanks for still reviewing it anyway. Patch version 2 follows.

Best regards,
Nils
diff mbox series

Patch

diff --git a/drivers/media/tuners/tuner-types.c b/drivers/media/tuners/tuner-types.c
index ff5a6c0acdd..cec2d6fefd7 100644
--- a/drivers/media/tuners/tuner-types.c
+++ b/drivers/media/tuners/tuner-types.c
@@ -1434,6 +1434,23 @@  static struct tuner_params tuner_sony_btf_pg463z_params[] = {
 	},
 };

+
+/* ------------- TUNER_TENA_TNF_931D_DFDR1 - NXP TDA6509A ------------- */
+
+static struct tuner_range tuner_tena_tnf_931d_dfdr1_ranges[] = {
+	{ 16 * 161.15 /*MHz*/, 0x8e, 0x01, },
+	{ 16 * 463.15 /*MHz*/, 0x8e, 0x02, },
+	{ 16 * 999.99        , 0x8e, 0x08, },
+};
+
+static struct tuner_params tuner_tena_tnf_931d_dfdr1_params[] = {
+	{
+		.type   = TUNER_PARAM_TYPE_PAL,
+		.ranges = tuner_tena_tnf_931d_dfdr1_ranges,
+		.count  = ARRAY_SIZE(tuner_tena_tnf_931d_dfdr1_ranges),
+	},
+};
+
 /* --------------------------------------------------------------------- */

 struct tunertype tuners[] = {
@@ -1946,6 +1963,11 @@  struct tunertype tuners[] = {
 		.name   = "Silicon Labs Si2157 tuner",
 		/* see si2157.c for details */
 	},
+	[TUNER_TENA_TNF_931D_DFDR1] = {
+		.name = "Tena TNF931D-DFDR1",
+		.params = tuner_tena_tnf_931d_dfdr1_params,
+		.count = ARRAY_SIZE(tuner_tena_tnf_931d_dfdr1_params),
+	}
 };
 EXPORT_SYMBOL(tuners);

diff --git a/include/media/tuner.h b/include/media/tuner.h
index a7796e0a365..c5fd6faabfd 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -133,6 +133,7 @@ 
 #define TUNER_SONY_BTF_PK467Z		90	/* NTSC_JP */
 #define TUNER_SONY_BTF_PB463Z		91	/* NTSC */
 #define TUNER_SI2157			92
+#define TUNER_TENA_TNF_931D_DFDR1	93

 /* tv card specific */
 #define TDA9887_PRESENT			(1<<0)