Skip to contentSkip to conversation

af901x: NXP TDA18218

PATCH Bert Massop 1 participant 2 messages Feb 24, 2010 – Feb 26, 2010 4 messages not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

This is a forward of the original email from Nikola Pajkovsky. Just for the records, so it is on the list.

This solves the problem of the tuner id:179 not supported error, when loading the AF9015 driver.

Thank you, Nikola!

Regards,
Bert Massop

---------- Forwarded message ----------
From: Nikola Pajkovsky <[email protected]>
Date: Wed, Feb 24, 2010 at 11:54
Subject: Re: af901x: NXP TDA18218
To: Antti Palosaari <[email protected]>
Cc: [email protected], [email protected], [email protected], [email protected]

Hello,

   here is my solution, I can watch Vancouver right now :). I don't look at the patch if there is some mistake(no time watch Vancouver), but I will when I will have some free time.
Attached patch apply against this souce (hg clone
http://linuxtv.org/hg/~anttip/af9015/).

Firmware:
wget http://jusst.de/manu/fw/AFA/dvb-usb-af9015.fw_a-link
sudo mv dvb-usb-af9015.fw_a-link /lib/firmware/dvb-usb-af9015.fw

Have a nice day ;)

Quoted 16 lines · Antti Palosaari

Hello,
I just got info from one user about this driver, looks like Terratec have driver.
http://forum.ubuntuusers.de/topic/probleme-beim-installieren-terratec-cinergy-t/3/?highlight=terratec+cinergy+t+stick

Antti

Quoted 7 lines · Nikola Pajkovsky

Hello,

   is any chance that will be support for TDA182118?

Regards,

--
Nikola

linux/drivers/media/common/tuners/Kconfig +7 -0
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Kconfig
@@ -179,4 +179,11 @@
 	help
 	  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+	tristate "NXP TDA18218 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
linux/drivers/media/common/tuners/Makefile +1 -0
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Makefile
@@ -24,6 +24,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
linux/drivers/media/dvb/dvb-usb/af9015.c +173 -197

499 lines not on this page · raw message

linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +1 -0
diff -r 0f41fd7df85d linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -129,6 +129,7 @@
 #define USB_PID_KWORLD_VSTREAM_WARM			0x17df
 #define USB_PID_TERRATEC_CINERGY_T_USB_XE		0x0055
 #define USB_PID_TERRATEC_CINERGY_T_USB_XE_REV2		0x0069
+#define USB_PID_TERRATEC_CINERGY_T_STICK_RC        0x0097
 #define USB_PID_TWINHAN_VP7041_COLD			0x3201
 #define USB_PID_TWINHAN_VP7041_WARM			0x3202
 #define USB_PID_TWINHAN_VP7020_COLD			0x3203
linux/drivers/media/dvb/frontends/af9013.c +15 -0
diff -r 0f41fd7df85d linux/drivers/media/dvb/frontends/af9013.c
@@ -488,6 +488,20 @@
 				break;
 			}
 		}
+		else if(state->config.tuner == AF9013_TUNER_TDA18218) {
+			switch (bw) {
+			case BANDWIDTH_6_MHZ:
+				if_sample_freq = 3000000; /* 3 MHz */
+				break;
+			case BANDWIDTH_7_MHZ:
+				if_sample_freq = 3500000; /* 3.5 MHz */
+				break;
+			case BANDWIDTH_8_MHZ:
+			default:
+				if_sample_freq = 4000000; /* 4 MHz */
+				break;
+			}
+		}
 
 		while (if_sample_freq > (adc_freq / 2))
 			if_sample_freq = if_sample_freq - adc_freq;
@@ -1390,6 +1404,7 @@
 		init = tuner_init_mt2060_2;
 		break;
 	case AF9013_TUNER_TDA18271:
+	case AF9013_TUNER_TDA18218:
 		len = ARRAY_SIZE(tuner_init_tda18271);
 		init = tuner_init_tda18271;
 		break;
