All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Volokh Konstantin <volokh84@gmail.com>,
	Pete Eberlein <pete@sensoray.com>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: [REVIEW PATCH 08/42] tuner: add Sony BTF tuners
Date: Mon, 11 Mar 2013 12:45:46 +0100	[thread overview]
Message-ID: <a1e6fd16a40c140c406f31862979ae2dfd4d057b.1363000605.git.hans.verkuil@cisco.com> (raw)
In-Reply-To: <1363002380-19825-1-git-send-email-hverkuil@xs4all.nl>
In-Reply-To: <38bc3cc42d0c021432afd29c2c1e22cf380b06e0.1363000605.git.hans.verkuil@cisco.com>

From: Hans Verkuil <hans.verkuil@cisco.com>

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>
---
 Documentation/video4linux/CARDLIST.tuner   |    3 ++
 drivers/media/tuners/tuner-types.c         |   69 ++++++++++++++++++++++++++++
 drivers/staging/media/go7007/go7007-usb.c  |    1 +
 drivers/staging/media/go7007/go7007-v4l2.c |    1 +
 drivers/staging/media/go7007/wis-i2c.h     |    6 ---
 include/media/tuner.h                      |    4 ++
 6 files changed, 78 insertions(+), 6 deletions(-)

diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index c83f6e4..5b83a3f 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -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)
diff --git a/drivers/media/tuners/tuner-types.c b/drivers/media/tuners/tuner-types.c
index 2da4440..98bc15a 100644
--- a/drivers/media/tuners/tuner-types.c
+++ b/drivers/media/tuners/tuner-types.c
@@ -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);
 
diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c
index 914b247..3333a8f 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -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"
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index cb9fe33..e115132 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -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);
 }
 
diff --git a/drivers/staging/media/go7007/wis-i2c.h b/drivers/staging/media/go7007/wis-i2c.h
index 6d09c06..97763db 100644
--- a/drivers/staging/media/go7007/wis-i2c.h
+++ b/drivers/staging/media/go7007/wis-i2c.h
@@ -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
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 926aff9..24eaafe 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -138,6 +138,10 @@
 #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)
-- 
1.7.10.4


  parent reply	other threads:[~2013-03-11 11:46 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 11:45 [REVIEW PATCH 00/42] go7007: complete overhaul Hans Verkuil
2013-03-11 11:45 ` [REVIEW PATCH 01/42] v4l2-ctrls: eliminate lockdep false alarms for struct v4l2_ctrl_handler.lock Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 02/42] v4l2-core: add code to check for specific ops Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 03/42] v4l2-ioctl: check if an ioctl is valid Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 04/42] saa7115: add config flag to change the IDQ polarity Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 05/42] saa7115: improve querystd handling for the saa7115 Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 06/42] saa7115: add support for double-rate ASCLK Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 07/42] go7007: fix i2c_xfer return codes Hans Verkuil
2013-03-11 11:45   ` Hans Verkuil [this message]
2013-03-11 11:45   ` [REVIEW PATCH 09/42] sony-btf-mpx: the MPX driver for the sony BTF PAL/SECAM tuner Hans Verkuil
2013-03-24 15:21     ` Mauro Carvalho Chehab
2013-03-25  8:52       ` Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 10/42] ov7640: add new ov7640 driver Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 11/42] uda1342: add new uda1342 audio codec driver Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 12/42] tw9903: add new tw9903 video decoder Hans Verkuil
2013-03-24 15:29     ` Mauro Carvalho Chehab
2013-03-24 16:06       ` Mauro Carvalho Chehab
2013-03-25  8:55       ` Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 13/42] tw2804: add support for the Techwell tw2804 Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 14/42] tw2804: modify ADC power control Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 15/42] go7007: i2c initialization changes for tw2804 Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 16/42] go7007: switch to standard tuner/i2c subdevs Hans Verkuil
2013-03-24 15:35     ` Mauro Carvalho Chehab
2013-03-11 11:45   ` [REVIEW PATCH 17/42] go7007: remove all wis* drivers Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 18/42] go7007: add audio input ioctls Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 19/42] s2250-loader: use usbv2_cypress_load_firmware Hans Verkuil
2013-03-24 15:39     ` Mauro Carvalho Chehab
2013-03-24 15:49       ` Antti Palosaari
2013-03-25  8:56       ` Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 20/42] go7007: go7007: add device_caps and bus_info support to querycap Hans Verkuil
2013-03-11 11:45   ` [REVIEW PATCH 21/42] go7007: remove current_norm Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 22/42] go7007: fix DMA related errors Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 23/42] go7007: remember boot firmware Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 24/42] go7007: fix unregister/disconnect handling Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 25/42] go7007: convert to the control framework and remove obsolete JPEGCOMP support Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 26/42] s2250: convert to the control framework Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 27/42] go7007: add prio and control event support Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 28/42] go7007: add log_status support Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 29/42] go7007: tuner/std related fixes Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 30/42] go7007: standardize MPEG handling support Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 31/42] go7007: simplify the PX-TV402U board ID handling Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 32/42] go7007: set up the saa7115 audio clock correctly Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 33/42] go7007: drop struct go7007_file Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 34/42] go7007: convert to core locking and vb2 Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 35/42] go7007: embed struct video_device Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 36/42] go7007: remove cropping functions Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 37/42] saa7134-go7007: add support for this combination Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 38/42] s2250: add comment describing the hardware Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 39/42] go7007-loader: renamed from s2250-loader Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 40/42] go7007-loader: add support for the other devices and move fw files Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 41/42] go7007: update the README Hans Verkuil
2013-03-11 11:46   ` [REVIEW PATCH 42/42] MAINTAINERS: add the go7007 driver Hans Verkuil
2013-03-11 11:50   ` [REVIEW PATCH 01/42] v4l2-ctrls: eliminate lockdep false alarms for struct v4l2_ctrl_handler.lock Hans Verkuil
2013-03-11 22:01 ` [REVIEW PATCH 00/42] go7007: complete overhaul Hans Verkuil
2013-03-12 14:37 ` Darrick Burch
2013-03-12 15:05   ` Hans Verkuil

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=a1e6fd16a40c140c406f31862979ae2dfd4d057b.1363000605.git.hans.verkuil@cisco.com \
    --to=hverkuil@xs4all.nl \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=pete@sensoray.com \
    --cc=volokh84@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.