[media] tuner: add Sony BTF tuners
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 9 Mar 2013 16:14:32 +0000 (13:14 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 24 Mar 2013 15:11:35 +0000 (12:11 -0300)
This adds support for three Sony BTF tuners:
TUNER_SONY_BTF_PG472Z: PAL+SECAM
TUNER_SONY_BTF_PK467Z: NTSC-M-JP
TUNER_SONY_BTF_PB463Z: NTSC-M
These come from the go7007 staging driver where they were implemented in
the wis-sony-tuner i2c driver.
Adding support for these tuners to tuner-types.c is the first step towards
removing the wis-sony-tuner driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Documentation/video4linux/CARDLIST.tuner
drivers/media/tuners/tuner-types.c
drivers/staging/media/go7007/go7007-usb.c
drivers/staging/media/go7007/go7007-v4l2.c
drivers/staging/media/go7007/wis-i2c.h
include/media/tuner.h

index c83f6e418879d398ca113d8d6e05657798c3468a..5b83a3ff15c2443a2f27d16ebbb844a2d439255e 100644 (file)
@@ -86,3 +86,6 @@ tuner=85 - Philips FQ1236 MK5
 tuner=86 - Tena TNF5337 MFD
 tuner=87 - Xceive 4000 tuner
 tuner=88 - Xceive 5000C tuner
+tuner=89 - Sony PAL+SECAM (BTF-PG472Z)
+tuner=90 - Sony NTSC-M-JP (BTF-PK467Z)
+tuner=91 - Sony NTSC-M (BTF-PB463Z)
index 2da4440c16eee78a774d8a3f07bdc47b7238a339..98bc15a388be502d723fcba08a3570318041e2e2 100644 (file)
@@ -1381,6 +1381,58 @@ static struct tuner_params tuner_philips_fq1236_mk5_params[] = {
        },
 };
 
+/* --------- Sony BTF-PG472Z PAL/SECAM ------- */
+
+static struct tuner_range tuner_sony_btf_pg472z_ranges[] = {
+       { 16 * 144.25 /*MHz*/, 0xc6, 0x01, },
+       { 16 * 427.25 /*MHz*/, 0xc6, 0x02, },
+       { 16 * 999.99        , 0xc6, 0x04, },
+};
+
+static struct tuner_params tuner_sony_btf_pg472z_params[] = {
+       {
+               .type   = TUNER_PARAM_TYPE_PAL,
+               .ranges = tuner_sony_btf_pg472z_ranges,
+               .count  = ARRAY_SIZE(tuner_sony_btf_pg472z_ranges),
+               .has_tda9887 = 1,
+               .port1_active = 1,
+               .port2_invert_for_secam_lc = 1,
+       },
+};
+
+/* 90-99 */
+/* --------- Sony BTF-PG467Z NTSC-M-JP ------- */
+
+static struct tuner_range tuner_sony_btf_pg467z_ranges[] = {
+       { 16 * 220.25 /*MHz*/, 0xc6, 0x01, },
+       { 16 * 467.25 /*MHz*/, 0xc6, 0x02, },
+       { 16 * 999.99        , 0xc6, 0x04, },
+};
+
+static struct tuner_params tuner_sony_btf_pg467z_params[] = {
+       {
+               .type   = TUNER_PARAM_TYPE_NTSC,
+               .ranges = tuner_sony_btf_pg467z_ranges,
+               .count  = ARRAY_SIZE(tuner_sony_btf_pg467z_ranges),
+       },
+};
+
+/* --------- Sony BTF-PG463Z NTSC-M ------- */
+
+static struct tuner_range tuner_sony_btf_pg463z_ranges[] = {
+       { 16 * 130.25 /*MHz*/, 0xc6, 0x01, },
+       { 16 * 364.25 /*MHz*/, 0xc6, 0x02, },
+       { 16 * 999.99        , 0xc6, 0x04, },
+};
+
+static struct tuner_params tuner_sony_btf_pg463z_params[] = {
+       {
+               .type   = TUNER_PARAM_TYPE_NTSC,
+               .ranges = tuner_sony_btf_pg463z_ranges,
+               .count  = ARRAY_SIZE(tuner_sony_btf_pg463z_ranges),
+       },
+};
+
 /* --------------------------------------------------------------------- */
 
 struct tunertype tuners[] = {
@@ -1872,6 +1924,23 @@ struct tunertype tuners[] = {
                .name   = "Xceive 5000C tuner",
                /* see xc5000.c for details */
        },
+       [TUNER_SONY_BTF_PG472Z] = {
+               .name   = "Sony BTF-PG472Z PAL/SECAM",
+               .params = tuner_sony_btf_pg472z_params,
+               .count  = ARRAY_SIZE(tuner_sony_btf_pg472z_params),
+       },
+
+       /* 90-99 */
+       [TUNER_SONY_BTF_PK467Z] = {
+               .name   = "Sony BTF-PK467Z NTSC-M-JP",
+               .params = tuner_sony_btf_pg467z_params,
+               .count  = ARRAY_SIZE(tuner_sony_btf_pg467z_params),
+       },
+       [TUNER_SONY_BTF_PB463Z] = {
+               .name   = "Sony BTF-PB463Z NTSC-M",
+               .params = tuner_sony_btf_pg463z_params,
+               .count  = ARRAY_SIZE(tuner_sony_btf_pg463z_params),
+       },
 };
 EXPORT_SYMBOL(tuners);
 
index 914b247e9652c91a052e94887507b4aed8b18ed3..3333a8f3b654bee925e9194b4b589b1cad6a0bb1 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/i2c.h>
 #include <asm/byteorder.h>
 #include <media/tvaudio.h>
+#include <media/tuner.h>
 
 #include "go7007-priv.h"
 #include "wis-i2c.h"
index 29fe94da5f717955d770efc6b829797e1fbcd64b..4ad383ad875862dd83b3159877519e4c4509a0e1 100644 (file)
@@ -1238,6 +1238,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
        if (!go->i2c_adapter_online)
                return -EIO;
 
+       strlcpy(t->name, "Tuner", sizeof(t->name));
        return call_all(&go->v4l2_dev, tuner, g_tuner, t);
 }
 
index 6d09c06c8560ab8a3d2174461c2552210f0247fd..97763db80bac34ab090b61dbf4a652702c3b32c9 100644 (file)
@@ -34,9 +34,3 @@ struct video_decoder_resolution {
 
 #define        DECODER_SET_RESOLUTION  _IOW('d', 200, struct video_decoder_resolution)
 #define        DECODER_SET_CHANNEL     _IOW('d', 201, int)
-
-/* Sony tuner types */
-
-#define TUNER_SONY_BTF_PG472Z          200
-#define TUNER_SONY_BTF_PK467Z          201
-#define TUNER_SONY_BTF_PB463Z          202
index 926aff9bdf65c062ce334a0ac6c40a55678d9909..24eaafe461bd02a237091b84d176b327c6cf69f1 100644 (file)
 #define TUNER_XC4000                   87      /* Xceive Silicon Tuner */
 #define TUNER_XC5000C                  88      /* Xceive Silicon Tuner */
 
+#define TUNER_SONY_BTF_PG472Z          89      /* PAL+SECAM */
+#define TUNER_SONY_BTF_PK467Z          90      /* NTSC_JP */
+#define TUNER_SONY_BTF_PB463Z          91      /* NTSC */
+
 /* tv card specific */
 #define TDA9887_PRESENT                (1<<0)
 #define TDA9887_PORT1_INACTIVE                 (1<<1)