linux/drivers/media/dvb/frontends/af9013.h +1 -1
diff -r 0f41fd7df85d linux/drivers/media/dvb/frontends/af9013.h
@@ -44,7 +44,7 @@
 	AF9013_TUNER_MT2060_2   = 147, /* Microtune */
 	AF9013_TUNER_TDA18271   = 156, /* NXP */
 	AF9013_TUNER_QT1010A    = 162, /* Quantek */
-	AF9013_TUNER_TDA18218   = 179, /* NXP */
+	AF9013_TUNER_TDA18218    = 179, /* NXP */
 };
 
 /* AF9013/5 GPIOs (mostly guessed)
linux/drivers/media/dvb/frontends/af9013_priv.h +3 -2
diff -r 0f41fd7df85d linux/drivers/media/dvb/frontends/af9013_priv.h
@@ -789,8 +789,9 @@
 	{ 0x9bd9, 0, 8, 0x08 },
 };
 
-/* NXP TDA18271 tuner init
-   AF9013_TUNER_TDA18271   = 156 */
+/* NXP TDA18271 & TDA18218 tuner init
+   AF9013_TUNER_TDA18271   = 156
+   AF9013_TUNER_TDA18218   = 179 */
 static struct regdesc tuner_init_tda18271[] = {
 	{ 0x9bd5, 0, 8, 0x01 },
 	{ 0x9bd6, 0, 8, 0x04 },
#5 lore raw

Using the previous patch, the compiler will complain about a missing file (tda18218.h). Please use this updated version of the patch, also made by Nikola.

Have fun with it, it's working fine here!

Regards, Bert

Quoted 48 lines · Bert Massop

This is a forward of the original email from Nikola Pajkovsky. Just for the records, so it is on the list.

This solves the problem of the tuner id:179 not supported error, when loading the AF9015 driver.

Thank you, Nikola!

Regards,
Bert Massop

---------- Forwarded message ----------
From: Nikola Pajkovsky <[email protected]>
Date: Wed, Feb 24, 2010 at 11:54
Subject: Re: af901x: NXP TDA18218
To: Antti Palosaari <[email protected]>
Cc: [email protected], [email protected], [email protected], [email protected]

Hello,

   here is my solution, I can watch Vancouver right now :). I don't look at the patch if there is some mistake(no time watch Vancouver), but I will when I will have some free time.
Attached patch apply against this souce (hg clone
http://linuxtv.org/hg/~anttip/af9015/).

Firmware:
wget http://jusst.de/manu/fw/AFA/dvb-usb-af9015.fw_a-link
sudo mv dvb-usb-af9015.fw_a-link /lib/firmware/dvb-usb-af9015.fw

Have a nice day ;)

Quoted 13 lines · Antti Palosaari

Hello,
I just got info from one user about this driver, looks like Terratec have driver.
http://forum.ubuntuusers.de/topic/probleme-beim-installieren-terratec-cinergy-t/3/?highlight=terratec+cinergy+t+stick

Antti

Quoted 5 lines · Nikola Pajkovsky

Hello,

   is any chance that will be support for TDA182118?

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Regards,

--
Nikola

linux/drivers/media/common/tuners/Kconfig +7 -0
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Kconfig
@@ -179,4 +179,11 @@
 	help
 	  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+	tristate "NXP TDA18218 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
linux/drivers/media/common/tuners/Makefile +1 -0
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Makefile
@@ -24,6 +24,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
linux/drivers/media/common/tuners/tda18218.c new file +471 -0

471 lines not on this page · raw message

linux/drivers/media/common/tuners/tda18218.h new file +44 -0

45 lines not on this page · raw message

linux/drivers/media/common/tuners/tda18218_priv.h new file +36 -0
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/tda18218_priv.h
@@ -0,0 +1,36 @@
+/*
+ *  Driver for NXP TDA18218 silicon tuner
+ *
+ *  Copyright (C) 2010 Lauris Ding <[email protected]>
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef TDA18218_PRIV_H
+#define TDA18218_PRIV_H
+
+#define TDA18218_STEP         1000 /* 1 kHz */
+#define TDA18218_MIN_FREQ   174000000 /*   174 MHz */
+#define TDA18218_MAX_FREQ  864000000 /*  864 MHz */
+
+struct tda18218_priv {
+	u8 tda18218_regs[0x3b];
+	struct tda18218_config *cfg;
+	struct i2c_adapter *i2c;
+
+	u32 frequency;
+	u32 bandwidth;
+};
+
+#endif
linux/drivers/media/dvb/dvb-usb/af9015.c +173 -197

499 lines not on this page · raw message

linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +1 -0
diff -r 0f41fd7df85d linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -129,6 +129,7 @@
 #define USB_PID_KWORLD_VSTREAM_WARM			0x17df
 #define USB_PID_TERRATEC_CINERGY_T_USB_XE		0x0055
 #define USB_PID_TERRATEC_CINERGY_T_USB_XE_REV2		0x0069
+#define USB_PID_TERRATEC_CINERGY_T_STICK_RC        0x0097
 #define USB_PID_TWINHAN_VP7041_COLD			0x3201
 #define USB_PID_TWINHAN_VP7041_WARM			0x3202
 #define USB_PID_TWINHAN_VP7020_COLD			0x3203
linux/drivers/media/dvb/frontends/af9013.c +15 -0
diff -r 0f41fd7df85d linux/drivers/media/dvb/frontends/af9013.c
@@ -488,6 +488,20 @@
 				break;
 			}
 		}
+		else if(state->config.tuner == AF9013_TUNER_TDA18218) {
+			switch (bw) {
+			case BANDWIDTH_6_MHZ:
+				if_sample_freq = 3000000; /* 3 MHz */
+				break;
+			case BANDWIDTH_7_MHZ:
+				if_sample_freq = 3500000; /* 3.5 MHz */
+				break;
+			case BANDWIDTH_8_MHZ:
+			default:
+				if_sample_freq = 4000000; /* 4 MHz */
+				break;
+			}
+		}
 
 		while (if_sample_freq > (adc_freq / 2))
 			if_sample_freq = if_sample_freq - adc_freq;
@@ -1390,6 +1404,7 @@
 		init = tuner_init_mt2060_2;
 		break;
 	case AF9013_TUNER_TDA18271:
+	case AF9013_TUNER_TDA18218:
 		len = ARRAY_SIZE(tuner_init_tda18271);
 		init = tuner_init_tda18271;
 		break;
linux/drivers/media/dvb/frontends/af9013.h +1 -1
diff -r 0f41fd7df85d linux/drivers/media/dvb/frontends/af9013.h
@@ -44,7 +44,7 @@
 	AF9013_TUNER_MT2060_2   = 147, /* Microtune */
 	AF9013_TUNER_TDA18271   = 156, /* NXP */
 	AF9013_TUNER_QT1010A    = 162, /* Quantek */
-	AF9013_TUNER_TDA18218   = 179, /* NXP */
+	AF9013_TUNER_TDA18218    = 179, /* NXP */
 };
 
 /* AF9013/5 GPIOs (mostly guessed)
linux/drivers/media/dvb/frontends/af9013_priv.h +3 -2
diff -r 0f41fd7df85d linux/drivers/media/dvb/frontends/af9013_priv.h
@@ -789,8 +789,9 @@
 	{ 0x9bd9, 0, 8, 0x08 },
 };
 
-/* NXP TDA18271 tuner init
-   AF9013_TUNER_TDA18271   = 156 */
+/* NXP TDA18271 & TDA18218 tuner init
+   AF9013_TUNER_TDA18271   = 156
+   AF9013_TUNER_TDA18218   = 179 */
 static struct regdesc tuner_init_tda18271[] = {
 	{ 0x9bd5, 0, 8, 0x01 },
 	{ 0x9bd6, 0, 8, 0x04 },